@devschile/chucao 2.4.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 (281) 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-0409c063.entry.js +2 -0
  7. package/dist/chucao/p-0409c063.entry.js.map +1 -0
  8. package/dist/chucao/{p-1ebd9dc4.entry.js → p-090d26f1.entry.js} +2 -2
  9. package/dist/chucao/{p-84d875e9.entry.js → p-207648f9.entry.js} +2 -2
  10. package/dist/chucao/{p-b5552b50.entry.js → p-20ea1b18.entry.js} +2 -2
  11. package/dist/chucao/p-21ca2235.entry.js +2 -0
  12. package/dist/chucao/p-21ca2235.entry.js.map +1 -0
  13. package/dist/chucao/{p-1778a313.entry.js → p-2c1bc8bd.entry.js} +2 -2
  14. package/dist/chucao/{p-6e95f31f.entry.js → p-337d7f68.entry.js} +2 -2
  15. package/dist/chucao/p-370d9629.entry.js +2 -0
  16. package/dist/chucao/p-370d9629.entry.js.map +1 -0
  17. package/dist/chucao/{p-d0533af6.entry.js → p-50cbea7f.entry.js} +2 -2
  18. package/dist/chucao/p-66ae9e2c.entry.js +2 -0
  19. package/dist/chucao/p-66ae9e2c.entry.js.map +1 -0
  20. package/dist/chucao/p-79f20bfd.entry.js +2 -0
  21. package/dist/chucao/p-79f20bfd.entry.js.map +1 -0
  22. package/dist/chucao/{p-56d64d84.entry.js → p-7d4336bd.entry.js} +2 -2
  23. package/dist/chucao/p-81b6622f.entry.js +2 -0
  24. package/dist/chucao/p-81b6622f.entry.js.map +1 -0
  25. package/dist/chucao/{p-17451d92.entry.js → p-925af6b8.entry.js} +2 -2
  26. package/dist/chucao/p-95061461.entry.js +2 -0
  27. package/dist/chucao/{p-34a9d1f4.entry.js → p-9794a3fa.entry.js} +2 -2
  28. package/dist/chucao/p-CIV5Gg1o.js +3 -0
  29. package/dist/chucao/p-CIV5Gg1o.js.map +1 -0
  30. package/dist/chucao/p-CnivhwvG.js +2 -0
  31. package/dist/chucao/p-CnivhwvG.js.map +1 -0
  32. package/dist/chucao/{p-85db779c.entry.js → p-b56f4a29.entry.js} +2 -2
  33. package/dist/chucao/p-b9b47942.entry.js +2 -0
  34. package/dist/chucao/p-b9b47942.entry.js.map +1 -0
  35. package/dist/chucao/{p-449e1ba0.entry.js → p-c1b35f1b.entry.js} +2 -2
  36. package/dist/chucao/{p-0e3c83a6.entry.js → p-e2f725bd.entry.js} +2 -2
  37. package/dist/chucao/{p-7c85f5fe.entry.js → p-e6f959f4.entry.js} +2 -2
  38. package/dist/chucao/{p-907195ff.entry.js → p-f0aea6ed.entry.js} +2 -2
  39. package/dist/chucao/{p-a07e0e97.entry.js → p-f7305552.entry.js} +2 -2
  40. package/dist/chucao/p-ffaf1a31.entry.js +2 -0
  41. package/dist/chucao/p-ffaf1a31.entry.js.map +1 -0
  42. package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
  43. package/dist/cjs/ch-alert_8.cjs.entry.js +34 -10
  44. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
  45. package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
  46. package/dist/cjs/ch-cluster.cjs.entry.js +3 -3
  47. package/dist/cjs/ch-description-list.cjs.entry.js +29 -0
  48. package/dist/cjs/ch-description-list.cjs.entry.js.map +1 -0
  49. package/dist/cjs/ch-divider.cjs.entry.js +2 -2
  50. package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
  51. package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
  52. package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
  53. package/dist/cjs/ch-grid.cjs.entry.js +2 -2
  54. package/dist/cjs/ch-icon-button.cjs.entry.js +51 -0
  55. package/dist/cjs/ch-icon-button.cjs.entry.js.map +1 -0
  56. package/dist/cjs/ch-icon.cjs.entry.js +38 -0
  57. package/dist/cjs/ch-icon.cjs.entry.js.map +1 -0
  58. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  59. package/dist/cjs/ch-modal.cjs.entry.js +2 -2
  60. package/dist/cjs/ch-page-header.cjs.entry.js +45 -0
  61. package/dist/cjs/ch-page-header.cjs.entry.js.map +1 -0
  62. package/dist/cjs/ch-radio.cjs.entry.js +2 -2
  63. package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
  64. package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
  65. package/dist/cjs/ch-stack.cjs.entry.js +2 -2
  66. package/dist/cjs/ch-stat.cjs.entry.js +46 -0
  67. package/dist/cjs/ch-stat.cjs.entry.js.map +1 -0
  68. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  69. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  70. package/dist/cjs/ch-timeline.cjs.entry.js +20 -0
  71. package/dist/cjs/ch-timeline.cjs.entry.js.map +1 -0
  72. package/dist/cjs/ch-tooltip.cjs.entry.js +206 -5
  73. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
  74. package/dist/cjs/chucao.cjs.js +2 -2
  75. package/dist/cjs/icons-CNyDgV-q.js +88 -0
  76. package/dist/cjs/icons-CNyDgV-q.js.map +1 -0
  77. package/dist/cjs/{index-ysucLiAq.js → index-ByZY6aTj.js} +81 -5
  78. package/dist/cjs/index-ByZY6aTj.js.map +1 -0
  79. package/dist/cjs/index.cjs.js +16 -0
  80. package/dist/cjs/index.cjs.js.map +1 -1
  81. package/dist/cjs/loader.cjs.js +2 -2
  82. package/dist/collection/collection-manifest.json +12 -6
  83. package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
  84. package/dist/collection/components/ch-alert/ch-alert.css +13 -0
  85. package/dist/collection/components/ch-alert/ch-alert.js +44 -1
  86. package/dist/collection/components/ch-alert/ch-alert.js.map +1 -1
  87. package/dist/collection/components/ch-badge/ch-badge.css +30 -1
  88. package/dist/collection/components/ch-badge/ch-badge.js +35 -1
  89. package/dist/collection/components/ch-badge/ch-badge.js.map +1 -1
  90. package/dist/collection/components/ch-card/ch-card.js +1 -1
  91. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  92. package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
  93. package/dist/collection/components/ch-description-list/ch-description-list.css +60 -0
  94. package/dist/collection/components/ch-description-list/ch-description-list.js +78 -0
  95. package/dist/collection/components/ch-description-list/ch-description-list.js.map +1 -0
  96. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  97. package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
  98. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  99. package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
  100. package/dist/collection/components/ch-grid/ch-grid.js +1 -1
  101. package/dist/collection/components/ch-icon/ch-icon.css +25 -0
  102. package/dist/collection/components/ch-icon/ch-icon.js +121 -0
  103. package/dist/collection/components/ch-icon/ch-icon.js.map +1 -0
  104. package/dist/collection/components/ch-icon-button/ch-icon-button.css +99 -0
  105. package/dist/collection/components/ch-icon-button/ch-icon-button.js +216 -0
  106. package/dist/collection/components/ch-icon-button/ch-icon-button.js.map +1 -0
  107. package/dist/collection/components/ch-input/ch-input.js +1 -1
  108. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  109. package/dist/collection/components/ch-page-header/ch-page-header.css +84 -0
  110. package/dist/collection/components/ch-page-header/ch-page-header.js +162 -0
  111. package/dist/collection/components/ch-page-header/ch-page-header.js.map +1 -0
  112. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  113. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
  114. package/dist/collection/components/ch-select/ch-select.js +1 -1
  115. package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
  116. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  117. package/dist/collection/components/ch-stack/ch-stack.js +1 -1
  118. package/dist/collection/components/ch-stat/ch-stat.css +68 -0
  119. package/dist/collection/components/ch-stat/ch-stat.js +151 -0
  120. package/dist/collection/components/ch-stat/ch-stat.js.map +1 -0
  121. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  122. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  123. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  124. package/dist/collection/components/ch-timeline/ch-timeline.css +54 -0
  125. package/dist/collection/components/ch-timeline/ch-timeline.js +43 -0
  126. package/dist/collection/components/ch-timeline/ch-timeline.js.map +1 -0
  127. package/dist/collection/components/ch-tooltip/ch-tooltip.css +29 -1
  128. package/dist/collection/components/ch-tooltip/ch-tooltip.js +127 -6
  129. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
  130. package/dist/collection/tokens/tokens.js +12 -0
  131. package/dist/collection/tokens/tokens.js.map +1 -1
  132. package/dist/collection/tokens/types.js.map +1 -1
  133. package/dist/collection/utils/icons.js +82 -0
  134. package/dist/collection/utils/icons.js.map +1 -0
  135. package/dist/collection/utils/overlay.js +101 -0
  136. package/dist/collection/utils/overlay.js.map +1 -0
  137. package/dist/components/ch-accordion.js +1 -1
  138. package/dist/components/ch-alert.js +1 -1
  139. package/dist/components/ch-alert.js.map +1 -1
  140. package/dist/components/ch-badge.js +1 -1
  141. package/dist/components/ch-badge.js.map +1 -1
  142. package/dist/components/ch-button.js +1 -1
  143. package/dist/components/ch-card.js +1 -1
  144. package/dist/components/ch-card.js.map +1 -1
  145. package/dist/components/ch-checkbox.js +1 -1
  146. package/dist/components/ch-cluster.js +1 -1
  147. package/dist/components/ch-description-list.d.ts +11 -0
  148. package/dist/components/ch-description-list.js +2 -0
  149. package/dist/components/ch-description-list.js.map +1 -0
  150. package/dist/components/ch-divider.js +1 -1
  151. package/dist/components/ch-drawer.js +1 -1
  152. package/dist/components/ch-emoji.js +1 -1
  153. package/dist/components/ch-empty-state.js +1 -1
  154. package/dist/components/ch-grid.js +1 -1
  155. package/dist/components/ch-icon-button.d.ts +11 -0
  156. package/dist/components/ch-icon-button.js +2 -0
  157. package/dist/components/ch-icon-button.js.map +1 -0
  158. package/dist/components/ch-icon.d.ts +11 -0
  159. package/dist/components/ch-icon.js +2 -0
  160. package/dist/components/ch-icon.js.map +1 -0
  161. package/dist/components/ch-input.js +1 -1
  162. package/dist/components/ch-link.js +1 -1
  163. package/dist/components/ch-modal.js +1 -1
  164. package/dist/components/ch-page-header.d.ts +11 -0
  165. package/dist/components/ch-page-header.js +2 -0
  166. package/dist/components/ch-page-header.js.map +1 -0
  167. package/dist/components/ch-radio.js +1 -1
  168. package/dist/components/ch-segmented-control.js +1 -1
  169. package/dist/components/ch-select.js +1 -1
  170. package/dist/components/ch-skeleton.js +1 -1
  171. package/dist/components/ch-spinner.js +1 -1
  172. package/dist/components/ch-stack.js +1 -1
  173. package/dist/components/ch-stat.d.ts +11 -0
  174. package/dist/components/ch-stat.js +2 -0
  175. package/dist/components/ch-stat.js.map +1 -0
  176. package/dist/components/ch-switch.js +1 -1
  177. package/dist/components/ch-tabs.js +1 -1
  178. package/dist/components/ch-textarea.js +1 -1
  179. package/dist/components/ch-timeline.d.ts +11 -0
  180. package/dist/components/ch-timeline.js +2 -0
  181. package/dist/components/ch-timeline.js.map +1 -0
  182. package/dist/components/ch-tooltip.js +1 -1
  183. package/dist/components/ch-tooltip.js.map +1 -1
  184. package/dist/components/index.js +1 -1
  185. package/dist/components/index.js.map +1 -1
  186. package/dist/components/p-CnivhwvG.js +2 -0
  187. package/dist/components/p-CnivhwvG.js.map +1 -0
  188. package/dist/components/{p-no2_9Jk-.js → p-Cw0b4OGc.js} +2 -2
  189. package/dist/components/p-qP_9qshx.js +2 -0
  190. package/dist/components/p-qP_9qshx.js.map +1 -0
  191. package/dist/esm/ch-accordion.entry.js +2 -2
  192. package/dist/esm/ch-alert_8.entry.js +34 -10
  193. package/dist/esm/ch-alert_8.entry.js.map +1 -1
  194. package/dist/esm/ch-checkbox.entry.js +2 -2
  195. package/dist/esm/ch-cluster.entry.js +3 -3
  196. package/dist/esm/ch-description-list.entry.js +27 -0
  197. package/dist/esm/ch-description-list.entry.js.map +1 -0
  198. package/dist/esm/ch-divider.entry.js +2 -2
  199. package/dist/esm/ch-drawer.entry.js +2 -2
  200. package/dist/esm/ch-emoji.entry.js +2 -2
  201. package/dist/esm/ch-empty-state.entry.js +2 -2
  202. package/dist/esm/ch-grid.entry.js +2 -2
  203. package/dist/esm/ch-icon-button.entry.js +49 -0
  204. package/dist/esm/ch-icon-button.entry.js.map +1 -0
  205. package/dist/esm/ch-icon.entry.js +36 -0
  206. package/dist/esm/ch-icon.entry.js.map +1 -0
  207. package/dist/esm/ch-link.entry.js +1 -1
  208. package/dist/esm/ch-modal.entry.js +2 -2
  209. package/dist/esm/ch-page-header.entry.js +43 -0
  210. package/dist/esm/ch-page-header.entry.js.map +1 -0
  211. package/dist/esm/ch-radio.entry.js +2 -2
  212. package/dist/esm/ch-segmented-control.entry.js +2 -2
  213. package/dist/esm/ch-skeleton.entry.js +2 -2
  214. package/dist/esm/ch-stack.entry.js +2 -2
  215. package/dist/esm/ch-stat.entry.js +44 -0
  216. package/dist/esm/ch-stat.entry.js.map +1 -0
  217. package/dist/esm/ch-tabs.entry.js +2 -2
  218. package/dist/esm/ch-textarea.entry.js +2 -2
  219. package/dist/esm/ch-timeline.entry.js +18 -0
  220. package/dist/esm/ch-timeline.entry.js.map +1 -0
  221. package/dist/esm/ch-tooltip.entry.js +206 -5
  222. package/dist/esm/ch-tooltip.entry.js.map +1 -1
  223. package/dist/esm/chucao.js +3 -3
  224. package/dist/esm/icons-CnivhwvG.js +86 -0
  225. package/dist/esm/icons-CnivhwvG.js.map +1 -0
  226. package/dist/esm/{index-DVKZbUp9.js → index-CIV5Gg1o.js} +81 -6
  227. package/dist/esm/index-CIV5Gg1o.js.map +1 -0
  228. package/dist/esm/index.js +13 -1
  229. package/dist/esm/index.js.map +1 -1
  230. package/dist/esm/loader.js +3 -3
  231. package/dist/types/components/ch-alert/ch-alert.d.ts +11 -0
  232. package/dist/types/components/ch-badge/ch-badge.d.ts +14 -0
  233. package/dist/types/components/ch-description-list/ch-description-list.d.ts +30 -0
  234. package/dist/types/components/ch-icon/ch-icon.d.ts +29 -0
  235. package/dist/types/components/ch-icon-button/ch-icon-button.d.ts +36 -0
  236. package/dist/types/components/ch-page-header/ch-page-header.d.ts +39 -0
  237. package/dist/types/components/ch-stat/ch-stat.d.ts +42 -0
  238. package/dist/types/components/ch-timeline/ch-timeline.d.ts +27 -0
  239. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +34 -2
  240. package/dist/types/components.d.ts +718 -2
  241. package/dist/types/tokens/tokens.d.ts +12 -0
  242. package/dist/types/tokens/types.d.ts +2 -1
  243. package/dist/types/utils/icons.d.ts +15 -0
  244. package/dist/types/utils/overlay.d.ts +49 -0
  245. package/dist-react/components.d.ts +21 -1
  246. package/dist-react/components.js +54 -0
  247. package/dist-react/components.ts +73 -1
  248. package/dist-vue/index.d.ts +6 -0
  249. package/dist-vue/index.js +42 -1
  250. package/dist-vue/index.ts +54 -1
  251. package/hydrate/index.js +772 -35
  252. package/hydrate/index.mjs +772 -35
  253. package/package.json +104 -5
  254. package/dist/chucao/p-82216381.entry.js +0 -2
  255. package/dist/chucao/p-82216381.entry.js.map +0 -1
  256. package/dist/chucao/p-DVKZbUp9.js +0 -3
  257. package/dist/chucao/p-DVKZbUp9.js.map +0 -1
  258. package/dist/chucao/p-b392021c.entry.js +0 -2
  259. package/dist/chucao/p-b392021c.entry.js.map +0 -1
  260. package/dist/chucao/p-d776b092.entry.js +0 -2
  261. package/dist/cjs/index-ysucLiAq.js.map +0 -1
  262. package/dist/components/p-DQOKq7af.js +0 -2
  263. package/dist/components/p-DQOKq7af.js.map +0 -1
  264. package/dist/esm/index-DVKZbUp9.js.map +0 -1
  265. /package/dist/chucao/{p-1ebd9dc4.entry.js.map → p-090d26f1.entry.js.map} +0 -0
  266. /package/dist/chucao/{p-84d875e9.entry.js.map → p-207648f9.entry.js.map} +0 -0
  267. /package/dist/chucao/{p-b5552b50.entry.js.map → p-20ea1b18.entry.js.map} +0 -0
  268. /package/dist/chucao/{p-1778a313.entry.js.map → p-2c1bc8bd.entry.js.map} +0 -0
  269. /package/dist/chucao/{p-6e95f31f.entry.js.map → p-337d7f68.entry.js.map} +0 -0
  270. /package/dist/chucao/{p-d0533af6.entry.js.map → p-50cbea7f.entry.js.map} +0 -0
  271. /package/dist/chucao/{p-56d64d84.entry.js.map → p-7d4336bd.entry.js.map} +0 -0
  272. /package/dist/chucao/{p-17451d92.entry.js.map → p-925af6b8.entry.js.map} +0 -0
  273. /package/dist/chucao/{p-d776b092.entry.js.map → p-95061461.entry.js.map} +0 -0
  274. /package/dist/chucao/{p-34a9d1f4.entry.js.map → p-9794a3fa.entry.js.map} +0 -0
  275. /package/dist/chucao/{p-85db779c.entry.js.map → p-b56f4a29.entry.js.map} +0 -0
  276. /package/dist/chucao/{p-449e1ba0.entry.js.map → p-c1b35f1b.entry.js.map} +0 -0
  277. /package/dist/chucao/{p-0e3c83a6.entry.js.map → p-e2f725bd.entry.js.map} +0 -0
  278. /package/dist/chucao/{p-7c85f5fe.entry.js.map → p-e6f959f4.entry.js.map} +0 -0
  279. /package/dist/chucao/{p-907195ff.entry.js.map → p-f0aea6ed.entry.js.map} +0 -0
  280. /package/dist/chucao/{p-a07e0e97.entry.js.map → p-f7305552.entry.js.map} +0 -0
  281. /package/dist/components/{p-no2_9Jk-.js.map → p-Cw0b4OGc.js.map} +0 -0
@@ -1,16 +1,122 @@
1
- import { r as registerInstance, a as getElement, h, H as Host } from './index-DVKZbUp9.js';
1
+ import { r as registerInstance, a as getElement, f as forceUpdate, h, H as Host } from './index-CIV5Gg1o.js';
2
2
 
3
- 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}}`;
3
+ const OPPOSITE = {
4
+ top: 'bottom',
5
+ bottom: 'top',
6
+ left: 'right',
7
+ right: 'left',
8
+ };
9
+ const AXIS = {
10
+ top: 'vertical',
11
+ bottom: 'vertical',
12
+ left: 'horizontal',
13
+ right: 'horizontal',
14
+ };
15
+ /**
16
+ * How far a placed surface overflows each viewport edge. Positive values are
17
+ * overflow. Used both to pick a placement and to shift the surface back in.
18
+ */
19
+ function overflowOf(surface, viewport) {
20
+ return {
21
+ top: viewport.top - surface.top,
22
+ left: viewport.left - surface.left,
23
+ bottom: surface.top + surface.height - (viewport.top + viewport.height),
24
+ right: surface.left + surface.width - (viewport.left + viewport.width),
25
+ };
26
+ }
27
+ function offsetFor(placement, anchor, surface, gap) {
28
+ switch (placement) {
29
+ case 'top':
30
+ return {
31
+ top: anchor.top - surface.height - gap,
32
+ left: anchor.left + (anchor.width - surface.width) / 2,
33
+ };
34
+ case 'bottom':
35
+ return {
36
+ top: anchor.top + anchor.height + gap,
37
+ left: anchor.left + (anchor.width - surface.width) / 2,
38
+ };
39
+ case 'left':
40
+ return {
41
+ top: anchor.top + (anchor.height - surface.height) / 2,
42
+ left: anchor.left - surface.width - gap,
43
+ };
44
+ case 'right':
45
+ return {
46
+ top: anchor.top + (anchor.height - surface.height) / 2,
47
+ left: anchor.left + anchor.width + gap,
48
+ };
49
+ }
50
+ }
51
+ /**
52
+ * Picks the placement that overflows least and then shifts the surface along
53
+ * the cross axis so it stays inside the viewport.
54
+ *
55
+ * The main-axis overflow is not compensated with a translate: a tooltip pinned
56
+ * to the top edge would cover its own trigger. Flipping to the other side is
57
+ * what keeps it readable, and the caller decides whether to accept the
58
+ * remaining overflow.
59
+ */
60
+ function placeOverlay({ anchor, surface, viewport, preferred, gap, }) {
61
+ const candidates = [preferred, OPPOSITE[preferred]];
62
+ let placement = preferred;
63
+ let best = Number.POSITIVE_INFINITY;
64
+ for (const candidate of candidates) {
65
+ const { top, left } = offsetFor(candidate, anchor, surface, gap);
66
+ const rect = { top, left, width: surface.width, height: surface.height };
67
+ const overflow = overflowOf(rect, viewport);
68
+ const main = AXIS[candidate] === 'vertical' ? clamp(overflow.top) + clamp(overflow.bottom) : clamp(overflow.left) + clamp(overflow.right);
69
+ if (main < best) {
70
+ best = main;
71
+ placement = candidate;
72
+ }
73
+ }
74
+ const { top, left } = offsetFor(placement, anchor, surface, gap);
75
+ const rect = { top, left, width: surface.width, height: surface.height };
76
+ const overflow = overflowOf(rect, viewport);
77
+ const shifted = AXIS[placement] === 'vertical' ? { top, left: left + correction(overflow.left, overflow.right) } : { top: top + correction(overflow.top, overflow.bottom), left };
78
+ return { placement, top: shifted.top, left: shifted.left };
79
+ }
80
+ /** Only real overflow counts: the side that fits contributes nothing. */
81
+ function clamp(overflow) {
82
+ return overflow > 0 ? overflow : 0;
83
+ }
84
+ /**
85
+ * Turns the two overflows on an axis into a shift. `before` is the overflow on
86
+ * the leading edge (top or left), `after` the one on the trailing edge; both
87
+ * are positive when the surface spills past that edge.
88
+ *
89
+ * Pushing away from the leading edge moves the surface inwards, so the shift is
90
+ * `+before`. The trailing edge needs the opposite sign. When both overflow the
91
+ * surface is larger than the viewport: pin it to the leading edge and let
92
+ * `max-width` stop the spill.
93
+ */
94
+ function correction(before, after) {
95
+ if (before > 0) {
96
+ return before;
97
+ }
98
+ if (after > 0) {
99
+ return -after;
100
+ }
101
+ return 0;
102
+ }
103
+
104
+ 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}}`;
4
105
 
5
106
  let tooltipIds = 0;
107
+ /** Space between the trigger and the bubble, matching `--spacing-md`. */
108
+ const GAP = 8;
6
109
  const ChTooltip = class {
7
110
  constructor(hostRef) {
8
111
  registerInstance(this, hostRef);
9
112
  }
10
113
  get el() { return getElement(this); }
11
114
  fallbackId = `ch-tooltip-${++tooltipIds}`;
115
+ bubbleEl;
116
+ cleanup;
12
117
  /**
13
- * Which side of the trigger the bubble is placed on.
118
+ * The side the bubble is placed on. It is a preference: when that side has no
119
+ * room the bubble flips to the opposite one.
14
120
  */
15
121
  placement = 'top';
16
122
  // Hover and focus are tracked apart so that neither cancels the other: a
@@ -19,15 +125,26 @@ const ChTooltip = class {
19
125
  hovered = false;
20
126
  focused = false;
21
127
  dismissed = false;
128
+ /** The placement actually used, which may differ from the prop after a flip. */
129
+ resolvedPlacement;
130
+ /** Offset applied to the bubble once it has been measured. */
131
+ offset;
22
132
  get visible() {
23
133
  return (this.hovered || this.focused) && !this.dismissed;
24
134
  }
25
135
  componentDidLoad() {
26
136
  this.associate();
27
137
  }
138
+ connectedCallback() {
139
+ this.watchViewport();
140
+ }
141
+ disconnectedCallback() {
142
+ this.cleanup?.();
143
+ }
28
144
  handleMouseEnter() {
29
145
  this.hovered = true;
30
146
  this.dismissed = false;
147
+ this.position();
31
148
  }
32
149
  handleMouseLeave() {
33
150
  this.hovered = false;
@@ -35,6 +152,7 @@ const ChTooltip = class {
35
152
  handleFocusIn() {
36
153
  this.focused = true;
37
154
  this.dismissed = false;
155
+ this.position();
38
156
  }
39
157
  handleFocusOut() {
40
158
  this.focused = false;
@@ -42,15 +160,85 @@ const ChTooltip = class {
42
160
  /**
43
161
  * Listens on the document because a tooltip opened by hovering leaves focus
44
162
  * wherever it was, so a host-scoped handler would never see the key.
163
+ *
164
+ * `preventDefault()` dismisses only the innermost surface: the platform's
165
+ * close request for an open native `<dialog>` is the default action of this
166
+ * same keydown, so cancelling it keeps an enclosing `ch-modal` open. Proven
167
+ * against a real `ch-modal` in `tests/browser/ch-tooltip.browser.spec.ts`.
45
168
  */
46
169
  handleKeyDown(event) {
47
- if (event.key === 'Escape' && this.visible) {
170
+ if (event.key === 'Escape' && this.visible && !event.defaultPrevented) {
171
+ event.preventDefault();
48
172
  this.dismissed = true;
49
173
  }
50
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
+ }
51
200
  slotted(name) {
52
201
  return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
53
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
+ forceUpdate(this);
240
+ }
241
+ }
54
242
  /**
55
243
  * Points the trigger at the text with `aria-describedby`. Re-run on
56
244
  * `slotchange` because a framework re-render can replace the slotted nodes
@@ -69,9 +257,22 @@ const ChTooltip = class {
69
257
  trigger.setAttribute('aria-describedby', content.id);
70
258
  };
71
259
  render() {
72
- return (h(Host, { key: 'e05ba1cdb8f3ee499762a04c8271c772c7cbe201' }, h("span", { key: 'c5a0bd2f6107e99114fc9328a3f731dfe59753d4', class: "anchor" }, h("slot", { key: 'ffd09d90395e2ffb2349e7d2eb8e349b2a7991b8', name: "trigger", onSlotchange: this.associate }), h("span", { key: '4af10e86d9f61e2defef8b86df3ba55f280acd91', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, h("slot", { key: '047ba42d8846f43d31823318258f1761f15efc64', name: "content", onSlotchange: this.associate })))));
260
+ const { offset } = this;
261
+ return (h(Host, { key: '676e431d0100ecc9ea688b7e37bc87e8295bb24d' }, h("span", { key: '20a388681252e9c4d52e662c014efd9a198efbd7', class: "anchor" }, h("slot", { key: 'a06cbe31dd04cba38ef09788359783d816fc1a5b', name: "trigger", onSlotchange: this.associate }), h("span", { key: '13cb5b782a7029fc82c10b9b6765de62b94b9afa', 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
+ } }, h("slot", { key: '6610bbf299354bb3be07bb273fab3f8fd91fd254', name: "content", onSlotchange: this.associate })))));
73
270
  }
74
271
  };
272
+ function horizontalMargin(el) {
273
+ const style = getComputedStyle(el);
274
+ return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
275
+ }
75
276
  ChTooltip.style = chTooltipCss();
76
277
 
77
278
  export { ChTooltip as ch_tooltip };
@@ -1 +1 @@
1
- {"version":3,"file":"ch-tooltip.entry.js","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"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,MAAM,CAAC,02CAA02C,CAAC;;ACIv4C,IAAI,UAAU,GAAG,CAAC;MAuBL,SAAS,GAAA,MAAA;;;;;AAGH,IAAA,UAAU,GAAG,CAAA,WAAA,EAAc,EAAE,UAAU,EAAE;AAE1D;;AAEG;IACK,SAAS,GAAuB,KAAK;;;;IAKpC,OAAO,GAAG,KAAK;IACf,OAAO,GAAG,KAAK;IACf,SAAS,GAAG,KAAK;AAE1B,IAAA,IAAY,OAAO,GAAA;AACjB,QAAA,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS;;IAG1D,gBAAgB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E,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,QAAQ,EAAA,EAClB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,EAC1D,CAAA,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,EACnG,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;;;;;"}
1
+ {"version":3,"file":"ch-tooltip.entry.js","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"],"names":[],"mappings":";;AAwBA,MAAM,QAAQ,GAAmD;AAC/D,IAAA,GAAG,EAAE,QAAQ;AACb,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AAG,CAAA,EAAA,CAAI,GAAG,IAAI;AAC5D,gBAAA,0BAA0B,EAAE,MAAM,GAAG,CAAA,EAAG,MAAM,CAAC,IAAI,CAAA,EAAA,CAAI,GAAG,IAAI;AAC/D,aAAA,EACD,KAAK,EAAE;AACL,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC1C,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI;gBAC7D,iBAAiB,EAAE,IAAI,CAAC,OAAO;aAChC,EAAA,EAED,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;AAKb,SAAS,gBAAgB,CAAC,EAAe,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnF;;;;;"}
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-DVKZbUp9.js';
2
- export { s as setNonce } from './index-DVKZbUp9.js';
1
+ import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-CIV5Gg1o.js';
2
+ export { s as setNonce } from './index-CIV5Gg1o.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v4.45.1 | MIT Licensed | https://stenciljs.com
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[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",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio",[[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",[[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",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[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",[[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",[[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);
19
+ return bootstrapLazy([["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[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",[[769,"ch-cluster",{"gap":[1],"align":[1],"justify":[1],"wrap":[4]}]]],["ch-description-list",[[769,"ch-description-list",{"columns":[1]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-drawer",[[769,"ch-drawer",{"open":[1028],"side":[1],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-emoji",[[513,"ch-emoji",{"name":[1],"alt":[1],"size":[1],"extIndex":[32],"loaded":[32]},null,{"name":[{"handleNameChange":0}]}]]],["ch-empty-state",[[769,"ch-empty-state",{"title":[1],"description":[1],"size":[1]}]]],["ch-grid",[[769,"ch-grid",{"columns":[1],"gap":[1],"minItemWidth":[1,"min-item-width"]}]]],["ch-icon",[[513,"ch-icon",{"name":[1],"size":[1],"label":[1]}]]],["ch-icon-button",[[513,"ch-icon-button",{"name":[1],"label":[1],"size":[1],"type":[1],"disabled":[4],"loading":[4]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-page-header",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-radio",[[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",[[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",[[513,"ch-skeleton",{"width":[1],"height":[1],"shape":[1],"count":[2],"animated":[4]}]]],["ch-stack",[[769,"ch-stack",{"gap":[1],"align":[1],"justify":[1]}]]],["ch-stat",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[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-timeline",[[257,"ch-timeline"]]],["ch-tooltip",[[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",[[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);
20
20
  });
21
21
  //# sourceMappingURL=chucao.js.map
22
22
 
@@ -0,0 +1,86 @@
1
+ const chIcons = {
2
+ alert: [
3
+ { tag: 'path', attrs: { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' } },
4
+ { tag: 'path', attrs: { d: 'M12 9v4' } },
5
+ { tag: 'path', attrs: { d: 'M12 17h.01' } },
6
+ ],
7
+ arrowRight: [
8
+ { tag: 'path', attrs: { d: 'M5 12h14' } },
9
+ { tag: 'path', attrs: { d: 'm12 5 7 7-7 7' } },
10
+ ],
11
+ check: [{ tag: 'path', attrs: { d: 'M20 6 9 17l-5-5' } }],
12
+ chevronDown: [{ tag: 'path', attrs: { d: 'm6 9 6 6 6-6' } }],
13
+ chevronRight: [{ tag: 'path', attrs: { d: 'm9 18 6-6-6-6' } }],
14
+ close: [
15
+ { tag: 'path', attrs: { d: 'M18 6 6 18' } },
16
+ { tag: 'path', attrs: { d: 'm6 6 12 12' } },
17
+ ],
18
+ copy: [
19
+ { tag: 'rect', attrs: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' } },
20
+ { tag: 'path', attrs: { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' } },
21
+ ],
22
+ delete: [
23
+ { tag: 'path', attrs: { d: 'M10 11v6' } },
24
+ { tag: 'path', attrs: { d: 'M14 11v6' } },
25
+ { tag: 'path', attrs: { d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6' } },
26
+ { tag: 'path', attrs: { d: 'M3 6h18' } },
27
+ { tag: 'path', attrs: { d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' } },
28
+ ],
29
+ download: [
30
+ { tag: 'path', attrs: { d: 'M12 15V3' } },
31
+ { tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
32
+ { tag: 'path', attrs: { d: 'm7 10 5 5 5-5' } },
33
+ ],
34
+ error: [
35
+ { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
36
+ { tag: 'line', attrs: {} },
37
+ { tag: 'line', attrs: {} },
38
+ ],
39
+ externalLink: [
40
+ { tag: 'path', attrs: { d: 'M15 3h6v6' } },
41
+ { tag: 'path', attrs: { d: 'M10 14 21 3' } },
42
+ { tag: 'path', attrs: { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' } },
43
+ ],
44
+ info: [
45
+ { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
46
+ { tag: 'path', attrs: { d: 'M12 16v-4' } },
47
+ { tag: 'path', attrs: { d: 'M12 8h.01' } },
48
+ ],
49
+ menu: [
50
+ { tag: 'path', attrs: { d: 'M4 5h16' } },
51
+ { tag: 'path', attrs: { d: 'M4 12h16' } },
52
+ { tag: 'path', attrs: { d: 'M4 19h16' } },
53
+ ],
54
+ plus: [
55
+ { tag: 'path', attrs: { d: 'M5 12h14' } },
56
+ { tag: 'path', attrs: { d: 'M12 5v14' } },
57
+ ],
58
+ search: [
59
+ { tag: 'path', attrs: { d: 'm21 21-4.34-4.34' } },
60
+ { tag: 'circle', attrs: { cx: '11', cy: '11', r: '8' } },
61
+ ],
62
+ spinner: [
63
+ { tag: 'path', attrs: { d: 'M12 2v4' } },
64
+ { tag: 'path', attrs: { d: 'm16.2 7.8 2.9-2.9' } },
65
+ { tag: 'path', attrs: { d: 'M18 12h4' } },
66
+ { tag: 'path', attrs: { d: 'm16.2 16.2 2.9 2.9' } },
67
+ { tag: 'path', attrs: { d: 'M12 18v4' } },
68
+ { tag: 'path', attrs: { d: 'm4.9 19.1 2.9-2.9' } },
69
+ { tag: 'path', attrs: { d: 'M2 12h4' } },
70
+ { tag: 'path', attrs: { d: 'm4.9 4.9 2.9 2.9' } },
71
+ ],
72
+ success: [
73
+ { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },
74
+ { tag: 'path', attrs: { d: 'm16 9-5.5 5.5L8 12' } },
75
+ ],
76
+ upload: [
77
+ { tag: 'path', attrs: { d: 'M12 3v12' } },
78
+ { tag: 'path', attrs: { d: 'm17 8-5-5-5 5' } },
79
+ { tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },
80
+ ],
81
+ };
82
+
83
+ export { chIcons as c };
84
+ //# sourceMappingURL=icons-CnivhwvG.js.map
85
+
86
+ //# sourceMappingURL=icons-CnivhwvG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons-CnivhwvG.js","sources":["src/utils/icons.ts"],"sourcesContent":["/**\n * Icon geometry, copied from Lucide v1.82.0 (https://lucide.dev), ISC licensed.\n *\n * Only the shapes are vendored, not the package: a dependency would ship a\n * whole icon set to consumers who need six of them, and the set has to be\n * frozen so an upstream rename cannot silently break a public `name` value.\n * Each entry keeps Lucide's 24x24 viewBox, so stroke width stays consistent\n * across sizes.\n */\nexport type ChIconName =\n | 'alert'\n | 'arrowRight'\n | 'check'\n | 'chevronDown'\n | 'chevronRight'\n | 'close'\n | 'copy'\n | 'delete'\n | 'download'\n | 'error'\n | 'externalLink'\n | 'info'\n | 'menu'\n | 'plus'\n | 'search'\n | 'spinner'\n | 'success'\n | 'upload';\n\nexport interface ChIconShape {\n tag: 'path' | 'circle' | 'rect' | 'line' | 'polyline' | 'polygon';\n attrs: Record<string, string>;\n}\n\nexport const chIcons: Record<ChIconName, ChIconShape[]> = {\n alert: [\n { tag: 'path', attrs: { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' } },\n { tag: 'path', attrs: { d: 'M12 9v4' } },\n { tag: 'path', attrs: { d: 'M12 17h.01' } },\n ],\n arrowRight: [\n { tag: 'path', attrs: { d: 'M5 12h14' } },\n { tag: 'path', attrs: { d: 'm12 5 7 7-7 7' } },\n ],\n check: [{ tag: 'path', attrs: { d: 'M20 6 9 17l-5-5' } }],\n chevronDown: [{ tag: 'path', attrs: { d: 'm6 9 6 6 6-6' } }],\n chevronRight: [{ tag: 'path', attrs: { d: 'm9 18 6-6-6-6' } }],\n close: [\n { tag: 'path', attrs: { d: 'M18 6 6 18' } },\n { tag: 'path', attrs: { d: 'm6 6 12 12' } },\n ],\n copy: [\n { tag: 'rect', attrs: { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' } },\n { tag: 'path', attrs: { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' } },\n ],\n delete: [\n { tag: 'path', attrs: { d: 'M10 11v6' } },\n { tag: 'path', attrs: { d: 'M14 11v6' } },\n { tag: 'path', attrs: { d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6' } },\n { tag: 'path', attrs: { d: 'M3 6h18' } },\n { tag: 'path', attrs: { d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' } },\n ],\n download: [\n { tag: 'path', attrs: { d: 'M12 15V3' } },\n { tag: 'path', attrs: { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' } },\n { tag: 'path', attrs: { d: 'm7 10 5 5 5-5' } },\n ],\n error: [\n { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },\n { tag: 'line', attrs: {} },\n { tag: 'line', attrs: {} },\n ],\n externalLink: [\n { tag: 'path', attrs: { d: 'M15 3h6v6' } },\n { tag: 'path', attrs: { d: 'M10 14 21 3' } },\n { tag: 'path', attrs: { d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' } },\n ],\n info: [\n { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },\n { tag: 'path', attrs: { d: 'M12 16v-4' } },\n { tag: 'path', attrs: { d: 'M12 8h.01' } },\n ],\n menu: [\n { tag: 'path', attrs: { d: 'M4 5h16' } },\n { tag: 'path', attrs: { d: 'M4 12h16' } },\n { tag: 'path', attrs: { d: 'M4 19h16' } },\n ],\n plus: [\n { tag: 'path', attrs: { d: 'M5 12h14' } },\n { tag: 'path', attrs: { d: 'M12 5v14' } },\n ],\n search: [\n { tag: 'path', attrs: { d: 'm21 21-4.34-4.34' } },\n { tag: 'circle', attrs: { cx: '11', cy: '11', r: '8' } },\n ],\n spinner: [\n { tag: 'path', attrs: { d: 'M12 2v4' } },\n { tag: 'path', attrs: { d: 'm16.2 7.8 2.9-2.9' } },\n { tag: 'path', attrs: { d: 'M18 12h4' } },\n { tag: 'path', attrs: { d: 'm16.2 16.2 2.9 2.9' } },\n { tag: 'path', attrs: { d: 'M12 18v4' } },\n { tag: 'path', attrs: { d: 'm4.9 19.1 2.9-2.9' } },\n { tag: 'path', attrs: { d: 'M2 12h4' } },\n { tag: 'path', attrs: { d: 'm4.9 4.9 2.9 2.9' } },\n ],\n success: [\n { tag: 'circle', attrs: { cx: '12', cy: '12', r: '10' } },\n { tag: 'path', attrs: { d: 'm16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