@mcp-b/web-components 0.2.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 (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/accordion-B1Q3kuP_.d.ts +373 -0
  4. package/dist/accordion-item-DvPfhpm8.js +307 -0
  5. package/dist/accordion-item-bPRIahNn.d.ts +63 -0
  6. package/dist/accordion-zDr-Br4V.js +483 -0
  7. package/dist/action-bar-CYsjmhwP.d.ts +29 -0
  8. package/dist/action-bar-CjN_UcnP.js +56 -0
  9. package/dist/alert-dialog-4CnO3Nb5.d.ts +60 -0
  10. package/dist/alert-dialog-D25Oi_TS.js +126 -0
  11. package/dist/avatar-Bje_KpZo.d.ts +141 -0
  12. package/dist/avatar-CRP0kW3x.js +224 -0
  13. package/dist/badge-Ct95U4UO.js +301 -0
  14. package/dist/badge-D1DNQrWn.d.ts +106 -0
  15. package/dist/breadcrumb-BxZ-nQE5.d.ts +365 -0
  16. package/dist/breadcrumb-item-BC454oQe.d.ts +59 -0
  17. package/dist/breadcrumb-item-P5pdq_gE.js +151 -0
  18. package/dist/breadcrumb-uURhiqWJ.js +384 -0
  19. package/dist/button-5k_aL_gD.js +802 -0
  20. package/dist/button-BQofnUt4.d.ts +354 -0
  21. package/dist/button-group-BydvJTQy.js +197 -0
  22. package/dist/button-group-COodHeuB.d.ts +155 -0
  23. package/dist/callout-B8zTf8Go.js +188 -0
  24. package/dist/callout-DFwPao36.d.ts +103 -0
  25. package/dist/card-BYDzdMAU.d.ts +177 -0
  26. package/dist/card-DIg1-X2G.js +332 -0
  27. package/dist/carousel-Bktu7wrD.js +843 -0
  28. package/dist/carousel-DQITCtEY.d.ts +423 -0
  29. package/dist/carousel-item-B5-X31Ha.js +79 -0
  30. package/dist/carousel-item-BB3jL2tk.d.ts +34 -0
  31. package/dist/cdn/loader.js +530 -0
  32. package/dist/checkbox-D6r7PVPj.js +641 -0
  33. package/dist/checkbox-DoFcDEKB.d.ts +354 -0
  34. package/dist/checkbox-group-CLvNAO_F.js +201 -0
  35. package/dist/checkbox-group-Cnh8rAn4.d.ts +152 -0
  36. package/dist/color-input-Bky89xg_.d.ts +470 -0
  37. package/dist/color-input-DPIxi9wR.js +894 -0
  38. package/dist/color-picker-adwOmtRl.js +1240 -0
  39. package/dist/color-picker-wQw8bPsq.d.ts +360 -0
  40. package/dist/combobox-B6al50UG.js +1693 -0
  41. package/dist/combobox-item-D2H1CMxC.d.ts +714 -0
  42. package/dist/combobox-item-yM6tDrGG.js +225 -0
  43. package/dist/comparison-B1-nMwmp.d.ts +134 -0
  44. package/dist/comparison-CyqKrCN-.js +435 -0
  45. package/dist/components/accordion/accordion.d.ts +2 -0
  46. package/dist/components/accordion/accordion.js +2 -0
  47. package/dist/components/accordion-item/accordion-item.d.ts +2 -0
  48. package/dist/components/accordion-item/accordion-item.js +2 -0
  49. package/dist/components/action-bar/action-bar.d.ts +2 -0
  50. package/dist/components/action-bar/action-bar.js +2 -0
  51. package/dist/components/alert-dialog/alert-dialog.d.ts +2 -0
  52. package/dist/components/alert-dialog/alert-dialog.js +2 -0
  53. package/dist/components/avatar/avatar.d.ts +2 -0
  54. package/dist/components/avatar/avatar.js +2 -0
  55. package/dist/components/badge/badge.d.ts +2 -0
  56. package/dist/components/badge/badge.js +2 -0
  57. package/dist/components/breadcrumb/breadcrumb.d.ts +2 -0
  58. package/dist/components/breadcrumb/breadcrumb.js +2 -0
  59. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +2 -0
  60. package/dist/components/breadcrumb-item/breadcrumb-item.js +2 -0
  61. package/dist/components/button/button.d.ts +2 -0
  62. package/dist/components/button/button.js +2 -0
  63. package/dist/components/button-group/button-group.d.ts +2 -0
  64. package/dist/components/button-group/button-group.js +2 -0
  65. package/dist/components/callout/callout.d.ts +2 -0
  66. package/dist/components/callout/callout.js +2 -0
  67. package/dist/components/card/card.d.ts +2 -0
  68. package/dist/components/card/card.js +2 -0
  69. package/dist/components/carousel/carousel.d.ts +2 -0
  70. package/dist/components/carousel/carousel.js +2 -0
  71. package/dist/components/carousel-item/carousel-item.d.ts +2 -0
  72. package/dist/components/carousel-item/carousel-item.js +2 -0
  73. package/dist/components/checkbox/checkbox.d.ts +2 -0
  74. package/dist/components/checkbox/checkbox.js +2 -0
  75. package/dist/components/checkbox-group/checkbox-group.d.ts +2 -0
  76. package/dist/components/checkbox-group/checkbox-group.js +2 -0
  77. package/dist/components/color-input/color-input.d.ts +2 -0
  78. package/dist/components/color-input/color-input.js +2 -0
  79. package/dist/components/color-picker/color-picker.d.ts +2 -0
  80. package/dist/components/color-picker/color-picker.js +2 -0
  81. package/dist/components/combobox/combobox.d.ts +2 -0
  82. package/dist/components/combobox/combobox.js +2 -0
  83. package/dist/components/combobox-item/combobox-item.d.ts +2 -0
  84. package/dist/components/combobox-item/combobox-item.js +2 -0
  85. package/dist/components/comparison/comparison.d.ts +2 -0
  86. package/dist/components/comparison/comparison.js +2 -0
  87. package/dist/components/copy/copy.d.ts +2 -0
  88. package/dist/components/copy/copy.js +291 -0
  89. package/dist/components/data-table/data-table.d.ts +2 -0
  90. package/dist/components/data-table/data-table.js +2 -0
  91. package/dist/components/date/date.d.ts +2 -0
  92. package/dist/components/date/date.js +2 -0
  93. package/dist/components/dialog/dialog.d.ts +2 -0
  94. package/dist/components/dialog/dialog.js +2 -0
  95. package/dist/components/divider/divider.d.ts +2 -0
  96. package/dist/components/divider/divider.js +2 -0
  97. package/dist/components/dropdown/dropdown.d.ts +2 -0
  98. package/dist/components/dropdown/dropdown.js +2 -0
  99. package/dist/components/dropdown-item/dropdown-item.d.ts +2 -0
  100. package/dist/components/dropdown-item/dropdown-item.js +2 -0
  101. package/dist/components/empty-result/empty-result.d.ts +2 -0
  102. package/dist/components/empty-result/empty-result.js +2 -0
  103. package/dist/components/empty-state/empty-state.d.ts +2 -0
  104. package/dist/components/empty-state/empty-state.js +2 -0
  105. package/dist/components/expander/expander.d.ts +2 -0
  106. package/dist/components/expander/expander.js +2 -0
  107. package/dist/components/field/field.d.ts +2 -0
  108. package/dist/components/field/field.js +2 -0
  109. package/dist/components/file-input/file-input.d.ts +2 -0
  110. package/dist/components/file-input/file-input.js +2 -0
  111. package/dist/components/filter-bar/filter-bar.d.ts +2 -0
  112. package/dist/components/filter-bar/filter-bar.js +2 -0
  113. package/dist/components/form-section/form-section.d.ts +2 -0
  114. package/dist/components/form-section/form-section.js +2 -0
  115. package/dist/components/icon/icon.d.ts +2 -0
  116. package/dist/components/icon/icon.js +2 -0
  117. package/dist/components/include/include.d.ts +2 -0
  118. package/dist/components/include/include.js +2 -0
  119. package/dist/components/index.d.ts +85 -0
  120. package/dist/components/index.js +86 -0
  121. package/dist/components/infinite-scroller/infinite-scroller.d.ts +2 -0
  122. package/dist/components/infinite-scroller/infinite-scroller.js +2 -0
  123. package/dist/components/intersection-observer/intersection-observer.d.ts +2 -0
  124. package/dist/components/intersection-observer/intersection-observer.js +2 -0
  125. package/dist/components/listbox/listbox.d.ts +2 -0
  126. package/dist/components/listbox/listbox.js +2 -0
  127. package/dist/components/listbox-item/listbox-item.d.ts +2 -0
  128. package/dist/components/listbox-item/listbox-item.js +2 -0
  129. package/dist/components/lorem-ipsum/lorem-ipsum.d.ts +2 -0
  130. package/dist/components/lorem-ipsum/lorem-ipsum.js +2 -0
  131. package/dist/components/meter/meter.d.ts +2 -0
  132. package/dist/components/meter/meter.js +2 -0
  133. package/dist/components/metric/metric.d.ts +2 -0
  134. package/dist/components/metric/metric.js +2 -0
  135. package/dist/components/metric-grid/metric-grid.d.ts +2 -0
  136. package/dist/components/metric-grid/metric-grid.js +2 -0
  137. package/dist/components/mutation-observer/mutation-observer.d.ts +2 -0
  138. package/dist/components/mutation-observer/mutation-observer.js +2 -0
  139. package/dist/components/navicon/navicon.d.ts +2 -0
  140. package/dist/components/navicon/navicon.js +2 -0
  141. package/dist/components/number/number.d.ts +2 -0
  142. package/dist/components/number/number.js +2 -0
  143. package/dist/components/number-field/number-field.d.ts +2 -0
  144. package/dist/components/number-field/number-field.js +2 -0
  145. package/dist/components/pagination/pagination.d.ts +2 -0
  146. package/dist/components/pagination/pagination.js +2 -0
  147. package/dist/components/popover/popover.d.ts +2 -0
  148. package/dist/components/popover/popover.js +2 -0
  149. package/dist/components/preview-card/preview-card.d.ts +2 -0
  150. package/dist/components/preview-card/preview-card.js +2 -0
  151. package/dist/components/progress/progress.d.ts +2 -0
  152. package/dist/components/progress/progress.js +2 -0
  153. package/dist/components/radio/radio.d.ts +2 -0
  154. package/dist/components/radio/radio.js +2 -0
  155. package/dist/components/radio-item/radio-item.d.ts +2 -0
  156. package/dist/components/radio-item/radio-item.js +2 -0
  157. package/dist/components/random-content/random-content.d.ts +2 -0
  158. package/dist/components/random-content/random-content.js +2 -0
  159. package/dist/components/rating/rating.d.ts +2 -0
  160. package/dist/components/rating/rating.js +2 -0
  161. package/dist/components/resize-observer/resize-observer.d.ts +2 -0
  162. package/dist/components/resize-observer/resize-observer.js +2 -0
  163. package/dist/components/scroll-area/scroll-area.d.ts +2 -0
  164. package/dist/components/scroll-area/scroll-area.js +2 -0
  165. package/dist/components/scroller/scroller.d.ts +2 -0
  166. package/dist/components/scroller/scroller.js +2 -0
  167. package/dist/components/search-list/search-list.d.ts +2 -0
  168. package/dist/components/search-list/search-list.js +2 -0
  169. package/dist/components/select/select.d.ts +2 -0
  170. package/dist/components/select/select.js +2 -0
  171. package/dist/components/selection-summary/selection-summary.d.ts +2 -0
  172. package/dist/components/selection-summary/selection-summary.js +2 -0
  173. package/dist/components/share/share.d.ts +2 -0
  174. package/dist/components/share/share.js +2 -0
  175. package/dist/components/slide-activator/slide-activator.d.ts +2 -0
  176. package/dist/components/slide-activator/slide-activator.js +2 -0
  177. package/dist/components/slider/slider.d.ts +2 -0
  178. package/dist/components/slider/slider.js +2 -0
  179. package/dist/components/sparkline/sparkline.d.ts +2 -0
  180. package/dist/components/sparkline/sparkline.js +2 -0
  181. package/dist/components/spinner/spinner.d.ts +2 -0
  182. package/dist/components/spinner/spinner.js +2 -0
  183. package/dist/components/splitter/splitter.d.ts +2 -0
  184. package/dist/components/splitter/splitter.js +2 -0
  185. package/dist/components/switch/switch.d.ts +2 -0
  186. package/dist/components/switch/switch.js +2 -0
  187. package/dist/components/tab/tab.d.ts +2 -0
  188. package/dist/components/tab/tab.js +2 -0
  189. package/dist/components/tab-list/tab-list.d.ts +2 -0
  190. package/dist/components/tab-list/tab-list.js +2 -0
  191. package/dist/components/tab-panel/tab-panel.d.ts +2 -0
  192. package/dist/components/tab-panel/tab-panel.js +2 -0
  193. package/dist/components/text-area/text-area.d.ts +2 -0
  194. package/dist/components/text-area/text-area.js +2 -0
  195. package/dist/components/text-field/text-field.d.ts +2 -0
  196. package/dist/components/text-field/text-field.js +2 -0
  197. package/dist/components/text-mask/text-mask.d.ts +2 -0
  198. package/dist/components/text-mask/text-mask.js +2 -0
  199. package/dist/components/timed-content/timed-content.d.ts +2 -0
  200. package/dist/components/timed-content/timed-content.js +2 -0
  201. package/dist/components/toast/toast.d.ts +2 -0
  202. package/dist/components/toast/toast.js +2 -0
  203. package/dist/components/toast-item/toast-item.d.ts +2 -0
  204. package/dist/components/toast-item/toast-item.js +2 -0
  205. package/dist/components/toggle-icon/toggle-icon.d.ts +2 -0
  206. package/dist/components/toggle-icon/toggle-icon.js +2 -0
  207. package/dist/components/toggle-tag/toggle-tag.d.ts +2 -0
  208. package/dist/components/toggle-tag/toggle-tag.js +2 -0
  209. package/dist/components/toolbar/toolbar.d.ts +2 -0
  210. package/dist/components/toolbar/toolbar.js +2 -0
  211. package/dist/components/tooltip/tooltip.d.ts +2 -0
  212. package/dist/components/tooltip/tooltip.js +2 -0
  213. package/dist/components/transition-group/transition-group.d.ts +2 -0
  214. package/dist/components/transition-group/transition-group.js +2 -0
  215. package/dist/components/zoomable-frame/zoomable-frame.d.ts +2 -0
  216. package/dist/components/zoomable-frame/zoomable-frame.js +2 -0
  217. package/dist/copy-CvC9vaGw.d.ts +206 -0
  218. package/dist/copy.styles-DWGvGNTP.js +100 -0
  219. package/dist/data-table-CITa8DSn.js +247 -0
  220. package/dist/data-table-DL5RhE0d.d.ts +89 -0
  221. package/dist/date-CJPmOdi9.js +146 -0
  222. package/dist/date-DtaTBM71.d.ts +142 -0
  223. package/dist/decorate-DcF3lt7P.js +9 -0
  224. package/dist/dialog-Cx46HMaZ.js +983 -0
  225. package/dist/dialog-N-v0woIy.d.ts +414 -0
  226. package/dist/divider-9vNsfHW8.js +169 -0
  227. package/dist/divider-DWuAxcXv.d.ts +79 -0
  228. package/dist/docs/custom-elements.json +29301 -0
  229. package/dist/dropdown-BXSKpVX9.js +1123 -0
  230. package/dist/dropdown-Bo00Vlr5.d.ts +537 -0
  231. package/dist/dropdown-item-_lIs-Tfd.d.ts +111 -0
  232. package/dist/dropdown-item-i77cRuN6.js +504 -0
  233. package/dist/empty-result-B2ln1yFL.js +65 -0
  234. package/dist/empty-result-B54x_Ab2.d.ts +31 -0
  235. package/dist/empty-state-BLWjtKUo.js +186 -0
  236. package/dist/empty-state-SGKjpwp3.d.ts +117 -0
  237. package/dist/expander-BUev0BmM.d.ts +174 -0
  238. package/dist/expander-Bwvxj6Oa.js +342 -0
  239. package/dist/field-BEyS909F.js +163 -0
  240. package/dist/field-ITx0jVw-.d.ts +69 -0
  241. package/dist/file-input-BEumLJjg.js +841 -0
  242. package/dist/file-input-D2D6YC0B.d.ts +378 -0
  243. package/dist/filter-bar-Bj2QzEn9.d.ts +35 -0
  244. package/dist/filter-bar-Dcs67aXo.js +66 -0
  245. package/dist/form-section-BchPetkj.js +83 -0
  246. package/dist/form-section-xFBTBULQ.d.ts +34 -0
  247. package/dist/icon-BPVkNsY4.js +165 -0
  248. package/dist/icon-Ci9CPZJV.d.ts +72 -0
  249. package/dist/icon-library-D_if7p2h.d.ts +2 -0
  250. package/dist/include-CQHVVtNs.d.ts +103 -0
  251. package/dist/include-qNUh_6kT.js +155 -0
  252. package/dist/index.d.ts +89 -0
  253. package/dist/index.js +92 -0
  254. package/dist/infinite-scroller-BmmtnWNt.js +285 -0
  255. package/dist/infinite-scroller-CuUEAlB9.d.ts +174 -0
  256. package/dist/intersection-observer-B6TciOAQ.js +503 -0
  257. package/dist/intersection-observer-B7nmP7Zz.d.ts +418 -0
  258. package/dist/listbox-C3XXRWGX.js +1257 -0
  259. package/dist/listbox-DD4ujIJe.d.ts +682 -0
  260. package/dist/listbox-item-CwD9s3VY.js +135 -0
  261. package/dist/listbox-item-DQEJWp4Z.d.ts +53 -0
  262. package/dist/localize-322EtXNX.d.ts +66 -0
  263. package/dist/lorem-ipsum-B2x3V-v8.js +198 -0
  264. package/dist/lorem-ipsum-CR82CSuJ.d.ts +130 -0
  265. package/dist/meter-BC7uaJWf.d.ts +73 -0
  266. package/dist/meter-BIDyjwFp.js +155 -0
  267. package/dist/metric-CjlLq_VA.d.ts +36 -0
  268. package/dist/metric-DbuOcDp_.js +86 -0
  269. package/dist/metric-grid-C2Pb0Zl3.js +37 -0
  270. package/dist/metric-grid-C5Xbb1_0.d.ts +27 -0
  271. package/dist/mutation-observer-BmrZ-GER.d.ts +326 -0
  272. package/dist/mutation-observer-DS8EBuOp.js +388 -0
  273. package/dist/navicon-Dic5Qjzb.d.ts +159 -0
  274. package/dist/navicon-_yMHY27-.js +486 -0
  275. package/dist/number-BNtNXNF3.js +162 -0
  276. package/dist/number-BwbnErlB.d.ts +143 -0
  277. package/dist/number-field-BQHB7UYo.js +726 -0
  278. package/dist/number-field-odk4lKXM.d.ts +422 -0
  279. package/dist/pagination-6z2qcf3U.d.ts +322 -0
  280. package/dist/pagination-DuKPuzdb.js +679 -0
  281. package/dist/popover-D0sxTU6o.d.ts +259 -0
  282. package/dist/popover-DJBrJ0za.js +556 -0
  283. package/dist/preview-card-C7H1FPfd.js +287 -0
  284. package/dist/preview-card-DitOCZTD.d.ts +86 -0
  285. package/dist/progress-Db0_axHQ.d.ts +181 -0
  286. package/dist/progress-DzVk260j.js +494 -0
  287. package/dist/radio-BtDG9xJM.js +658 -0
  288. package/dist/radio-CieMa4zU.d.ts +460 -0
  289. package/dist/radio-item-DIrUStAX.js +264 -0
  290. package/dist/radio-item-Xq2U3cMu.d.ts +69 -0
  291. package/dist/random-content-BhSeJFKz.d.ts +380 -0
  292. package/dist/random-content-BwiirXdG.js +450 -0
  293. package/dist/rating-4xNsWumY.d.ts +369 -0
  294. package/dist/rating-C1BcJDIO.js +722 -0
  295. package/dist/resize-observer-BseSbVWP.d.ts +187 -0
  296. package/dist/resize-observer-DcrLhddo.js +236 -0
  297. package/dist/scroll-area-COc1857S.js +127 -0
  298. package/dist/scroll-area-CVYDf5qY.d.ts +61 -0
  299. package/dist/scroller-LYgBVyfY.js +590 -0
  300. package/dist/scroller-bB2rGs7b.d.ts +374 -0
  301. package/dist/search-list-Clmrg8EV.js +884 -0
  302. package/dist/search-list-n0GYO7rh.d.ts +777 -0
  303. package/dist/select-CkZK2jJn.d.ts +506 -0
  304. package/dist/select-DLIaRnA4.js +690 -0
  305. package/dist/selection-summary-BVnNJ8Lw.js +48 -0
  306. package/dist/selection-summary-DmFkGyZI.d.ts +34 -0
  307. package/dist/share-DPlqP2dc.d.ts +162 -0
  308. package/dist/share-bsgXZCl7.js +250 -0
  309. package/dist/sigvelo.d.ts +5 -0
  310. package/dist/sigvelo.js +5 -0
  311. package/dist/sigvelo.loader.d.ts +3 -0
  312. package/dist/sigvelo.loader.js +102 -0
  313. package/dist/slide-activator-D7bBz69E.d.ts +429 -0
  314. package/dist/slide-activator-DlxQt9R9.js +798 -0
  315. package/dist/slider-B0FVsV1o.d.ts +921 -0
  316. package/dist/slider-B90Il7x3.js +1744 -0
  317. package/dist/sparkline-CcpTaJ_Z.js +358 -0
  318. package/dist/sparkline-DlCIt81-.d.ts +235 -0
  319. package/dist/spinner-C04Dmc0H.js +188 -0
  320. package/dist/spinner-CZ19x_dC.d.ts +99 -0
  321. package/dist/splitter-DBDJAzsp.d.ts +325 -0
  322. package/dist/splitter-MnD4In9H.js +638 -0
  323. package/dist/switch-CPaEKbog.js +581 -0
  324. package/dist/switch-Cief9M59.d.ts +248 -0
  325. package/dist/tab-BcqYGsuW.d.ts +44 -0
  326. package/dist/tab-C-FtuNmh.js +102 -0
  327. package/dist/tab-list-B_Ye_Oj9.js +691 -0
  328. package/dist/tab-list-DDvS8qHr.d.ts +450 -0
  329. package/dist/tab-panel-BaBl6eep.js +60 -0
  330. package/dist/tab-panel-BzSJlSfd.d.ts +38 -0
  331. package/dist/text-area-B_mjCE9W.d.ts +327 -0
  332. package/dist/text-area-Czixaz-_.js +556 -0
  333. package/dist/text-field-BClWMp6q.d.ts +424 -0
  334. package/dist/text-field-inpJfp0A.js +687 -0
  335. package/dist/text-mask-CNKVKSFp.d.ts +336 -0
  336. package/dist/text-mask-DDEurj90.js +370 -0
  337. package/dist/themes/sigvelo.css +10 -0
  338. package/dist/themes/utilities.css +9 -0
  339. package/dist/timed-content-D2mGFamc.d.ts +181 -0
  340. package/dist/timed-content-pvEP4l5V.js +226 -0
  341. package/dist/toast-BnZaIg6Z.js +636 -0
  342. package/dist/toast-cEBVK9NQ.d.ts +487 -0
  343. package/dist/toast-item-BPpJT6vD.d.ts +159 -0
  344. package/dist/toast-item-IS8IFUEg.js +372 -0
  345. package/dist/toggle-icon-4oLDeEt4.js +752 -0
  346. package/dist/toggle-icon-DlwMMWZL.d.ts +359 -0
  347. package/dist/toggle-tag-1sfTFJtg.js +434 -0
  348. package/dist/toggle-tag-IVvMGT4R.d.ts +245 -0
  349. package/dist/toolbar-CABq0ZL1.d.ts +122 -0
  350. package/dist/toolbar-CEZ0-F-X.js +196 -0
  351. package/dist/tooltip-DbyoPFNe.js +521 -0
  352. package/dist/tooltip-ahFthek8.d.ts +192 -0
  353. package/dist/transition-group-3hnAnwSd.js +801 -0
  354. package/dist/transition-group-DD_CjSNC.d.ts +608 -0
  355. package/dist/translations/en.d.ts +6 -0
  356. package/dist/translations/en.js +75 -0
  357. package/dist/translations/es.d.ts +6 -0
  358. package/dist/translations/es.js +75 -0
  359. package/dist/types/custom-element-jsx.d.ts +13723 -0
  360. package/dist/utilities/icon-library.d.ts +3 -0
  361. package/dist/utilities/icon-library.js +93 -0
  362. package/dist/utilities/localize.d.ts +2 -0
  363. package/dist/utilities/localize.js +6 -0
  364. package/dist/zoomable-frame-Cldvj5sE.js +398 -0
  365. package/dist/zoomable-frame-r6S6587z.d.ts +162 -0
  366. package/package.json +83 -0
@@ -0,0 +1,983 @@
1
+ import { Localize } from "./utilities/localize.js";
2
+ import { t as __decorate } from "./decorate-DcF3lt7P.js";
3
+ import { css, html, nothing } from "lit";
4
+ import { property, query } from "lit/decorators.js";
5
+ import hostStyles from "@mcp-b/wc-support/styles/host.styles";
6
+ import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
7
+ import { classMap } from "lit/directives/class-map.js";
8
+ import { animateWithClass } from "@mcp-b/wc-support/utilities/animate";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ import { SigveloBeforeCloseEvent, SigveloBeforeOpenEvent, SigveloCloseEvent, SigveloOpenEvent } from "@mcp-b/wc-support/events/open-close";
11
+ import { parseDelimitedTokens } from "@mcp-b/wc-support/utilities/parse";
12
+ import { stripElementPrefix } from "@mcp-b/wc-support/prefix";
13
+ import { lockScrolling, unlockScrolling } from "@mcp-b/wc-support/utilities/scroll";
14
+ //#region src/components/dialog/dialog.styles.ts
15
+ var dialog_styles_default = css`
16
+ :host {
17
+ --width: 30rem;
18
+ --height: fit-content;
19
+ --show-duration: var(--sigvelo-motion-duration-interaction);
20
+ --spacing: 1.5em;
21
+
22
+ display: none;
23
+ }
24
+
25
+ :host(:state(open)) {
26
+ display: block;
27
+ }
28
+
29
+ #dialog {
30
+ display: flex;
31
+ position: fixed;
32
+ flex-direction: column;
33
+ width: var(--width);
34
+ height: var(--height);
35
+ inset-block-end: 0;
36
+ inset-block-start: 0;
37
+ padding: 0;
38
+ border: none;
39
+ border-radius: var(--sigvelo-radius-md);
40
+ background: var(--sigvelo-color-canvas);
41
+ box-shadow: var(--sigvelo-elevation-overlay);
42
+
43
+ &::backdrop {
44
+ backdrop-filter: var(--sigvelo-glass-filter);
45
+ -webkit-backdrop-filter: var(--sigvelo-glass-filter, blur(6px));
46
+ /*
47
+ NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
48
+ remove the fallback values here.
49
+ */
50
+ background-color: var(--sigvelo-color-backdrop, rgb(0 0 0 / 0.25));
51
+ }
52
+
53
+ &:focus,
54
+ &:focus-visible {
55
+ outline: none;
56
+ }
57
+
58
+ /* Shake animation */
59
+ &.shake {
60
+ animation: shake 1000ms ease;
61
+ }
62
+
63
+ &.pulse {
64
+ --pulse-size: 1.01;
65
+ animation: pulse var(--sigvelo-motion-duration-presence) ease;
66
+ }
67
+
68
+ /* Center placement */
69
+ &[data-placement="center"] {
70
+ --pulse-size: 1.02;
71
+ max-width: calc(100dvw - 2rem);
72
+ max-height: calc(100dvh - 2rem);
73
+
74
+ &.show {
75
+ animation: show-from-center var(--show-duration) ease;
76
+
77
+ &::backdrop {
78
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
79
+ ease;
80
+ }
81
+ }
82
+
83
+ &.hide {
84
+ animation: show-from-center var(--show-duration) ease reverse;
85
+
86
+ &::backdrop {
87
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
88
+ ease reverse;
89
+ }
90
+ }
91
+ }
92
+
93
+ /* Top placement */
94
+ &[data-placement="top"] {
95
+ width: 100dvw;
96
+ max-width: 100dvw;
97
+ max-height: 100dvh;
98
+ inset-block-end: auto;
99
+ inset-block-start: 0;
100
+ inset-inline-end: 0;
101
+ inset-inline-start: 0;
102
+ border-radius: 0;
103
+
104
+ &.show {
105
+ animation: show-from-top var(--show-duration) ease;
106
+
107
+ &::backdrop {
108
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
109
+ ease;
110
+ }
111
+ }
112
+
113
+ &.hide {
114
+ animation: show-from-top var(--show-duration) ease reverse;
115
+
116
+ &::backdrop {
117
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
118
+ ease reverse;
119
+ }
120
+ }
121
+ }
122
+
123
+ /* Bottom placement */
124
+ &[data-placement="bottom"] {
125
+ width: 100dvw;
126
+ max-width: 100dvw;
127
+ max-height: 100dvh;
128
+ inset-block-end: 0;
129
+ inset-block-start: auto;
130
+ inset-inline-end: 0;
131
+ inset-inline-start: 0;
132
+ border-radius: 0;
133
+
134
+ &.show {
135
+ animation: show-from-bottom var(--show-duration) ease;
136
+
137
+ &::backdrop {
138
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
139
+ ease;
140
+ }
141
+ }
142
+
143
+ &.hide {
144
+ animation: show-from-bottom var(--show-duration) ease reverse;
145
+
146
+ &::backdrop {
147
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
148
+ ease reverse;
149
+ }
150
+ }
151
+ }
152
+
153
+ /* Start placement */
154
+ &[data-placement="start"] {
155
+ max-width: 100dvw;
156
+ height: 100dvh;
157
+ max-height: none;
158
+ inset-block-end: 0;
159
+ inset-block-start: 0;
160
+ inset-inline-end: auto;
161
+ inset-inline-start: 0;
162
+ border-radius: 0;
163
+
164
+ &.show {
165
+ animation: show-from-left var(--show-duration) ease;
166
+
167
+ &:dir(rtl) {
168
+ animation-name: show-from-right;
169
+ }
170
+
171
+ &::backdrop {
172
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
173
+ ease;
174
+ }
175
+ }
176
+
177
+ &.hide {
178
+ animation: show-from-left var(--show-duration) ease reverse;
179
+
180
+ &:dir(rtl) {
181
+ animation-name: show-from-right;
182
+ }
183
+
184
+ &::backdrop {
185
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
186
+ ease reverse;
187
+ }
188
+ }
189
+ }
190
+
191
+ /* End placement */
192
+ &[data-placement="end"] {
193
+ max-width: 100dvw;
194
+ height: 100dvh;
195
+ max-height: none;
196
+ inset-block-end: 0;
197
+ inset-block-start: 0;
198
+ inset-inline-end: 0;
199
+ inset-inline-start: auto;
200
+ border-radius: 0;
201
+
202
+ &.show {
203
+ animation: show-from-right var(--show-duration) ease;
204
+
205
+ &:dir(rtl) {
206
+ animation-name: show-from-left;
207
+ }
208
+
209
+ &::backdrop {
210
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
211
+ ease;
212
+ }
213
+ }
214
+
215
+ &.hide {
216
+ animation: show-from-right var(--show-duration) ease reverse;
217
+
218
+ &:dir(rtl) {
219
+ animation-name: show-from-left;
220
+ }
221
+
222
+ &::backdrop {
223
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
224
+ ease reverse;
225
+ }
226
+ }
227
+ }
228
+
229
+ /* Full placement */
230
+ &[data-placement="full"] {
231
+ width: 100dvw;
232
+ max-width: 100dvw;
233
+ height: 100dvh;
234
+ max-height: 100dvh;
235
+ inset: 0;
236
+ border-radius: 0;
237
+
238
+ &.show {
239
+ animation: show-from-center var(--show-duration) ease;
240
+
241
+ &::backdrop {
242
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
243
+ ease;
244
+ }
245
+ }
246
+
247
+ &.hide {
248
+ animation: show-from-center var(--show-duration) ease reverse;
249
+
250
+ &::backdrop {
251
+ animation: show-backdrop var(--show-duration, var(--sigvelo-motion-duration-presence))
252
+ ease reverse;
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ /* Header */
259
+ #header {
260
+ display: flex;
261
+ flex-wrap: wrap;
262
+ align-items: center;
263
+ padding-inline-start: var(--spacing);
264
+ padding-inline-end: calc(
265
+ var(--spacing) / 2
266
+ ); /* less spacing to better align buttons as actions */
267
+ padding-block-start: calc(var(--spacing) / 2);
268
+ padding-block-end: calc(var(--spacing) / 2);
269
+ gap: calc(var(--spacing) / 4);
270
+ background: var(--sigvelo-color-canvas);
271
+ }
272
+
273
+ #actions {
274
+ display: flex;
275
+ flex-wrap: wrap;
276
+ margin-inline-start: auto;
277
+ }
278
+
279
+ /* Body */
280
+ #body {
281
+ flex: 1 1 auto;
282
+ padding-inline: var(--spacing);
283
+ padding-block: calc(var(--spacing) / 2);
284
+ overflow: auto;
285
+ scrollbar-color: var(--sigvelo-color-neutral-bg) transparent;
286
+ scrollbar-width: thin;
287
+ }
288
+
289
+ /* Normalize spacing when the header and footer are absent */
290
+ #dialog:not(.has-header) #body {
291
+ padding-block-start: var(--spacing);
292
+ }
293
+
294
+ #dialog:not(.has-footer) #body {
295
+ padding-block-end: var(--spacing);
296
+ }
297
+
298
+ /* Footer */
299
+ #footer {
300
+ display: flex;
301
+ flex-wrap: wrap;
302
+ align-items: center;
303
+ justify-content: end;
304
+ padding-inline: var(--spacing);
305
+ padding-block: var(--spacing);
306
+ gap: calc(var(--spacing) / 4);
307
+ background: var(--sigvelo-color-canvas);
308
+ }
309
+
310
+ @keyframes show-from-center {
311
+ from {
312
+ scale: 0.9;
313
+ opacity: 0;
314
+ }
315
+ to {
316
+ scale: 1;
317
+ opacity: 1;
318
+ }
319
+ }
320
+
321
+ @keyframes show-from-top {
322
+ from {
323
+ translate: 0 -75%;
324
+ opacity: 0;
325
+ }
326
+ to {
327
+ translate: 0 0;
328
+ opacity: 1;
329
+ }
330
+ }
331
+
332
+ @keyframes show-from-bottom {
333
+ from {
334
+ translate: 0 75%;
335
+ opacity: 0;
336
+ }
337
+ to {
338
+ translate: 0 0;
339
+ opacity: 1;
340
+ }
341
+ }
342
+
343
+ @keyframes show-from-left {
344
+ from {
345
+ translate: -75%;
346
+ opacity: 0;
347
+ }
348
+ to {
349
+ translate: 0 0;
350
+ opacity: 1;
351
+ }
352
+ }
353
+
354
+ @keyframes show-from-right {
355
+ from {
356
+ translate: 75%;
357
+ opacity: 0;
358
+ }
359
+ to {
360
+ translate: 0 0;
361
+ opacity: 1;
362
+ }
363
+ }
364
+
365
+ @keyframes show-backdrop {
366
+ from {
367
+ opacity: 0;
368
+ }
369
+ to {
370
+ opacity: 1;
371
+ }
372
+ }
373
+
374
+ @keyframes pulse {
375
+ 0% {
376
+ scale: 1;
377
+ }
378
+ 50% {
379
+ scale: var(--pulse-size);
380
+ }
381
+ 100% {
382
+ scale: 1;
383
+ }
384
+ }
385
+
386
+ @keyframes shake {
387
+ 0% {
388
+ -webkit-transform: translateX(0);
389
+ }
390
+ 10% {
391
+ -webkit-transform: translateX(2%);
392
+ }
393
+ 20% {
394
+ -webkit-transform: translateX(-2%);
395
+ }
396
+ 30% {
397
+ -webkit-transform: translateX(2%);
398
+ }
399
+ 40% {
400
+ -webkit-transform: translateX(-2%);
401
+ }
402
+ 50% {
403
+ -webkit-transform: translateX(2%);
404
+ }
405
+ 60% {
406
+ -webkit-transform: translateX(0);
407
+ }
408
+ }
409
+ `;
410
+ //#endregion
411
+ //#region src/components/dialog/dialog.ts
412
+ function setDialogTriggerAttributes(trigger, id, open) {
413
+ if (open === null) {
414
+ trigger.removeAttribute("aria-haspopup");
415
+ trigger.removeAttribute("aria-controls");
416
+ trigger.removeAttribute("aria-expanded");
417
+ return;
418
+ }
419
+ trigger.setAttribute("aria-haspopup", "dialog");
420
+ trigger.setAttribute("aria-controls", id);
421
+ trigger.setAttribute("aria-expanded", String(open));
422
+ }
423
+ function syncDialogTriggers(owner, open) {
424
+ if (!owner.id) return;
425
+ const root = owner.getRootNode();
426
+ for (const trigger of root.querySelectorAll("[data-dialog]")) {
427
+ const [command, id] = parseDelimitedTokens(trigger.getAttribute("data-dialog") || "");
428
+ if (command !== "open" || id !== owner.id) continue;
429
+ setDialogTriggerAttributes(trigger, owner.id, open);
430
+ if (stripElementPrefix(trigger.localName) === "button") customElements.whenDefined("sigvelo-button").then(async () => {
431
+ await trigger.updateComplete;
432
+ const nativeButton = trigger.shadowRoot?.querySelector("button");
433
+ if (nativeButton) {
434
+ const currentOpen = open === null ? null : Boolean(owner.open);
435
+ setDialogTriggerAttributes(nativeButton, owner.id, currentOpen);
436
+ }
437
+ });
438
+ }
439
+ }
440
+ /**
441
+ * <sigvelo-dialog>
442
+ *
443
+ * @summary Displays modal content for alerts, confirmations, configurations, and other important interactions that
444
+ * @tag sigvelo-dialog
445
+ * require immediate attention.
446
+ * @documentation https://design-system.sigvelo.com/docs/components/dialog
447
+ * @status stable
448
+ * @since 1.0
449
+ *
450
+ * @slot - Content to place in the dialog's body. Note that, due to [this Chrome bug](https://issues.chromium.org/issues/40800208),
451
+ * you should wrap text nodes in an element to allow text selection in that browser.
452
+ * @slot header - Content to place in the dialog's header.
453
+ * @slot description - A concise description of the dialog's purpose, associated with the dialog for assistive technology.
454
+ * @slot actions - Slot in one or more text buttons to customize the actions that appear in the dialog's header. Only
455
+ * available when the header is enabled.
456
+ * @slot footer - Content to place in the dialog's footer.
457
+ *
458
+ * @event sigvelo-before-open - Emitted when the dialog is instructed to open but before it is shown. Calling
459
+ * `event.preventDefault()` will prevent the dialog from opening.
460
+ * @event sigvelo-open - Emitted after the dialog has been opened and the show animation has completed.
461
+ * @event sigvelo-before-close - Emitted when the dialog is dismissed. Calling `event.preventDefault()` will prevent the
462
+ * dialog from closing and show a brief animation.<br><br>You can check `event.detail.source` to see which element
463
+ * triggered the dialog to close, such as a button. If the source is the dialog itself, the user has pressed [[Escape]]
464
+ * or the dialog has been closed programmatically.
465
+ * @event sigvelo-close - Emitted after the dialog has been closed and the hide animation has completed.
466
+ *
467
+ * @cssproperty [--height=fit-content] - The default height of the dialog. Note that dialogs shrink to fit as necessary.
468
+ * @cssproperty [--show-duration=200ms] - The duration of the show/hide animation.
469
+ * @cssproperty [--spacing=1.5rem] - The spacing to use throughout the dialog.
470
+ * @cssproperty [--width=30rem] - The default width of the dialog. Note that dialogs shrink to fit as necessary.
471
+ *
472
+ * @csspart dialog - The internal `<dialog>` element.
473
+ * @csspart body - The container that wraps the dialog's body.
474
+ * @csspart header - The container that wraps the dialog's header. A flex container, by default.
475
+ * @csspart footer - The container that wraps the dialog's footer. A flex container, by default.
476
+ *
477
+ * @cssstate open - Applied when the dialog is open.
478
+ *
479
+ * @example Default
480
+ * ```html
481
+ * <sigvelo-dialog id="dialog__overview">
482
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
483
+ * Dialog
484
+ * </h3>
485
+ *
486
+ * <p>Curious cats explore every corner of their domain, gracefully leaping from windowsills to countertops, always seeking new adventures.</p>
487
+ *
488
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
489
+ * Close
490
+ * </sigvelo-button>
491
+ * </sigvelo-dialog>
492
+ *
493
+ * <sigvelo-button data-dialog="open dialog__overview">Show dialog</sigvelo-button>
494
+ * ```
495
+ *
496
+ * @example Opening and closing dialogs
497
+ * You can open and close a dialog programmatically by obtaining a reference to it and setting the `open` property to `true` or `false`, respectively.
498
+ *
499
+ * ```js
500
+ * const dialog = document.querySelector('sigvelo-dialog');
501
+ *
502
+ * // Open the dialog
503
+ * dialog.open = true;
504
+ *
505
+ * // Close the dialog
506
+ * dialog.open = false;
507
+ * ```
508
+ *
509
+ * However, it's often more convenient for a button to control the dialog _without_ additional scripting. In this case, you can add the `data-dialog="open *"` attribute to any button in the document, where `*` is the target dialog's `id`.
510
+ *
511
+ * Similarly, you can add `data-dialog="close"` to any button inside a dialog to close it.
512
+ *
513
+ * ```html
514
+ * <sigvelo-dialog id="dialog__opening">
515
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
516
+ * Opening and closing
517
+ * </h3>
518
+ *
519
+ * <p>The button you clicked has <code>data-dialog="open <em>id</em>"</code> so it opens the dialog that has a matching ID.</p>
520
+ * <p>The button below has <code>data-dialog="close"</code> so clicking it will close the dialog.</p>
521
+ *
522
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
523
+ * Close
524
+ * </sigvelo-button>
525
+ * </sigvelo-dialog>
526
+ *
527
+ * <sigvelo-button data-dialog="open dialog__opening">Show dialog</sigvelo-button>
528
+ * ```
529
+ *
530
+ * @example With header
531
+ * Place elements into the `header` slot to add content at the start of the dialog.
532
+ *
533
+ * ```html
534
+ * <sigvelo-dialog id="dialog__header">
535
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
536
+ * With header
537
+ * </h3>
538
+ *
539
+ * <p>A playful kitten chases a red laser dot across the room, pouncing with determination while its tail twitches with excitement.</p>
540
+ * </sigvelo-dialog>
541
+ *
542
+ * <sigvelo-button data-dialog="open dialog__header">Show dialog</sigvelo-button>
543
+ * ```
544
+ *
545
+ * @example With footer
546
+ * Place elements into the `footer` slot to add actions or other supplemental information at the end of the dialog.
547
+ *
548
+ * ```html
549
+ * <sigvelo-dialog id="dialog__footer">
550
+ * <p>Gentle purrs fill the room as a content cat naps in a warm sunbeam, dreaming of chasing butterflies in the garden.</p>
551
+ *
552
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
553
+ * Close
554
+ * </sigvelo-button>
555
+ * </sigvelo-dialog>
556
+ *
557
+ * <sigvelo-button data-dialog="open dialog__footer">Show dialog</sigvelo-button>
558
+ * ```
559
+ *
560
+ * @example Disabling light dismissal
561
+ * Clicking outside a dialog dismisses it by default. Set the `lightDismiss` property to `false` when an interaction must keep the dialog open until an explicit action is chosen.
562
+ *
563
+ * ```html
564
+ * <sigvelo-dialog id="dialog__light">
565
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
566
+ * Explicit dismissal
567
+ * </h3>
568
+ *
569
+ * <p>Clicking outside the dialog will keep it open.</p>
570
+ *
571
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
572
+ * Close
573
+ * </sigvelo-button>
574
+ * </sigvelo-dialog>
575
+ *
576
+ * <sigvelo-button data-dialog="open dialog__light">Show dialog</sigvelo-button>
577
+ *
578
+ * <script>
579
+ * document.getElementById('dialog__light').lightDismiss = false;
580
+ * <\/script>
581
+ * ```
582
+ *
583
+ *
584
+ * @example Customizing actions
585
+ * By default, a close button is provided as a single action in the dialog's header. You can add your own header actions by slotting text buttons into the `actions` slot. Note that adding your own actions will remove the default close button.
586
+ *
587
+ * ```html
588
+ * <sigvelo-dialog id="dialog__customizing">
589
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
590
+ * Actions
591
+ * </h3>
592
+ *
593
+ * <sigvelo-button slot="actions" variant="ghost" icon-label="Settings">
594
+ * <sigvelo-icon name="settings"></sigvelo-icon>
595
+ * </sigvelo-button>
596
+ *
597
+ * <sigvelo-button slot="actions" variant="ghost" icon-label="Open in a new window">
598
+ * <sigvelo-icon name="external-link"></sigvelo-icon>
599
+ * </sigvelo-button>
600
+ *
601
+ * <sigvelo-button slot="actions" variant="ghost" icon-label="Close" data-dialog="close">
602
+ * <sigvelo-icon name="x"></sigvelo-icon>
603
+ * </sigvelo-button>
604
+ *
605
+ * <p>Graceful cats leap through sunny windows. Their sleek whiskers twitch as they watch birds flutter past their perch.</p>
606
+ *
607
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
608
+ * Close
609
+ * </sigvelo-button>
610
+ * </sigvelo-dialog>
611
+ *
612
+ * <sigvelo-button data-dialog="open dialog__customizing">Show dialog</sigvelo-button>
613
+ * ```
614
+ *
615
+ * **Note:** The `actions` slot is only available when the header is enabled.
616
+ *
617
+ * @example Changing the placement
618
+ * By default, dialogs appear in the center of the screen. To make the dialog slide in from the side of the screen like a drawer, set the `placement` attribute to `start`, `end`, `top`, `bottom`, or `full`.
619
+ *
620
+ * ```html
621
+ * <sigvelo-dialog id="dialog__placement">
622
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
623
+ * Placement
624
+ * </h3>
625
+ *
626
+ * <p>Two mischievous cats prowl the kitchen countertops at midnight. Their glowing eyes search for forgotten treats and adventures.</p>
627
+ *
628
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
629
+ * Close
630
+ * </sigvelo-button>
631
+ * </sigvelo-dialog>
632
+ *
633
+ * <div style="display: flex; flex-wrap: wrap; gap: 0.25rem;">
634
+ * <sigvelo-button data-placement="start">Start</sigvelo-button>
635
+ * <sigvelo-button data-placement="end">End</sigvelo-button>
636
+ * <sigvelo-button data-placement="top">Top</sigvelo-button>
637
+ * <sigvelo-button data-placement="bottom">Bottom</sigvelo-button>
638
+ * <sigvelo-button data-placement="full">Full</sigvelo-button>
639
+ * </div>
640
+ *
641
+ * <script>
642
+ * const dialog = document.getElementById('dialog__placement');
643
+ * const container = dialog.nextElementSibling;
644
+ *
645
+ * container.addEventListener('click', event => {
646
+ * if (event.target.closest('sigvelo-button')) {
647
+ * dialog.placement = event.target.getAttribute('data-placement');
648
+ * dialog.open = true;
649
+ * }
650
+ * });
651
+ * <\/script>
652
+ * ```
653
+ *
654
+ * **Note:** The `--width` custom property has no effect on dialogs with `top` and `bottom` placements. Similarly, the `--height` custom property has no effect on dialogs with `start` and `end` placements. Neither have an effect on dialogs with the `full` placement.
655
+ *
656
+ * @example Changing the size
657
+ * The `--width` and `--height` custom properties control the default width and height of the dialog, respectively. On smaller screens, the dialog will shrink to fit the viewport.
658
+ *
659
+ * ```html
660
+ * <sigvelo-dialog id="dialog__width" style="--width: 800px;">
661
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
662
+ * Size
663
+ * </h3>
664
+ *
665
+ * <p>Lobortis feugiat vivamus at augue eget arcu dictum. Nulla at volutpat diam ut venenatis tellus in metus vulputate. Venenatis tellus in metus vulputate eu scelerisque felis.</p>
666
+ * <p>Et malesuada fames ac turpis egestas maecenas pharetra. Eu lobortis elementum nibh tellus molestie nunc. Nisl purus in mollis nunc sed id semper risus in. Ultricies mi quis hendrerit dolor magna eget. Venenatis cras sed felis eget velit aliquet sagittis.</p>
667
+ *
668
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
669
+ * Close
670
+ * </sigvelo-button>
671
+ * </sigvelo-dialog>
672
+ *
673
+ * <sigvelo-button data-dialog="open dialog__width">Show dialog</sigvelo-button>
674
+ * ```
675
+ *
676
+ * @example Scrolling dialogs
677
+ * Dialogs with overflowing content will expand as the viewport allows before scrolling. By design, the header and footer will remain visible so users don't get confused and have an easy way to exit the dialog.
678
+ *
679
+ * ```html
680
+ * <sigvelo-dialog id="dialog__scrolling" reset-scroll>
681
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
682
+ * The Chronicles of Cats
683
+ * </h3>
684
+ *
685
+ * <p>In the cozy corner of a sunlit room, a mysterious tabby cat named Shadow prowls with silent grace. Her whiskers twitch as she surveys her domain, a master of stealth and elegance. The morning light catches her fur, creating a mesmerizing dance of golden highlights across her perfectly groomed coat.</p>
686
+ * <p>Nearby, a mischievous kitten named Pixel bounces from cushion to cushion, defying gravity with each leap. His tiny paws barely touch one surface before he's airborne again, a blur of energy and enthusiasm. The curtains flutter in his wake, marking his path of playful destruction.</p>
687
+ * <p>In the kitchen windowsill, wise old Mr. Whiskers observes the garden with half-closed eyes. Birds flit past, catching his attention, but he merely twitches an ear – he's long past his bird-chasing days. Instead, he focuses on the important task of soaking up the warm sunshine, occasionally stretching out one paw in perfect contentment.</p>
688
+ * <p>Luna, the elegant Siamese, practices her opera on the highest shelf of the bookcase. Her melodious complaints about dinner being four hours away echo through the house. She's convinced that her humans simply don't understand the concept of proper feeding schedules – clearly, anytime is dinner time.</p>
689
+ * <p>Under the dining room table, partners in crime Socks and Mittens plot their next kitchen raid. Their synchronized tail swishes betray their excitement as they plan the optimal route to the treats stored in the highest cabinet. Their previous attempts may have failed, but cats are nothing if not persistent.</p>
690
+ * <p>Out in the garden, adventurous explorer Captain Whiskers maps uncharted territory behind the rose bushes. Each rustle of leaves could hide a potential adversary – or worse, a cucumber. He approaches each step with military precision, his battle-scarred ear twitching at every sound.</p>
691
+ * <p>Back inside, the newest family member, a tiny rescue named Pixel, discovers the joy of cardboard boxes. The expensive cat bed lies ignored as she claims a simple shipping box as her castle. Her purrs of contentment vibrate through the cardboard walls of her newfound kingdom.</p>
692
+ *
693
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
694
+ * Close
695
+ * </sigvelo-button>
696
+ * </sigvelo-dialog>
697
+ *
698
+ * <sigvelo-button data-dialog="open dialog__scrolling">Show dialog</sigvelo-button>
699
+ * ```
700
+ *
701
+ * **Note:** By default, dialogs will maintain their scroll position when closed. Use the `reset-scroll` attribute to tell the dialog to reset scrolling each time it's closed.
702
+ *
703
+ * @example Setting focus on open
704
+ * To move focus to a specific form control when the dialog opens, add the `autofocus` attribute to it.
705
+ *
706
+ * ```html
707
+ * <sigvelo-dialog id="dialog__focus">
708
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
709
+ * Autofocus
710
+ * </h3>
711
+ *
712
+ * <sigvelo-text-field autofocus placeholder="Enter something"></sigvelo-text-field>
713
+ *
714
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">Close</sigvelo-button>
715
+ * </sigvelo-dialog>
716
+ *
717
+ * <sigvelo-button data-dialog="open dialog__focus">Show dialog</sigvelo-button>
718
+ * ```
719
+ *
720
+ * @example Preventing the dialog from closing
721
+ * You can stop the dialog from closing by preventing the `sigvelo-before-close` event. The dialog will briefly animate to draw the user's attention.
722
+ *
723
+ * You can check `event.detail.source` to see which element triggered the dialog to close, such as a button. If the source is the dialog itself, you can assume that the user has pressed [[Escape]] or the dialog has been closed programmatically.
724
+ *
725
+ * ```html
726
+ * <sigvelo-dialog id="dialog__prevent">
727
+ * <h3 slot="header" style="font-size: 1.25rem; margin-block: 0;">
728
+ * Try closing me
729
+ * </h3>
730
+ *
731
+ * <p>Only clicking the last button will close this dialog. Not even the <kbd>Escape</kbd> key will save you!</p>
732
+ *
733
+ * <sigvelo-button slot="footer" data-dialog="close">
734
+ * I won't close it
735
+ * </sigvelo-button>
736
+ *
737
+ * <sigvelo-button slot="footer" data-dialog="close" color="primary">
738
+ * Only I will close it
739
+ * </sigvelo-button>
740
+ * </sigvelo-dialog>
741
+ *
742
+ * <sigvelo-button data-dialog="open dialog__prevent">Show dialog</sigvelo-button>
743
+ *
744
+ * <script>
745
+ * const dialog = document.getElementById('dialog__prevent');
746
+ * const closeButton = dialog.querySelector('sigvelo-button:last-of-type');
747
+ *
748
+ * dialog.addEventListener('sigvelo-before-close', event => {
749
+ * if (event.detail.source !== closeButton) {
750
+ * event.preventDefault();
751
+ * }
752
+ * });
753
+ * <\/script>
754
+ * ```
755
+ *
756
+ * **Note:** For best results, avoid using this feature unless something severe will result from the user not making an explicit choice, e.g. data loss.
757
+ *
758
+ * @example Styling dialogs
759
+ * Dialogs come with a simple, minimal appearance. Feel free to customize them with your own styles. Here's a quick way to turn a dialog into an action sheet that works great on mobile devices.
760
+ *
761
+ * ```html
762
+ * <sigvelo-dialog class="dialog__action-sheet" placement="bottom" id="dialog__styling">
763
+ * <sigvelo-button data-dialog="close" pill>Cancel</sigvelo-button>
764
+ * <sigvelo-button color="destructive" pill data-dialog="close">Delete</sigvelo-button>
765
+ * </sigvelo-dialog>
766
+ *
767
+ * <sigvelo-button color="destructive" data-dialog="open dialog__styling">Delete</sigvelo-button>
768
+ *
769
+ * <style>
770
+ * sigvelo-dialog.dialog__action-sheet::part(dialog) {
771
+ * background: transparent;
772
+ * box-shadow: none;
773
+ * }
774
+ *
775
+ * sigvelo-dialog.dialog__action-sheet::part(body) {
776
+ * display: flex;
777
+ * flex-direction: column;
778
+ * width: 100%;
779
+ * max-width: 500px;
780
+ * align-self: center;
781
+ * gap: 1rem;
782
+ * }
783
+ * </style>
784
+ * ```
785
+ *
786
+ * @example Using dialogs with top-layer elements
787
+ * This component uses the `<dialog>` element under the hood, which makes everything outside of it inert and blocks interaction with other top-layer elements such as popovers and toasts. The elements will be visible, but they cannot receive clicks or focus.
788
+ *
789
+ * One workaround is to place interactive top-layer elements _inside_ the dialog, which will prevent them from becoming inert when the dialog opens.
790
+ *
791
+ * ```html
792
+ * <sigvelo-dialog>
793
+ * ...
794
+ * <sigvelo-button id="my-popover">Show popover</sigvelo-button>
795
+ *
796
+ * <!-- This popover is inside the dialog and will be interactive -->
797
+ * <sigvelo-popover for="my-popover">
798
+ * ...
799
+ * </sigvelo-popover>
800
+ * </sigvelo-dialog>
801
+ * ```
802
+ */
803
+ var SigveloDialog = class extends SigveloElement {
804
+ constructor(..._args) {
805
+ super(..._args);
806
+ this.localize = new Localize(this);
807
+ this.open = false;
808
+ this.dialogRole = "dialog";
809
+ this.placement = "center";
810
+ this.lightDismiss = true;
811
+ this.resetScroll = false;
812
+ this.handleDocumentKeyDown = (event) => {
813
+ if (event.key === "Escape") {
814
+ event.preventDefault();
815
+ this.requestClose(this);
816
+ }
817
+ };
818
+ }
819
+ static {
820
+ this.observeSlots = true;
821
+ }
822
+ static {
823
+ this.styles = [hostStyles, dialog_styles_default];
824
+ }
825
+ /** @internal Keeps declarative dialog triggers synchronized with a dialog-like component. */
826
+ static syncTriggers(owner, open) {
827
+ syncDialogTriggers(owner, open);
828
+ }
829
+ firstUpdated() {
830
+ syncDialogTriggers(this, this.open);
831
+ }
832
+ disconnectedCallback() {
833
+ super.disconnectedCallback();
834
+ syncDialogTriggers(this, null);
835
+ document.removeEventListener("keydown", this.handleDocumentKeyDown);
836
+ }
837
+ updated(changedProperties) {
838
+ if (changedProperties.has("open")) {
839
+ if (this.open && !this.dialog.open) this.show();
840
+ else if (this.dialog.open) this.requestClose(this.dialog);
841
+ syncDialogTriggers(this, this.open);
842
+ }
843
+ }
844
+ handleDialogCancel(event) {
845
+ event.preventDefault();
846
+ if (!this.dialog.classList.contains("hide")) this.requestClose(this.dialog);
847
+ }
848
+ handleDialogClick(event) {
849
+ const button = event.target.closest("[data-dialog=\"close\"]");
850
+ if (button) {
851
+ event.stopPropagation();
852
+ this.requestClose(button);
853
+ }
854
+ }
855
+ handleDialogPointerDown(event) {
856
+ if (event.target === this.dialog) if (this.lightDismiss) this.requestClose(this.dialog);
857
+ else animateWithClass(this.dialog, "pulse");
858
+ }
859
+ /** Call this to show the dialog. */
860
+ async show() {
861
+ const openEvent = new SigveloBeforeOpenEvent();
862
+ this.dispatchEvent(openEvent);
863
+ if (openEvent.defaultPrevented) {
864
+ this.open = false;
865
+ return;
866
+ }
867
+ document.addEventListener("keydown", this.handleDocumentKeyDown);
868
+ lockScrolling(this.dialog);
869
+ this.dialog.showModal();
870
+ this.customStates.set("open", true);
871
+ requestAnimationFrame(() => {
872
+ const elementToFocus = this.querySelector("[autofocus]");
873
+ if (elementToFocus && typeof elementToFocus.focus === "function") elementToFocus.focus();
874
+ else this.dialog.focus();
875
+ });
876
+ await animateWithClass(this.dialog, "show");
877
+ this.dispatchEvent(new SigveloOpenEvent());
878
+ }
879
+ /** Call this to ask the dialog to close. */
880
+ async requestClose(source) {
881
+ const closeEvent = new SigveloBeforeCloseEvent({ source });
882
+ this.dispatchEvent(closeEvent);
883
+ if (closeEvent.defaultPrevented) {
884
+ this.open = true;
885
+ animateWithClass(this.dialog, "shake");
886
+ } else {
887
+ document.removeEventListener("keydown", this.handleDocumentKeyDown);
888
+ unlockScrolling(this.dialog);
889
+ await animateWithClass(this.dialog, "hide");
890
+ if (this.resetScroll) this.scrollBodyTo({
891
+ top: 0,
892
+ left: 0
893
+ });
894
+ this.dialog.close();
895
+ this.open = false;
896
+ this.customStates.set("open", false);
897
+ this.dispatchEvent(new SigveloCloseEvent());
898
+ }
899
+ }
900
+ /** Scrolls the dialog's body to the specified position. */
901
+ scrollBodyTo(options) {
902
+ this.body.scrollTo(options);
903
+ }
904
+ render() {
905
+ return html`
906
+ <dialog
907
+ id="dialog"
908
+ part="dialog"
909
+ role=${this.dialogRole}
910
+ aria-label=${ifDefined(this.label)}
911
+ aria-labelledby=${!this.label && this.slotsWithContent.has("header") ? "header" : nothing}
912
+ aria-describedby=${this.description || this.slotsWithContent.has("description") ? "description" : nothing}
913
+ class=${classMap({
914
+ "has-header": this.slotsWithContent.has("header"),
915
+ "has-footer": this.slotsWithContent.has("footer")
916
+ })}
917
+ data-placement=${this.placement}
918
+ @click=${this.handleDialogClick}
919
+ @pointerdown=${this.handleDialogPointerDown}
920
+ @cancel=${this.handleDialogCancel}
921
+ >
922
+ ${this.whenSlotted("header", html`
923
+ <header id="header" part="header">
924
+ <slot name="header"></slot>
925
+ <slot id="actions" name="actions">
926
+ <sigvelo-button
927
+ slot="header"
928
+ variant="ghost"
929
+ icon-label=${this.localize.term("close")}
930
+ data-dialog="close"
931
+ >
932
+ <sigvelo-icon library="system" name="x"></sigvelo-icon>
933
+ </sigvelo-button>
934
+ </slot>
935
+ </header>
936
+ `)}
937
+
938
+ <div id="body" part="body">
939
+ ${this.description || this.slotsWithContent.has("description") ? html`<div id="description" part="description">
940
+ <slot name="description">${this.description}</slot>
941
+ </div>` : nothing}
942
+ <slot></slot>
943
+ </div>
944
+
945
+ ${this.whenSlotted("footer", html` <footer id="footer" part="footer"><slot name="footer"></slot></footer> `)}
946
+ </dialog>
947
+ `;
948
+ }
949
+ };
950
+ __decorate([query("#body")], SigveloDialog.prototype, "body", void 0);
951
+ __decorate([query("#dialog")], SigveloDialog.prototype, "dialog", void 0);
952
+ __decorate([property({
953
+ type: Boolean,
954
+ reflect: true
955
+ })], SigveloDialog.prototype, "open", void 0);
956
+ __decorate([property()], SigveloDialog.prototype, "label", void 0);
957
+ __decorate([property()], SigveloDialog.prototype, "description", void 0);
958
+ __decorate([property({ attribute: false })], SigveloDialog.prototype, "dialogRole", void 0);
959
+ __decorate([property({ reflect: true })], SigveloDialog.prototype, "placement", void 0);
960
+ __decorate([property({
961
+ attribute: "light-dismiss",
962
+ type: Boolean
963
+ })], SigveloDialog.prototype, "lightDismiss", void 0);
964
+ __decorate([property({
965
+ attribute: "reset-scroll",
966
+ type: Boolean
967
+ })], SigveloDialog.prototype, "resetScroll", void 0);
968
+ document.addEventListener("click", (event) => {
969
+ const dialogAttrEl = event.target.closest("[data-dialog]");
970
+ if (dialogAttrEl instanceof Element) {
971
+ const [command, id] = parseDelimitedTokens(dialogAttrEl.getAttribute("data-dialog") || "");
972
+ if (command === "open" && id?.length) {
973
+ const dialog = dialogAttrEl.getRootNode().getElementById(id);
974
+ const componentName = stripElementPrefix(dialog?.localName);
975
+ if (dialog && (componentName === "dialog" || componentName === "alert-dialog")) dialog.open = true;
976
+ else console.warn(`A dialog with an ID of "${id}" could not be found in this document.`);
977
+ }
978
+ }
979
+ });
980
+ document.addEventListener("pointerdown", () => {});
981
+ customElements.define("sigvelo-dialog", SigveloDialog);
982
+ //#endregion
983
+ export { SigveloDialog as t };