@devschile/chucao 2.4.0 → 2.5.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 (241) hide show
  1. package/README.md +17 -16
  2. package/dist/chucao/chucao.css +1 -1
  3. package/dist/chucao/chucao.esm.js +1 -1
  4. package/dist/chucao/index.esm.js +1 -1
  5. package/dist/chucao/index.esm.js.map +1 -1
  6. package/dist/chucao/{p-1ebd9dc4.entry.js → p-0bc141a2.entry.js} +2 -2
  7. package/dist/chucao/{p-449e1ba0.entry.js → p-0e044eff.entry.js} +2 -2
  8. package/dist/chucao/{p-a07e0e97.entry.js → p-1108062e.entry.js} +2 -2
  9. package/dist/chucao/{p-85db779c.entry.js → p-26e144ff.entry.js} +2 -2
  10. package/dist/chucao/p-2c681cc0.entry.js +2 -0
  11. package/dist/chucao/p-2c681cc0.entry.js.map +1 -0
  12. package/dist/chucao/p-2e785177.entry.js +2 -0
  13. package/dist/chucao/{p-0e3c83a6.entry.js.map → p-2e785177.entry.js.map} +1 -1
  14. package/dist/chucao/{p-6e95f31f.entry.js → p-337d7f68.entry.js} +2 -2
  15. package/dist/chucao/{p-7c85f5fe.entry.js → p-350f974d.entry.js} +2 -2
  16. package/dist/chucao/p-4846cac4.entry.js +2 -0
  17. package/dist/chucao/{p-d0533af6.entry.js → p-6345c9e1.entry.js} +2 -2
  18. package/dist/chucao/p-957acf39.entry.js +2 -0
  19. package/dist/chucao/p-957acf39.entry.js.map +1 -0
  20. package/dist/chucao/{p-34a9d1f4.entry.js → p-97655c41.entry.js} +2 -2
  21. package/dist/chucao/{p-b5552b50.entry.js → p-9f73855e.entry.js} +2 -2
  22. package/dist/chucao/p-CIV5Gg1o.js +3 -0
  23. package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
  24. package/dist/chucao/p-CnivhwvG.js +2 -0
  25. package/dist/chucao/p-CnivhwvG.js.map +1 -0
  26. package/dist/chucao/{p-17451d92.entry.js → p-b53d954e.entry.js} +2 -2
  27. package/dist/chucao/{p-d776b092.entry.js → p-b6cc08f0.entry.js} +2 -2
  28. package/dist/chucao/p-be7b5c21.entry.js +2 -0
  29. package/dist/chucao/p-be7b5c21.entry.js.map +1 -0
  30. package/dist/chucao/p-c165f839.entry.js +2 -0
  31. package/dist/chucao/p-c165f839.entry.js.map +1 -0
  32. package/dist/chucao/{p-56d64d84.entry.js → p-c251b0d1.entry.js} +2 -2
  33. package/dist/chucao/p-f5b74bca.entry.js +2 -0
  34. package/dist/chucao/p-f5b74bca.entry.js.map +1 -0
  35. package/dist/chucao/{p-84d875e9.entry.js → p-f9fe752c.entry.js} +2 -2
  36. package/dist/chucao/{p-1778a313.entry.js → p-fdf065e6.entry.js} +2 -2
  37. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  38. package/dist/cjs/ch-alert_8.cjs.entry.js +34 -10
  39. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
  40. package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
  41. package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
  42. package/dist/cjs/ch-divider.cjs.entry.js +2 -2
  43. package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
  44. package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
  45. package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
  46. package/dist/cjs/ch-grid.cjs.entry.js +2 -2
  47. package/dist/cjs/ch-icon-button.cjs.entry.js +51 -0
  48. package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
  49. package/dist/cjs/ch-icon.cjs.entry.js +38 -0
  50. package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
  51. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  52. package/dist/cjs/ch-modal.cjs.entry.js +2 -2
  53. package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
  54. package/dist/cjs/ch-page-header.cjs.entry.js.map +1 -0
  55. package/dist/cjs/ch-radio.cjs.entry.js +2 -2
  56. package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
  57. package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
  58. package/dist/cjs/ch-stack.cjs.entry.js +2 -2
  59. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  60. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  61. package/dist/cjs/ch-tooltip.cjs.entry.js +204 -5
  62. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
  63. package/dist/cjs/chucao.cjs.js +2 -2
  64. package/dist/cjs/icons-CNyDgV-q.js +88 -0
  65. package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
  66. package/dist/cjs/{index-ysucLiAq.js → index-ByZY6aTj.js} +81 -5
  67. package/dist/cjs/index-ByZY6aTj.js.map +1 -0
  68. package/dist/cjs/index.cjs.js +16 -0
  69. package/dist/cjs/index.cjs.js.map +1 -1
  70. package/dist/cjs/loader.cjs.js +2 -2
  71. package/dist/collection/collection-manifest.json +3 -0
  72. package/dist/collection/components/ch-alert/ch-alert.css +13 -0
  73. package/dist/collection/components/ch-alert/ch-alert.js +44 -1
  74. package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
  75. package/dist/collection/components/ch-badge/ch-badge.css +30 -1
  76. package/dist/collection/components/ch-badge/ch-badge.js +35 -1
  77. package/dist/collection/components/ch-badge/ch-badge.js.map +1 -1
  78. package/dist/collection/components/ch-card/ch-card.js +1 -1
  79. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  80. package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
  81. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  82. package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
  83. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  84. package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
  85. package/dist/collection/components/ch-grid/ch-grid.js +1 -1
  86. package/dist/collection/components/ch-icon/ch-icon.css +25 -0
  87. package/dist/collection/components/ch-icon/ch-icon.js +121 -0
  88. package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
  89. package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
  90. package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
  91. package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
  92. package/dist/collection/components/ch-input/ch-input.js +1 -1
  93. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  94. package/dist/collection/components/ch-page-header/ch-page-header.css +84 -0
  95. package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
  96. package/dist/collection/components/ch-page-header/ch-page-header.js.map +1 -0
  97. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  98. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
  99. package/dist/collection/components/ch-select/ch-select.js +1 -1
  100. package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
  101. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  102. package/dist/collection/components/ch-stack/ch-stack.js +1 -1
  103. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  104. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  105. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  106. package/dist/collection/components/ch-tooltip/ch-tooltip.css +29 -1
  107. package/dist/collection/components/ch-tooltip/ch-tooltip.js +125 -6
  108. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
  109. package/dist/collection/tokens/tokens.js +12 -0
  110. package/dist/collection/tokens/tokens.js.map +1 -1
  111. package/dist/collection/tokens/types.js.map +1 -1
  112. package/dist/collection/utils/icons.js +82 -0
  113. package/dist/collection/utils/icons.js.map +1 -0
  114. package/dist/collection/utils/overlay.js +101 -0
  115. package/dist/collection/utils/overlay.js.map +1 -0
  116. package/dist/components/ch-accordion.js +1 -1
  117. package/dist/components/ch-alert.js +1 -1
  118. package/dist/components/ch-alert.js.map +1 -1
  119. package/dist/components/ch-badge.js +1 -1
  120. package/dist/components/ch-badge.js.map +1 -1
  121. package/dist/components/ch-button.js +1 -1
  122. package/dist/components/ch-card.js +1 -1
  123. package/dist/components/ch-checkbox.js +1 -1
  124. package/dist/components/ch-cluster.js +1 -1
  125. package/dist/components/ch-divider.js +1 -1
  126. package/dist/components/ch-drawer.js +1 -1
  127. package/dist/components/ch-emoji.js +1 -1
  128. package/dist/components/ch-empty-state.js +1 -1
  129. package/dist/components/ch-grid.js +1 -1
  130. package/dist/components/ch-icon-button.d.ts +11 -0
  131. package/dist/components/ch-icon-button.js +2 -0
  132. package/dist/components/ch-icon-button.js.map +1 -0
  133. package/dist/components/ch-icon.d.ts +11 -0
  134. package/dist/components/ch-icon.js +2 -0
  135. package/dist/components/ch-icon.js.map +1 -0
  136. package/dist/components/ch-input.js +1 -1
  137. package/dist/components/ch-link.js +1 -1
  138. package/dist/components/ch-modal.js +1 -1
  139. package/dist/components/ch-page-header.d.ts +11 -0
  140. package/dist/components/ch-page-header.js +2 -0
  141. package/dist/components/ch-page-header.js.map +1 -0
  142. package/dist/components/ch-radio.js +1 -1
  143. package/dist/components/ch-segmented-control.js +1 -1
  144. package/dist/components/ch-select.js +1 -1
  145. package/dist/components/ch-skeleton.js +1 -1
  146. package/dist/components/ch-spinner.js +1 -1
  147. package/dist/components/ch-stack.js +1 -1
  148. package/dist/components/ch-switch.js +1 -1
  149. package/dist/components/ch-tabs.js +1 -1
  150. package/dist/components/ch-textarea.js +1 -1
  151. package/dist/components/ch-tooltip.js +1 -1
  152. package/dist/components/ch-tooltip.js.map +1 -1
  153. package/dist/components/index.js +1 -1
  154. package/dist/components/index.js.map +1 -1
  155. package/dist/components/{p-no2_9Jk-.js → p-CV0rD-fF.js} +2 -2
  156. package/dist/components/p-CnivhwvG.js +2 -0
  157. package/dist/components/p-CnivhwvG.js.map +1 -0
  158. package/dist/components/p-qP_9qshx.js +2 -0
  159. package/dist/components/p-qP_9qshx.js.map +1 -0
  160. package/dist/esm/ch-accordion.entry.js +1 -1
  161. package/dist/esm/ch-alert_8.entry.js +34 -10
  162. package/dist/esm/ch-alert_8.entry.js.map +1 -1
  163. package/dist/esm/ch-checkbox.entry.js +2 -2
  164. package/dist/esm/ch-cluster.entry.js +3 -3
  165. package/dist/esm/ch-divider.entry.js +2 -2
  166. package/dist/esm/ch-drawer.entry.js +2 -2
  167. package/dist/esm/ch-emoji.entry.js +2 -2
  168. package/dist/esm/ch-empty-state.entry.js +2 -2
  169. package/dist/esm/ch-grid.entry.js +2 -2
  170. package/dist/esm/ch-icon-button.entry.js +49 -0
  171. package/dist/esm/ch-icon-button.entry.js.map +1 -0
  172. package/dist/esm/ch-icon.entry.js +36 -0
  173. package/dist/esm/ch-icon.entry.js.map +1 -0
  174. package/dist/esm/ch-link.entry.js +1 -1
  175. package/dist/esm/ch-modal.entry.js +2 -2
  176. package/dist/esm/ch-page-header.entry.js +43 -0
  177. package/dist/esm/ch-page-header.entry.js.map +1 -0
  178. package/dist/esm/ch-radio.entry.js +2 -2
  179. package/dist/esm/ch-segmented-control.entry.js +2 -2
  180. package/dist/esm/ch-skeleton.entry.js +2 -2
  181. package/dist/esm/ch-stack.entry.js +2 -2
  182. package/dist/esm/ch-tabs.entry.js +2 -2
  183. package/dist/esm/ch-textarea.entry.js +2 -2
  184. package/dist/esm/ch-tooltip.entry.js +204 -5
  185. package/dist/esm/ch-tooltip.entry.js.map +1 -1
  186. package/dist/esm/chucao.js +3 -3
  187. package/dist/esm/icons-CnivhwvG.js +86 -0
  188. package/dist/esm/icons-CnivhwvG.js.map +1 -0
  189. package/dist/esm/{index-DVKZbUp9.js → index-CIV5Gg1o.js} +81 -6
  190. package/dist/esm/index-CIV5Gg1o.js.map +1 -0
  191. package/dist/esm/index.js +13 -1
  192. package/dist/esm/index.js.map +1 -1
  193. package/dist/esm/loader.js +3 -3
  194. package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
  195. package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
  196. package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
  197. package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
  198. package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
  199. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +32 -2
  200. package/dist/types/components.d.ts +406 -2
  201. package/dist/types/tokens/tokens.d.ts +12 -0
  202. package/dist/types/tokens/types.d.ts +2 -1
  203. package/dist/types/utils/icons.d.ts +15 -0
  204. package/dist/types/utils/overlay.d.ts +49 -0
  205. package/dist-react/components.d.ts +12 -1
  206. package/dist-react/components.js +27 -0
  207. package/dist-react/components.ts +37 -1
  208. package/dist-vue/index.d.ts +3 -0
  209. package/dist-vue/index.js +29 -1
  210. package/dist-vue/index.ts +35 -1
  211. package/hydrate/index.js +601 -34
  212. package/hydrate/index.mjs +601 -34
  213. package/package.json +91 -4
  214. package/dist/chucao/p-0e3c83a6.entry.js +0 -2
  215. package/dist/chucao/p-82216381.entry.js +0 -2
  216. package/dist/chucao/p-82216381.entry.js.map +0 -1
  217. package/dist/chucao/p-907195ff.entry.js +0 -2
  218. package/dist/chucao/p-DVKZbUp9.js +0 -3
  219. package/dist/chucao/p-DVKZbUp9.js.map +0 -1
  220. package/dist/chucao/p-b392021c.entry.js +0 -2
  221. package/dist/chucao/p-b392021c.entry.js.map +0 -1
  222. package/dist/cjs/index-ysucLiAq.js.map +0 -1
  223. package/dist/components/p-DQOKq7af.js +0 -2
  224. package/dist/components/p-DQOKq7af.js.map +0 -1
  225. package/dist/esm/index-DVKZbUp9.js.map +0 -1
  226. /package/dist/chucao/{p-1ebd9dc4.entry.js.map → p-0bc141a2.entry.js.map} +0 -0
  227. /package/dist/chucao/{p-449e1ba0.entry.js.map → p-0e044eff.entry.js.map} +0 -0
  228. /package/dist/chucao/{p-a07e0e97.entry.js.map → p-1108062e.entry.js.map} +0 -0
  229. /package/dist/chucao/{p-85db779c.entry.js.map → p-26e144ff.entry.js.map} +0 -0
  230. /package/dist/chucao/{p-6e95f31f.entry.js.map → p-337d7f68.entry.js.map} +0 -0
  231. /package/dist/chucao/{p-7c85f5fe.entry.js.map → p-350f974d.entry.js.map} +0 -0
  232. /package/dist/chucao/{p-907195ff.entry.js.map → p-4846cac4.entry.js.map} +0 -0
  233. /package/dist/chucao/{p-d0533af6.entry.js.map → p-6345c9e1.entry.js.map} +0 -0
  234. /package/dist/chucao/{p-34a9d1f4.entry.js.map → p-97655c41.entry.js.map} +0 -0
  235. /package/dist/chucao/{p-b5552b50.entry.js.map → p-9f73855e.entry.js.map} +0 -0
  236. /package/dist/chucao/{p-17451d92.entry.js.map → p-b53d954e.entry.js.map} +0 -0
  237. /package/dist/chucao/{p-d776b092.entry.js.map → p-b6cc08f0.entry.js.map} +0 -0
  238. /package/dist/chucao/{p-56d64d84.entry.js.map → p-c251b0d1.entry.js.map} +0 -0
  239. /package/dist/chucao/{p-84d875e9.entry.js.map → p-f9fe752c.entry.js.map} +0 -0
  240. /package/dist/chucao/{p-1778a313.entry.js.map → p-fdf065e6.entry.js.map} +0 -0
  241. /package/dist/components/{p-no2_9Jk-.js.map → p-CV0rD-fF.js.map} +0 -0
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-ByZY6aTj.js');
4
+
5
+ const chPageHeaderCss = () => `:host{display:block}.header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);padding-bottom:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.header-text{display:flex;flex-direction:column;gap:var(--spacing-xs);flex:1 1 20rem;min-width:0}.header-eyebrow{margin:0;color:var(--text-secondary);font-family:var(--font-heading);font-size:var(--typography-size-xs);letter-spacing:var(--typography-tracking-badge);text-transform:uppercase}.header-title{margin:0;color:var(--text);font-family:var(--font-heading);font-size:var(--typography-size-xl);font-weight:var(--typography-weight-bold);line-height:1.2;overflow-wrap:anywhere}.header-description{margin:0;color:var(--text-secondary);font-size:var(--typography-size-sm);line-height:1.5;overflow-wrap:anywhere}.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);max-width:100%}.header-actions:empty{display:none}.header--stacked .header-actions{flex-basis:100%}@media (max-width: 30rem){.header{flex-direction:column}.header-actions{width:100%}}@media (forced-colors: active){.header{border-bottom-color:CanvasText}}`;
6
+
7
+ const ChPageHeader = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ }
11
+ /**
12
+ * The page title. Rendered as a real heading, so it also works as the
13
+ * accessible name of the page region.
14
+ */
15
+ title;
16
+ /**
17
+ * Heading element to render. Use `h2` (or `h3`) when the page already has a
18
+ * higher-level heading above this block, so the document outline stays valid.
19
+ */
20
+ headingLevel = 'h1';
21
+ /**
22
+ * Optional small label above the title, as slotted content. Use it for a
23
+ * section or entity kind ("Proyecto", "Factura #1042"), not for the title.
24
+ */
25
+ eyebrow;
26
+ /**
27
+ * Optional supporting line under the title.
28
+ */
29
+ description;
30
+ /**
31
+ * Puts the actions below the title instead of beside it. Use it when the
32
+ * actions are too wide to sit on the same row even after wrapping.
33
+ */
34
+ actionsStacked = false;
35
+ render() {
36
+ const Heading = this.headingLevel;
37
+ return (index.h(index.Host, { key: '02317c9b8a8164400ac269cbfd872e066e3269e3' }, index.h("div", { key: 'c1ab176079e95f4854826588405cd49c1bc42b58', class: { 'header': true, 'header--stacked': this.actionsStacked } }, index.h("div", { key: '57553e0d8ac563dfd55bedb23fb6896f922c187c', class: "header-text" }, this.eyebrow && index.h("p", { key: 'b38cbdfbc5a08cfddf60e9f82481df3ed8ad48e6', class: "header-eyebrow" }, this.eyebrow), index.h(Heading, { key: '521003f555a4adaae81bac11a6410638db923399', class: "header-title" }, this.title), this.description && index.h("p", { key: '0625bcd1903f52dfe16963bfc6d3ccf7e404d13a', class: "header-description" }, this.description)), index.h("div", { key: '23b65e1729bfa24324c24958b946435ff247cb4d', class: "header-actions" }, index.h("slot", { key: '45b4c24e4ce2bb4edc2929a2f17563260efb410f', name: "actions" })))));
38
+ }
39
+ };
40
+ ChPageHeader.style = chPageHeaderCss();
41
+
42
+ exports.ch_page_header = ChPageHeader;
43
+ //# sourceMappingURL=ch-page-header.entry.cjs.js.map
44
+
45
+ //# sourceMappingURL=ch-page-header.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"ch-page-header.cjs.entry.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,MAAM,CAAC,opCAAopC,CAAC;;MCoBvqC,YAAY,GAAA,MAAA;;;;AACvB;;;AAGG;AACK,IAAA,KAAK;AAEb;;;AAGG;IACK,YAAY,GAA6B,IAAI;AAErD;;;AAGG;AACK,IAAA,OAAO;AAEf;;AAEG;AACK,IAAA,WAAW;AAEnB;;;AAGG;IACK,cAAc,GAAG,KAAK;IAE9B,MAAM,GAAA;AACJ,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY;AAEjC,QAAA,QACEA,QAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACHD,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,cAAc,EAAE,EAAA,EACpEA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,aAAa,EAAA,EACrB,IAAI,CAAC,OAAO,IAAIA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,gBAAgB,EAAA,EAAE,IAAI,CAAC,OAAO,CAAK,EAC7DA,OAAA,CAAC,OAAO,qDAAC,KAAK,EAAC,cAAc,EAAA,EAAE,IAAI,CAAC,KAAK,CAAW,EACnD,IAAI,CAAC,WAAW,IAAIA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,oBAAoB,EAAA,EAAE,IAAI,CAAC,WAAW,CAAK,CACrE,EACNA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAA,EACzBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAA,CAAQ,CACxB,CACF,CACD;;;;;;;","names":["h","Host"],"sources":["src/components/ch-page-header/ch-page-header.css?tag=ch-page-header&encapsulation=shadow","src/components/ch-page-header/ch-page-header.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.header {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--spacing-2xl);\n padding-bottom: var(--spacing-2xl);\n border-bottom: var(--border-width) solid var(--border);\n}\n\n.header-text {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-xs);\n /* Lets a long, unbroken title shrink instead of pushing the actions off the\n row at narrow widths. */\n flex: 1 1 20rem;\n min-width: 0;\n}\n\n.header-eyebrow {\n margin: 0;\n color: var(--text-secondary);\n font-family: var(--font-heading);\n font-size: var(--typography-size-xs);\n letter-spacing: var(--typography-tracking-badge);\n text-transform: uppercase;\n}\n\n.header-title {\n margin: 0;\n color: var(--text);\n font-family: var(--font-heading);\n font-size: var(--typography-size-xl);\n font-weight: var(--typography-weight-bold);\n line-height: 1.2;\n overflow-wrap: anywhere;\n}\n\n.header-description {\n margin: 0;\n color: var(--text-secondary);\n font-size: var(--typography-size-sm);\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.header-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-md);\n /* Never wider than the row: the actions wrap inside it rather than forcing\n horizontal overflow on a 390px screen. */\n max-width: 100%;\n}\n\n.header-actions:empty {\n display: none;\n}\n\n.header--stacked .header-actions {\n flex-basis: 100%;\n}\n\n@media (max-width: 30rem) {\n .header {\n flex-direction: column;\n }\n\n .header-actions {\n width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n .header {\n border-bottom-color: CanvasText;\n }\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChPageHeaderHeadingLevel = 'h1' | 'h2' | 'h3';\n\n/**\n * The heading block at the top of a page: title, optional eyebrow and\n * description, and a trailing actions area.\n *\n * The title is a `title` prop rather than a slot so the heading level always\n * matches the page. A slotted heading lets a consumer nest a second `h1`, and\n * \"one top-level heading per page\" then depends on every caller remembering it;\n * here the level is explicit and defaults to `h1`. The actions wrap rather than\n * push the page sideways at 390px, and the DOM order keeps the heading before\n * the actions so reading and focus order still start with the title.\n */\n@Component({\n tag: 'ch-page-header',\n styleUrl: 'ch-page-header.css',\n shadow: true,\n})\nexport class ChPageHeader {\n /**\n * The page title. Rendered as a real heading, so it also works as the\n * accessible name of the page region.\n */\n @Prop() title!: string;\n\n /**\n * Heading element to render. Use `h2` (or `h3`) when the page already has a\n * higher-level heading above this block, so the document outline stays valid.\n */\n @Prop() headingLevel: ChPageHeaderHeadingLevel = 'h1';\n\n /**\n * Optional small label above the title, as slotted content. Use it for a\n * section or entity kind (\"Proyecto\", \"Factura #1042\"), not for the title.\n */\n @Prop() eyebrow?: string;\n\n /**\n * Optional supporting line under the title.\n */\n @Prop() description?: string;\n\n /**\n * Puts the actions below the title instead of beside it. Use it when the\n * actions are too wide to sit on the same row even after wrapping.\n */\n @Prop() actionsStacked = false;\n\n render() {\n const Heading = this.headingLevel;\n\n return (\n <Host>\n <div class={{ 'header': true, 'header--stacked': this.actionsStacked }}>\n <div class=\"header-text\">\n {this.eyebrow && <p class=\"header-eyebrow\">{this.eyebrow}</p>}\n <Heading class=\"header-title\">{this.title}</Heading>\n {this.description && <p class=\"header-description\">{this.description}</p>}\n </div>\n <div class=\"header-actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
  var validationMessage = require('./validation-message-bbtJ2sa_.js');
5
5
 
6
6
  const chRadioCss = () => `:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
@@ -114,7 +114,7 @@ const ChRadio = class {
114
114
  }
115
115
  render() {
116
116
  const groupName = this.name || `${this.groupId}-group`;
117
- return (index.h(index.Host, { key: 'a2e08f3a0b409472f8f49e3c7f1a7f16619e66ec' }, this.label && (index.h("span", { key: '95d3bbd01c7301aeef7c64cd500d247184f5c4b3', class: "group-label", id: this.labelId }, this.label)), index.h("div", { key: 'fc8a4de53693e2a5e642dce6cb8d740c04b9e64e', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (index.h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, index.h("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), index.h("span", { class: "mark" }), index.h("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '0712a66b5344123bdce6b984de588465554b5c78', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'ce8111b984cd5280a960c4814ef124963ce95815', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
117
+ return (index.h(index.Host, { key: '9803d5b41d3985503d1b304d53504239d2a2de1d' }, this.label && (index.h("span", { key: 'f75cf217d50a300e5c6ddcdcfb9c5832e1f6b964', class: "group-label", id: this.labelId }, this.label)), index.h("div", { key: 'd8e9e24e82dfb77f728e8d9c994102202a9ce85b', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (index.h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, index.h("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), index.h("span", { class: "mark" }), index.h("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '91bed0d5cd70a032de7b8ba6e298903b387e1a4a', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'a2e6d6c87d60e98ac3d396f7dde907ce1e46946a', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
118
118
  }
119
119
  static get formAssociated() { return true; }
120
120
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
  var validationMessage = require('./validation-message-bbtJ2sa_.js');
5
5
 
6
6
  const chSegmentedControlCss = () => `: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}}`;
@@ -93,7 +93,7 @@ const ChSegmentedControl = class {
93
93
  }
94
94
  render() {
95
95
  const groupName = this.name || `${this.groupId}-group`;
96
- return (index.h(index.Host, { key: 'fde08d667755f78242d3c8c26e0c6df417c716ae' }, this.label && (index.h("span", { key: 'abadad2f4b7140fc77b78e25d15b64ed95fd150e', class: "group-label", id: this.labelId }, this.label)), index.h("div", { key: '7361933a554eec0728f10812907495813da8f3a3', class: { segmented: true, [`segmented--${this.size}`]: true }, role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (index.h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, index.h("input", { class: "input", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), index.h("span", { class: "label-text" }, option.label)))))));
96
+ return (index.h(index.Host, { key: 'd6a9a720a1a210c73711cff1f7cd6c1ffa0c89b2' }, this.label && (index.h("span", { key: 'af5fb9ab87e918ac6047ebd6e65e540044c6a2d0', class: "group-label", id: this.labelId }, this.label)), index.h("div", { key: '8dd76ea8d792d918ac5e413946e8a08cb89480c7', class: { segmented: true, [`segmented--${this.size}`]: true }, role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (index.h("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, index.h("input", { class: "input", type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, onChange: this.handleChange }), index.h("span", { class: "label-text" }, option.label)))))));
97
97
  }
98
98
  static get formAssociated() { return true; }
99
99
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
 
5
5
  const chSkeletonCss = () => `: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}}`;
6
6
 
@@ -47,7 +47,7 @@ const ChSkeleton = class {
47
47
  return { width: this.width, height: this.height };
48
48
  }
49
49
  render() {
50
- return (index.h(index.Host, { key: 'd55fcc926f439555de011ae5f730a53ac42d1a28', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index$1) => (index.h("span", { class: "skeleton__item", style: this.sizeStyle, key: index$1, "data-index": String(value) })))));
50
+ return (index.h(index.Host, { key: 'bbcafacc79f0288204028378f2cf460f793ca702', "aria-hidden": "true", class: { 'skeleton': true, [`skeleton--${this.shape}`]: true, 'skeleton--animated': this.animated } }, Array.from({ length: this.items }).map((value, index$1) => (index.h("span", { class: "skeleton__item", style: this.sizeStyle, key: index$1, "data-index": String(value) })))));
51
51
  }
52
52
  };
53
53
  ChSkeleton.style = chSkeletonCss();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
 
5
5
  const chStackCss = () => `: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}`;
6
6
 
@@ -26,7 +26,7 @@ const ChStack = class {
26
26
  return GAPS.has(this.gap) ? this.gap : 'md';
27
27
  }
28
28
  render() {
29
- return (index.h(index.Host, { key: '0408430206db8b807cd879679a643b196699e2a9', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, index.h("slot", { key: 'e05b9a1c4a944d8029e2738395828232098da324' })));
29
+ return (index.h(index.Host, { key: '646286c45adc0d816b0fdbcdfe9e70f809fedb95', class: { stack: true, [`stack--gap-${this.gapStep}`]: true, [`stack--align-${this.align}`]: true, [`stack--justify-${this.justify}`]: true } }, index.h("slot", { key: '1c18713eb95fc568a08bcbd6e018add9336a0fd0' })));
30
30
  }
31
31
  };
32
32
  ChStack.style = chStackCss();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
 
5
5
  const chTabsCss = () => `: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}`;
6
6
 
@@ -86,7 +86,7 @@ const ChTabs = class {
86
86
  }
87
87
  render() {
88
88
  const active = this.activeValue;
89
- return (index.h(index.Host, { key: '4dfeb1c42a7dd10d73e6372da15649eae502e565' }, index.h("div", { key: '1c75500e73377920e3629734316c103b8c0b2a60', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
89
+ return (index.h(index.Host, { key: '915c7a584397bbe10a72642a1ce5ed68f2264ed2' }, index.h("div", { key: 'b37a294722442c73d224410793cd0c098734993f', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
90
90
  const selected = tab.value === active;
91
91
  return (index.h("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
92
92
  })), this.tabs.map(tab => (index.h("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, index.h("slot", { name: `panel-${tab.value}` }))))));
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
  var validationMessage = require('./validation-message-bbtJ2sa_.js');
5
5
 
6
6
  const chTextareaCss = () => `: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)}`;
@@ -125,7 +125,7 @@ const ChTextarea = class {
125
125
  return undefined;
126
126
  }
127
127
  render() {
128
- return (index.h(index.Host, { key: '0c7cb5ba7d3ccc84286a7cef5ca4208aa248c11b' }, this.label && (index.h("label", { key: 'a8b5e1e97394ab822cd43b8d70683e4add572d59', class: "label", htmlFor: this.textareaId }, this.label)), index.h("textarea", { key: '979f0a57566fdf8d0d946a9120b2431863f69ce4', 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) && (index.h("p", { key: 'ca0e931102deaf36d9524f889d93a72850f70a63', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '595add930eedf5675c7a2aacd45d891fb8edb0f0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
128
+ return (index.h(index.Host, { key: '5e7f4e6c779b677f259b56ebf6cb2e829511275e' }, this.label && (index.h("label", { key: '73a3a3d44b4926aaf0681aa68f878932c7932dae', class: "label", htmlFor: this.textareaId }, this.label)), index.h("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) && (index.h("p", { key: '393ea00da6e7def75d4305c242a9cf957013359b', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'ba405aec9d92b410e063cec29235240a4a4ec715', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
129
129
  }
130
130
  static get formAssociated() { return true; }
131
131
  static get watchers() { return {
@@ -1,18 +1,124 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
 
5
- const chTooltipCss = () => `:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:16rem;padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;
5
+ const OPPOSITE = {
6
+ top: 'bottom',
7
+ bottom: 'top',
8
+ left: 'right',
9
+ right: 'left',
10
+ };
11
+ const AXIS = {
12
+ top: 'vertical',
13
+ bottom: 'vertical',
14
+ left: 'horizontal',
15
+ right: 'horizontal',
16
+ };
17
+ /**
18
+ * How far a placed surface overflows each viewport edge. Positive values are
19
+ * overflow. Used both to pick a placement and to shift the surface back in.
20
+ */
21
+ function overflowOf(surface, viewport) {
22
+ return {
23
+ top: viewport.top - surface.top,
24
+ left: viewport.left - surface.left,
25
+ bottom: surface.top + surface.height - (viewport.top + viewport.height),
26
+ right: surface.left + surface.width - (viewport.left + viewport.width),
27
+ };
28
+ }
29
+ function offsetFor(placement, anchor, surface, gap) {
30
+ switch (placement) {
31
+ case 'top':
32
+ return {
33
+ top: anchor.top - surface.height - gap,
34
+ left: anchor.left + (anchor.width - surface.width) / 2,
35
+ };
36
+ case 'bottom':
37
+ return {
38
+ top: anchor.top + anchor.height + gap,
39
+ left: anchor.left + (anchor.width - surface.width) / 2,
40
+ };
41
+ case 'left':
42
+ return {
43
+ top: anchor.top + (anchor.height - surface.height) / 2,
44
+ left: anchor.left - surface.width - gap,
45
+ };
46
+ case 'right':
47
+ return {
48
+ top: anchor.top + (anchor.height - surface.height) / 2,
49
+ left: anchor.left + anchor.width + gap,
50
+ };
51
+ }
52
+ }
53
+ /**
54
+ * Picks the placement that overflows least and then shifts the surface along
55
+ * the cross axis so it stays inside the viewport.
56
+ *
57
+ * The main-axis overflow is not compensated with a translate: a tooltip pinned
58
+ * to the top edge would cover its own trigger. Flipping to the other side is
59
+ * what keeps it readable, and the caller decides whether to accept the
60
+ * remaining overflow.
61
+ */
62
+ function placeOverlay({ anchor, surface, viewport, preferred, gap, }) {
63
+ const candidates = [preferred, OPPOSITE[preferred]];
64
+ let placement = preferred;
65
+ let best = Number.POSITIVE_INFINITY;
66
+ for (const candidate of candidates) {
67
+ const { top, left } = offsetFor(candidate, anchor, surface, gap);
68
+ const rect = { top, left, width: surface.width, height: surface.height };
69
+ const overflow = overflowOf(rect, viewport);
70
+ const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);
71
+ if (main < best) {
72
+ best = main;
73
+ placement = candidate;
74
+ }
75
+ }
76
+ const { top, left } = offsetFor(placement, anchor, surface, gap);
77
+ const rect = { top, left, width: surface.width, height: surface.height };
78
+ const overflow = overflowOf(rect, viewport);
79
+ const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };
80
+ return { placement, top: shifted.top, left: shifted.left };
81
+ }
82
+ /** Only real overflow counts: the side that fits contributes nothing. */
83
+ function clamp(overflow) {
84
+ return overflow > 0 ? overflow : 0;
85
+ }
86
+ /**
87
+ * Turns the two overflows on an axis into a shift. `before` is the overflow on
88
+ * the leading edge (top or left), `after` the one on the trailing edge; both
89
+ * are positive when the surface spills past that edge.
90
+ *
91
+ * Pushing away from the leading edge moves the surface inwards, so the shift is
92
+ * `+before`. The trailing edge needs the opposite sign. When both overflow the
93
+ * surface is larger than the viewport: pin it to the leading edge and let
94
+ * `max-width` stop the spill.
95
+ */
96
+ function correction(before, after) {
97
+ if (before > 0) {
98
+ return before;
99
+ }
100
+ if (after > 0) {
101
+ return -after;
102
+ }
103
+ return 0;
104
+ }
105
+
106
+ const chTooltipCss = () => `: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}}`;
6
107
 
7
108
  let tooltipIds = 0;
109
+ /** Space between the trigger and the bubble, matching `--spacing-md`. */
110
+ const GAP = 8;
8
111
  const ChTooltip = class {
9
112
  constructor(hostRef) {
10
113
  index.registerInstance(this, hostRef);
11
114
  }
12
115
  get el() { return index.getElement(this); }
13
116
  fallbackId = `ch-tooltip-${++tooltipIds}`;
117
+ bubbleEl;
118
+ cleanup;
14
119
  /**
15
- * Which side of the trigger the bubble is placed on.
120
+ * The side the bubble is placed on. It is a preference: when that side has no
121
+ * room the bubble flips to the opposite one.
16
122
  */
17
123
  placement = 'top';
18
124
  // Hover and focus are tracked apart so that neither cancels the other: a
@@ -21,15 +127,26 @@ const ChTooltip = class {
21
127
  hovered = false;
22
128
  focused = false;
23
129
  dismissed = false;
130
+ /** The placement actually used, which may differ from the prop after a flip. */
131
+ resolvedPlacement;
132
+ /** Offset applied to the bubble once it has been measured. */
133
+ offset;
24
134
  get visible() {
25
135
  return (this.hovered || this.focused) && !this.dismissed;
26
136
  }
27
137
  componentDidLoad() {
28
138
  this.associate();
29
139
  }
140
+ connectedCallback() {
141
+ this.watchViewport();
142
+ }
143
+ disconnectedCallback() {
144
+ this.cleanup?.();
145
+ }
30
146
  handleMouseEnter() {
31
147
  this.hovered = true;
32
148
  this.dismissed = false;
149
+ this.position();
33
150
  }
34
151
  handleMouseLeave() {
35
152
  this.hovered = false;
@@ -37,6 +154,7 @@ const ChTooltip = class {
37
154
  handleFocusIn() {
38
155
  this.focused = true;
39
156
  this.dismissed = false;
157
+ this.position();
40
158
  }
41
159
  handleFocusOut() {
42
160
  this.focused = false;
@@ -44,15 +162,83 @@ const ChTooltip = class {
44
162
  /**
45
163
  * Listens on the document because a tooltip opened by hovering leaves focus
46
164
  * wherever it was, so a host-scoped handler would never see the key.
165
+ *
166
+ * Only the outermost Escape handler is stopped from propagating, so a
167
+ * tooltip inside an open modal closes itself and leaves the modal open.
47
168
  */
48
169
  handleKeyDown(event) {
49
- if (event.key === 'Escape' && this.visible) {
170
+ if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {
171
+ event.preventDefault();
50
172
  this.dismissed = true;
51
173
  }
52
174
  }
175
+ /** Cheap guard so scroll frames do not measure while nothing is shown. */
176
+ handleScroll() {
177
+ if (this.visible && this.offset) {
178
+ this.position();
179
+ }
180
+ }
181
+ handleResize() {
182
+ this.position();
183
+ }
184
+ watchViewport() {
185
+ if (typeof window === 'undefined') {
186
+ return;
187
+ }
188
+ const viewport = window.visualViewport;
189
+ if (!viewport || this.cleanup) {
190
+ return;
191
+ }
192
+ const update = () => this.position();
193
+ viewport.addEventListener('resize', update);
194
+ viewport.addEventListener('scroll', update);
195
+ this.cleanup = () => {
196
+ viewport.removeEventListener('resize', update);
197
+ viewport.removeEventListener('scroll', update);
198
+ };
199
+ }
53
200
  slotted(name) {
54
201
  return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
55
202
  }
203
+ /**
204
+ * Measures the anchor and the bubble and stores the offset that keeps the
205
+ * bubble inside the viewport. Nothing is measured before the bubble has a
206
+ * box to measure, so the pre-paint render uses plain CSS.
207
+ */
208
+ position() {
209
+ if (typeof window === 'undefined') {
210
+ return;
211
+ }
212
+ const bubble = this.bubbleEl ?? (this.bubbleEl = this.el.shadowRoot?.querySelector('.bubble') ?? undefined);
213
+ if (!bubble || bubble.offsetWidth === 0) {
214
+ return;
215
+ }
216
+ const anchorRect = this.slotted('trigger')?.getBoundingClientRect?.();
217
+ if (!anchorRect) {
218
+ return;
219
+ }
220
+ const surface = {
221
+ width: bubble.offsetWidth + horizontalMargin(bubble),
222
+ height: bubble.offsetHeight,
223
+ };
224
+ const viewport = window.visualViewport;
225
+ const { placement, top, left } = placeOverlay({
226
+ anchor: { top: anchorRect.top, left: anchorRect.left, width: anchorRect.width, height: anchorRect.height },
227
+ surface,
228
+ viewport: viewport
229
+ ? { top: viewport.offsetTop, left: viewport.offsetLeft, width: viewport.width, height: viewport.height }
230
+ : { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight },
231
+ preferred: this.placement,
232
+ gap: GAP,
233
+ });
234
+ const current = this.offset;
235
+ const unchanged = current?.top === top && current?.left === left && this.resolvedPlacement === placement;
236
+ this.resolvedPlacement = placement;
237
+ this.offset = { top, left };
238
+ if (!unchanged) {
239
+ index.forceUpdate(this);
240
+ }
241
+ }
56
242
  /**
57
243
  * Points the trigger at the text with `aria-describedby`. Re-run on
58
244
  * `slotchange` because a framework re-render can replace the slotted nodes
@@ -71,9 +257,22 @@ const ChTooltip = class {
71
257
  trigger.setAttribute('aria-describedby', content.id);
72
258
  };
73
259
  render() {
74
- return (index.h(index.Host, { key: 'e05ba1cdb8f3ee499762a04c8271c772c7cbe201' }, index.h("span", { key: 'c5a0bd2f6107e99114fc9328a3f731dfe59753d4', class: "anchor" }, index.h("slot", { key: 'ffd09d90395e2ffb2349e7d2eb8e349b2a7991b8', name: "trigger", onSlotchange: this.associate }), index.h("span", { key: '4af10e86d9f61e2defef8b86df3ba55f280acd91', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, index.h("slot", { key: '047ba42d8846f43d31823318258f1761f15efc64', name: "content", onSlotchange: this.associate })))));
260
+ const { offset } = this;
261
+ return (index.h(index.Host, { key: 'fb651dc0bf007fb86c9f69b2c714106520df4d4a' }, index.h("span", { key: '74324b8e4c0b7c552255605c6aa4ae739e16d832', class: "anchor" }, index.h("slot", { key: 'd4c2025af2d96b2ea4e7d8d601ce803be82a4a3e', name: "trigger", onSlotchange: this.associate }), index.h("span", { key: 'f6561dce022d8d9d2d0fb2b6984591301483b1f3', ref: el => (this.bubbleEl = el), style: {
262
+ '--ch-tooltip-offset-top': offset ? `${offset.top}px` : null,
263
+ '--ch-tooltip-offset-left': offset ? `${offset.left}px` : null,
264
+ }, class: {
265
+ 'bubble': true,
266
+ 'bubble--positioned': Boolean(this.offset),
267
+ [`bubble--${this.resolvedPlacement ?? this.placement}`]: true,
268
+ 'bubble--visible': this.visible,
269
+ } }, index.h("slot", { key: 'a099d15660ea17211b4c50912842b3152e5f652c', name: "content", onSlotchange: this.associate })))));
75
270
  }
76
271
  };
272
+ function horizontalMargin(el) {
273
+ const style = getComputedStyle(el);
274
+ return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
275
+ }
77
276
  ChTooltip.style = chTooltipCss();
78
277
 
79
278
  exports.ch_tooltip = ChTooltip;
@@ -1 +1 @@
1
- {"file":"ch-tooltip.cjs.entry.js","mappings":";;;;AAAA,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AI,CAAC,OAAO,CAAC,SAAS,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;AACvC,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE;YACxB;;AAEF,QAAA,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;AACf,YAAA,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU;;AAE9B,QAAA,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;QACvC,OAAO,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAC;AACtD,KAAC;IAED,MAAM,GAAA;QACJ,QACEA,QAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACHD,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,QAAQ,EAAA,EAClBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,EAC1DA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,EAAE,EAAA,EACnGA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;;;;;","names":["h","Host"],"sources":["src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: 16rem;\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\nexport type ChTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nlet tooltipIds = 0;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n /**\n * Which side of the trigger the bubble is placed on.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.dismissed = true;\n }\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n return (\n <Host>\n <span class=\"anchor\">\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span class={{ 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible }}>\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"ch-tooltip.cjs.entry.js","mappings":";;;;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAAA,GAAG,EAAE,QAAQ;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,MAAM;CACd;AAED,MAAM,IAAI,GAA0D;AAClE,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,YAAY;CACpB;AAED;;;AAGG;AACG,SAAU,UAAU,CAAC,OAAsB,EAAE,QAA2B,EAAA;IAC5E,OAAO;AACL,QAAA,GAAG,EAAE,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;AAC/B,QAAA,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;AAClC,QAAA,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;AACvE,QAAA,KAAK,EAAE,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC;KACvE;AACH;AAEA,SAAS,SAAS,CAAC,SAA6B,EAAE,MAAqB,EAAE,OAA0C,EAAE,GAAW,EAAA;IAC9H,QAAQ,SAAS;AACf,QAAA,KAAK,KAAK;YACR,OAAO;gBACL,GAAG,EAAE,MAAM,CAAC,GAAG,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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"],"version":3}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ysucLiAq.js');
3
+ var index = require('./index-ByZY6aTj.js');
4
4
 
5
5
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
6
  /*
@@ -18,7 +18,7 @@ var patchBrowser = () => {
18
18
 
19
19
  patchBrowser().then(async (options) => {
20
20
  await index.globalScripts();
21
- return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
21
+ return index.bootstrapLazy([["ch-accordion.cjs",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox.cjs",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-cluster.cjs",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider.cjs",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer.cjs",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji.cjs",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state.cjs",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid.cjs",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon.cjs",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button.cjs",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link.cjs",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio.cjs",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-segmented-control.cjs",[[577,"ch-segmented-control",{"label":[1],"options":[16],"value":[1025],"size":[1],"name":[513],"disabled":[516],"required":[516],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}]}]]],["ch-skeleton.cjs",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack.cjs",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs.cjs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea.cjs",[[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip.cjs",[[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"]]]]],["ch-alert_8.cjs",[[769,"ch-button",{"variant":[1],"size":[1],"disabled":[4],"loading":[4],"href":[1],"target":[1],"label":[1]}],[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"],"statusCue":[4,"status-cue"]}],[769,"ch-badge",{"variant":[1],"statusCue":[4,"status-cue"]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[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]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}]]]], options);
22
22
  });
23
23
 
24
24
  exports.setNonce = index.setNonce;