@devschile/chucao 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/{p-10109256.entry.js → p-0831c6f2.entry.js} +2 -2
  3. package/dist/chucao/p-0d7fc720.entry.js +2 -0
  4. package/dist/chucao/{p-62e762f7.entry.js.map → p-0d7fc720.entry.js.map} +1 -1
  5. package/dist/chucao/{p-999dba28.entry.js → p-19d90f87.entry.js} +2 -2
  6. package/dist/chucao/{p-afe45116.entry.js → p-25f4f815.entry.js} +2 -2
  7. package/dist/chucao/{p-14184080.entry.js → p-3e0d7585.entry.js} +2 -2
  8. package/dist/chucao/{p-afacd489.entry.js → p-46dae34b.entry.js} +2 -2
  9. package/dist/chucao/{p-d1e9f563.entry.js → p-5093c486.entry.js} +2 -2
  10. package/dist/chucao/{p-337d7f68.entry.js → p-51f6327c.entry.js} +2 -2
  11. package/dist/chucao/{p-bf036509.entry.js → p-5577e0a0.entry.js} +2 -2
  12. package/dist/chucao/{p-339e3c30.entry.js → p-56e41372.entry.js} +2 -2
  13. package/dist/chucao/{p-a84d4493.entry.js → p-6c2e5931.entry.js} +2 -2
  14. package/dist/chucao/{p-1e8d921d.entry.js → p-6e93c392.entry.js} +2 -2
  15. package/dist/chucao/{p-93f25dd5.entry.js → p-7f99ae48.entry.js} +2 -2
  16. package/dist/chucao/p-8b09ad3c.entry.js +2 -0
  17. package/dist/chucao/p-8b09ad3c.entry.js.map +1 -0
  18. package/dist/chucao/{p-e2fe7c5d.entry.js → p-8fcf6d36.entry.js} +2 -2
  19. package/dist/chucao/{p-CIV5Gg1o.js → p-8l_6qAY9.js} +3 -3
  20. package/dist/chucao/p-8l_6qAY9.js.map +1 -0
  21. package/dist/chucao/{p-d2077ae4.entry.js → p-920d5727.entry.js} +2 -2
  22. package/dist/chucao/{p-1852dfdb.entry.js → p-ad41da02.entry.js} +2 -2
  23. package/dist/chucao/p-af088ffd.entry.js +2 -0
  24. package/dist/chucao/p-af088ffd.entry.js.map +1 -0
  25. package/dist/chucao/{p-08d90a3d.entry.js → p-b42ec9bf.entry.js} +2 -2
  26. package/dist/chucao/{p-36c59ad1.entry.js → p-b80c39c3.entry.js} +2 -2
  27. package/dist/chucao/{p-507d4b69.entry.js → p-ba589c2f.entry.js} +2 -2
  28. package/dist/chucao/{p-39815ee2.entry.js → p-c4d68ab7.entry.js} +2 -2
  29. package/dist/chucao/{p-3e6614ee.entry.js → p-c98e2a50.entry.js} +2 -2
  30. package/dist/chucao/{p-4c8838a0.entry.js → p-ca3179ae.entry.js} +2 -2
  31. package/dist/chucao/{p-3f9894a4.entry.js → p-d630f662.entry.js} +2 -2
  32. package/dist/chucao/{p-4cda7f71.entry.js → p-d868bdbc.entry.js} +2 -2
  33. package/dist/chucao/{p-f17b186f.entry.js → p-e6b7b2da.entry.js} +2 -2
  34. package/dist/chucao/p-eb39b9c2.entry.js +2 -0
  35. package/dist/chucao/p-eb39b9c2.entry.js.map +1 -0
  36. package/dist/chucao/p-f0c288db.entry.js +2 -0
  37. package/dist/chucao/p-f0c288db.entry.js.map +1 -0
  38. package/dist/cjs/ch-accordion.cjs.entry.js +2 -2
  39. package/dist/cjs/ch-alert_8.cjs.entry.js +8 -8
  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-confirm-dialog.cjs.entry.js +138 -0
  43. package/dist/cjs/ch-confirm-dialog.cjs.entry.js.map +1 -0
  44. package/dist/cjs/ch-description-list.cjs.entry.js +2 -2
  45. package/dist/cjs/ch-divider.cjs.entry.js +2 -2
  46. package/dist/cjs/ch-drawer.cjs.entry.js +2 -2
  47. package/dist/cjs/ch-emoji.cjs.entry.js +2 -2
  48. package/dist/cjs/ch-empty-state.cjs.entry.js +2 -2
  49. package/dist/cjs/ch-grid.cjs.entry.js +2 -2
  50. package/dist/cjs/ch-icon-button.cjs.entry.js +2 -2
  51. package/dist/cjs/ch-icon.cjs.entry.js +2 -2
  52. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  53. package/dist/cjs/ch-modal.cjs.entry.js +2 -2
  54. package/dist/cjs/ch-number-input.cjs.entry.js +3 -3
  55. package/dist/cjs/ch-otp-input.cjs.entry.js +196 -0
  56. package/dist/cjs/ch-otp-input.cjs.entry.js.map +1 -0
  57. package/dist/cjs/ch-page-header.cjs.entry.js +2 -2
  58. package/dist/cjs/ch-pagination.cjs.entry.js +67 -0
  59. package/dist/cjs/ch-pagination.cjs.entry.js.map +1 -0
  60. package/dist/cjs/ch-radio.cjs.entry.js +2 -2
  61. package/dist/cjs/ch-segmented-control.cjs.entry.js +2 -2
  62. package/dist/cjs/ch-skeleton.cjs.entry.js +2 -2
  63. package/dist/cjs/ch-stack.cjs.entry.js +2 -2
  64. package/dist/cjs/ch-stat.cjs.entry.js +3 -3
  65. package/dist/cjs/ch-table.cjs.entry.js +2 -2
  66. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  67. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  68. package/dist/cjs/ch-timeline.cjs.entry.js +2 -2
  69. package/dist/cjs/ch-tooltip.cjs.entry.js +25 -8
  70. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -1
  71. package/dist/cjs/chucao.cjs.js +2 -2
  72. package/dist/cjs/{index-ByZY6aTj.js → index-C6khqyw3.js} +19 -2
  73. package/dist/cjs/index-C6khqyw3.js.map +1 -0
  74. package/dist/cjs/loader.cjs.js +2 -2
  75. package/dist/collection/collection-manifest.json +3 -0
  76. package/dist/collection/components/ch-accordion/ch-accordion.js +1 -1
  77. package/dist/collection/components/ch-alert/ch-alert.js +1 -1
  78. package/dist/collection/components/ch-badge/ch-badge.js +1 -1
  79. package/dist/collection/components/ch-card/ch-card.js +1 -1
  80. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  81. package/dist/collection/components/ch-cluster/ch-cluster.js +2 -2
  82. package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.css +71 -0
  83. package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js +382 -0
  84. package/dist/collection/components/ch-confirm-dialog/ch-confirm-dialog.js.map +1 -0
  85. package/dist/collection/components/ch-description-list/ch-description-list.js +1 -1
  86. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  87. package/dist/collection/components/ch-drawer/ch-drawer.js +1 -1
  88. package/dist/collection/components/ch-emoji/ch-emoji.js +1 -1
  89. package/dist/collection/components/ch-empty-state/ch-empty-state.js +1 -1
  90. package/dist/collection/components/ch-grid/ch-grid.js +1 -1
  91. package/dist/collection/components/ch-icon/ch-icon.js +1 -1
  92. package/dist/collection/components/ch-icon-button/ch-icon-button.js +1 -1
  93. package/dist/collection/components/ch-input/ch-input.js +1 -1
  94. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  95. package/dist/collection/components/ch-number-input/ch-number-input.js +2 -2
  96. package/dist/collection/components/ch-otp-input/ch-otp-input.css +86 -0
  97. package/dist/collection/components/ch-otp-input/ch-otp-input.js +478 -0
  98. package/dist/collection/components/ch-otp-input/ch-otp-input.js.map +1 -0
  99. package/dist/collection/components/ch-page-header/ch-page-header.js +1 -1
  100. package/dist/collection/components/ch-pagination/ch-pagination.css +63 -0
  101. package/dist/collection/components/ch-pagination/ch-pagination.js +228 -0
  102. package/dist/collection/components/ch-pagination/ch-pagination.js.map +1 -0
  103. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  104. package/dist/collection/components/ch-segmented-control/ch-segmented-control.js +1 -1
  105. package/dist/collection/components/ch-select/ch-select.js +1 -1
  106. package/dist/collection/components/ch-skeleton/ch-skeleton.js +1 -1
  107. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  108. package/dist/collection/components/ch-stack/ch-stack.js +1 -1
  109. package/dist/collection/components/ch-stat/ch-stat.js +2 -2
  110. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  111. package/dist/collection/components/ch-table/ch-table.js +1 -1
  112. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  113. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  114. package/dist/collection/components/ch-timeline/ch-timeline.js +1 -1
  115. package/dist/collection/components/ch-tooltip/ch-tooltip.css +11 -0
  116. package/dist/collection/components/ch-tooltip/ch-tooltip.js +23 -6
  117. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -1
  118. package/dist/collection/utils/overlay.js.map +1 -1
  119. package/dist/components/ch-accordion.js +1 -1
  120. package/dist/components/ch-alert.js +1 -1
  121. package/dist/components/ch-badge.js +1 -1
  122. package/dist/components/ch-button.js +1 -1
  123. package/dist/components/ch-card.js +1 -1
  124. package/dist/components/ch-checkbox.js +1 -1
  125. package/dist/components/ch-cluster.js +1 -1
  126. package/dist/components/ch-confirm-dialog.d.ts +11 -0
  127. package/dist/components/ch-confirm-dialog.js +2 -0
  128. package/dist/components/ch-confirm-dialog.js.map +1 -0
  129. package/dist/components/ch-description-list.js +1 -1
  130. package/dist/components/ch-divider.js +1 -1
  131. package/dist/components/ch-drawer.js +1 -1
  132. package/dist/components/ch-emoji.js +1 -1
  133. package/dist/components/ch-empty-state.js +1 -1
  134. package/dist/components/ch-grid.js +1 -1
  135. package/dist/components/ch-icon-button.js +1 -1
  136. package/dist/components/ch-icon.js +1 -1
  137. package/dist/components/ch-input.js +1 -1
  138. package/dist/components/ch-modal.js +1 -1
  139. package/dist/components/ch-modal.js.map +1 -1
  140. package/dist/components/ch-number-input.js +1 -1
  141. package/dist/components/ch-otp-input.d.ts +11 -0
  142. package/dist/components/ch-otp-input.js +2 -0
  143. package/dist/components/ch-otp-input.js.map +1 -0
  144. package/dist/components/ch-page-header.js +1 -1
  145. package/dist/components/ch-pagination.d.ts +11 -0
  146. package/dist/components/ch-pagination.js +2 -0
  147. package/dist/components/ch-pagination.js.map +1 -0
  148. package/dist/components/ch-radio.js +1 -1
  149. package/dist/components/ch-segmented-control.js +1 -1
  150. package/dist/components/ch-select.js +1 -1
  151. package/dist/components/ch-skeleton.js +1 -1
  152. package/dist/components/ch-spinner.js +1 -1
  153. package/dist/components/ch-stack.js +1 -1
  154. package/dist/components/ch-stat.js +1 -1
  155. package/dist/components/ch-switch.js +1 -1
  156. package/dist/components/ch-table.js +1 -1
  157. package/dist/components/ch-tabs.js +1 -1
  158. package/dist/components/ch-textarea.js +1 -1
  159. package/dist/components/ch-timeline.js +1 -1
  160. package/dist/components/ch-tooltip.js +1 -1
  161. package/dist/components/ch-tooltip.js.map +1 -1
  162. package/dist/components/{p-CuczWSQU.js → p-CF1yV0aa.js} +2 -2
  163. package/dist/components/p-CmMN-UuJ.js +2 -0
  164. package/dist/components/p-CmMN-UuJ.js.map +1 -0
  165. package/dist/components/p-qP_9qshx.js.map +1 -1
  166. package/dist/esm/ch-accordion.entry.js +2 -2
  167. package/dist/esm/ch-alert_8.entry.js +8 -8
  168. package/dist/esm/ch-checkbox.entry.js +2 -2
  169. package/dist/esm/ch-cluster.entry.js +3 -3
  170. package/dist/esm/ch-confirm-dialog.entry.js +136 -0
  171. package/dist/esm/ch-confirm-dialog.entry.js.map +1 -0
  172. package/dist/esm/ch-description-list.entry.js +2 -2
  173. package/dist/esm/ch-divider.entry.js +2 -2
  174. package/dist/esm/ch-drawer.entry.js +2 -2
  175. package/dist/esm/ch-emoji.entry.js +2 -2
  176. package/dist/esm/ch-empty-state.entry.js +2 -2
  177. package/dist/esm/ch-grid.entry.js +2 -2
  178. package/dist/esm/ch-icon-button.entry.js +2 -2
  179. package/dist/esm/ch-icon.entry.js +2 -2
  180. package/dist/esm/ch-link.entry.js +1 -1
  181. package/dist/esm/ch-modal.entry.js +2 -2
  182. package/dist/esm/ch-number-input.entry.js +3 -3
  183. package/dist/esm/ch-otp-input.entry.js +194 -0
  184. package/dist/esm/ch-otp-input.entry.js.map +1 -0
  185. package/dist/esm/ch-page-header.entry.js +2 -2
  186. package/dist/esm/ch-pagination.entry.js +65 -0
  187. package/dist/esm/ch-pagination.entry.js.map +1 -0
  188. package/dist/esm/ch-radio.entry.js +2 -2
  189. package/dist/esm/ch-segmented-control.entry.js +2 -2
  190. package/dist/esm/ch-skeleton.entry.js +2 -2
  191. package/dist/esm/ch-stack.entry.js +2 -2
  192. package/dist/esm/ch-stat.entry.js +3 -3
  193. package/dist/esm/ch-table.entry.js +2 -2
  194. package/dist/esm/ch-tabs.entry.js +2 -2
  195. package/dist/esm/ch-textarea.entry.js +2 -2
  196. package/dist/esm/ch-timeline.entry.js +2 -2
  197. package/dist/esm/ch-tooltip.entry.js +25 -8
  198. package/dist/esm/ch-tooltip.entry.js.map +1 -1
  199. package/dist/esm/chucao.js +3 -3
  200. package/dist/esm/{index-CIV5Gg1o.js → index-8l_6qAY9.js} +19 -2
  201. package/dist/esm/index-8l_6qAY9.js.map +1 -0
  202. package/dist/esm/loader.js +3 -3
  203. package/dist/types/components/ch-confirm-dialog/ch-confirm-dialog.d.ts +81 -0
  204. package/dist/types/components/ch-otp-input/ch-otp-input.d.ts +79 -0
  205. package/dist/types/components/ch-pagination/ch-pagination.d.ts +44 -0
  206. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +7 -0
  207. package/dist/types/components.d.ts +548 -0
  208. package/dist/types/utils/overlay.d.ts +1 -1
  209. package/dist-react/components.d.ts +21 -1
  210. package/dist-react/components.js +33 -0
  211. package/dist-react/components.ts +49 -1
  212. package/dist-vue/index.d.ts +3 -0
  213. package/dist-vue/index.js +48 -0
  214. package/dist-vue/index.ts +54 -0
  215. package/hydrate/index.js +540 -40
  216. package/hydrate/index.mjs +540 -40
  217. package/package.json +13 -1
  218. package/dist/chucao/p-5c253fa0.entry.js +0 -2
  219. package/dist/chucao/p-5c253fa0.entry.js.map +0 -1
  220. package/dist/chucao/p-62e762f7.entry.js +0 -2
  221. package/dist/chucao/p-CIV5Gg1o.js.map +0 -1
  222. package/dist/cjs/index-ByZY6aTj.js.map +0 -1
  223. package/dist/esm/index-CIV5Gg1o.js.map +0 -1
  224. /package/dist/chucao/{p-10109256.entry.js.map → p-0831c6f2.entry.js.map} +0 -0
  225. /package/dist/chucao/{p-999dba28.entry.js.map → p-19d90f87.entry.js.map} +0 -0
  226. /package/dist/chucao/{p-afe45116.entry.js.map → p-25f4f815.entry.js.map} +0 -0
  227. /package/dist/chucao/{p-14184080.entry.js.map → p-3e0d7585.entry.js.map} +0 -0
  228. /package/dist/chucao/{p-afacd489.entry.js.map → p-46dae34b.entry.js.map} +0 -0
  229. /package/dist/chucao/{p-d1e9f563.entry.js.map → p-5093c486.entry.js.map} +0 -0
  230. /package/dist/chucao/{p-337d7f68.entry.js.map → p-51f6327c.entry.js.map} +0 -0
  231. /package/dist/chucao/{p-bf036509.entry.js.map → p-5577e0a0.entry.js.map} +0 -0
  232. /package/dist/chucao/{p-339e3c30.entry.js.map → p-56e41372.entry.js.map} +0 -0
  233. /package/dist/chucao/{p-a84d4493.entry.js.map → p-6c2e5931.entry.js.map} +0 -0
  234. /package/dist/chucao/{p-1e8d921d.entry.js.map → p-6e93c392.entry.js.map} +0 -0
  235. /package/dist/chucao/{p-93f25dd5.entry.js.map → p-7f99ae48.entry.js.map} +0 -0
  236. /package/dist/chucao/{p-e2fe7c5d.entry.js.map → p-8fcf6d36.entry.js.map} +0 -0
  237. /package/dist/chucao/{p-d2077ae4.entry.js.map → p-920d5727.entry.js.map} +0 -0
  238. /package/dist/chucao/{p-1852dfdb.entry.js.map → p-ad41da02.entry.js.map} +0 -0
  239. /package/dist/chucao/{p-08d90a3d.entry.js.map → p-b42ec9bf.entry.js.map} +0 -0
  240. /package/dist/chucao/{p-36c59ad1.entry.js.map → p-b80c39c3.entry.js.map} +0 -0
  241. /package/dist/chucao/{p-507d4b69.entry.js.map → p-ba589c2f.entry.js.map} +0 -0
  242. /package/dist/chucao/{p-39815ee2.entry.js.map → p-c4d68ab7.entry.js.map} +0 -0
  243. /package/dist/chucao/{p-3e6614ee.entry.js.map → p-c98e2a50.entry.js.map} +0 -0
  244. /package/dist/chucao/{p-4c8838a0.entry.js.map → p-ca3179ae.entry.js.map} +0 -0
  245. /package/dist/chucao/{p-3f9894a4.entry.js.map → p-d630f662.entry.js.map} +0 -0
  246. /package/dist/chucao/{p-4cda7f71.entry.js.map → p-d868bdbc.entry.js.map} +0 -0
  247. /package/dist/chucao/{p-f17b186f.entry.js.map → p-e6b7b2da.entry.js.map} +0 -0
  248. /package/dist/components/{p-CuczWSQU.js.map → p-CF1yV0aa.js.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-ByZY6aTj.js');
3
+ var index = require('./index-C6khqyw3.js');
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await index.globalScripts();
8
- 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-description-list.cjs",[[769,"ch-description-list",{"columns":[1]}]]],["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-number-input.cjs",[[577,"ch-number-input",{"label":[1],"value":[1025],"format":[1],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"min":[2],"max":[2],"step":[8],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32],"draft":[32],"typing":[32]},null,{"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}],"min":[{"syncForm":0}],"max":[{"syncForm":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-stat.cjs",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-table.cjs",[[769,"ch-table",{"columns":[16],"sortable":[516],"sortKey":[1,"sort-key"],"sortDirection":[1,"sort-direction"],"label":[1],"filtered":[516],"empty":[32],"rerender":[32]},null,{"filtered":[{"onFiltered":0}],"sortKey":[{"rerenderHeaders":0}],"sortDirection":[{"rerenderHeaders":0}],"sortable":[{"rerenderHeaders":0}]}]]],["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-timeline.cjs",[[257,"ch-timeline"]]],["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);
8
+ return index.bootstrapLazy([["ch-confirm-dialog.cjs",[[513,"ch-confirm-dialog",{"open":[1028],"heading":[1],"message":[1],"confirmLabel":[1,"confirm-label"],"cancelLabel":[1,"cancel-label"],"tone":[1],"pending":[4],"dismissible":[4],"settled":[32],"focusCancel":[64]},null,{"open":[{"handleOpenChange":0}]}]]],["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-description-list.cjs",[[769,"ch-description-list",{"columns":[1]}]]],["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-number-input.cjs",[[577,"ch-number-input",{"label":[1],"value":[1025],"format":[1],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"min":[2],"max":[2],"step":[8],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32],"draft":[32],"typing":[32]},null,{"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}],"min":[{"syncForm":0}],"max":[{"syncForm":0}]}]]],["ch-otp-input.cjs",[[577,"ch-otp-input",{"label":[1],"value":[1025],"length":[2],"inputMode":[1,"input-mode"],"secret":[4],"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}],"length":[{"syncForm":0}],"inputMode":[{"syncForm":0}]}]]],["ch-page-header.cjs",[[769,"ch-page-header",{"title":[1],"headingLevel":[1,"heading-level"],"eyebrow":[1],"description":[1],"actionsStacked":[4,"actions-stacked"]}]]],["ch-pagination.cjs",[[513,"ch-pagination",{"page":[2],"pageSize":[2,"page-size"],"total":[2],"label":[1],"size":[1],"disabled":[516]}]]],["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-stat.cjs",[[769,"ch-stat",{"label":[1],"value":[1],"hint":[1],"tone":[1]}]]],["ch-table.cjs",[[769,"ch-table",{"columns":[16],"sortable":[516],"sortKey":[1,"sort-key"],"sortDirection":[1,"sort-direction"],"label":[1],"filtered":[516],"empty":[32],"rerender":[32]},null,{"filtered":[{"onFiltered":0}],"sortKey":[{"rerenderHeaders":0}],"sortDirection":[{"rerenderHeaders":0}],"sortable":[{"rerenderHeaders":0}]}]]],["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-timeline.cjs",[[257,"ch-timeline"]]],["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]}]]],["ch-modal.cjs",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"],"size":[1]},null,{"open":[{"handleOpenChange":0}]}]]]], options);
9
9
  };
10
10
 
11
11
  exports.setNonce = index.setNonce;
@@ -7,6 +7,7 @@
7
7
  "components/ch-card/ch-card.js",
8
8
  "components/ch-checkbox/ch-checkbox.js",
9
9
  "components/ch-cluster/ch-cluster.js",
10
+ "components/ch-confirm-dialog/ch-confirm-dialog.js",
10
11
  "components/ch-description-list/ch-description-list.js",
11
12
  "components/ch-divider/ch-divider.js",
12
13
  "components/ch-drawer/ch-drawer.js",
@@ -19,7 +20,9 @@
19
20
  "components/ch-link/ch-link.js",
20
21
  "components/ch-modal/ch-modal.js",
21
22
  "components/ch-number-input/ch-number-input.js",
23
+ "components/ch-otp-input/ch-otp-input.js",
22
24
  "components/ch-page-header/ch-page-header.js",
25
+ "components/ch-pagination/ch-pagination.js",
23
26
  "components/ch-radio/ch-radio.js",
24
27
  "components/ch-segmented-control/ch-segmented-control.js",
25
28
  "components/ch-select/ch-select.js",
@@ -25,7 +25,7 @@ export class ChAccordion {
25
25
  this.chChange.emit(this.value);
26
26
  };
27
27
  render() {
28
- return (h(Host, { key: '409acc858675f8586e07dd3739b3998bb0bd1b5c' }, this.items.map(item => {
28
+ return (h(Host, { key: 'da264a6faa4d8da510d2964bef410d7c733bc507' }, this.items.map(item => {
29
29
  const open = this.value === item.value;
30
30
  return (h("div", { key: item.value, class: { 'item': true, 'item--open': open } }, h("h3", { class: "item-head" }, h("button", { type: "button", class: "item-toggle", id: this.headerId(item.value), "data-value": item.value, "aria-expanded": open ? 'true' : 'false', "aria-controls": this.panelId(item.value), disabled: item.disabled, onClick: () => this.toggle(item.value) }, item.title)), h("div", { class: "item-panel", id: this.panelId(item.value), role: "region", "aria-labelledby": this.headerId(item.value), hidden: !open }, h("slot", { name: `panel-${item.value}` }))));
31
31
  })));
@@ -56,7 +56,7 @@ export class ChAlert {
56
56
  render() {
57
57
  const role = this.variant === 'warning' ? 'alert' : 'status';
58
58
  const shapes = this.statusCue ? chIcons[VARIANT_ICON[this.variant]] : undefined;
59
- return (h(Host, { key: '215aabbfa3003e3e7535272c08944260f1a9632d' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: '0ce82e3f75057178968440f52d9227b822c56c00', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: 'ddaa7c828c61f95a1a341b73b13f676678f5df90', class: "alert-content" }, h("slot", { key: 'd3ec8f34fee0a58acbccfd8b62ccb316db3fa80b' })), this.dismissLabel && (h("button", { key: '1e8b52b8149cfa788253797c16a86b087430878e', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: '5dfed25295ef86ca384d7f4bfd0d5c555274728c', "aria-hidden": "true" }, "\u00D7"))))));
59
+ return (h(Host, { key: 'c7fb041416b2958fcda758a3297a0f9546456ef3' }, h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, shapes && (h("svg", { key: '1a89cc6797bd6b425920f61f545f407326422e93', class: "alert-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, shapes.map(shape => h(shape.tag, shape.attrs)))), h("div", { key: 'd30f1b3897d3ce681789507aa2677b29a83e8346', class: "alert-content" }, h("slot", { key: 'a4bc52ace056a573b21ecec083d017b3c5c22245' })), this.dismissLabel && (h("button", { key: '571947bd96a9c2f22b7af7989abd406dff860256', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, h("span", { key: 'e8d282730aa25aad78f05ce118cb65fce9ea85c5', "aria-hidden": "true" }, "\u00D7"))))));
60
60
  }
61
61
  static get is() { return "ch-alert"; }
62
62
  static get encapsulation() { return "shadow"; }
@@ -19,7 +19,7 @@ export class ChBadge {
19
19
  */
20
20
  statusCue = true;
21
21
  render() {
22
- return (h(Host, { key: 'c6e468054822e210a4067d1c651f7602ff14fb43' }, h("span", { key: '1615a33a2ca7ace0570e6710038be8cb9f29825a', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: '20e222901097dffb6da270da17510851160a7553', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: '28d66fa8367ec3b3106c51af50bc8db15561bb6e' }))));
22
+ return (h(Host, { key: '712c653d4047845d6afce4655271f2c80e3fe6a8' }, h("span", { key: 'dd24bf1f555b229bee277b77c175b485f4a10680', class: { badge: true, [`badge--${this.variant}`]: true } }, this.statusCue && h("span", { key: 'cef4173e40dac2798c2a26381763bb470cf0bacc', class: "badge-dot", "aria-hidden": "true" }), h("slot", { key: '6e8c09dd9260d80c9fda09b402dfc3b1cef53907' }))));
23
23
  }
24
24
  static get is() { return "ch-badge"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class ChCard {
3
3
  render() {
4
- return (h(Host, { key: 'c9ba0279cf4abcd7d4080f73686fbdf6eb74346d' }, h("div", { key: 'c246fe28baabad8b8692d981f397f206fbaeef87', class: "card" }, h("slot", { key: '30065c0b9b12c071b937d37d6b18c6727569f108' }))));
4
+ return (h(Host, { key: 'f237dce6afd9f9c88f52784de63073d3b4dc31fd' }, h("div", { key: '2256360ad3b736aaf595cb0440903eb90ffc9968', class: "card" }, h("slot", { key: '5ce63027b9e1abd925b4a1d7261752a4b579b336' }))));
5
5
  }
6
6
  static get is() { return "ch-card"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -95,7 +95,7 @@ export class ChCheckbox {
95
95
  return undefined;
96
96
  }
97
97
  render() {
98
- return (h(Host, { key: 'b3f66a5f7c7a9325cf85e6ee80b0893d520201a4' }, h("label", { key: '2362a243af367f8d0c286ef910fb4f7814a1ca4e', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: 'c2ebaf6a15259caa4bac3d104507137be815ed11', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '60e9393b8d0a4abaa1dcdad11c94607c91bd3b40', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: '041cfba5bfdf5924cabfdf375905d99755959fcd', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: 'c72207cfdf83d419804c7e969aaa35d70fc3fddf', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
98
+ return (h(Host, { key: '3e0f2f162d1ec1a4715b44a37211a30c63f830b2' }, h("label", { key: '8042cb81ab53a9451a8757dfa63ef8cea8f41954', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, h("input", { key: '0d55f22c4625f48c8bf2eee15a7710cfb80c4328', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && h("span", { key: '146e3b4fa88237da4af8f8b0a408909b4d11555e', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (h("p", { key: 'd82032ae57e8e818a91fa04cfd5e505dea47c22d', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (h("p", { key: '9f418c648d4929086a77ca868a7c13cdccb328cb', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
99
99
  }
100
100
  static get is() { return "ch-checkbox"; }
101
101
  static get encapsulation() { return "shadow"; }
@@ -26,13 +26,13 @@ export class ChCluster {
26
26
  return GAPS.has(this.gap) ? this.gap : 'md';
27
27
  }
28
28
  render() {
29
- return (h(Host, { key: '9eee9c08a5e08f27cfcd401a0e70d6b97a426206', class: {
29
+ return (h(Host, { key: 'd1852bc490835eb559f31039e14b87d59b151b11', class: {
30
30
  'cluster': true,
31
31
  [`cluster--gap-${this.gapStep}`]: true,
32
32
  [`cluster--align-${this.align}`]: true,
33
33
  [`cluster--justify-${this.justify}`]: true,
34
34
  'cluster--nowrap': !this.wrap,
35
- } }, h("slot", { key: '47fc7945bc64d427f7e7a274e26a20d7f85f9b78' })));
35
+ } }, h("slot", { key: '7dc3c83e40d8e0d5dd18052bb9c36898a443ce23' })));
36
36
  }
37
37
  static get is() { return "ch-cluster"; }
38
38
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,71 @@
1
+ :host {
2
+ display: contents;
3
+ font-family: var(--typography-body);
4
+ }
5
+
6
+ .confirm__heading {
7
+ margin: 0;
8
+ font-family: var(--typography-heading);
9
+ font-size: var(--typography-size-lg);
10
+ font-weight: var(--typography-weight-semibold);
11
+ color: var(--color-text-primary);
12
+ }
13
+
14
+ .confirm__message {
15
+ margin: 0;
16
+ font-size: var(--typography-size-sm);
17
+ color: var(--color-text-secondary);
18
+ overflow-wrap: break-word;
19
+ }
20
+
21
+ .confirm__actions {
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ justify-content: flex-end;
25
+ gap: var(--spacing-md);
26
+ margin-top: var(--spacing-2xl);
27
+ }
28
+
29
+ .confirm__button {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ min-height: 2.25rem;
34
+ padding: 0 var(--spacing-lg);
35
+ border: var(--border-width) solid var(--color-border-default);
36
+ border-radius: var(--radius-sm);
37
+ background: var(--color-surface-default);
38
+ color: var(--color-text-primary);
39
+ font-family: var(--typography-body);
40
+ font-size: var(--typography-size-sm);
41
+ font-weight: var(--typography-weight-semibold);
42
+ cursor: pointer;
43
+ }
44
+
45
+ .confirm__button:focus-visible {
46
+ outline: 2px solid var(--color-accent-default);
47
+ outline-offset: 2px;
48
+ }
49
+
50
+ .confirm__button:disabled {
51
+ opacity: var(--opacity-disabled);
52
+ cursor: not-allowed;
53
+ }
54
+
55
+ .confirm__button--confirm {
56
+ border-color: var(--color-accent-default);
57
+ background: var(--color-accent-default);
58
+ color: var(--color-accent-text);
59
+ }
60
+
61
+ /* Destructive intent is carried by weight and iconography as well as colour. */
62
+ .confirm__button--danger {
63
+ border-color: var(--color-status-warning);
64
+ background: var(--color-status-warning);
65
+ color: var(--color-text-primary);
66
+ }
67
+
68
+ .confirm__button--danger::before {
69
+ content: '⚠';
70
+ margin-right: var(--spacing-xs);
71
+ }
@@ -0,0 +1,382 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * A confirmation dialog over `ch-modal`.
4
+ *
5
+ * Declarative only: the consumer opens it with `open` and handles the outcome.
6
+ * The imperative `confirm()` helper is a separate concern and a separate issue,
7
+ * because a promise-returning helper has to own mounting, focus and unhandled
8
+ * rejection, none of which a component should decide for its consumer.
9
+ *
10
+ * The guarantees this adds over a plain `ch-modal` are the ones that make a
11
+ * confirmation safe:
12
+ *
13
+ * - exactly one outcome per interaction — a double click on Confirm emits once;
14
+ * - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a
15
+ * consumer awaiting an answer cannot hang;
16
+ * - focus lands on Cancel for a destructive action, so the absent-minded Enter
17
+ * does not destroy anything;
18
+ * - `pending` is not a cancellation: a slow request keeps the dialog open.
19
+ */
20
+ export class ChConfirmDialog {
21
+ el;
22
+ /** Whether the dialog is open. Kept in sync when it is dismissed. */
23
+ open = false;
24
+ /**
25
+ * The question, set as the dialog's accessible name. Required: a dialog
26
+ * without a name is announced as an unlabelled group.
27
+ */
28
+ heading;
29
+ /** Supporting text, rendered under the heading. */
30
+ message;
31
+ /** Label of the confirming action. */
32
+ confirmLabel = 'Confirm';
33
+ /** Label of the dismissing action. */
34
+ cancelLabel = 'Cancel';
35
+ /**
36
+ * `danger` styles the confirm action as destructive and moves the initial
37
+ * focus to Cancel, so the safe choice is the default one.
38
+ */
39
+ tone = 'default';
40
+ /** Whether the confirm action is in flight; both buttons are then disabled. */
41
+ pending = false;
42
+ /**
43
+ * Whether Escape and the backdrop dismiss the dialog. When false, the only
44
+ * way out is one of the two buttons — use it only for a decision that must
45
+ * be answered rather than abandoned.
46
+ */
47
+ dismissible = true;
48
+ /** Emitted once when the user confirms. */
49
+ chConfirm;
50
+ /** Emitted once when the dialog is dismissed without confirming. */
51
+ chCancel;
52
+ /** `true` once an outcome has been emitted for the current opening. */
53
+ settled = false;
54
+ cancelButton;
55
+ confirmButton;
56
+ componentDidLoad() {
57
+ if (this.open) {
58
+ this.onOpening();
59
+ }
60
+ }
61
+ handleOpenChange(open) {
62
+ if (open) {
63
+ this.onOpening();
64
+ return;
65
+ }
66
+ this.settled = false;
67
+ }
68
+ onOpening() {
69
+ this.settled = false;
70
+ // Focus is moved once the dialog is actually shown; the modal handles
71
+ // moving focus into itself, and this refines where it lands.
72
+ requestAnimationFrame(() => {
73
+ const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;
74
+ target?.focus();
75
+ });
76
+ }
77
+ settle(outcome) {
78
+ if (this.settled) {
79
+ return;
80
+ }
81
+ this.settled = true;
82
+ if (outcome === 'confirm') {
83
+ this.chConfirm.emit();
84
+ return;
85
+ }
86
+ this.chCancel.emit();
87
+ }
88
+ handleConfirm = () => {
89
+ if (this.pending) {
90
+ return;
91
+ }
92
+ this.settle('confirm');
93
+ };
94
+ handleCancel = () => {
95
+ if (this.pending) {
96
+ return;
97
+ }
98
+ this.open = false;
99
+ this.settle('cancel');
100
+ };
101
+ /**
102
+ * `ch-modal` reports every close that was not requested by the consumer —
103
+ * Escape and the backdrop. A close while `pending` is the consumer's own
104
+ * doing and is not a cancellation.
105
+ */
106
+ handleModalClose = () => {
107
+ this.open = false;
108
+ if (this.pending) {
109
+ return;
110
+ }
111
+ this.settle('cancel');
112
+ };
113
+ /**
114
+ * Escape is a platform close request on the inner `<dialog>`, so a
115
+ * non-dismissible dialog cancels it before it takes effect. The backdrop is
116
+ * handled by `ch-modal` and is suppressed the same way.
117
+ */
118
+ handleKeyDown = (event) => {
119
+ if (this.dismissible || event.key !== 'Escape') {
120
+ return;
121
+ }
122
+ event.preventDefault();
123
+ event.stopPropagation();
124
+ };
125
+ /**
126
+ * Focus the safe action. Exposed so a consumer can return focus deliberately
127
+ * after a request settles.
128
+ */
129
+ async focusCancel() {
130
+ this.cancelButton?.focus();
131
+ }
132
+ render() {
133
+ return (h(Host, { key: '7aa8fd72a281369f47ce7f1eb99c52ab60ba4ee0', onKeyDown: this.handleKeyDown }, h("ch-modal", { key: '019663f042f5c2ce3dd1f58433faee170c01e8e6', open: this.open, label: this.heading, size: "sm", onChClose: this.handleModalClose, onChOpen: () => this.onOpening() }, h("h2", { key: '9d97f437e535a3a9feb181e9807dc9c532efd872', slot: "heading", class: "confirm__heading" }, this.heading), this.message && h("p", { key: 'a0d64b2b915624473162557972eabdf80b445d58', class: "confirm__message" }, this.message), h("div", { key: '0b44308d6eb7a4aea2c1166f8a7f6f19c41cdbb7', class: "confirm__actions" }, h("button", { key: '7908d0db96e7c59c7b4673220aa62c2170b29d54', class: { 'confirm__button': true, 'confirm__button--cancel': true }, type: "button", ref: el => (this.cancelButton = el), disabled: this.pending, onClick: this.handleCancel }, this.cancelLabel), h("button", { key: '43657105b474b303160da19e1fa5fda47f63207c', class: { 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }, type: "button", ref: el => (this.confirmButton = el), disabled: this.pending, "aria-busy": this.pending ? 'true' : undefined, onClick: this.handleConfirm }, this.confirmLabel)))));
134
+ }
135
+ static get is() { return "ch-confirm-dialog"; }
136
+ static get encapsulation() { return "shadow"; }
137
+ static get originalStyleUrls() {
138
+ return {
139
+ "$": ["ch-confirm-dialog.css"]
140
+ };
141
+ }
142
+ static get styleUrls() {
143
+ return {
144
+ "$": ["ch-confirm-dialog.css"]
145
+ };
146
+ }
147
+ static get properties() {
148
+ return {
149
+ "open": {
150
+ "type": "boolean",
151
+ "mutable": true,
152
+ "complexType": {
153
+ "original": "boolean",
154
+ "resolved": "boolean",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Whether the dialog is open. Kept in sync when it is dismissed."
162
+ },
163
+ "getter": false,
164
+ "setter": false,
165
+ "reflect": false,
166
+ "attribute": "open",
167
+ "defaultValue": "false"
168
+ },
169
+ "heading": {
170
+ "type": "string",
171
+ "mutable": false,
172
+ "complexType": {
173
+ "original": "string",
174
+ "resolved": "string",
175
+ "references": {}
176
+ },
177
+ "required": true,
178
+ "optional": false,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": "The question, set as the dialog's accessible name. Required: a dialog\nwithout a name is announced as an unlabelled group."
182
+ },
183
+ "getter": false,
184
+ "setter": false,
185
+ "reflect": false,
186
+ "attribute": "heading"
187
+ },
188
+ "message": {
189
+ "type": "string",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "string",
193
+ "resolved": "string",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": true,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Supporting text, rendered under the heading."
201
+ },
202
+ "getter": false,
203
+ "setter": false,
204
+ "reflect": false,
205
+ "attribute": "message"
206
+ },
207
+ "confirmLabel": {
208
+ "type": "string",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "string",
212
+ "resolved": "string",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": "Label of the confirming action."
220
+ },
221
+ "getter": false,
222
+ "setter": false,
223
+ "reflect": false,
224
+ "attribute": "confirm-label",
225
+ "defaultValue": "'Confirm'"
226
+ },
227
+ "cancelLabel": {
228
+ "type": "string",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "string",
232
+ "resolved": "string",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "Label of the dismissing action."
240
+ },
241
+ "getter": false,
242
+ "setter": false,
243
+ "reflect": false,
244
+ "attribute": "cancel-label",
245
+ "defaultValue": "'Cancel'"
246
+ },
247
+ "tone": {
248
+ "type": "string",
249
+ "mutable": false,
250
+ "complexType": {
251
+ "original": "ChConfirmDialogTone",
252
+ "resolved": "\"danger\" | \"default\"",
253
+ "references": {
254
+ "ChConfirmDialogTone": {
255
+ "location": "local",
256
+ "path": "/home/runner/work/chucao/chucao/src/components/ch-confirm-dialog/ch-confirm-dialog.tsx",
257
+ "id": "src/components/ch-confirm-dialog/ch-confirm-dialog.tsx::ChConfirmDialogTone"
258
+ }
259
+ }
260
+ },
261
+ "required": false,
262
+ "optional": false,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": "`danger` styles the confirm action as destructive and moves the initial\nfocus to Cancel, so the safe choice is the default one."
266
+ },
267
+ "getter": false,
268
+ "setter": false,
269
+ "reflect": false,
270
+ "attribute": "tone",
271
+ "defaultValue": "'default'"
272
+ },
273
+ "pending": {
274
+ "type": "boolean",
275
+ "mutable": false,
276
+ "complexType": {
277
+ "original": "boolean",
278
+ "resolved": "boolean",
279
+ "references": {}
280
+ },
281
+ "required": false,
282
+ "optional": false,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": "Whether the confirm action is in flight; both buttons are then disabled."
286
+ },
287
+ "getter": false,
288
+ "setter": false,
289
+ "reflect": false,
290
+ "attribute": "pending",
291
+ "defaultValue": "false"
292
+ },
293
+ "dismissible": {
294
+ "type": "boolean",
295
+ "mutable": false,
296
+ "complexType": {
297
+ "original": "boolean",
298
+ "resolved": "boolean",
299
+ "references": {}
300
+ },
301
+ "required": false,
302
+ "optional": false,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": "Whether Escape and the backdrop dismiss the dialog. When false, the only\nway out is one of the two buttons \u2014 use it only for a decision that must\nbe answered rather than abandoned."
306
+ },
307
+ "getter": false,
308
+ "setter": false,
309
+ "reflect": false,
310
+ "attribute": "dismissible",
311
+ "defaultValue": "true"
312
+ }
313
+ };
314
+ }
315
+ static get states() {
316
+ return {
317
+ "settled": {}
318
+ };
319
+ }
320
+ static get events() {
321
+ return [{
322
+ "method": "chConfirm",
323
+ "name": "chConfirm",
324
+ "bubbles": true,
325
+ "cancelable": true,
326
+ "composed": true,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": "Emitted once when the user confirms."
330
+ },
331
+ "complexType": {
332
+ "original": "void",
333
+ "resolved": "void",
334
+ "references": {}
335
+ }
336
+ }, {
337
+ "method": "chCancel",
338
+ "name": "chCancel",
339
+ "bubbles": true,
340
+ "cancelable": true,
341
+ "composed": true,
342
+ "docs": {
343
+ "tags": [],
344
+ "text": "Emitted once when the dialog is dismissed without confirming."
345
+ },
346
+ "complexType": {
347
+ "original": "void",
348
+ "resolved": "void",
349
+ "references": {}
350
+ }
351
+ }];
352
+ }
353
+ static get methods() {
354
+ return {
355
+ "focusCancel": {
356
+ "complexType": {
357
+ "signature": "() => Promise<void>",
358
+ "parameters": [],
359
+ "references": {
360
+ "Promise": {
361
+ "location": "global",
362
+ "id": "global::Promise"
363
+ }
364
+ },
365
+ "return": "Promise<void>"
366
+ },
367
+ "docs": {
368
+ "text": "Focus the safe action. Exposed so a consumer can return focus deliberately\nafter a request settles.",
369
+ "tags": []
370
+ }
371
+ }
372
+ };
373
+ }
374
+ static get elementRef() { return "el"; }
375
+ static get watchers() {
376
+ return [{
377
+ "propName": "open",
378
+ "methodName": "handleOpenChange"
379
+ }];
380
+ }
381
+ }
382
+ //# sourceMappingURL=ch-confirm-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ch-confirm-dialog.js","sourceRoot":"","sources":["../../../../src/components/ch-confirm-dialog/ch-confirm-dialog.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Element, Event, type EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\n\nexport type ChConfirmDialogTone = 'default' | 'danger';\n\n/**\n * A confirmation dialog over `ch-modal`.\n *\n * Declarative only: the consumer opens it with `open` and handles the outcome.\n * The imperative `confirm()` helper is a separate concern and a separate issue,\n * because a promise-returning helper has to own mounting, focus and unhandled\n * rejection, none of which a component should decide for its consumer.\n *\n * The guarantees this adds over a plain `ch-modal` are the ones that make a\n * confirmation safe:\n *\n * - exactly one outcome per interaction — a double click on Confirm emits once;\n * - every dismissal path (Cancel, Escape, backdrop, confirm) is reported, so a\n * consumer awaiting an answer cannot hang;\n * - focus lands on Cancel for a destructive action, so the absent-minded Enter\n * does not destroy anything;\n * - `pending` is not a cancellation: a slow request keeps the dialog open.\n */\n@Component({\n tag: 'ch-confirm-dialog',\n styleUrl: 'ch-confirm-dialog.css',\n shadow: true,\n})\nexport class ChConfirmDialog {\n @Element() el: HTMLElement;\n\n /** Whether the dialog is open. Kept in sync when it is dismissed. */\n @Prop({ mutable: true }) open = false;\n\n /**\n * The question, set as the dialog's accessible name. Required: a dialog\n * without a name is announced as an unlabelled group.\n */\n @Prop() heading!: string;\n\n /** Supporting text, rendered under the heading. */\n @Prop() message?: string;\n\n /** Label of the confirming action. */\n @Prop() confirmLabel = 'Confirm';\n\n /** Label of the dismissing action. */\n @Prop() cancelLabel = 'Cancel';\n\n /**\n * `danger` styles the confirm action as destructive and moves the initial\n * focus to Cancel, so the safe choice is the default one.\n */\n @Prop() tone: ChConfirmDialogTone = 'default';\n\n /** Whether the confirm action is in flight; both buttons are then disabled. */\n @Prop() pending = false;\n\n /**\n * Whether Escape and the backdrop dismiss the dialog. When false, the only\n * way out is one of the two buttons — use it only for a decision that must\n * be answered rather than abandoned.\n */\n @Prop() dismissible = true;\n\n /** Emitted once when the user confirms. */\n @Event() chConfirm: EventEmitter<void>;\n\n /** Emitted once when the dialog is dismissed without confirming. */\n @Event() chCancel: EventEmitter<void>;\n\n /** `true` once an outcome has been emitted for the current opening. */\n @State() private settled = false;\n\n private cancelButton?: HTMLButtonElement;\n private confirmButton?: HTMLButtonElement;\n\n componentDidLoad() {\n if (this.open) {\n this.onOpening();\n }\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n if (open) {\n this.onOpening();\n return;\n }\n this.settled = false;\n }\n\n private onOpening() {\n this.settled = false;\n // Focus is moved once the dialog is actually shown; the modal handles\n // moving focus into itself, and this refines where it lands.\n requestAnimationFrame(() => {\n const target = this.tone === 'danger' ? this.cancelButton : this.confirmButton;\n target?.focus();\n });\n }\n\n private settle(outcome: 'confirm' | 'cancel') {\n if (this.settled) {\n return;\n }\n this.settled = true;\n if (outcome === 'confirm') {\n this.chConfirm.emit();\n return;\n }\n this.chCancel.emit();\n }\n\n private handleConfirm = () => {\n if (this.pending) {\n return;\n }\n this.settle('confirm');\n };\n\n private handleCancel = () => {\n if (this.pending) {\n return;\n }\n this.open = false;\n this.settle('cancel');\n };\n\n /**\n * `ch-modal` reports every close that was not requested by the consumer —\n * Escape and the backdrop. A close while `pending` is the consumer's own\n * doing and is not a cancellation.\n */\n private handleModalClose = () => {\n this.open = false;\n if (this.pending) {\n return;\n }\n this.settle('cancel');\n };\n\n /**\n * Escape is a platform close request on the inner `<dialog>`, so a\n * non-dismissible dialog cancels it before it takes effect. The backdrop is\n * handled by `ch-modal` and is suppressed the same way.\n */\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.dismissible || event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * Focus the safe action. Exposed so a consumer can return focus deliberately\n * after a request settles.\n */\n @Method()\n async focusCancel(): Promise<void> {\n this.cancelButton?.focus();\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <ch-modal open={this.open} label={this.heading} size=\"sm\" onChClose={this.handleModalClose} onChOpen={() => this.onOpening()}>\n <h2 slot=\"heading\" class=\"confirm__heading\">\n {this.heading}\n </h2>\n {this.message && <p class=\"confirm__message\">{this.message}</p>}\n <div class=\"confirm__actions\">\n <button\n class={{ 'confirm__button': true, 'confirm__button--cancel': true }}\n type=\"button\"\n ref={el => (this.cancelButton = el as HTMLButtonElement)}\n disabled={this.pending}\n onClick={this.handleCancel}\n >\n {this.cancelLabel}\n </button>\n <button\n class={{ 'confirm__button': true, 'confirm__button--confirm': true, 'confirm__button--danger': this.tone === 'danger' }}\n type=\"button\"\n ref={el => (this.confirmButton = el as HTMLButtonElement)}\n disabled={this.pending}\n aria-busy={this.pending ? 'true' : undefined}\n onClick={this.handleConfirm}\n >\n {this.confirmLabel}\n </button>\n </div>\n </ch-modal>\n </Host>\n );\n }\n}\n"]}
@@ -30,7 +30,7 @@ export class ChDescriptionList {
30
30
  return COLUMNS.has(this.columns) ? this.columns : '1';
31
31
  }
32
32
  render() {
33
- return (h(Host, { key: 'e08da698cbef6acf5a98d69687ea3da1cc766320' }, h("dl", { key: '6c9f4d7eb2ccaa978e60990e4fb0ba7154ac4bcd', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '6a7e8db498e40ef6aab6f8b350feed5474d5c970' }))));
33
+ return (h(Host, { key: '590fc24614ba9240d7708cff6cb6027eca5904bf' }, h("dl", { key: '868ee275cd6c792bff933c2429fe23985b9c30e3', class: `list list--columns-${this.columnCount}` }, h("slot", { key: '7433fcda6f0e6b2c738c790839169669c31bd266' }))));
34
34
  }
35
35
  static get is() { return "ch-description-list"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -5,7 +5,7 @@ export class ChDivider {
5
5
  */
6
6
  orientation = 'horizontal';
7
7
  render() {
8
- return (h(Host, { key: '8bc2b7f15c104c6dc88ebaa01c557325795ebf4d', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: '6762a8fe2524d3192b02e96f4791b597a952d18e', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
8
+ return (h(Host, { key: '068a29854d312d17f5f5b768975996e1b8db9317', class: { 'divider--vertical': this.orientation === 'vertical' } }, h("hr", { key: 'c2dca357f717b822caa028fae4c1d5e4709ae75c', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
9
9
  }
10
10
  static get is() { return "ch-divider"; }
11
11
  static get encapsulation() { return "shadow"; }