@devschile/chucao 2.5.0 → 2.6.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 (199) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/{p-f5b74bca.entry.js → p-0409c063.entry.js} +2 -2
  3. package/dist/chucao/{p-0bc141a2.entry.js → p-090d26f1.entry.js} +2 -2
  4. package/dist/chucao/{p-f9fe752c.entry.js → p-207648f9.entry.js} +2 -2
  5. package/dist/chucao/{p-9f73855e.entry.js → p-20ea1b18.entry.js} +2 -2
  6. package/dist/chucao/{p-be7b5c21.entry.js → p-21ca2235.entry.js} +2 -2
  7. package/dist/chucao/{p-fdf065e6.entry.js → p-2c1bc8bd.entry.js} +2 -2
  8. package/dist/chucao/{p-2c681cc0.entry.js → p-370d9629.entry.js} +2 -2
  9. package/dist/chucao/{p-2c681cc0.entry.js.map → p-370d9629.entry.js.map} +1 -1
  10. package/dist/chucao/{p-6345c9e1.entry.js → p-50cbea7f.entry.js} +2 -2
  11. package/dist/chucao/p-66ae9e2c.entry.js +2 -0
  12. package/dist/chucao/p-66ae9e2c.entry.js.map +1 -0
  13. package/dist/chucao/p-79f20bfd.entry.js +2 -0
  14. package/dist/chucao/p-79f20bfd.entry.js.map +1 -0
  15. package/dist/chucao/{p-c251b0d1.entry.js → p-7d4336bd.entry.js} +2 -2
  16. package/dist/chucao/{p-957acf39.entry.js → p-81b6622f.entry.js} +2 -2
  17. package/dist/chucao/{p-b53d954e.entry.js → p-925af6b8.entry.js} +2 -2
  18. package/dist/chucao/p-95061461.entry.js +2 -0
  19. package/dist/chucao/{p-97655c41.entry.js → p-9794a3fa.entry.js} +2 -2
  20. package/dist/chucao/{p-26e144ff.entry.js → p-b56f4a29.entry.js} +2 -2
  21. package/dist/chucao/{p-c165f839.entry.js → p-b9b47942.entry.js} +2 -2
  22. package/dist/chucao/{p-0e044eff.entry.js → p-c1b35f1b.entry.js} +2 -2
  23. package/dist/chucao/p-e2f725bd.entry.js +2 -0
  24. package/dist/chucao/{p-2e785177.entry.js.map → p-e2f725bd.entry.js.map} +1 -1
  25. package/dist/chucao/{p-350f974d.entry.js → p-e6f959f4.entry.js} +2 -2
  26. package/dist/chucao/p-f0aea6ed.entry.js +2 -0
  27. package/dist/chucao/{p-1108062e.entry.js → p-f7305552.entry.js} +2 -2
  28. package/dist/chucao/p-ffaf1a31.entry.js +2 -0
  29. package/dist/chucao/p-ffaf1a31.entry.js.map +1 -0
  30. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  31. package/dist/cjs/ch-alert_8.cjs.entry.js +7 -7
  32. package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
  33. package/dist/cjs/ch-cluster.cjs.entry.js +2 -2
  34. package/dist/cjs/ch-description-list.cjs.entry.js +29 -0
  35. package/dist/cjs/ch-description-list.cjs.entry.js.map +1 -0
  36. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  37. package/dist/cjs/ch-drawer.cjs.entry.js +1 -1
  38. package/dist/cjs/ch-emoji.cjs.entry.js +1 -1
  39. package/dist/cjs/ch-empty-state.cjs.entry.js +1 -1
  40. package/dist/cjs/ch-grid.cjs.entry.js +1 -1
  41. package/dist/cjs/ch-icon-button.cjs.entry.js +1 -1
  42. package/dist/cjs/ch-icon.cjs.entry.js +1 -1
  43. package/dist/cjs/ch-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/ch-page-header.cjs.entry.js +1 -1
  45. package/dist/cjs/ch-radio.cjs.entry.js +1 -1
  46. package/dist/cjs/ch-segmented-control.cjs.entry.js +1 -1
  47. package/dist/cjs/ch-skeleton.cjs.entry.js +1 -1
  48. package/dist/cjs/ch-stack.cjs.entry.js +1 -1
  49. package/dist/cjs/ch-stat.cjs.entry.js +46 -0
  50. package/dist/cjs/ch-stat.cjs.entry.js.map +1 -0
  51. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  52. package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
  53. package/dist/cjs/ch-timeline.cjs.entry.js +20 -0
  54. package/dist/cjs/ch-timeline.cjs.entry.js.map +1 -0
  55. package/dist/cjs/ch-tooltip.cjs.entry.js +6 -4
  56. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
  57. package/dist/cjs/chucao.cjs.js +1 -1
  58. package/dist/cjs/loader.cjs.js +1 -1
  59. package/dist/collection/collection-manifest.json +9 -6
  60. package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
  61. package/dist/collection/components/ch-alert/ch-alert.js +1 -1
  62. package/dist/collection/components/ch-badge/ch-badge.js +1 -1
  63. package/dist/collection/components/ch-card/ch-card.js +1 -1
  64. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  65. package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
  66. package/dist/collection/components/ch-description-list/ch-description-list.css +60 -0
  67. package/dist/collection/components/ch-description-list/ch-description-list.js +78 -0
  68. package/dist/collection/components/ch-description-list/ch-description-list.js.map +1 -0
  69. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  70. package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
  71. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  72. package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
  73. package/dist/collection/components/ch-grid/ch-grid.js +1 -1
  74. package/dist/collection/components/ch-icon/ch-icon.js +1 -1
  75. package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
  76. package/dist/collection/components/ch-input/ch-input.js +1 -1
  77. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  78. package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
  79. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  80. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
  81. package/dist/collection/components/ch-select/ch-select.js +1 -1
  82. package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
  83. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  84. package/dist/collection/components/ch-stack/ch-stack.js +1 -1
  85. package/dist/collection/components/ch-stat/ch-stat.css +68 -0
  86. package/dist/collection/components/ch-stat/ch-stat.js +151 -0
  87. package/dist/collection/components/ch-stat/ch-stat.js.map +1 -0
  88. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  89. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  90. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  91. package/dist/collection/components/ch-timeline/ch-timeline.css +54 -0
  92. package/dist/collection/components/ch-timeline/ch-timeline.js +43 -0
  93. package/dist/collection/components/ch-timeline/ch-timeline.js.map +1 -0
  94. package/dist/collection/components/ch-tooltip/ch-tooltip.js +6 -4
  95. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
  96. package/dist/components/ch-accordion.js +1 -1
  97. package/dist/components/ch-alert.js +1 -1
  98. package/dist/components/ch-badge.js +1 -1
  99. package/dist/components/ch-button.js +1 -1
  100. package/dist/components/ch-card.js +1 -1
  101. package/dist/components/ch-card.js.map +1 -1
  102. package/dist/components/ch-checkbox.js +1 -1
  103. package/dist/components/ch-cluster.js +1 -1
  104. package/dist/components/ch-description-list.d.ts +11 -0
  105. package/dist/components/ch-description-list.js +2 -0
  106. package/dist/components/ch-description-list.js.map +1 -0
  107. package/dist/components/ch-divider.js +1 -1
  108. package/dist/components/ch-drawer.js +1 -1
  109. package/dist/components/ch-emoji.js +1 -1
  110. package/dist/components/ch-empty-state.js +1 -1
  111. package/dist/components/ch-grid.js +1 -1
  112. package/dist/components/ch-icon-button.js +1 -1
  113. package/dist/components/ch-icon.js +1 -1
  114. package/dist/components/ch-input.js +1 -1
  115. package/dist/components/ch-modal.js +1 -1
  116. package/dist/components/ch-page-header.js +1 -1
  117. package/dist/components/ch-radio.js +1 -1
  118. package/dist/components/ch-segmented-control.js +1 -1
  119. package/dist/components/ch-select.js +1 -1
  120. package/dist/components/ch-skeleton.js +1 -1
  121. package/dist/components/ch-spinner.js +1 -1
  122. package/dist/components/ch-stack.js +1 -1
  123. package/dist/components/ch-stat.d.ts +11 -0
  124. package/dist/components/ch-stat.js +2 -0
  125. package/dist/components/ch-stat.js.map +1 -0
  126. package/dist/components/ch-switch.js +1 -1
  127. package/dist/components/ch-tabs.js +1 -1
  128. package/dist/components/ch-textarea.js +1 -1
  129. package/dist/components/ch-timeline.d.ts +11 -0
  130. package/dist/components/ch-timeline.js +2 -0
  131. package/dist/components/ch-timeline.js.map +1 -0
  132. package/dist/components/ch-tooltip.js +1 -1
  133. package/dist/components/ch-tooltip.js.map +1 -1
  134. package/dist/components/{p-CV0rD-fF.js → p-Cw0b4OGc.js} +2 -2
  135. package/dist/esm/ch-accordion.entry.js +1 -1
  136. package/dist/esm/ch-alert_8.entry.js +7 -7
  137. package/dist/esm/ch-checkbox.entry.js +1 -1
  138. package/dist/esm/ch-cluster.entry.js +2 -2
  139. package/dist/esm/ch-description-list.entry.js +27 -0
  140. package/dist/esm/ch-description-list.entry.js.map +1 -0
  141. package/dist/esm/ch-divider.entry.js +1 -1
  142. package/dist/esm/ch-drawer.entry.js +1 -1
  143. package/dist/esm/ch-emoji.entry.js +1 -1
  144. package/dist/esm/ch-empty-state.entry.js +1 -1
  145. package/dist/esm/ch-grid.entry.js +1 -1
  146. package/dist/esm/ch-icon-button.entry.js +1 -1
  147. package/dist/esm/ch-icon.entry.js +1 -1
  148. package/dist/esm/ch-modal.entry.js +1 -1
  149. package/dist/esm/ch-page-header.entry.js +1 -1
  150. package/dist/esm/ch-radio.entry.js +1 -1
  151. package/dist/esm/ch-segmented-control.entry.js +1 -1
  152. package/dist/esm/ch-skeleton.entry.js +1 -1
  153. package/dist/esm/ch-stack.entry.js +1 -1
  154. package/dist/esm/ch-stat.entry.js +44 -0
  155. package/dist/esm/ch-stat.entry.js.map +1 -0
  156. package/dist/esm/ch-tabs.entry.js +1 -1
  157. package/dist/esm/ch-textarea.entry.js +1 -1
  158. package/dist/esm/ch-timeline.entry.js +18 -0
  159. package/dist/esm/ch-timeline.entry.js.map +1 -0
  160. package/dist/esm/ch-tooltip.entry.js +6 -4
  161. package/dist/esm/ch-tooltip.entry.js.map +1 -1
  162. package/dist/esm/chucao.js +1 -1
  163. package/dist/esm/loader.js +1 -1
  164. package/dist/types/components/ch-description-list/ch-description-list.d.ts +30 -0
  165. package/dist/types/components/ch-stat/ch-stat.d.ts +42 -0
  166. package/dist/types/components/ch-timeline/ch-timeline.d.ts +27 -0
  167. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +4 -2
  168. package/dist/types/components.d.ts +312 -0
  169. package/dist-react/components.d.ts +9 -0
  170. package/dist-react/components.js +27 -0
  171. package/dist-react/components.ts +36 -0
  172. package/dist-vue/index.d.ts +3 -0
  173. package/dist-vue/index.js +13 -0
  174. package/dist-vue/index.ts +19 -0
  175. package/hydrate/index.js +200 -30
  176. package/hydrate/index.mjs +200 -30
  177. package/package.json +14 -2
  178. package/dist/chucao/p-2e785177.entry.js +0 -2
  179. package/dist/chucao/p-4846cac4.entry.js +0 -2
  180. package/dist/chucao/p-b6cc08f0.entry.js +0 -2
  181. /package/dist/chucao/{p-f5b74bca.entry.js.map → p-0409c063.entry.js.map} +0 -0
  182. /package/dist/chucao/{p-0bc141a2.entry.js.map → p-090d26f1.entry.js.map} +0 -0
  183. /package/dist/chucao/{p-f9fe752c.entry.js.map → p-207648f9.entry.js.map} +0 -0
  184. /package/dist/chucao/{p-9f73855e.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
  185. /package/dist/chucao/{p-be7b5c21.entry.js.map → p-21ca2235.entry.js.map} +0 -0
  186. /package/dist/chucao/{p-fdf065e6.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
  187. /package/dist/chucao/{p-6345c9e1.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
  188. /package/dist/chucao/{p-c251b0d1.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
  189. /package/dist/chucao/{p-957acf39.entry.js.map → p-81b6622f.entry.js.map} +0 -0
  190. /package/dist/chucao/{p-b53d954e.entry.js.map → p-925af6b8.entry.js.map} +0 -0
  191. /package/dist/chucao/{p-b6cc08f0.entry.js.map → p-95061461.entry.js.map} +0 -0
  192. /package/dist/chucao/{p-97655c41.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
  193. /package/dist/chucao/{p-26e144ff.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
  194. /package/dist/chucao/{p-c165f839.entry.js.map → p-b9b47942.entry.js.map} +0 -0
  195. /package/dist/chucao/{p-0e044eff.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
  196. /package/dist/chucao/{p-350f974d.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
  197. /package/dist/chucao/{p-4846cac4.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
  198. /package/dist/chucao/{p-1108062e.entry.js.map → p-f7305552.entry.js.map} +0 -0
  199. /package/dist/components/{p-CV0rD-fF.js.map → p-Cw0b4OGc.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;max-width:100%}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.segmented{display:inline-flex;align-items:stretch;max-width:100%;padding:var(--spacing-2xs);border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface)}.control{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-pill);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default)}.control:hover:not(.control--disabled){background:var(--surface-hover)}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;margin:0;opacity:0;cursor:inherit}.input:checked~.label-text{background:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-semibold)}.input:focus-visible~.label-text{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.label-text{display:block;padding:var(--spacing-2xs) var(--spacing-3xl);border-radius:inherit;font-size:var(--typography-size-sm);white-space:nowrap;transition:background-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.segmented--sm .label-text{padding:var(--spacing-2xs) var(--spacing-2xl);font-size:var(--typography-size-xs)}:host([data-touched]:invalid) .segmented,:host(:user-invalid) .segmented{border-color:var(--color-status-warning)}@media (prefers-reduced-motion: reduce){.control,.label-text{transition:none}}`;let l=0;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=s(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-segmented-${++l}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:t,message:s}=o({required:this.required,empty:!this.value});e.setValidity(t,s)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}render(){const e=this.name||`${this.groupId}-group`;return a(i,{key:"d6a9a720a1a210c73711cff1f7cd6c1ffa0c89b2"},this.label&&a("span",{key:"af5fb9ab87e918ac6047ebd6e65e540044c6a2d0",class:"group-label",id:this.labelId},this.label),a("div",{key:"8dd76ea8d792d918ac5e413946e8a08cb89480c7",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((t=>a("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||t.disabled}},a("input",{class:"input",type:"radio",name:e,value:t.value,checked:t.value===this.value,disabled:this.disabled||this.formDisabled||t.disabled,onChange:this.handleChange}),a("span",{class:"label-text"},t.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-segmented-control",{label:[1],options:[16],value:[1025],size:[1],name:[513],disabled:[516],required:[516],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-segmented-control"];e.forEach((e=>{switch(e){case"ch-segmented-control":if(!customElements.get(r(e))){customElements.define(r(e),c)}break}}))}d();const h=c;const u=d;export{h as ChSegmentedControl,u as defineCustomElement};
1
+ import{p as e,H as t,c as s,h as a,d as i,t as r}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;max-width:100%}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.segmented{display:inline-flex;align-items:stretch;max-width:100%;padding:var(--spacing-2xs);border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface)}.control{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-pill);cursor:pointer;transition:background-color var(--duration-normal) var(--easing-default)}.control:hover:not(.control--disabled){background:var(--surface-hover)}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;margin:0;opacity:0;cursor:inherit}.input:checked~.label-text{background:var(--accent);color:var(--color-accent-text);font-weight:var(--typography-weight-semibold)}.input:focus-visible~.label-text{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.label-text{display:block;padding:var(--spacing-2xs) var(--spacing-3xl);border-radius:inherit;font-size:var(--typography-size-sm);white-space:nowrap;transition:background-color var(--duration-normal) var(--easing-default), color var(--duration-normal) var(--easing-default)}.segmented--sm .label-text{padding:var(--spacing-2xs) var(--spacing-2xl);font-size:var(--typography-size-xs)}:host([data-touched]:invalid) .segmented,:host(:user-invalid) .segmented{border-color:var(--color-status-warning)}@media (prefers-reduced-motion: reduce){.control,.label-text{transition:none}}`;let l=0;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=s(this,"chChange");this.internals=this.attachInternals()}groupId=`ch-segmented-${++l}`;labelId=`${this.groupId}-label`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;size="md";name;disabled=false;required=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??null);const{flags:t,message:s}=o({required:this.required,empty:!this.value});e.setValidity(t,s)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}render(){const e=this.name||`${this.groupId}-group`;return a(i,{key:"a8782886fd0c20fa96a5a54c9997fe9d91d3e670"},this.label&&a("span",{key:"99a2727035a62f71d01f07e0cf222becb118d3b2",class:"group-label",id:this.labelId},this.label),a("div",{key:"31b293c379a996e06650c1a6c9fe9c46c32097a2",class:{segmented:true,[`segmented--${this.size}`]:true},role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((t=>a("label",{class:{control:true,"control--disabled":this.disabled||this.formDisabled||t.disabled}},a("input",{class:"input",type:"radio",name:e,value:t.value,checked:t.value===this.value,disabled:this.disabled||this.formDisabled||t.disabled,onChange:this.handleChange}),a("span",{class:"label-text"},t.label))))))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-segmented-control",{label:[1],options:[16],value:[1025],size:[1],name:[513],disabled:[516],required:[516],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const e=["ch-segmented-control"];e.forEach((e=>{switch(e){case"ch-segmented-control":if(!customElements.get(r(e))){customElements.define(r(e),c)}break}}))}d();const h=c;const u=d;export{h as ChSegmentedControl,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-segmented-control.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);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 n=0;const d=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}selectId=`ch-select-${++n}`;hintId=`${this.selectId}-hint`;errorId=`${this.selectId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??"");const{flags:s,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(s,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(i,{key:"b01c1dca70dbf88556521faa1be7430dc3d2355c"},this.label&&r("label",{key:"265a09b70dafca0c9330ceaec2477b6b203a71eb",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"43b387edff4fd326beac608fa16e50f3407e8cac",id:this.label?this.selectId:undefined,class:{select:true,"select--invalid":this.invalid},name:this.name,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange},this.placeholder&&r("option",{key:"456e5220d2fd6fdb2a2171d10bcd11c6d2c58956",value:"",disabled:true,hidden:true,selected:!this.value},this.placeholder),this.options.map((e=>r("option",{value:e.value,disabled:e.disabled,selected:e.value===this.value},e.label)))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"7f4609f6441f9ce6c5f13b4a12875d85c110ccd8",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"e05a04a3f43ad055cd7cc57deb48f8b19d1a7084",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return c()}},[577,"ch-select",{label:[1],options:[16],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-select"];e.forEach((e=>{switch(e){case"ch-select":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}l();const h=d;const u=l;export{h as ChSelect,u as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as r,d as i,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);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 l=0;const d=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chChange=t(this,"chChange");this.internals=this.attachInternals()}selectId=`ch-select-${++l}`;hintId=`${this.selectId}-hint`;errorId=`${this.selectId}-error`;initialValue;internals;formDisabled=false;get host(){return this}label;options=[];value;placeholder;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value??"");const{flags:s,message:t}=o({required:this.required,empty:!this.value,invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(s,t)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(i,{key:"aeba7eff5bf3bd7926922e65376c6508fc1c4dd3"},this.label&&r("label",{key:"943e5557014e2297368825505513f4ad8b093ee5",class:"label",htmlFor:this.selectId},this.label),r("select",{key:"ccec2dfef1b06b219e7aed536914ebf2b24e370f",id:this.label?this.selectId:undefined,class:{select:true,"select--invalid":this.invalid},name:this.name,disabled:this.disabled||this.formDisabled,required:this.required,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange},this.placeholder&&r("option",{key:"a0c41592c1a5a90f611917da984374edf5305b96",value:"",disabled:true,hidden:true,selected:!this.value},this.placeholder),this.options.map((e=>r("option",{value:e.value,disabled:e.disabled,selected:e.value===this.value},e.label)))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"28a35ede5d7bb1937d501719244b4b9f7a5d95f2",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"b021c848f75367e2e3329aab423f787205ee0491",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-select",{label:[1],options:[16],value:[1025],placeholder:[1],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function c(){if(typeof customElements==="undefined"){return}const e=["ch-select"];e.forEach((e=>{switch(e){case"ch-select":if(!customElements.get(a(e))){customElements.define(a(e),d)}break}}))}c();const h=d;const u=c;export{h as ChSelect,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-select.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,h as s,d as i,t as n}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;const o=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}width="100%";height="1rem";shape="line";count=1;animated=true;get items(){const e=Number(this.count);return Number.isInteger(e)&&e>=1?e:1}get sizeStyle(){if(this.shape==="circle"){return{width:this.width,height:this.width}}if(this.shape==="line"){return{width:this.width,height:this.height}}return{width:this.width,height:this.height}}render(){return s(i,{key:"bbcafacc79f0288204028378f2cf460f793ca702","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,t)=>s("span",{class:"skeleton__item",style:this.sizeStyle,key:t,"data-index":String(e)}))))}static get style(){return r()}},[513,"ch-skeleton",{width:[1],height:[1],shape:[1],count:[2],animated:[4]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-skeleton"];e.forEach((e=>{switch(e){case"ch-skeleton":if(!customElements.get(n(e))){customElements.define(n(e),o)}break}}))}a();const c=o;const d=a;export{c as ChSkeleton,d as defineCustomElement};
1
+ import{p as e,H as t,h as s,d as i,t as n}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;width:100%}:host([hidden]){display:none}:host(.skeleton--circle){width:auto;display:inline-flex}.skeleton__item{display:block;background:var(--color-surface-default);border-radius:var(--radius-sm)}.skeleton--circle .skeleton__item{border-radius:50%}.skeleton--rect .skeleton__item{border-radius:var(--radius-md)}.skeleton--animated .skeleton__item{background-image:linear-gradient(90deg, transparent 0%, var(--color-surface-hover) 50%, transparent 100%);background-size:200% 100%;background-repeat:no-repeat;animation:ch-skeleton-shimmer 1.4s ease-in-out infinite}@keyframes ch-skeleton-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.skeleton--animated .skeleton__item{animation:none;background-image:none}}`;const o=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}width="100%";height="1rem";shape="line";count=1;animated=true;get items(){const e=Number(this.count);return Number.isInteger(e)&&e>=1?e:1}get sizeStyle(){if(this.shape==="circle"){return{width:this.width,height:this.width}}if(this.shape==="line"){return{width:this.width,height:this.height}}return{width:this.width,height:this.height}}render(){return s(i,{key:"705e4cd6dac9c8c8578cb8133a700c3297d9fffe","aria-hidden":"true",class:{skeleton:true,[`skeleton--${this.shape}`]:true,"skeleton--animated":this.animated}},Array.from({length:this.items}).map(((e,t)=>s("span",{class:"skeleton__item",style:this.sizeStyle,key:t,"data-index":String(e)}))))}static get style(){return r()}},[513,"ch-skeleton",{width:[1],height:[1],shape:[1],count:[2],animated:[4]}]);function a(){if(typeof customElements==="undefined"){return}const e=["ch-skeleton"];e.forEach((e=>{switch(e){case"ch-skeleton":if(!customElements.get(n(e))){customElements.define(n(e),o)}break}}))}a();const c=o;const d=a;export{c as ChSkeleton,d as defineCustomElement};
2
2
  //# sourceMappingURL=ch-skeleton.js.map
@@ -1,2 +1,2 @@
1
- import{C as o,d as s}from"./p-CV0rD-fF.js";const r=o;const t=s;export{r as ChSpinner,t as defineCustomElement};
1
+ import{C as o,d as s}from"./p-Cw0b4OGc.js";const t=o;const c=s;export{t as ChSpinner,c as defineCustomElement};
2
2
  //# sourceMappingURL=ch-spinner.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,h as a,d as e,t as c}from"./p-qP_9qshx.js";const n=()=>`:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;const i=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const g=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="stretch";justify="start";get gapStep(){return i.has(this.gap)?this.gap:"md"}render(){return a(e,{key:"646286c45adc0d816b0fdbcdfe9e70f809fedb95",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"1c18713eb95fc568a08bcbd6e018add9336a0fd0"}))}static get style(){return n()}},[769,"ch-stack",{gap:[1],align:[1],justify:[1]}]);function p(){if(typeof customElements==="undefined"){return}const t=["ch-stack"];t.forEach((t=>{switch(t){case"ch-stack":if(!customElements.get(c(t))){customElements.define(c(t),g)}break}}))}p();const l=g;const r=p;export{l as ChStack,r as defineCustomElement};
1
+ import{p as t,H as s,h as a,d as e,t as c}from"./p-qP_9qshx.js";const n=()=>`:host{display:flex;flex-direction:column;box-sizing:border-box}:host([hidden]){display:none}.stack--gap-none{gap:0}.stack--gap-2xs{gap:var(--spacing-2xs)}.stack--gap-xs{gap:var(--spacing-xs)}.stack--gap-sm{gap:var(--spacing-sm)}.stack--gap-md{gap:var(--spacing-md)}.stack--gap-lg{gap:var(--spacing-lg)}.stack--gap-xl{gap:var(--spacing-xl)}.stack--gap-2xl{gap:var(--spacing-2xl)}.stack--gap-3xl{gap:var(--spacing-3xl)}.stack--gap-4xl{gap:var(--spacing-4xl)}.stack--gap-5xl{gap:var(--spacing-5xl)}.stack--gap-6xl{gap:var(--spacing-6xl)}.stack--align-stretch{align-items:stretch}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-between{justify-content:space-between}.stack--justify-around{justify-content:space-around}`;const i=new Set(["none","2xs","xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl"]);const g=t(class t extends s{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}gap="md";align="stretch";justify="start";get gapStep(){return i.has(this.gap)?this.gap:"md"}render(){return a(e,{key:"d4ee90331cd1ff0d65eb9c80aa684d3b2f5e2876",class:{stack:true,[`stack--gap-${this.gapStep}`]:true,[`stack--align-${this.align}`]:true,[`stack--justify-${this.justify}`]:true}},a("slot",{key:"bdfe358adc457ed6ba79ca80b9e96f17597fbcb5"}))}static get style(){return n()}},[769,"ch-stack",{gap:[1],align:[1],justify:[1]}]);function p(){if(typeof customElements==="undefined"){return}const t=["ch-stack"];t.forEach((t=>{switch(t){case"ch-stack":if(!customElements.get(c(t))){customElements.define(c(t),g)}break}}))}p();const l=g;const r=p;export{l as ChStack,r as defineCustomElement};
2
2
  //# sourceMappingURL=ch-stack.js.map
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ChStat extends Components.ChStat, HTMLElement {}
4
+ export const ChStat: {
5
+ prototype: ChStat;
6
+ new (): ChStat;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,2 @@
1
+ import{p as t,H as a,h as e,d as s,t as o}from"./p-qP_9qshx.js";const r=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-primary)}:host([hidden]){display:none}.stat__inner{display:flex;flex-direction:column;gap:var(--spacing-2xs);padding:var(--spacing-md) var(--spacing-lg);border:var(--border-width) solid var(--color-border-default);border-radius:var(--radius-md);background:var(--color-surface-default)}.stat__label{font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-secondary)}.stat__value{font-family:var(--typography-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:var(--spacing-2xs)}.stat__cue{font-size:var(--typography-size-md)}.stat__value--positive{color:var(--color-status-positive)}.stat__value--negative{color:var(--color-status-negative)}.stat__value--unavailable{color:var(--color-text-tertiary);font-style:italic}.stat__hint{font-size:var(--typography-size-sm);color:var(--color-text-secondary)}.stat__footer:empty{display:none}.stat__footer{margin-top:var(--spacing-2xs)}`;const c=new Set(["default","positive","negative","unavailable"]);const i=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}label;value;hint;tone="default";get toneClass(){return c.has(this.tone)?this.tone:"default"}render(){const t=this.toneClass==="positive"?"+":this.toneClass==="negative"?"−":null;return e(s,{key:"5a43c713faab1513866d8f06899bb3fd3184cf09",class:"stat"},e("div",{key:"9c24e9774cfe0a70b8ba37c06ce7f264b34a9d8c",class:"stat__inner"},e("span",{key:"1a9330c2b31ec6de29f1b8c77761d7eb16160aae",class:"stat__label"},this.label),e("span",{key:"3f6c5e76f5c062effcb9793206a949942bcdfb9a",class:{stat__value:true,[`stat__value--${this.toneClass}`]:this.toneClass!=="default"}},t&&e("span",{key:"b5f79899ec52e7e2b3ec3c00295f755f770a8bca",class:"stat__cue","aria-hidden":"true"},t),e("slot",{key:"b64083aa5738b4088cf9029650286b2564649ec9",name:"value"},this.value)),this.hint&&e("span",{key:"9f560c1f1fd23f08ea63eccc9076066a7fd1a0f9",class:"stat__hint"},this.hint),e("div",{key:"77f3fe1f87e3abc2cce829e06b21f6b2c5f9aa15",class:"stat__footer"},e("slot",{key:"d75204702eab0ab1f55df92e9c13c899235f6840",name:"footer"}))))}static get style(){return r()}},[769,"ch-stat",{label:[1],value:[1],hint:[1],tone:[1]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-stat"];t.forEach((t=>{switch(t){case"ch-stat":if(!customElements.get(o(t))){customElements.define(o(t),i)}break}}))}l();const n=i;const f=l;export{n as ChStat,f as defineCustomElement};
2
+ //# sourceMappingURL=ch-stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chStatCss","TONES","Set","ChStat","__stencil_proxyCustomElement","HTMLElement","label","value","hint","tone","toneClass","has","this","render","cue","h","Host","key","class","stat__value","name"],"sources":["src/components/ch-stat/ch-stat.css?tag=ch-stat&encapsulation=shadow","src/components/ch-stat/ch-stat.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-primary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.stat__inner {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2xs);\n padding: var(--spacing-md) var(--spacing-lg);\n border: var(--border-width) solid var(--color-border-default);\n border-radius: var(--radius-md);\n background: var(--color-surface-default);\n}\n\n.stat__label {\n font-size: var(--typography-size-xs);\n font-weight: var(--typography-weight-semibold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--color-text-secondary);\n}\n\n.stat__value {\n font-family: var(--typography-heading);\n font-size: var(--typography-size-xl);\n font-weight: var(--typography-weight-bold);\n font-variant-numeric: tabular-nums;\n display: flex;\n align-items: baseline;\n gap: var(--spacing-2xs);\n}\n\n/* The sign cue carries the tone in greyscale; colour only reinforces it. */\n.stat__cue {\n font-size: var(--typography-size-md);\n}\n\n.stat__value--positive {\n color: var(--color-status-positive);\n}\n\n.stat__value--negative {\n color: var(--color-status-negative);\n}\n\n.stat__value--unavailable {\n color: var(--color-text-tertiary);\n font-style: italic;\n}\n\n.stat__hint {\n font-size: var(--typography-size-sm);\n color: var(--color-text-secondary);\n}\n\n.stat__footer:empty {\n display: none;\n}\n\n.stat__footer {\n margin-top: var(--spacing-2xs);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChStatTone = 'default' | 'positive' | 'negative' | 'unavailable';\n\nconst TONES = new Set(['default', 'positive', 'negative', 'unavailable']);\n\n/**\n * One dashboard metric: a label, a value and an optional hint.\n *\n * The value is a string the consumer has already formatted — the component\n * never parses numbers, so locale, currency and precision stay where the\n * data comes from. On a fetch error, pass the em dash and the unavailable\n * tone rather than a zero that would read as a real measurement:\n *\n * ```html\n * <ch-stat label=\"Ventas del mes\" value=\"$1.250.000\" tone=\"positive\"></ch-stat>\n * <ch-stat label=\"Ticket promedio\" value=\"—\" tone=\"unavailable\"></ch-stat>\n * ```\n *\n * A tone is never carried by colour alone: positive and negative values get\n * a visible sign cue, so the three states stay distinguishable in greyscale\n * and for colour-blind users. The `value` slot replaces the rendered value\n * for composed content (a link, a spinner), and the `footer` slot sits under\n * the hint for a comparison line or a sparkline.\n */\n@Component({\n tag: 'ch-stat',\n styleUrl: 'ch-stat.css',\n shadow: true,\n})\nexport class ChStat {\n /**\n * Short label naming the metric, rendered in small caps above the value.\n */\n @Prop() label!: string;\n\n /**\n * The metric value, already formatted by the consumer. Shown verbatim.\n */\n @Prop() value!: string;\n\n /**\n * Secondary line under the value — a comparison or a unit note.\n */\n @Prop() hint?: string;\n\n /**\n * Visual tone of the value. `positive` and `negative` add a sign cue so\n * the tone survives greyscale; `unavailable` dims the value for the\n * \"could not be measured\" case. An unknown value falls back to `default`.\n */\n @Prop() tone: ChStatTone = 'default';\n\n private get toneClass() {\n return TONES.has(this.tone) ? this.tone : 'default';\n }\n\n render() {\n const cue = this.toneClass === 'positive' ? '+' : this.toneClass === 'negative' ? '−' : null;\n\n return (\n <Host class=\"stat\">\n <div class=\"stat__inner\">\n <span class=\"stat__label\">{this.label}</span>\n <span\n class={{\n stat__value: true,\n [`stat__value--${this.toneClass}`]: this.toneClass !== 'default',\n }}\n >\n {cue && (\n <span class=\"stat__cue\" aria-hidden=\"true\">\n {cue}\n </span>\n )}\n <slot name=\"value\">{this.value}</slot>\n </span>\n {this.hint && <span class=\"stat__hint\">{this.hint}</span>}\n <div class=\"stat__footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAY,IAAM,yoCCIxB,MAAMC,EAAQ,IAAIC,IAAI,CAAC,UAAW,WAAY,WAAY,gB,MA0B7CC,EAAMC,EAAA,MAAAD,UAAAE,E,iFAITC,MAKAC,MAKAC,KAOAC,KAAmB,UAE3B,aAAYC,GACV,OAAOT,EAAMU,IAAIC,KAAKH,MAAQG,KAAKH,KAAO,S,CAG5C,MAAAI,GACE,MAAMC,EAAMF,KAAKF,YAAc,WAAa,IAAME,KAAKF,YAAc,WAAa,IAAM,KAExF,OACEK,EAACC,EAAI,CAAAC,IAAA,2CAACC,MAAM,QACVH,EAAA,OAAAE,IAAA,2CAAKC,MAAM,eACTH,EAAA,QAAAE,IAAA,2CAAMC,MAAM,eAAeN,KAAKN,OAChCS,EAAA,QAAAE,IAAA,2CACEC,MAAO,CACLC,YAAa,KACb,CAAC,gBAAgBP,KAAKF,aAAcE,KAAKF,YAAc,YAGxDI,GACCC,EAAA,QAAAE,IAAA,2CAAMC,MAAM,YAAW,cAAa,QACjCJ,GAGLC,EAAA,QAAAE,IAAA,2CAAMG,KAAK,SAASR,KAAKL,QAE1BK,KAAKJ,MAAQO,EAAA,QAAAE,IAAA,2CAAMC,MAAM,cAAcN,KAAKJ,MAC7CO,EAAA,OAAAE,IAAA,2CAAKC,MAAM,gBACTH,EAAA,QAAAE,IAAA,2CAAMG,KAAK,a","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`: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)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input: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)}`;let n=0;const l=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}switchId=`ch-switch-${++n}`;hintId=`${this.switchId}-hint`;errorId=`${this.switchId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=t=>{this.checked=t.target.checked;this.chChange.emit(this.checked)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.checked?this.value:null);const{flags:e,message:i}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,i)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(s,{key:"7c862590fa8ce9c53d168cb670361259405c72bb"},r("label",{key:"e5602d4daa8ebf1a9832282fffb9e538fc1592a8",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"d29c00496c4a05ccbe66ffdbebf3a496c5ae6995",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||this.formDisabled,required:this.required,"aria-checked":this.checked?"true":"false","aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),r("span",{key:"5739a0b689ac7ed9ebc917e6102b3951e80ac06d",class:"track"},r("span",{key:"e10c21f740092750dd9bb00cde84fa1c26746eb9",class:"thumb"})),this.label&&r("span",{key:"bec86897b1ef0023d3eb8c8438bf6740f32a5921",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"2568bcf74334e5f081df8efa9a1196c69cb3093d",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"319d5583cf10e329f05430a577d2f1f956ac8dd5",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return c()}},[577,"ch-switch",{label:[1],name:[513],value:[1],checked:[1028],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-switch"];t.forEach((t=>{switch(t){case"ch-switch":if(!customElements.get(a(t))){customElements.define(a(t),l)}break}}))}d();const h=l;const u=d;export{h as ChSwitch,u as defineCustomElement};
1
+ import{p as t,H as e,c as i,h as r,d as s,t as a}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const c=()=>`: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)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input: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)}`;let n=0;const l=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=i(this,"chChange");this.internals=this.attachInternals()}switchId=`ch-switch-${++n}`;hintId=`${this.switchId}-hint`;errorId=`${this.switchId}-error`;initialChecked=false;internals;formDisabled=false;get host(){return this}label;name;value="on";checked=false;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=t=>{this.checked=t.target.checked;this.chChange.emit(this.checked)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.checked?this.value:null);const{flags:e,message:i}=o({required:this.required,empty:!this.checked,invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,i)}componentDidLoad(){this.initialChecked=this.checked;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.checked=this.initialChecked}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return r(s,{key:"e1493afa72058b44b5051cdc641604d02952b6be"},r("label",{key:"80f2ca9bdb7fab02556f427f4a1fce56744eaf50",class:{control:true,"control--disabled":this.disabled||this.formDisabled},htmlFor:this.switchId},r("input",{key:"22a873c43b7f9c94455373d80ab5b3c28153ff70",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||this.formDisabled,required:this.required,"aria-checked":this.checked?"true":"false","aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),r("span",{key:"d995c061f60ad3040048966da17ad8cb2ebdb622",class:"track"},r("span",{key:"ba09dcb23640b2925d0c82f5ab46213acc7e8a86",class:"thumb"})),this.label&&r("span",{key:"9849238fd3486bc1d869c6df373e30209e46d264",class:"label-text"},this.label)),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"76a5cb6da88dbd7088cf2c0d9c2b5a781a632a7f",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"5ebd8ab9b2390fea801bf75eeb4967e95983e041",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return c()}},[577,"ch-switch",{label:[1],name:[513],value:[1],checked:[1028],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{checked:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function d(){if(typeof customElements==="undefined"){return}const t=["ch-switch"];t.forEach((t=>{switch(t){case"ch-switch":if(!customElements.get(a(t))){customElements.define(a(t),l)}break}}))}d();const h=l;const u=d;export{h as ChSwitch,u as defineCustomElement};
2
2
  //# sourceMappingURL=ch-switch.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-qP_9qshx.js";const o=()=>`: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 n=0;const l=-1;const c=1;const d=-1;let b=0;const h=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=e(this,"chChange")}baseId=`ch-tabs-${++b}`;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+c)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+d+a.length)%a.length]?.value}if(t==="Home"){return a[n]?.value}if(t==="End"){return a[a.length+l]?.value}return undefined}render(){const t=this.activeValue;return r(i,{key:"915c7a584397bbe10a72642a1ce5ed68f2264ed2"},r("div",{key:"b37a294722442c73d224410793cd0c098734993f",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const e=a.value===t;return r("button",{key:a.value,type:"button",class:{tab:true,"tab--active":e,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":e?"true":"false","aria-controls":this.panelId(a.value),tabIndex:e?n:l,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>r("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:n,hidden:a.value!==t},r("slot",{name:`panel-${a.value}`})))))}static get style(){return o()}},[769,"ch-tabs",{tabs:[16],value:[1025],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ch-tabs"];t.forEach((t=>{switch(t){case"ch-tabs":if(!customElements.get(s(t))){customElements.define(s(t),h)}break}}))}u();const f=h;const p=u;export{f as ChTabs,p as defineCustomElement};
1
+ import{p as t,H as a,c as e,h as r,d as i,t as s}from"./p-qP_9qshx.js";const o=()=>`: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 n=0;const l=-1;const c=1;const d=-1;let b=0;const h=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chChange=e(this,"chChange")}baseId=`ch-tabs-${++b}`;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+c)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+d+a.length)%a.length]?.value}if(t==="Home"){return a[n]?.value}if(t==="End"){return a[a.length+l]?.value}return undefined}render(){const t=this.activeValue;return r(i,{key:"de167280c159345631f84f5eb7a3dc165396f361"},r("div",{key:"62c008bcf9eafd1c5f5121540b2841e2a6ada541",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const e=a.value===t;return r("button",{key:a.value,type:"button",class:{tab:true,"tab--active":e,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":e?"true":"false","aria-controls":this.panelId(a.value),tabIndex:e?n:l,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>r("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:n,hidden:a.value!==t},r("slot",{name:`panel-${a.value}`})))))}static get style(){return o()}},[769,"ch-tabs",{tabs:[16],value:[1025],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const t=["ch-tabs"];t.forEach((t=>{switch(t){case"ch-tabs":if(!customElements.get(s(t))){customElements.define(s(t),h)}break}}))}u();const f=h;const p=u;export{f as ChTabs,p as defineCustomElement};
2
2
  //# sourceMappingURL=ch-tabs.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as r,h as a,d as s,t as i}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.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 h=0;const d=4;const c=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}textareaId=`ch-textarea-${++h}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=d;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=e=>{this.value=e.target.value;this.chInput.emit(this.value)};handleChange=e=>{this.value=e.target.value;this.chChange.emit(this.value)};syncForm(){const e=this.internals;if(typeof e?.setFormValue!=="function"){return}e.setFormValue(this.value);const{flags:t,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});e.setValidity(t,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(e){this.formDisabled=e}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return a(s,{key:"5e7f4e6c779b677f259b56ebf6cb2e829511275e"},this.label&&a("label",{key:"73a3a3d44b4926aaf0681aa68f878932c7932dae",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"10edc56d4846b578bd11c7bd001e7ca47aa1838d",id:this.label?this.textareaId:undefined,class:{textarea:true,"textarea--invalid":this.invalid},rows:this.rows,name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,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)&&a("p",{key:"393ea00da6e7def75d4305c242a9cf957013359b",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"ba405aec9d92b410e063cec29235240a4a4ec715",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-textarea",{label:[1],value:[1025],placeholder:[1],rows:[2],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const e=["ch-textarea"];e.forEach((e=>{switch(e){case"ch-textarea":if(!customElements.get(i(e))){customElements.define(i(e),c)}break}}))}l();const u=c;const b=l;export{u as ChTextarea,b as defineCustomElement};
1
+ import{p as t,H as e,c as r,h as a,d as s,t as i}from"./p-qP_9qshx.js";import{r as o}from"./p-BXzZsX2r.js";const n=()=>`:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.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 h=0;const d=4;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chInput=r(this,"chInput");this.chChange=r(this,"chChange");this.internals=this.attachInternals()}textareaId=`ch-textarea-${++h}`;hintId=`${this.textareaId}-hint`;errorId=`${this.textareaId}-error`;initialValue="";internals;formDisabled=false;get host(){return this}label;value="";placeholder;rows=d;name;disabled=false;required=false;hint;errorMessage;invalid=false;chInput;chChange;handleInput=t=>{this.value=t.target.value;this.chInput.emit(this.value)};handleChange=t=>{this.value=t.target.value;this.chChange.emit(this.value)};syncForm(){const t=this.internals;if(typeof t?.setFormValue!=="function"){return}t.setFormValue(this.value);const{flags:e,message:r}=o({required:this.required,empty:this.value==="",invalid:this.invalid,errorMessage:this.errorMessage});t.setValidity(e,r)}componentDidLoad(){this.initialValue=this.value;this.syncForm();this.host.addEventListener("change",this.markTouched);this.host.addEventListener("focusout",this.markTouched);this.host.addEventListener("invalid",this.markTouched)}markTouched=()=>{this.host.setAttribute("data-touched","")};formResetCallback(){this.value=this.initialValue}formDisabledCallback(t){this.formDisabled=t}get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){return a(s,{key:"c4334a23f6ad2394d410498726f3f422a654ffe3"},this.label&&a("label",{key:"d935613b40c6c52be41e258aad2a3c17a290a506",class:"label",htmlFor:this.textareaId},this.label),a("textarea",{key:"ab27ae9a6be7d2bcc17638c209ef23eb3757c102",id:this.label?this.textareaId:undefined,class:{textarea:true,"textarea--invalid":this.invalid},rows:this.rows,name:this.name,placeholder:this.placeholder,disabled:this.disabled||this.formDisabled,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)&&a("p",{key:"eb488704ac6ff76534308aefd0938d848d14608f",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"04c084b29d102f06bf15efc4c416b6ba0967ba8d",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}static get watchers(){return{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}}static get style(){return n()}},[577,"ch-textarea",{label:[1],value:[1025],placeholder:[1],rows:[2],name:[513],disabled:[516],required:[516],hint:[1],errorMessage:[1,"error-message"],invalid:[4],formDisabled:[32]},undefined,{value:[{syncForm:0}],required:[{syncForm:0}],invalid:[{syncForm:0}],errorMessage:[{syncForm:0}]}]);function l(){if(typeof customElements==="undefined"){return}const t=["ch-textarea"];t.forEach((t=>{switch(t){case"ch-textarea":if(!customElements.get(i(t))){customElements.define(i(t),c)}break}}))}l();const u=c;const f=l;export{u as ChTextarea,f as defineCustomElement};
2
2
  //# sourceMappingURL=ch-textarea.js.map
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ChTimeline extends Components.ChTimeline, HTMLElement {}
4
+ export const ChTimeline: {
5
+ prototype: ChTimeline;
6
+ new (): ChTimeline;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,2 @@
1
+ import{p as t,H as e,h as a,d as s,t as o}from"./p-qP_9qshx.js";const i=()=>`:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;padding:0;display:grid;gap:var(--spacing-md);list-style:none}::slotted(li){position:relative;padding-left:var(--spacing-2xl);min-width:0}::slotted(li)::before{content:'';position:absolute;left:0;top:0.35em;width:var(--spacing-sm);height:var(--spacing-sm);border-radius:50%;background:var(--color-border-default)}::slotted(li:not(:last-of-type))::after{content:'';position:absolute;left:calc(var(--spacing-sm) / 2 - var(--border-width));top:calc(0.35em + var(--spacing-sm));bottom:calc(0px - var(--spacing-md));width:var(--border-width);background:var(--color-border-default)}::slotted(time){font-variant-numeric:tabular-nums}`;const r=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}render(){return a(s,{key:"da3288af540acb92113ba83d08fc5e1693e83b3e",class:"timeline"},a("ol",{key:"1aaee846703dd0a67d6df04945eb4a62e2bbf711",class:"list"},a("slot",{key:"394cfd03640a2cf78bd620338de9ed9ef7b9d9f5"})))}static get style(){return i()}},[257,"ch-timeline"]);function n(){if(typeof customElements==="undefined"){return}const t=["ch-timeline"];t.forEach((t=>{switch(t){case"ch-timeline":if(!customElements.get(o(t))){customElements.define(o(t),r)}break}}))}n();const d=r;const c=n;export{d as ChTimeline,c as defineCustomElement};
2
+ //# sourceMappingURL=ch-timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chTimelineCss","ChTimeline","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key","class"],"sources":["src/components/ch-timeline/ch-timeline.css?tag=ch-timeline&encapsulation=shadow","src/components/ch-timeline/ch-timeline.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-secondary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.list {\n margin: 0;\n padding: 0;\n display: grid;\n gap: var(--spacing-md);\n /* Reserve the rail: every item indents past its marker. */\n list-style: none;\n}\n\n/* Each slotted item indents past its dot; pseudo-elements on slotted\n * content are part of the shadow stylesheet's remit here. */\n::slotted(li) {\n position: relative;\n padding-left: var(--spacing-2xl);\n min-width: 0;\n}\n\n/* The marker dot, vertically on the item's first line. */\n::slotted(li)::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0.35em;\n width: var(--spacing-sm);\n height: var(--spacing-sm);\n border-radius: 50%;\n background: var(--color-border-default);\n}\n\n/* The connector to the next item; the last item never gets one, so the\n * timeline does not trail off into nothing. */\n::slotted(li:not(:last-of-type))::after {\n content: '';\n position: absolute;\n left: calc(var(--spacing-sm) / 2 - var(--border-width));\n top: calc(0.35em + var(--spacing-sm));\n bottom: calc(0px - var(--spacing-md));\n width: var(--border-width);\n background: var(--color-border-default);\n}\n\n::slotted(time) {\n font-variant-numeric: tabular-nums;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * Chronological history: a native ordered list with a marker dot per item\n * and a connector line between items — the last item never gets a trailing\n * connector.\n *\n * The component renders the `<ol>` and owns the rail; the consumer writes\n * plain `<li>` items with whatever content each entry needs — a preformatted\n * date, a title, a description, and a non-colour state cue from `ch-icon`:\n *\n * ```html\n * <ch-timeline>\n * <li>\n * <ch-icon name=\"check\"></ch-icon>\n * <time datetime=\"2026-11-02\">2 nov 2026</time> — Creado el pedido\n * </li>\n * <li><ch-icon name=\"spinner\"></ch-icon> Esperando despacho</li>\n * </ch-timeline>\n * ```\n *\n * The list semantics survive untouched because the `li` elements stay native\n * in the light DOM — measured on #83: a wrapped item still counts as a\n * `listitem`, so nothing is gained by a `ch-timeline-item` element, and\n * native markup is the safe bet across browsers.\n */\n@Component({\n tag: 'ch-timeline',\n styleUrl: 'ch-timeline.css',\n shadow: true,\n})\nexport class ChTimeline {\n render() {\n return (\n <Host class=\"timeline\">\n <ol class=\"list\">\n <slot></slot>\n </ol>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAgB,IAAM,yvB,MC+BfC,EAAUC,EAAA,MAAAD,UAAAE,E,iFACrB,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CAACC,MAAM,YACVH,EAAA,MAAAE,IAAA,2CAAIC,MAAM,QACRH,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,f as o,h as i,d as s,t as n}from"./p-qP_9qshx.js";const r={top:"bottom",bottom:"top",left:"right",right:"left"};const l={top:"vertical",bottom:"vertical",left:"horizontal",right:"horizontal"};function a(t,e){return{top:e.top-t.top,left:e.left-t.left,bottom:t.top+t.height-(e.top+e.height),right:t.left+t.width-(e.left+e.width)}}function b(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function c({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let c=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=b(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const u=a(h,o);const p=l[i]==="vertical"?f(u.top)+f(u.bottom):f(u.left)+f(u.right);if(p<d){d=p;c=i}}const{top:u,left:p}=b(c,t,e,s);const m={top:u,left:p,width:e.width,height:e.height};const g=a(m,o);const v=l[c]==="vertical"?{top:u,left:p+h(g.left,g.right)}:{top:u+h(g.top,g.bottom),left:p};return{placement:c,top:v.top,left:v.left}}function f(t){return t>0?t:0}function h(t,e){if(t>0){return t}if(e>0){return-e}return 0}const d=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));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--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.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 u=0;const p=8;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}fallbackId=`ch-tooltip-${++u}`;bubbleEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);if(!t||t.offsetWidth===0){return}const e=this.slotted("trigger")?.getBoundingClientRect?.();if(!e){return}const i={width:t.offsetWidth+g(t),height:t.offsetHeight};const s=window.visualViewport;const{placement:n,top:r,left:l}=c({anchor:{top:e.top,left:e.left,width:e.width,height:e.height},surface:i,viewport:s?{top:s.offsetTop,left:s.offsetLeft,width:s.width,height:s.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight},preferred:this.placement,gap:p});const a=this.offset;const b=a?.top===r&&a?.left===l&&this.resolvedPlacement===n;this.resolvedPlacement=n;this.offset={top:r,left:l};if(!b){o(this)}}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(){const{offset:t}=this;return i(s,{key:"fb651dc0bf007fb86c9f69b2c714106520df4d4a"},i("span",{key:"74324b8e4c0b7c552255605c6aa4ae739e16d832",class:"anchor"},i("slot",{key:"d4c2025af2d96b2ea4e7d8d601ce803be82a4a3e",name:"trigger",onSlotchange:this.associate}),i("span",{key:"f6561dce022d8d9d2d0fb2b6984591301483b1f3",ref:t=>this.bubbleEl=t,style:{"--ch-tooltip-offset-top":t?`${t.top}px`:null,"--ch-tooltip-offset-left":t?`${t.left}px`:null},class:{bubble:true,"bubble--positioned":Boolean(this.offset),[`bubble--${this.resolvedPlacement??this.placement}`]:true,"bubble--visible":this.visible}},i("slot",{key:"a099d15660ea17211b4c50912842b3152e5f652c",name:"content",onSlotchange:this.associate}))))}static get style(){return d()}},[769,"ch-tooltip",{placement:[1],hovered:[32],focused:[32],dismissed:[32],resolvedPlacement:[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]);function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}function v(){if(typeof customElements==="undefined"){return}const t=["ch-tooltip"];t.forEach((t=>{switch(t){case"ch-tooltip":if(!customElements.get(n(t))){customElements.define(n(t),m)}break}}))}v();const w=m;const y=v;export{w as ChTooltip,y as defineCustomElement};
1
+ import{p as t,H as e,f as o,h as i,d as s,t as n}from"./p-qP_9qshx.js";const r={top:"bottom",bottom:"top",left:"right",right:"left"};const l={top:"vertical",bottom:"vertical",left:"horizontal",right:"horizontal"};function a(t,e){return{top:e.top-t.top,left:e.left-t.left,bottom:t.top+t.height-(e.top+e.height),right:t.left+t.width-(e.left+e.width)}}function b(t,e,o,i){switch(t){case"top":return{top:e.top-o.height-i,left:e.left+(e.width-o.width)/2};case"bottom":return{top:e.top+e.height+i,left:e.left+(e.width-o.width)/2};case"left":return{top:e.top+(e.height-o.height)/2,left:e.left-o.width-i};case"right":return{top:e.top+(e.height-o.height)/2,left:e.left+e.width+i}}}function c({anchor:t,surface:e,viewport:o,preferred:i,gap:s}){const n=[i,r[i]];let c=i;let d=Number.POSITIVE_INFINITY;for(const i of n){const{top:n,left:r}=b(i,t,e,s);const h={top:n,left:r,width:e.width,height:e.height};const u=a(h,o);const p=l[i]==="vertical"?f(u.top)+f(u.bottom):f(u.left)+f(u.right);if(p<d){d=p;c=i}}const{top:u,left:p}=b(c,t,e,s);const m={top:u,left:p,width:e.width,height:e.height};const g=a(m,o);const v=l[c]==="vertical"?{top:u,left:p+h(g.left,g.right)}:{top:u+h(g.top,g.bottom),left:p};return{placement:c,top:v.top,left:v.left}}function f(t){return t>0?t:0}function h(t,e){if(t>0){return t}if(e>0){return-e}return 0}const d=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:min(16rem, calc(100vw - 2 * var(--spacing-2xl)));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--positioned{position:fixed;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);transform:none;margin:0}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble.bubble--positioned.bubble--top,.bubble.bubble--positioned.bubble--bottom,.bubble.bubble--positioned.bubble--left,.bubble.bubble--positioned.bubble--right{inset:auto;top:var(--ch-tooltip-offset-top);left:var(--ch-tooltip-offset-left);right:auto;bottom:auto;transform:none;margin:0}.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 u=0;const p=8;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow()}get el(){return this}fallbackId=`ch-tooltip-${++u}`;bubbleEl;cleanup;placement="top";hovered=false;focused=false;dismissed=false;resolvedPlacement;offset;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}connectedCallback(){this.watchViewport()}disconnectedCallback(){this.cleanup?.()}handleMouseEnter(){this.hovered=true;this.dismissed=false;this.position()}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false;this.position()}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible&&!t.defaultPrevented){t.preventDefault();this.dismissed=true}}handleScroll(){if(this.visible&&this.offset){this.position()}}handleResize(){this.position()}watchViewport(){if(typeof window==="undefined"){return}const t=window.visualViewport;if(!t||this.cleanup){return}const e=()=>this.position();t.addEventListener("resize",e);t.addEventListener("scroll",e);this.cleanup=()=>{t.removeEventListener("resize",e);t.removeEventListener("scroll",e)}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}position(){if(typeof window==="undefined"){return}const t=this.bubbleEl??(this.bubbleEl=this.el.shadowRoot?.querySelector(".bubble")??undefined);if(!t||t.offsetWidth===0){return}const e=this.slotted("trigger")?.getBoundingClientRect?.();if(!e){return}const i={width:t.offsetWidth+g(t),height:t.offsetHeight};const s=window.visualViewport;const{placement:n,top:r,left:l}=c({anchor:{top:e.top,left:e.left,width:e.width,height:e.height},surface:i,viewport:s?{top:s.offsetTop,left:s.offsetLeft,width:s.width,height:s.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight},preferred:this.placement,gap:p});const a=this.offset;const b=a?.top===r&&a?.left===l&&this.resolvedPlacement===n;this.resolvedPlacement=n;this.offset={top:r,left:l};if(!b){o(this)}}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(){const{offset:t}=this;return i(s,{key:"676e431d0100ecc9ea688b7e37bc87e8295bb24d"},i("span",{key:"20a388681252e9c4d52e662c014efd9a198efbd7",class:"anchor"},i("slot",{key:"a06cbe31dd04cba38ef09788359783d816fc1a5b",name:"trigger",onSlotchange:this.associate}),i("span",{key:"13cb5b782a7029fc82c10b9b6765de62b94b9afa",ref:t=>this.bubbleEl=t,style:{"--ch-tooltip-offset-top":t?`${t.top}px`:null,"--ch-tooltip-offset-left":t?`${t.left}px`:null},class:{bubble:true,"bubble--positioned":Boolean(this.offset),[`bubble--${this.resolvedPlacement??this.placement}`]:true,"bubble--visible":this.visible}},i("slot",{key:"6610bbf299354bb3be07bb273fab3f8fd91fd254",name:"content",onSlotchange:this.associate}))))}static get style(){return d()}},[769,"ch-tooltip",{placement:[1],hovered:[32],focused:[32],dismissed:[32],resolvedPlacement:[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"],[11,"scroll","handleScroll"],[9,"resize","handleResize"]]]);function g(t){const e=getComputedStyle(t);return(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)}function v(){if(typeof customElements==="undefined"){return}const t=["ch-tooltip"];t.forEach((t=>{switch(t){case"ch-tooltip":if(!customElements.get(n(t))){customElements.define(n(t),m)}break}}))}v();const w=m;const y=v;export{w as ChTooltip,y as defineCustomElement};
2
2
  //# sourceMappingURL=ch-tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["OPPOSITE","top","bottom","left","right","AXIS","overflowOf","surface","viewport","height","width","offsetFor","placement","anchor","gap","placeOverlay","preferred","candidates","best","Number","POSITIVE_INFINITY","candidate","rect","overflow","main","clamp","shifted","correction","before","after","chTooltipCss","tooltipIds","GAP","ChTooltip","__stencil_proxyCustomElement","HTMLElement","fallbackId","bubbleEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","offsetWidth","anchorRect","getBoundingClientRect","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","ref","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Offset from the anchor's top-left corner, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":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: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\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/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\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, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\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 * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\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 private bubbleEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\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 /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\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 this.position();\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 * Only the outermost Escape handler is stopped from propagating, so a\n * tooltip inside an open modal closes itself and leaves the modal open.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\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 * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n if (!bubble || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },\n surface,\n viewport: viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\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 const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["OPPOSITE","top","bottom","left","right","AXIS","overflowOf","surface","viewport","height","width","offsetFor","placement","anchor","gap","placeOverlay","preferred","candidates","best","Number","POSITIVE_INFINITY","candidate","rect","overflow","main","clamp","shifted","correction","before","after","chTooltipCss","tooltipIds","GAP","ChTooltip","__stencil_proxyCustomElement","HTMLElement","fallbackId","bubbleEl","cleanup","hovered","focused","dismissed","resolvedPlacement","offset","visible","this","componentDidLoad","associate","connectedCallback","watchViewport","disconnectedCallback","handleMouseEnter","position","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","defaultPrevented","preventDefault","handleScroll","handleResize","window","visualViewport","update","addEventListener","removeEventListener","slotted","name","Array","from","el","children","find","child","getAttribute","bubble","shadowRoot","querySelector","undefined","offsetWidth","anchorRect","getBoundingClientRect","horizontalMargin","offsetHeight","offsetTop","offsetLeft","innerWidth","innerHeight","current","unchanged","forceUpdate","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","ref","style","Boolean","getComputedStyle","parseFloat","marginLeft","marginRight"],"sources":["src/utils/overlay.ts","src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":["export type ChOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface ChOverlayPosition {\n /** Placement after flipping when the preferred side does not fit. */\n placement: ChOverlayPlacement;\n /** Offset from the anchor's top-left corner, in pixels. */\n top: number;\n left: number;\n}\n\nexport interface ChOverlayRect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface ChOverlayViewport {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst OPPOSITE: Record<ChOverlayPlacement, ChOverlayPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\nconst AXIS: Record<ChOverlayPlacement, 'vertical' | 'horizontal'> = {\n top: 'vertical',\n bottom: 'vertical',\n left: 'horizontal',\n right: 'horizontal',\n};\n\n/**\n * How far a placed surface overflows each viewport edge. Positive values are\n * overflow. Used both to pick a placement and to shift the surface back in.\n */\nexport function overflowOf(surface: ChOverlayRect, viewport: ChOverlayViewport) {\n return {\n top: viewport.top - surface.top,\n left: viewport.left - surface.left,\n bottom: surface.top + surface.height - (viewport.top + viewport.height),\n right: surface.left + surface.width - (viewport.left + viewport.width),\n };\n}\n\nfunction offsetFor(placement: ChOverlayPlacement, anchor: ChOverlayRect, surface: { width: number; height: number }, gap: number) {\n switch (placement) {\n case 'top':\n return {\n top: anchor.top - surface.height - gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'bottom':\n return {\n top: anchor.top + anchor.height + gap,\n left: anchor.left + (anchor.width - surface.width) / 2,\n };\n case 'left':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left - surface.width - gap,\n };\n case 'right':\n return {\n top: anchor.top + (anchor.height - surface.height) / 2,\n left: anchor.left + anchor.width + gap,\n };\n }\n}\n\n/**\n * Picks the placement that overflows least and then shifts the surface along\n * the cross axis so it stays inside the viewport.\n *\n * The main-axis overflow is not compensated with a translate: a tooltip pinned\n * to the top edge would cover its own trigger. Flipping to the other side is\n * what keeps it readable, and the caller decides whether to accept the\n * remaining overflow.\n */\nexport function placeOverlay({\n anchor,\n surface,\n viewport,\n preferred,\n gap,\n}: {\n anchor: ChOverlayRect;\n surface: { width: number; height: number };\n viewport: ChOverlayViewport;\n preferred: ChOverlayPlacement;\n gap: number;\n}): ChOverlayPosition {\n const candidates: ChOverlayPlacement[] = [preferred, OPPOSITE[preferred]];\n let placement = preferred;\n let best = Number.POSITIVE_INFINITY;\n\n for (const candidate of candidates) {\n const { top, left } = offsetFor(candidate, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);\n\n if (main < best) {\n best = main;\n placement = candidate;\n }\n }\n\n const { top, left } = offsetFor(placement, anchor, surface, gap);\n const rect = { top, left, width: surface.width, height: surface.height };\n const overflow = overflowOf(rect, viewport);\n\n const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };\n\n return { placement, top: shifted.top, left: shifted.left };\n}\n\n/** Only real overflow counts: the side that fits contributes nothing. */\nfunction clamp(overflow: number) {\n return overflow > 0 ? overflow : 0;\n}\n\n/**\n * Turns the two overflows on an axis into a shift. `before` is the overflow on\n * the leading edge (top or left), `after` the one on the trailing edge; both\n * are positive when the surface spills past that edge.\n *\n * Pushing away from the leading edge moves the surface inwards, so the shift is\n * `+before`. The trailing edge needs the opposite sign. When both overflow the\n * surface is larger than the viewport: pin it to the leading edge and let\n * `max-width` stop the spill.\n */\nfunction correction(before: number, after: number) {\n if (before > 0) {\n return before;\n }\n if (after > 0) {\n return -after;\n }\n return 0;\n}\n",":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: min(16rem, calc(100vw - 2 * var(--spacing-2xl)));\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/*\n * Once the component has measured the anchor, the bubble is placed with fixed\n * coordinates. Viewport coordinates do not depend on ancestors' transforms or\n * overflow, so a tooltip inside a scrolling drawer or modal stays anchored.\n */\n.bubble--positioned {\n position: fixed;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n transform: none;\n margin: 0;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n/* Stencil scopes each rule by doubling its classes, so a three-class selector\n is what actually outranks the single-class placement rules above. */\n.bubble.bubble--positioned.bubble--top,\n.bubble.bubble--positioned.bubble--bottom,\n.bubble.bubble--positioned.bubble--left,\n.bubble.bubble--positioned.bubble--right {\n inset: auto;\n top: var(--ch-tooltip-offset-top);\n left: var(--ch-tooltip-offset-left);\n right: auto;\n bottom: auto;\n transform: none;\n margin: 0;\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, forceUpdate, Host, Listen, Prop, State, h } from '@stencil/core';\n\nimport { placeOverlay, type ChOverlayPlacement } from '../../utils/overlay';\n\nexport type ChTooltipPlacement = ChOverlayPlacement;\n\nlet tooltipIds = 0;\n\n/** Space between the trigger and the bubble, matching `--spacing-md`. */\nconst GAP = 8;\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 * Positioning is measured, not purely CSS: `placement` is the preferred side,\n * and the bubble flips to the opposite side when the preferred one does not\n * fit, then shifts along the other axis to stay inside the viewport. It\n * re-measures on scroll, resize and visual-viewport changes, which is what\n * keeps it correct inside a scrolling modal or drawer and when a mobile\n * keyboard shrinks the visible area.\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 private bubbleEl?: HTMLElement;\n\n private cleanup?: () => void;\n\n /**\n * The side the bubble is placed on. It is a preference: when that side has no\n * room the bubble flips to the opposite one.\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 /** The placement actually used, which may differ from the prop after a flip. */\n @State() resolvedPlacement?: ChTooltipPlacement;\n\n /** Offset applied to the bubble once it has been measured. */\n private offset?: { top: number; left: number };\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n connectedCallback() {\n this.watchViewport();\n }\n\n disconnectedCallback() {\n this.cleanup?.();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n this.position();\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 this.position();\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 * `preventDefault()` dismisses only the innermost surface: the platform's\n * close request for an open native `<dialog>` is the default action of this\n * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven\n * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {\n event.preventDefault();\n this.dismissed = true;\n }\n }\n\n /** Cheap guard so scroll frames do not measure while nothing is shown. */\n @Listen('scroll', { target: 'window', capture: true, passive: true })\n handleScroll() {\n if (this.visible && this.offset) {\n this.position();\n }\n }\n\n @Listen('resize', { target: 'window', passive: true })\n handleResize() {\n this.position();\n }\n\n private watchViewport() {\n if (typeof window === 'undefined') {\n return;\n }\n const viewport = window.visualViewport;\n if (!viewport || this.cleanup) {\n return;\n }\n const update = () => this.position();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n this.cleanup = () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\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 * Measures the anchor and the bubble and stores the offset that keeps the\n * bubble inside the viewport. Nothing is measured before the bubble has a\n * box to measure, so the pre-paint render uses plain CSS.\n */\n private position() {\n if (typeof window === 'undefined') {\n return;\n }\n const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector<HTMLElement>('.bubble') ?? undefined);\n if (!bubble || bubble.offsetWidth === 0) {\n return;\n }\n\n const anchorRect = (this.slotted('trigger') as HTMLElement | undefined)?.getBoundingClientRect?.();\n if (!anchorRect) {\n return;\n }\n\n const surface = {\n width: bubble.offsetWidth + horizontalMargin(bubble),\n height: bubble.offsetHeight,\n };\n const viewport = window.visualViewport;\n\n const { placement, top, left } = placeOverlay({\n anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },\n surface,\n viewport: viewport\n ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }\n : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },\n preferred: this.placement,\n gap: GAP,\n });\n\n const current = this.offset;\n const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;\n this.resolvedPlacement = placement;\n this.offset = { top, left };\n if (!unchanged) {\n forceUpdate(this);\n }\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 const { offset } = this;\n\n return (\n <Host>\n <span class=\"anchor\">\n {/* Pre-measure render uses the preferred side so the bubble never\n jumps from the wrong edge on its first frame. */}\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span\n ref={el => (this.bubbleEl = el)}\n style={{\n '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,\n '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,\n }}\n class={{\n 'bubble': true,\n 'bubble--positioned': Boolean(this.offset),\n [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,\n 'bubble--visible': this.visible,\n }}\n >\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n\nfunction horizontalMargin(el: HTMLElement) {\n const style = getComputedStyle(el);\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`: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)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"9e1cc36781db28cded8318f67158332168b0bbfc"},r("span",{key:"9c923d38545c0fceab0f244b4374708e2b7e2043",class:{spinner:true,[`spinner--${this.size}`]:true},role:e?"status":undefined,"aria-label":e?this.label:undefined,"aria-hidden":e?undefined:"true"}))}static get style(){return t()}},[513,"ch-spinner",{size:[1],label:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-spinner"];e.forEach((e=>{switch(e){case"ch-spinner":if(!customElements.get(i(e))){customElements.define(i(e),a)}break}}))}o();export{a as C,o as d};
2
- //# sourceMappingURL=p-CV0rD-fF.js.map
1
+ import{p as e,H as n,h as r,d as s,t as i}from"./p-qP_9qshx.js";const t=()=>`: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)}}`;const a=e(class e extends n{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow()}size="md";label;render(){const e=Boolean(this.label);return r(s,{key:"6d26b2ead7b674058b3d5c56caf9329cf9377ae6"},r("span",{key:"a3fa9b56474271154527b9e0f9def3136b158ea4",class:{spinner:true,[`spinner--${this.size}`]:true},role:e?"status":undefined,"aria-label":e?this.label:undefined,"aria-hidden":e?undefined:"true"}))}static get style(){return t()}},[513,"ch-spinner",{size:[1],label:[1]}]);function o(){if(typeof customElements==="undefined"){return}const e=["ch-spinner"];e.forEach((e=>{switch(e){case"ch-spinner":if(!customElements.get(i(e))){customElements.define(i(e),a)}break}}))}o();export{a as C,o as d};
2
+ //# sourceMappingURL=p-Cw0b4OGc.js.map
@@ -32,7 +32,7 @@ const ChAccordion = class {
32
32
  this.chChange.emit(this.value);
33
33
  };
34
34
  render() {
35
- return (h(Host, { key: 'a0b6859c9efc45b158825f2b44aab73a5eb63f0b' }, this.items.map(item => {
35
+ return (h(Host, { key: '83cb1bb02baec54767edde0241c9f784b35cf336' }, this.items.map(item => {
36
36
  const open = this.value === item.value;
37
37
  return (h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, h("h3", { class: "item-head" }, h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, h("slot", { name: `panel-${item.value}` }))));
38
38
  })));
@@ -50,7 +50,7 @@ const ChAlert = class {
50
50
  render() {
51
51
  const role = this.variant === 'warning' ? 'alert' : 'status';
52
52
  const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
53
- return (h(Host, { key: '5a14801af29be0634bd35cf8706446a3a5d33286' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: 'dbaf65b9d7dc08e2ba51b60b273a16ae42eacb02', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: 'ad1c508dea9e3f9e718ec8104f8236065f3eb0e8', class: "alert-content" }, h("slot", { key: '6f906d355fa416b674994716a3ca896ae517f492' })), this.dismissLabel && (h("button", { key: '165af98fa093bda95c785e86c078b69aee2c0580', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: '0a05eff2d077559dc267bd72898299c5d42eaf8a', "aria-hidden": "true" }, "\u00D7"))))));
53
+ return (h(Host, { key: 'a3b0af93e0fd59c088575c1a56265698ca2836b0' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: '7bceb09ba57e6b6d2344cb88476f8327c215941d', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: '0e936cb51c852ab375b32b4fd5bcf3e275f56d21', class: "alert-content" }, h("slot", { key: 'f29a5e218b900718505908b0c6731403414eacda' })), this.dismissLabel && (h("button", { key: 'fe80820757f3fe2f76d44f6227f9ce6e0774cb30', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: 'eb8110f89d6fb3f080f78a8b2e2569f2050bd91d', "aria-hidden": "true" }, "\u00D7"))))));
54
54
  }
55
55
  };
56
56
  ChAlert.style = chAlertCss();
@@ -72,7 +72,7 @@ const ChBadge = class {
72
72
  */
73
73
  statusCue = true;
74
74
  render() {
75
- return (h(Host, { key: '4690e03d920f9fd89afc7a37cab1e2c57d26f1f2' }, h("span", { key: '73bac91869bb6e37d1434e7318fd716ffedc2120', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '8272f087de323e6d729a1820d971da6c5dc7c5b5', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: 'bafc32e7a928fa7c458efb12a08fa0bbf18e83e6' }))));
75
+ return (h(Host, { key: '4c2874a988c47589bb4b101479e93aba9c1cf05c' }, h("span", { key: '5d78f0c78545ad36f3e8cbfee48b0256545e9964', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '02bebc85a39fca230f09cc4688a05d055396d054', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: '87d5e53ae4ea195f6f78ce8694048c9cd27af2ac' }))));
76
76
  }
77
77
  };
78
78
  ChBadge.style = chBadgeCss();
@@ -176,7 +176,7 @@ const ChCard = class {
176
176
  registerInstance(this, hostRef);
177
177
  }
178
178
  render() {
179
- return (h(Host, { key: 'b3952612583c8f61076164d3795b56d54b023a77' }, h("div", { key: 'd0f58a9f84006c942ef9b27926f8cfa3138ad7d2', class: "card" }, h("slot", { key: '9b1b54af6c5ff58417732764d4fcb8a8114348c4' }))));
179
+ return (h(Host, { key: '3f9cac3b9c506e14a27750e0e501a4f524ef9d8d' }, h("div", { key: 'a35fc3f44e85df166a311317d5409ed96664c4e8', class: "card" }, h("slot", { key: '15efcaa33c3fdf8599c78cfe61ee107fd42115b3' }))));
180
180
  }
181
181
  };
182
182
  ChCard.style = chCardCss();
@@ -302,7 +302,7 @@ const ChInput = class {
302
302
  return undefined;
303
303
  }
304
304
  render() {
305
- return (h(Host, { key: 'e0bbbb592d8c90897f48060f570606453c125ce5' }, this.label && (h("label", { key: '2748fad40236a1ebe4acba6405c73f26e1284dd1', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'b7c6ed3c9135ecaddde161a88077bd415900b465', 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 || this.formDisabled, 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) && (h("p", { key: 'f87c7300a6cfca70770cd9eb05e5ba242698b3cf', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'e8ed5e8059e06d23c0e742de33c0a9b651e1ced4', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
305
+ return (h(Host, { key: 'd85d2773a340ee1a46f7f76a0d287ff1194d0e0b' }, this.label && (h("label", { key: '9ad19457232c703a59eab1062e12c17e8c2b8327', class: "label", htmlFor: this.inputId }, this.label)), h("input", { key: 'f88fe669d2afa183230b1286dd88ccc894eaee5e', 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 || this.formDisabled, 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) && (h("p", { key: '31bdbb81ba537cc7d84b8cf7fc24055890b9b000', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '50a7cb03654f5deaa70af64ee14d774e94f77816', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
306
306
  }
307
307
  static get formAssociated() { return true; }
308
308
  static get watchers() { return {
@@ -434,7 +434,7 @@ const ChSelect = class {
434
434
  return undefined;
435
435
  }
436
436
  render() {
437
- return (h(Host, { key: 'b01c1dca70dbf88556521faa1be7430dc3d2355c' }, this.label && (h("label", { key: '265a09b70dafca0c9330ceaec2477b6b203a71eb', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: '43b387edff4fd326beac608fa16e50f3407e8cac', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (h("option", { key: '456e5220d2fd6fdb2a2171d10bcd11c6d2c58956', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '7f4609f6441f9ce6c5f13b4a12875d85c110ccd8', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'e05a04a3f43ad055cd7cc57deb48f8b19d1a7084', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
437
+ return (h(Host, { key: 'aeba7eff5bf3bd7926922e65376c6508fc1c4dd3' }, this.label && (h("label", { key: '943e5557014e2297368825505513f4ad8b093ee5', class: "label", htmlFor: this.selectId }, this.label)), h("select", { key: 'ccec2dfef1b06b219e7aed536914ebf2b24e370f', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (h("option", { key: 'a0c41592c1a5a90f611917da984374edf5305b96', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '28a35ede5d7bb1937d501719244b4b9f7a5d95f2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'b021c848f75367e2e3329aab423f787205ee0491', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
438
438
  }
439
439
  static get formAssociated() { return true; }
440
440
  static get watchers() { return {
@@ -475,7 +475,7 @@ const ChSpinner = class {
475
475
  label;
476
476
  render() {
477
477
  const labelled = Boolean(this.label);
478
- return (h(Host, { key: '9e1cc36781db28cded8318f67158332168b0bbfc' }, h("span", { key: '9c923d38545c0fceab0f244b4374708e2b7e2043', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
478
+ return (h(Host, { key: '6d26b2ead7b674058b3d5c56caf9329cf9377ae6' }, h("span", { key: 'a3fa9b56474271154527b9e0f9def3136b158ea4', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
479
479
  }
480
480
  };
481
481
  ChSpinner.style = chSpinnerCss();
@@ -588,7 +588,7 @@ const ChSwitch = class {
588
588
  return undefined;
589
589
  }
590
590
  render() {
591
- return (h(Host, { key: '7c862590fa8ce9c53d168cb670361259405c72bb' }, h("label", { key: 'e5602d4daa8ebf1a9832282fffb9e538fc1592a8', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: 'd29c00496c4a05ccbe66ffdbebf3a496c5ae6995', 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 || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { key: '5739a0b689ac7ed9ebc917e6102b3951e80ac06d', class: "track" }, h("span", { key: 'e10c21f740092750dd9bb00cde84fa1c26746eb9', class: "thumb" })), this.label && h("span", { key: 'bec86897b1ef0023d3eb8c8438bf6740f32a5921', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '2568bcf74334e5f081df8efa9a1196c69cb3093d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '319d5583cf10e329f05430a577d2f1f956ac8dd5', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
591
+ return (h(Host, { key: 'e1493afa72058b44b5051cdc641604d02952b6be' }, h("label", { key: '80f2ca9bdb7fab02556f427f4a1fce56744eaf50', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, h("input", { key: '22a873c43b7f9c94455373d80ab5b3c28153ff70', 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 || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), h("span", { key: 'd995c061f60ad3040048966da17ad8cb2ebdb622', class: "track" }, h("span", { key: 'ba09dcb23640b2925d0c82f5ab46213acc7e8a86', class: "thumb" })), this.label && h("span", { key: '9849238fd3486bc1d869c6df373e30209e46d264', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '76a5cb6da88dbd7088cf2c0d9c2b5a781a632a7f', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '5ebd8ab9b2390fea801bf75eeb4967e95983e041', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
592
592
  }
593
593
  static get formAssociated() { return true; }
594
594
  static get watchers() { return {
@@ -109,7 +109,7 @@ const ChCheckbox = class {
109
109
  return undefined;
110
110
  }
111
111
  render() {
112
- return (h(Host, { key: '5246c3e6798a4ad0407f3b817ca1b83ab786ca1e' }, h("label", { key: 'c3fda492b9c61c81fd3c7afe62e5c379f783ff28', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'd77cdf632cbe58c74719567a52fbe224fcceca0b', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: 'b2707475cc9b3f1e70044566e16ce1b90facabc6', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'f597fbea344370911f71f2360db4eb0e57d3999d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '75082edd8a5a477c7c95365e6e2da66f6b69d6cc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
112
+ return (h(Host, { key: '09ba208488d214d27ae2d5019a231a17033e5157' }, h("label", { key: '266604e9468f3a12b9593afc0ba25389ae6ab327', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'd068dc3c56fd8c2588821de0f394296305023f1d', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '22f1fd5ab55d39da62fee78434794cd488bf1dcd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'ef7de0570aeac42cfedaf7dd90922460e0c822d9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'f4fea80489574d6673176fc1139c496c202a92bc', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
113
113
  }
114
114
  static get formAssociated() { return true; }
115
115
  static get watchers() { return {
@@ -28,13 +28,13 @@ const ChCluster = class {
28
28
  return GAPS.has(this.gap) ? this.gap : 'md';
29
29
  }
30
30
  render() {
31
- return (h(Host, { key: 'f55b938f1f3e898b63646945af934258bf87b1af', class: {
31
+ return (h(Host, { key: 'e3d17238168f3faaa452740f0aab6a9e0ed5219f', class: {
32
32
  'cluster': true,
33
33
  [`cluster--gap-${this.gapStep}`]: true,
34
34
  [`cluster--align-${this.align}`]: true,
35
35
  [`cluster--justify-${this.justify}`]: true,
36
36
  'cluster--nowrap': !this.wrap,
37
- } }, h("slot", { key: 'b4c3adf66aa275eac6f60c512454a9b4391e14d3' })));
37
+ } }, h("slot", { key: '638cecec55ed72d53eb5c6e51d1a683833fa5756' })));
38
38
  }
39
39
  };
40
40
  ChCluster.style = chClusterCss();
@@ -0,0 +1,27 @@
1
+ import { r as registerInstance, h, H as Host } from './index-CIV5Gg1o.js';
2
+
3
+ const chDescriptionListCss = () => `:host{display:block;font-family:var(--typography-body);color:var(--color-text-secondary)}:host([hidden]){display:none}.list{margin:0;display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));gap:var(--spacing-sm) var(--spacing-2xl)}.list--columns-2,.list--columns-3{grid-template-columns:repeat(2, minmax(0, 1fr))}.list--columns-3{grid-template-columns:repeat(3, minmax(0, 1fr))}@media (max-width: 48rem){.list--columns-2,.list--columns-3{grid-template-columns:minmax(0, 1fr)}}::slotted(div){display:grid;grid-template-columns:fit-content(min(12rem, 40%)) minmax(0, 1fr);gap:var(--spacing-sm);align-items:baseline}::slotted(dt){font-family:var(--typography-heading);font-weight:var(--typography-weight-semibold);font-size:var(--typography-size-sm);color:var(--color-text-primary)}::slotted(dd){margin:0;font-size:var(--typography-size-sm);min-width:0;overflow-wrap:break-word}`;
4
+
5
+ const COLUMNS = new Set(['1', '2', '3']);
6
+ const ChDescriptionList = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ /**
11
+ * How many pairs share a row on a wide viewport. One column is the stacked
12
+ * layout. An unknown value falls back to one column.
13
+ */
14
+ columns = '1';
15
+ get columnCount() {
16
+ return COLUMNS.has(this.columns) ? this.columns : '1';
17
+ }
18
+ render() {
19
+ return (h(Host, { key: 'd4905aeabf16e8c0798601a15e9115128c87f367' }, h("dl", { key: 'f2f85f1cdae61f0d5d8c007509ec75f21a9e69df', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '60883fb5884ad38791c7ef811e4f3a0be6396e61' }))));
20
+ }
21
+ };
22
+ ChDescriptionList.style = chDescriptionListCss();
23
+
24
+ export { ChDescriptionList as ch_description_list };
25
+ //# sourceMappingURL=ch-description-list.entry.js.map
26
+
27
+ //# sourceMappingURL=ch-description-list.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ch-description-list.entry.js","sources":["src/components/ch-description-list/ch-description-list.css?tag=ch-description-list&encapsulation=shadow","src/components/ch-description-list/ch-description-list.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: var(--typography-body);\n color: var(--color-text-secondary);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/*\n * Slotted content is laid out by the <dl> grid: a slot's assigned nodes\n * become its layout children, so each consumer-written <div> group is one\n * grid item and a pair can never split across columns.\n */\n.list {\n margin: 0;\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: var(--spacing-sm) var(--spacing-2xl);\n}\n\n.list--columns-2,\n.list--columns-3 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.list--columns-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n\n/* Narrow viewports collapse every column count to one. */\n@media (max-width: 48rem) {\n .list--columns-2,\n .list--columns-3 {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n\n/* A group places its term and description on one baseline row. */\n::slotted(div) {\n display: grid;\n grid-template-columns: fit-content(min(12rem, 40%)) minmax(0, 1fr);\n gap: var(--spacing-sm);\n align-items: baseline;\n}\n\n::slotted(dt) {\n font-family: var(--typography-heading);\n font-weight: var(--typography-weight-semibold);\n font-size: var(--typography-size-sm);\n color: var(--color-text-primary);\n}\n\n::slotted(dd) {\n margin: 0;\n font-size: var(--typography-size-sm);\n min-width: 0;\n overflow-wrap: break-word;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChDescriptionListColumns = '1' | '2' | '3';\n\nconst COLUMNS = new Set(['1', '2', '3']);\n\n/**\n * Label/value pairs for detail views, on a native `<dl>`.\n *\n * The component renders the `<dl>` and the layout; the consumer writes the\n * terms and descriptions. Group each pair in a `<div>` (valid HTML 5.2\n * grouping) — the group is the grid item, which is what keeps a pair from\n * splitting across columns:\n *\n * ```html\n * <ch-description-list columns=\"2\">\n * <div><dt>Cliente</dt><dd>Aurora SpA</dd></div>\n * <div><dt>Pedido</dt><dd>#1523</dd></div>\n * </ch-description-list>\n * ```\n *\n * The markup stays native in the light DOM, so the `term` role reaches the\n * accessibility tree untouched — the shape decision on #81 measured that a\n * custom wrapper adds nothing in Chromium while risking other browsers. No\n * `ch-description-item` element exists for the same reason.\n */\n@Component({\n tag: 'ch-description-list',\n styleUrl: 'ch-description-list.css',\n shadow: true,\n})\nexport class ChDescriptionList {\n /**\n * How many pairs share a row on a wide viewport. One column is the stacked\n * layout. An unknown value falls back to one column.\n */\n @Prop() columns: ChDescriptionListColumns = '1';\n\n private get columnCount() {\n return COLUMNS.has(this.columns) ? this.columns : '1';\n }\n\n render() {\n return (\n <Host>\n <dl class={`list list--columns-${this.columnCount}`}>\n <slot></slot>\n </dl>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,oBAAoB,GAAG,MAAM,CAAC,+2BAA+2B,CAAC;;ACIp5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;MA2B3B,iBAAiB,GAAA,MAAA;;;;AAC5B;;;AAGG;IACK,OAAO,GAA6B,GAAG;AAE/C,IAAA,IAAY,WAAW,GAAA;AACrB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG;;IAGvD,MAAM,GAAA;AACJ,QAAA,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAI,KAAK,EAAE,CAAA,mBAAA,EAAsB,IAAI,CAAC,WAAW,EAAE,EAAA,EACjD,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACV,CACA;;;;;;;"}
@@ -11,7 +11,7 @@ const ChDivider = class {
11
11
  */
12
12
  orientation = 'horizontal';
13
13
  render() {
14
- return (h(Host, { key: 'bf9e60345f2958ac334df8e8b3cf135363a4cd84', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '9a6348a2e46fa30c7b58a96f875c438468866b44', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
14
+ return (h(Host, { key: 'c18cffa051e3fde189ed358a748e58d0af534357', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '2a6fe2c3a2b61eecd03e0b5d2830695328e77453', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
15
15
  }
16
16
  };
17
17
  ChDivider.style = chDividerCss();