@govbr-ds/webcomponents 2.1.0 → 2.1.1

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 (858) hide show
  1. package/cem/custom-elements.json +63 -63
  2. package/dist/cjs/app-globals-DcqHuMBv.js +9 -0
  3. package/dist/cjs/br-avatar.cjs.entry.js +248 -0
  4. package/dist/cjs/br-breadcrumb-item.cjs.entry.js +45 -0
  5. package/dist/cjs/br-breadcrumb.cjs.entry.js +443 -0
  6. package/dist/cjs/br-button_2.cjs.entry.js +280 -0
  7. package/dist/cjs/br-card.cjs.entry.js +111 -0
  8. package/dist/cjs/br-carousel-page.cjs.entry.js +80 -0
  9. package/dist/cjs/br-carousel.cjs.entry.js +565 -0
  10. package/dist/cjs/br-checkbox-group.cjs.entry.js +118 -0
  11. package/dist/cjs/br-checkbox.cjs.entry.js +288 -0
  12. package/dist/cjs/br-checkgroup.cjs.entry.js +20 -0
  13. package/dist/cjs/br-collapse_2.cjs.entry.js +683 -0
  14. package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +83 -0
  15. package/dist/cjs/br-cookiebar-group.cjs.entry.js +309 -0
  16. package/dist/cjs/br-cookiebar-header.cjs.entry.js +39 -0
  17. package/dist/cjs/br-cookiebar-link.cjs.entry.js +54 -0
  18. package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +70 -0
  19. package/dist/cjs/br-cookiebar-note.cjs.entry.js +25 -0
  20. package/dist/cjs/br-cookiebar.cjs.entry.js +758 -0
  21. package/dist/cjs/br-crumb.cjs.entry.js +51 -0
  22. package/dist/cjs/br-date-picker_3.cjs.entry.js +2446 -0
  23. package/dist/cjs/br-datetime-picker.cjs.entry.js +1887 -0
  24. package/dist/cjs/br-divider.cjs.entry.js +225 -0
  25. package/dist/cjs/br-dropdown_2.cjs.entry.js +1856 -0
  26. package/dist/cjs/br-footer-category.cjs.entry.js +102 -0
  27. package/dist/cjs/br-footer-item.cjs.entry.js +52 -0
  28. package/dist/cjs/br-footer-legal.cjs.entry.js +41 -0
  29. package/dist/cjs/br-footer-logo.cjs.entry.js +104 -0
  30. package/dist/cjs/br-footer-social.cjs.entry.js +71 -0
  31. package/dist/cjs/br-footer.cjs.entry.js +92 -0
  32. package/dist/cjs/br-header-function.cjs.entry.js +142 -0
  33. package/dist/cjs/br-header-link.cjs.entry.js +60 -0
  34. package/dist/cjs/br-header-list.cjs.entry.js +279 -0
  35. package/dist/cjs/br-header-logo.cjs.entry.js +177 -0
  36. package/dist/cjs/br-header.cjs.entry.js +642 -0
  37. package/dist/cjs/br-icon.cjs.entry.js +485 -0
  38. package/dist/cjs/br-input.cjs.entry.js +599 -0
  39. package/dist/cjs/br-item.cjs.entry.js +356 -0
  40. package/dist/cjs/br-link.cjs.entry.js +132 -0
  41. package/dist/cjs/br-loading.cjs.entry.js +505 -0
  42. package/dist/cjs/br-magic-button.cjs.entry.js +92 -0
  43. package/dist/cjs/br-menu-group.cjs.entry.js +23 -0
  44. package/dist/cjs/br-menu-header.cjs.entry.js +47 -0
  45. package/dist/cjs/br-menu-info.cjs.entry.js +38 -0
  46. package/dist/cjs/br-menu-item.cjs.entry.js +79 -0
  47. package/dist/cjs/br-menu-link.cjs.entry.js +55 -0
  48. package/dist/cjs/br-menu-list.cjs.entry.js +149 -0
  49. package/dist/cjs/br-menu-logo.cjs.entry.js +75 -0
  50. package/dist/cjs/br-menu-social.cjs.entry.js +65 -0
  51. package/dist/cjs/br-menu.cjs.entry.js +993 -0
  52. package/dist/cjs/br-modal.cjs.entry.js +496 -0
  53. package/dist/cjs/br-notification-body.cjs.entry.js +71 -0
  54. package/dist/cjs/br-notification-header.cjs.entry.js +48 -0
  55. package/dist/cjs/br-notification-item.cjs.entry.js +110 -0
  56. package/dist/cjs/br-notification.cjs.entry.js +334 -0
  57. package/dist/cjs/br-pagination.cjs.entry.js +884 -0
  58. package/dist/cjs/br-radio-group.cjs.entry.js +428 -0
  59. package/dist/cjs/br-radio.cjs.entry.js +357 -0
  60. package/dist/cjs/br-scrim.cjs.entry.js +1336 -0
  61. package/dist/cjs/br-select-input_3.cjs.entry.js +954 -0
  62. package/dist/cjs/br-sign-in.cjs.entry.js +125 -0
  63. package/dist/cjs/br-skip-link-item.cjs.entry.js +20 -0
  64. package/dist/cjs/br-skip-link.cjs.entry.js +362 -0
  65. package/dist/cjs/br-skiplink-item.cjs.entry.js +192 -0
  66. package/dist/cjs/br-slider.cjs.entry.js +688 -0
  67. package/dist/cjs/br-step_2.cjs.entry.js +628 -0
  68. package/dist/cjs/br-switch.cjs.entry.js +245 -0
  69. package/dist/cjs/br-tab-item.cjs.entry.js +185 -0
  70. package/dist/cjs/br-tab.cjs.entry.js +397 -0
  71. package/dist/cjs/br-table-body.cjs.entry.js +37 -0
  72. package/dist/cjs/br-table-cell.cjs.entry.js +184 -0
  73. package/dist/cjs/br-table-header-cell.cjs.entry.js +173 -0
  74. package/dist/cjs/br-table-header.cjs.entry.js +37 -0
  75. package/dist/cjs/br-table-row.cjs.entry.js +81 -0
  76. package/dist/cjs/br-table.cjs.entry.js +680 -0
  77. package/dist/cjs/br-tag.cjs.entry.js +494 -0
  78. package/dist/cjs/br-textarea.cjs.entry.js +306 -0
  79. package/dist/cjs/br-tooltip.cjs.entry.js +627 -0
  80. package/dist/cjs/br-upload.cjs.entry.js +582 -0
  81. package/dist/cjs/br-wizard-panel.cjs.entry.js +54 -0
  82. package/dist/cjs/br-wizard.cjs.entry.js +708 -0
  83. package/dist/cjs/breakpoint-observer-P8veqXg7.js +144 -0
  84. package/dist/cjs/clamp-Co_hWptd.js +25 -0
  85. package/dist/cjs/cookiebar.utils-CB1gQwZ4.js +18 -0
  86. package/dist/cjs/datetime-picker-constants-B5pWeOn1.js +3827 -0
  87. package/dist/cjs/event-CmVdNHxl.js +56 -0
  88. package/dist/cjs/floating-surface-dismiss-ccdiD0KF.js +63 -0
  89. package/dist/cjs/floating-ui-MBI1osio.js +136 -0
  90. package/dist/cjs/floating-ui.dom-BUSTaaxR.js +1715 -0
  91. package/dist/cjs/focus-DuywwJPR.js +30 -0
  92. package/dist/cjs/getNextElement-R9l3JtM9.js +31 -0
  93. package/dist/cjs/iconify-icon-DfODV9bf.js +2307 -0
  94. package/dist/cjs/id-CjRFMzf6.js +20 -0
  95. package/dist/cjs/index-C92n55ch.js +678 -0
  96. package/dist/cjs/index-CRdcutym.js +3287 -0
  97. package/dist/cjs/index.cjs.js +12 -0
  98. package/dist/cjs/isNil-DO5zWc3l.js +19 -0
  99. package/dist/cjs/isValid-Fu3kaWNn.js +3694 -0
  100. package/dist/cjs/loader.cjs.js +17 -0
  101. package/dist/cjs/native-dialog--Ewqm4w0.js +49 -0
  102. package/dist/cjs/navigation-AbzwcRCU.js +25 -0
  103. package/dist/cjs/parts-D5K3ae2C.js +19 -0
  104. package/dist/cjs/props-CScmBvKd.js +24 -0
  105. package/dist/cjs/raf-batcher-yc87a4dS.js +55 -0
  106. package/dist/cjs/slot-DAllytTj.js +48 -0
  107. package/dist/cjs/swipe-BU8_XE9f.js +345 -0
  108. package/dist/cjs/table-constants-BOPSay0B.js +183 -0
  109. package/dist/cjs/validator-CTCajtT9.js +123 -0
  110. package/dist/cjs/webcomponents.cjs.js +50 -0
  111. package/dist/collection/assets/icon-search.svg +6 -0
  112. package/dist/collection/assets/logo-negative.svg +1 -0
  113. package/dist/collection/assets/logo-positive.svg +1 -0
  114. package/dist/collection/assets/wc.svg +1 -0
  115. package/dist/collection/collection-manifest.json +113 -0
  116. package/dist/collection/components/avatar/avatar.css +1 -0
  117. package/dist/collection/components/avatar/avatar.js +589 -0
  118. package/dist/collection/components/avatar/avatar.types.js +1 -0
  119. package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +166 -0
  120. package/dist/collection/components/breadcrumb/breadcrumb.css +1 -0
  121. package/dist/collection/components/breadcrumb/breadcrumb.js +619 -0
  122. package/dist/collection/components/breadcrumb/breadcrumb.types.js +1 -0
  123. package/dist/collection/components/breadcrumb/crumb/crumb.js +175 -0
  124. package/dist/collection/components/button/button.css +1 -0
  125. package/dist/collection/components/button/button.js +546 -0
  126. package/dist/collection/components/button/button.types.js +1 -0
  127. package/dist/collection/components/card/card.css +1 -0
  128. package/dist/collection/components/card/card.js +225 -0
  129. package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -0
  130. package/dist/collection/components/carousel/carousel-page/carousel-page.js +195 -0
  131. package/dist/collection/components/carousel/carousel.css +1 -0
  132. package/dist/collection/components/carousel/carousel.js +1217 -0
  133. package/dist/collection/components/carousel/carousel.types.js +1 -0
  134. package/dist/collection/components/checkbox/checkbox.css +1 -0
  135. package/dist/collection/components/checkbox/checkbox.js +823 -0
  136. package/dist/collection/components/checkbox/checkbox.types.js +1 -0
  137. package/dist/collection/components/checkbox-group/checkbox-group.css +1 -0
  138. package/dist/collection/components/checkbox-group/checkbox-group.js +268 -0
  139. package/dist/collection/components/checkgroup/checkgroup.js +166 -0
  140. package/dist/collection/components/collapse/collapse.css +1 -0
  141. package/dist/collection/components/collapse/collapse.js +642 -0
  142. package/dist/collection/components/collapse/collapse.types.js +1 -0
  143. package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -0
  144. package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.js +529 -0
  145. package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -0
  146. package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.js +628 -0
  147. package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -0
  148. package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.js +165 -0
  149. package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -0
  150. package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +200 -0
  151. package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -0
  152. package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.js +100 -0
  153. package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -0
  154. package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.js +172 -0
  155. package/dist/collection/components/cookiebar/cookiebar.css +1 -0
  156. package/dist/collection/components/cookiebar/cookiebar.js +1419 -0
  157. package/dist/collection/components/cookiebar/cookiebar.types.js +1 -0
  158. package/dist/collection/components/cookiebar/cookiebar.utils.js +14 -0
  159. package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +94 -0
  160. package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +57 -0
  161. package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -0
  162. package/dist/collection/components/datetime-picker/date-picker/date-picker.js +913 -0
  163. package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +65 -0
  164. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -0
  165. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +825 -0
  166. package/dist/collection/components/datetime-picker/datetime-picker-constants.js +36 -0
  167. package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +112 -0
  168. package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +202 -0
  169. package/dist/collection/components/datetime-picker/datetime-picker.css +1 -0
  170. package/dist/collection/components/datetime-picker/datetime-picker.js +1925 -0
  171. package/dist/collection/components/datetime-picker/datetime-picker.types.js +1 -0
  172. package/dist/collection/components/datetime-picker/datetime-picker.utils.js +250 -0
  173. package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +13 -0
  174. package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -0
  175. package/dist/collection/components/datetime-picker/time-picker/time-picker.js +456 -0
  176. package/dist/collection/components/divider/divider.css +1 -0
  177. package/dist/collection/components/divider/divider.js +537 -0
  178. package/dist/collection/components/divider/divider.types.js +1 -0
  179. package/dist/collection/components/dropdown/dropdown.css +1 -0
  180. package/dist/collection/components/dropdown/dropdown.js +939 -0
  181. package/dist/collection/components/dropdown/dropdown.types.js +1 -0
  182. package/dist/collection/components/footer/footer-category/footer-category.css +1 -0
  183. package/dist/collection/components/footer/footer-category/footer-category.js +160 -0
  184. package/dist/collection/components/footer/footer-item/footer-item.css +1 -0
  185. package/dist/collection/components/footer/footer-item/footer-item.js +154 -0
  186. package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -0
  187. package/dist/collection/components/footer/footer-legal/footer-legal.js +75 -0
  188. package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -0
  189. package/dist/collection/components/footer/footer-logo/footer-logo.js +342 -0
  190. package/dist/collection/components/footer/footer-logo/footer-logo.types.js +1 -0
  191. package/dist/collection/components/footer/footer-social/footer-social.css +1 -0
  192. package/dist/collection/components/footer/footer-social/footer-social.js +239 -0
  193. package/dist/collection/components/footer/footer.css +1 -0
  194. package/dist/collection/components/footer/footer.js +245 -0
  195. package/dist/collection/components/footer/footer.types.js +1 -0
  196. package/dist/collection/components/global.types.js +1 -0
  197. package/dist/collection/components/header/header-function/header-function.css +1 -0
  198. package/dist/collection/components/header/header-function/header-function.js +311 -0
  199. package/dist/collection/components/header/header-link/header-link.css +1 -0
  200. package/dist/collection/components/header/header-link/header-link.js +189 -0
  201. package/dist/collection/components/header/header-list/header-list.css +1 -0
  202. package/dist/collection/components/header/header-list/header-list.js +452 -0
  203. package/dist/collection/components/header/header-logo/header-logo.css +1 -0
  204. package/dist/collection/components/header/header-logo/header-logo.js +420 -0
  205. package/dist/collection/components/header/header.css +1 -0
  206. package/dist/collection/components/header/header.js +1131 -0
  207. package/dist/collection/components/header/header.types.js +1 -0
  208. package/dist/collection/components/icon/default-icons-cache.js +233 -0
  209. package/dist/collection/components/icon/icon.css +1 -0
  210. package/dist/collection/components/icon/icon.js +598 -0
  211. package/dist/collection/components/icon/icon.types.js +1 -0
  212. package/dist/collection/components/icon/icon.utils.js +33 -0
  213. package/dist/collection/components/input/input.css +1 -0
  214. package/dist/collection/components/input/input.js +1642 -0
  215. package/dist/collection/components/input/input.types.js +1 -0
  216. package/dist/collection/components/item/item.css +1 -0
  217. package/dist/collection/components/item/item.js +906 -0
  218. package/dist/collection/components/item/item.types.js +1 -0
  219. package/dist/collection/components/link/link.css +1 -0
  220. package/dist/collection/components/link/link.js +698 -0
  221. package/dist/collection/components/list/list.css +1 -0
  222. package/dist/collection/components/list/list.js +728 -0
  223. package/dist/collection/components/loading/loading.css +1 -0
  224. package/dist/collection/components/loading/loading.js +1169 -0
  225. package/dist/collection/components/loading/loading.types.js +1 -0
  226. package/dist/collection/components/magic-button/magic-button.css +1 -0
  227. package/dist/collection/components/magic-button/magic-button.js +237 -0
  228. package/dist/collection/components/menu/menu-group/menu-group.css +1 -0
  229. package/dist/collection/components/menu/menu-group/menu-group.js +77 -0
  230. package/dist/collection/components/menu/menu-header/menu-header.css +1 -0
  231. package/dist/collection/components/menu/menu-header/menu-header.js +161 -0
  232. package/dist/collection/components/menu/menu-info/menu-info.css +1 -0
  233. package/dist/collection/components/menu/menu-info/menu-info.js +94 -0
  234. package/dist/collection/components/menu/menu-item/menu-item.css +1 -0
  235. package/dist/collection/components/menu/menu-item/menu-item.js +306 -0
  236. package/dist/collection/components/menu/menu-item/menu-item.types.js +1 -0
  237. package/dist/collection/components/menu/menu-link/menu-link.css +1 -0
  238. package/dist/collection/components/menu/menu-link/menu-link.js +259 -0
  239. package/dist/collection/components/menu/menu-list/menu-list.css +1 -0
  240. package/dist/collection/components/menu/menu-list/menu-list.js +311 -0
  241. package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -0
  242. package/dist/collection/components/menu/menu-logo/menu-logo.js +230 -0
  243. package/dist/collection/components/menu/menu-social/menu-social.css +1 -0
  244. package/dist/collection/components/menu/menu-social/menu-social.js +263 -0
  245. package/dist/collection/components/menu/menu.css +1 -0
  246. package/dist/collection/components/menu/menu.js +1372 -0
  247. package/dist/collection/components/menu/menu.types.js +1 -0
  248. package/dist/collection/components/menu/menu.utils.js +279 -0
  249. package/dist/collection/components/message/message.css +1 -0
  250. package/dist/collection/components/message/message.js +508 -0
  251. package/dist/collection/components/modal/modal.css +1 -0
  252. package/dist/collection/components/modal/modal.js +842 -0
  253. package/dist/collection/components/modal/modal.types.js +1 -0
  254. package/dist/collection/components/notification/notification-body/notification-body.css +1 -0
  255. package/dist/collection/components/notification/notification-body/notification-body.js +153 -0
  256. package/dist/collection/components/notification/notification-header/notification-header.css +1 -0
  257. package/dist/collection/components/notification/notification-header/notification-header.js +181 -0
  258. package/dist/collection/components/notification/notification-item/notification-item.css +1 -0
  259. package/dist/collection/components/notification/notification-item/notification-item.js +351 -0
  260. package/dist/collection/components/notification/notification-item/notification-item.types.js +1 -0
  261. package/dist/collection/components/notification/notification.css +1 -0
  262. package/dist/collection/components/notification/notification.js +838 -0
  263. package/dist/collection/components/notification/notification.types.js +1 -0
  264. package/dist/collection/components/pagination/pagination.css +1 -0
  265. package/dist/collection/components/pagination/pagination.js +1470 -0
  266. package/dist/collection/components/pagination/pagination.types.js +1 -0
  267. package/dist/collection/components/radio/radio.css +1 -0
  268. package/dist/collection/components/radio/radio.js +847 -0
  269. package/dist/collection/components/radio/radio.types.js +1 -0
  270. package/dist/collection/components/radio-group/radio-group.css +1 -0
  271. package/dist/collection/components/radio-group/radio-group.js +862 -0
  272. package/dist/collection/components/radio-group/radio-group.types.js +1 -0
  273. package/dist/collection/components/scrim/scrim.css +1 -0
  274. package/dist/collection/components/scrim/scrim.js +1825 -0
  275. package/dist/collection/components/scrim/scrim.types.js +1 -0
  276. package/dist/collection/components/scrim/scrim.utils.js +132 -0
  277. package/dist/collection/components/select/select-input/select-input.css +1 -0
  278. package/dist/collection/components/select/select-input/select-input.js +585 -0
  279. package/dist/collection/components/select/select-list/select-list.css +1 -0
  280. package/dist/collection/components/select/select-list/select-list.js +1147 -0
  281. package/dist/collection/components/select/select-option/select-option.css +1 -0
  282. package/dist/collection/components/select/select-option/select-option.js +543 -0
  283. package/dist/collection/components/select/select.constants.js +6 -0
  284. package/dist/collection/components/select/select.css +1 -0
  285. package/dist/collection/components/select/select.js +2575 -0
  286. package/dist/collection/components/select/select.types.js +1 -0
  287. package/dist/collection/components/sign-in/sign-in.css +1 -0
  288. package/dist/collection/components/sign-in/sign-in.js +400 -0
  289. package/dist/collection/components/sign-in/sign-in.types.js +1 -0
  290. package/dist/collection/components/skip-link/skip-link-item/skip-link-item-alias.js +103 -0
  291. package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -0
  292. package/dist/collection/components/skip-link/skip-link-item/skip-link-item.js +450 -0
  293. package/dist/collection/components/skip-link/skip-link.css +1 -0
  294. package/dist/collection/components/skip-link/skip-link.js +699 -0
  295. package/dist/collection/components/skip-link/skip-link.types.js +1 -0
  296. package/dist/collection/components/slider/slider.css +1 -0
  297. package/dist/collection/components/slider/slider.js +1325 -0
  298. package/dist/collection/components/slider/slider.types.js +1 -0
  299. package/dist/collection/components/step/step-item/step-item.css +1 -0
  300. package/dist/collection/components/step/step-item/step-item.js +604 -0
  301. package/dist/collection/components/step/step-item/step-item.types.js +1 -0
  302. package/dist/collection/components/step/step.css +1 -0
  303. package/dist/collection/components/step/step.js +896 -0
  304. package/dist/collection/components/step/step.types.js +1 -0
  305. package/dist/collection/components/switch/switch.css +1 -0
  306. package/dist/collection/components/switch/switch.js +715 -0
  307. package/dist/collection/components/switch/switch.types.js +1 -0
  308. package/dist/collection/components/tab/tab-item/tab-item.css +1 -0
  309. package/dist/collection/components/tab/tab-item/tab-item.js +425 -0
  310. package/dist/collection/components/tab/tab.css +1 -0
  311. package/dist/collection/components/tab/tab.js +724 -0
  312. package/dist/collection/components/tab/tab.types.js +1 -0
  313. package/dist/collection/components/table/table-body/table-body.css +1 -0
  314. package/dist/collection/components/table/table-body/table-body.js +51 -0
  315. package/dist/collection/components/table/table-cell/table-cell.css +1 -0
  316. package/dist/collection/components/table/table-cell/table-cell.js +373 -0
  317. package/dist/collection/components/table/table-constants.js +171 -0
  318. package/dist/collection/components/table/table-header/table-header.css +1 -0
  319. package/dist/collection/components/table/table-header/table-header.js +51 -0
  320. package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -0
  321. package/dist/collection/components/table/table-header-cell/table-header-cell.js +402 -0
  322. package/dist/collection/components/table/table-row/table-row.css +1 -0
  323. package/dist/collection/components/table/table-row/table-row.js +261 -0
  324. package/dist/collection/components/table/table-tokens.js +50 -0
  325. package/dist/collection/components/table/table-types.js +1 -0
  326. package/dist/collection/components/table/table-utils.js +44 -0
  327. package/dist/collection/components/table/table.css +1 -0
  328. package/dist/collection/components/table/table.js +1030 -0
  329. package/dist/collection/components/tag/tag.css +1 -0
  330. package/dist/collection/components/tag/tag.js +1153 -0
  331. package/dist/collection/components/tag/tag.types.js +1 -0
  332. package/dist/collection/components/textarea/textarea.css +1 -0
  333. package/dist/collection/components/textarea/textarea.js +985 -0
  334. package/dist/collection/components/textarea/textarea.types.js +1 -0
  335. package/dist/collection/components/tooltip/tooltip.css +1 -0
  336. package/dist/collection/components/tooltip/tooltip.js +1024 -0
  337. package/dist/collection/components/tooltip/tooltip.types.js +1 -0
  338. package/dist/collection/components/upload/upload.css +1 -0
  339. package/dist/collection/components/upload/upload.js +1315 -0
  340. package/dist/collection/components/upload/upload.types.js +1 -0
  341. package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -0
  342. package/dist/collection/components/wizard/wizard-panel/wizard-panel.js +167 -0
  343. package/dist/collection/components/wizard/wizard.css +1 -0
  344. package/dist/collection/components/wizard/wizard.js +1228 -0
  345. package/dist/collection/index.js +14 -0
  346. package/dist/collection/pages/components/cookiebar/index.js +26 -0
  347. package/dist/collection/pages/components/link/index.js +29 -0
  348. package/dist/collection/pages/components/pagination/index.js +12 -0
  349. package/dist/collection/pages/components/slider/index.js +18 -0
  350. package/dist/collection/pages/scripts/code-editor.js +101 -0
  351. package/dist/collection/pages/scripts/component-controls.js +591 -0
  352. package/dist/collection/pages/scripts/dev-event-console.js +47 -0
  353. package/dist/collection/pages/scripts/menu.js +183 -0
  354. package/dist/collection/pages/scripts/pageLoader.js +1420 -0
  355. package/dist/collection/shared/utils/assetsPath.js +75 -0
  356. package/dist/collection/shared/utils/breakpoint-observer.js +139 -0
  357. package/dist/collection/shared/utils/clamp.js +21 -0
  358. package/dist/collection/shared/utils/css-variables.js +12 -0
  359. package/dist/collection/shared/utils/cssVariables.js +37 -0
  360. package/dist/collection/shared/utils/date.js +405 -0
  361. package/dist/collection/shared/utils/debounce.js +39 -0
  362. package/dist/collection/shared/utils/event.js +55 -0
  363. package/dist/collection/shared/utils/floating-surface-dismiss.js +59 -0
  364. package/dist/collection/shared/utils/floating-ui.js +131 -0
  365. package/dist/collection/shared/utils/focus.js +24 -0
  366. package/dist/collection/shared/utils/form.js +82 -0
  367. package/dist/collection/shared/utils/format-bytes.js +20 -0
  368. package/dist/collection/shared/utils/getNextElement.js +30 -0
  369. package/dist/collection/shared/utils/getRandom.js +27 -0
  370. package/dist/collection/shared/utils/helpers.js +31 -0
  371. package/dist/collection/shared/utils/id.js +16 -0
  372. package/dist/collection/shared/utils/index.js +60 -0
  373. package/dist/collection/shared/utils/interfaces.js +1 -0
  374. package/dist/collection/shared/utils/isClient.js +14 -0
  375. package/dist/collection/shared/utils/isDefined.js +19 -0
  376. package/dist/collection/shared/utils/isEmpty.js +30 -0
  377. package/dist/collection/shared/utils/isHTMLElement.js +16 -0
  378. package/dist/collection/shared/utils/isNil.js +15 -0
  379. package/dist/collection/shared/utils/isString.js +20 -0
  380. package/dist/collection/shared/utils/native-dialog.js +44 -0
  381. package/dist/collection/shared/utils/navigation.js +21 -0
  382. package/dist/collection/shared/utils/parts.js +15 -0
  383. package/dist/collection/shared/utils/prop-warning.js +7 -0
  384. package/dist/collection/shared/utils/props.js +37 -0
  385. package/dist/collection/shared/utils/raf-batcher.js +51 -0
  386. package/dist/collection/shared/utils/scrollLock.js +141 -0
  387. package/dist/collection/shared/utils/setRafTimeout.js +38 -0
  388. package/dist/collection/shared/utils/slot.js +113 -0
  389. package/dist/collection/shared/utils/ssr-date.js +33 -0
  390. package/dist/collection/shared/utils/stringToArray.js +29 -0
  391. package/dist/collection/shared/utils/swipe.js +342 -0
  392. package/dist/collection/shared/utils/transition.js +127 -0
  393. package/dist/collection/shared/utils/types.js +1 -0
  394. package/dist/collection/shared/utils/validator.js +51 -0
  395. package/dist/collection/value-accessors/angular-value-accessor-config.js +41 -0
  396. package/dist/collection/value-accessors/index.js +6 -0
  397. package/dist/collection/value-accessors/vue-model-config.js +43 -0
  398. package/dist/components/br-avatar.d.ts +11 -0
  399. package/dist/components/br-avatar.js +5 -0
  400. package/dist/components/br-breadcrumb-item.d.ts +11 -0
  401. package/dist/components/br-breadcrumb-item.js +5 -0
  402. package/dist/components/br-breadcrumb.d.ts +11 -0
  403. package/dist/components/br-breadcrumb.js +5 -0
  404. package/dist/components/br-button.d.ts +11 -0
  405. package/dist/components/br-button.js +5 -0
  406. package/dist/components/br-card.d.ts +11 -0
  407. package/dist/components/br-card.js +5 -0
  408. package/dist/components/br-carousel-page.d.ts +11 -0
  409. package/dist/components/br-carousel-page.js +5 -0
  410. package/dist/components/br-carousel.d.ts +11 -0
  411. package/dist/components/br-carousel.js +5 -0
  412. package/dist/components/br-checkbox-group.d.ts +11 -0
  413. package/dist/components/br-checkbox-group.js +5 -0
  414. package/dist/components/br-checkbox.d.ts +11 -0
  415. package/dist/components/br-checkbox.js +5 -0
  416. package/dist/components/br-checkgroup.d.ts +11 -0
  417. package/dist/components/br-checkgroup.js +5 -0
  418. package/dist/components/br-collapse.d.ts +11 -0
  419. package/dist/components/br-collapse.js +5 -0
  420. package/dist/components/br-cookiebar-cookie.d.ts +11 -0
  421. package/dist/components/br-cookiebar-cookie.js +5 -0
  422. package/dist/components/br-cookiebar-group.d.ts +11 -0
  423. package/dist/components/br-cookiebar-group.js +5 -0
  424. package/dist/components/br-cookiebar-header.d.ts +11 -0
  425. package/dist/components/br-cookiebar-header.js +5 -0
  426. package/dist/components/br-cookiebar-link.d.ts +11 -0
  427. package/dist/components/br-cookiebar-link.js +5 -0
  428. package/dist/components/br-cookiebar-note-group.d.ts +11 -0
  429. package/dist/components/br-cookiebar-note-group.js +5 -0
  430. package/dist/components/br-cookiebar-note.d.ts +11 -0
  431. package/dist/components/br-cookiebar-note.js +5 -0
  432. package/dist/components/br-cookiebar.d.ts +11 -0
  433. package/dist/components/br-cookiebar.js +5 -0
  434. package/dist/components/br-crumb.d.ts +11 -0
  435. package/dist/components/br-crumb.js +5 -0
  436. package/dist/components/br-date-picker.d.ts +11 -0
  437. package/dist/components/br-date-picker.js +5 -0
  438. package/dist/components/br-datetime-input.d.ts +11 -0
  439. package/dist/components/br-datetime-input.js +5 -0
  440. package/dist/components/br-datetime-picker.d.ts +11 -0
  441. package/dist/components/br-datetime-picker.js +5 -0
  442. package/dist/components/br-divider.d.ts +11 -0
  443. package/dist/components/br-divider.js +5 -0
  444. package/dist/components/br-dropdown.d.ts +11 -0
  445. package/dist/components/br-dropdown.js +5 -0
  446. package/dist/components/br-footer-category.d.ts +11 -0
  447. package/dist/components/br-footer-category.js +5 -0
  448. package/dist/components/br-footer-item.d.ts +11 -0
  449. package/dist/components/br-footer-item.js +5 -0
  450. package/dist/components/br-footer-legal.d.ts +11 -0
  451. package/dist/components/br-footer-legal.js +5 -0
  452. package/dist/components/br-footer-logo.d.ts +11 -0
  453. package/dist/components/br-footer-logo.js +5 -0
  454. package/dist/components/br-footer-social.d.ts +11 -0
  455. package/dist/components/br-footer-social.js +5 -0
  456. package/dist/components/br-footer.d.ts +11 -0
  457. package/dist/components/br-footer.js +5 -0
  458. package/dist/components/br-header-function.d.ts +11 -0
  459. package/dist/components/br-header-function.js +5 -0
  460. package/dist/components/br-header-link.d.ts +11 -0
  461. package/dist/components/br-header-link.js +5 -0
  462. package/dist/components/br-header-list.d.ts +11 -0
  463. package/dist/components/br-header-list.js +5 -0
  464. package/dist/components/br-header-logo.d.ts +11 -0
  465. package/dist/components/br-header-logo.js +5 -0
  466. package/dist/components/br-header.d.ts +11 -0
  467. package/dist/components/br-header.js +5 -0
  468. package/dist/components/br-icon.d.ts +11 -0
  469. package/dist/components/br-icon.js +5 -0
  470. package/dist/components/br-input.d.ts +11 -0
  471. package/dist/components/br-input.js +5 -0
  472. package/dist/components/br-item.d.ts +11 -0
  473. package/dist/components/br-item.js +5 -0
  474. package/dist/components/br-link.d.ts +11 -0
  475. package/dist/components/br-link.js +5 -0
  476. package/dist/components/br-list.d.ts +11 -0
  477. package/dist/components/br-list.js +5 -0
  478. package/dist/components/br-loading.d.ts +11 -0
  479. package/dist/components/br-loading.js +5 -0
  480. package/dist/components/br-magic-button.d.ts +11 -0
  481. package/dist/components/br-magic-button.js +5 -0
  482. package/dist/components/br-menu-group.d.ts +11 -0
  483. package/dist/components/br-menu-group.js +5 -0
  484. package/dist/components/br-menu-header.d.ts +11 -0
  485. package/dist/components/br-menu-header.js +5 -0
  486. package/dist/components/br-menu-info.d.ts +11 -0
  487. package/dist/components/br-menu-info.js +5 -0
  488. package/dist/components/br-menu-item.d.ts +11 -0
  489. package/dist/components/br-menu-item.js +5 -0
  490. package/dist/components/br-menu-link.d.ts +11 -0
  491. package/dist/components/br-menu-link.js +5 -0
  492. package/dist/components/br-menu-list.d.ts +11 -0
  493. package/dist/components/br-menu-list.js +5 -0
  494. package/dist/components/br-menu-logo.d.ts +11 -0
  495. package/dist/components/br-menu-logo.js +5 -0
  496. package/dist/components/br-menu-social.d.ts +11 -0
  497. package/dist/components/br-menu-social.js +5 -0
  498. package/dist/components/br-menu.d.ts +11 -0
  499. package/dist/components/br-menu.js +5 -0
  500. package/dist/components/br-message.d.ts +11 -0
  501. package/dist/components/br-message.js +5 -0
  502. package/dist/components/br-modal.d.ts +11 -0
  503. package/dist/components/br-modal.js +5 -0
  504. package/dist/components/br-notification-body.d.ts +11 -0
  505. package/dist/components/br-notification-body.js +5 -0
  506. package/dist/components/br-notification-header.d.ts +11 -0
  507. package/dist/components/br-notification-header.js +5 -0
  508. package/dist/components/br-notification-item.d.ts +11 -0
  509. package/dist/components/br-notification-item.js +5 -0
  510. package/dist/components/br-notification.d.ts +11 -0
  511. package/dist/components/br-notification.js +5 -0
  512. package/dist/components/br-pagination.d.ts +11 -0
  513. package/dist/components/br-pagination.js +5 -0
  514. package/dist/components/br-radio-group.d.ts +11 -0
  515. package/dist/components/br-radio-group.js +5 -0
  516. package/dist/components/br-radio.d.ts +11 -0
  517. package/dist/components/br-radio.js +5 -0
  518. package/dist/components/br-scrim.d.ts +11 -0
  519. package/dist/components/br-scrim.js +5 -0
  520. package/dist/components/br-select-input.d.ts +11 -0
  521. package/dist/components/br-select-input.js +5 -0
  522. package/dist/components/br-select-list.d.ts +11 -0
  523. package/dist/components/br-select-list.js +5 -0
  524. package/dist/components/br-select-option.d.ts +11 -0
  525. package/dist/components/br-select-option.js +5 -0
  526. package/dist/components/br-select.d.ts +11 -0
  527. package/dist/components/br-select.js +5 -0
  528. package/dist/components/br-sign-in.d.ts +11 -0
  529. package/dist/components/br-sign-in.js +5 -0
  530. package/dist/components/br-skip-link-item.d.ts +11 -0
  531. package/dist/components/br-skip-link-item.js +5 -0
  532. package/dist/components/br-skip-link.d.ts +11 -0
  533. package/dist/components/br-skip-link.js +5 -0
  534. package/dist/components/br-skiplink-item.d.ts +11 -0
  535. package/dist/components/br-skiplink-item.js +5 -0
  536. package/dist/components/br-slider.d.ts +11 -0
  537. package/dist/components/br-slider.js +5 -0
  538. package/dist/components/br-step-item.d.ts +11 -0
  539. package/dist/components/br-step-item.js +5 -0
  540. package/dist/components/br-step.d.ts +11 -0
  541. package/dist/components/br-step.js +5 -0
  542. package/dist/components/br-switch.d.ts +11 -0
  543. package/dist/components/br-switch.js +5 -0
  544. package/dist/components/br-tab-item.d.ts +11 -0
  545. package/dist/components/br-tab-item.js +5 -0
  546. package/dist/components/br-tab.d.ts +11 -0
  547. package/dist/components/br-tab.js +5 -0
  548. package/dist/components/br-table-body.d.ts +11 -0
  549. package/dist/components/br-table-body.js +5 -0
  550. package/dist/components/br-table-cell.d.ts +11 -0
  551. package/dist/components/br-table-cell.js +5 -0
  552. package/dist/components/br-table-header-cell.d.ts +11 -0
  553. package/dist/components/br-table-header-cell.js +5 -0
  554. package/dist/components/br-table-header.d.ts +11 -0
  555. package/dist/components/br-table-header.js +5 -0
  556. package/dist/components/br-table-row.d.ts +11 -0
  557. package/dist/components/br-table-row.js +5 -0
  558. package/dist/components/br-table.d.ts +11 -0
  559. package/dist/components/br-table.js +5 -0
  560. package/dist/components/br-tag.d.ts +11 -0
  561. package/dist/components/br-tag.js +5 -0
  562. package/dist/components/br-textarea.d.ts +11 -0
  563. package/dist/components/br-textarea.js +5 -0
  564. package/dist/components/br-time-picker.d.ts +11 -0
  565. package/dist/components/br-time-picker.js +5 -0
  566. package/dist/components/br-tooltip.d.ts +11 -0
  567. package/dist/components/br-tooltip.js +5 -0
  568. package/dist/components/br-upload.d.ts +11 -0
  569. package/dist/components/br-upload.js +5 -0
  570. package/dist/components/br-wizard-panel.d.ts +11 -0
  571. package/dist/components/br-wizard-panel.js +5 -0
  572. package/dist/components/br-wizard.d.ts +11 -0
  573. package/dist/components/br-wizard.js +5 -0
  574. package/dist/components/index.d.ts +213 -0
  575. package/dist/components/index.js +5 -0
  576. package/dist/components/p-0IYmyaTi.js +5 -0
  577. package/dist/components/p-41XwlWiS.js +5 -0
  578. package/dist/components/p-5z6jgH1D.js +5 -0
  579. package/dist/components/p-6OdfnwnK.js +5 -0
  580. package/dist/components/p-9S9bgUT0.js +5 -0
  581. package/dist/components/p-B-qLmYZC.js +5 -0
  582. package/dist/components/p-B-sbd1_h.js +5 -0
  583. package/dist/components/p-B55qsau4.js +5 -0
  584. package/dist/components/p-BC7f6MK8.js +5 -0
  585. package/dist/components/p-BPJpHGOW.js +5 -0
  586. package/dist/components/p-BW0_ORNA.js +5 -0
  587. package/dist/components/p-BWXfdbQH.js +5 -0
  588. package/dist/components/p-Bb-nLtTG.js +5 -0
  589. package/dist/components/p-BkS6ujyf.js +5 -0
  590. package/dist/components/p-Bm0ECvfB.js +5 -0
  591. package/dist/components/p-C1yRmdso.js +5 -0
  592. package/dist/components/p-C3LQSQpc.js +5 -0
  593. package/dist/components/p-C98-mHmV.js +5 -0
  594. package/dist/components/p-CDZFuUlU.js +5 -0
  595. package/dist/components/p-CRfi23Rd.js +5 -0
  596. package/dist/components/p-CUI5zWGf.js +5 -0
  597. package/dist/components/p-CXMwM9m4.js +5 -0
  598. package/dist/components/p-CdDwqbBv.js +5 -0
  599. package/dist/components/p-CxviDiCr.js +5 -0
  600. package/dist/components/p-D3usVJE2.js +16 -0
  601. package/dist/components/p-D6zroLx5.js +5 -0
  602. package/dist/components/p-D9SpD3Ay.js +5 -0
  603. package/dist/components/p-DA5GS53D.js +5 -0
  604. package/dist/components/p-DBP6K_aq.js +5 -0
  605. package/dist/components/p-DBmwzG9E.js +5 -0
  606. package/dist/components/p-DCrVo-8T.js +5 -0
  607. package/dist/components/p-DIK54tTj.js +5 -0
  608. package/dist/components/p-DQRSHR-D.js +5 -0
  609. package/dist/components/p-DRVMm1Py.js +5 -0
  610. package/dist/components/p-DWPmUV72.js +5 -0
  611. package/dist/components/p-DYA74R1r.js +5 -0
  612. package/dist/components/p-DYnkGWii.js +5 -0
  613. package/dist/components/p-D_CSvOY9.js +5 -0
  614. package/dist/components/p-DaeGwqw0.js +5 -0
  615. package/dist/components/p-Dkg2scYZ.js +5 -0
  616. package/dist/components/p-Dmfk7eEe.js +5 -0
  617. package/dist/components/p-DoXNfcTT.js +5 -0
  618. package/dist/components/p-DvrdmqoQ.js +5 -0
  619. package/dist/components/p-DxZJrIyL.js +5 -0
  620. package/dist/components/p-LmeJrLxH.js +5 -0
  621. package/dist/components/p-TFWd_UBV.js +5 -0
  622. package/dist/components/p-aF8bGN3t.js +5 -0
  623. package/dist/components/p-bhULC15U.js +5 -0
  624. package/dist/components/p-cF3ia5e9.js +5 -0
  625. package/dist/components/p-cfPt-vKA.js +5 -0
  626. package/dist/components/p-gvnfuTjd.js +5 -0
  627. package/dist/components/p-nJOJGpyl.js +5 -0
  628. package/dist/components/p-ttI0nvv_.js +5 -0
  629. package/dist/esm/app-globals-DVjNHTTs.js +7 -0
  630. package/dist/esm/br-avatar.entry.js +246 -0
  631. package/dist/esm/br-breadcrumb-item.entry.js +43 -0
  632. package/dist/esm/br-breadcrumb.entry.js +441 -0
  633. package/dist/esm/br-button_2.entry.js +277 -0
  634. package/dist/esm/br-card.entry.js +109 -0
  635. package/dist/esm/br-carousel-page.entry.js +78 -0
  636. package/dist/esm/br-carousel.entry.js +563 -0
  637. package/dist/esm/br-checkbox-group.entry.js +116 -0
  638. package/dist/esm/br-checkbox.entry.js +286 -0
  639. package/dist/esm/br-checkgroup.entry.js +18 -0
  640. package/dist/esm/br-collapse_2.entry.js +680 -0
  641. package/dist/esm/br-cookiebar-cookie.entry.js +81 -0
  642. package/dist/esm/br-cookiebar-group.entry.js +307 -0
  643. package/dist/esm/br-cookiebar-header.entry.js +37 -0
  644. package/dist/esm/br-cookiebar-link.entry.js +52 -0
  645. package/dist/esm/br-cookiebar-note-group.entry.js +68 -0
  646. package/dist/esm/br-cookiebar-note.entry.js +23 -0
  647. package/dist/esm/br-cookiebar.entry.js +756 -0
  648. package/dist/esm/br-crumb.entry.js +49 -0
  649. package/dist/esm/br-date-picker_3.entry.js +2442 -0
  650. package/dist/esm/br-datetime-picker.entry.js +1885 -0
  651. package/dist/esm/br-divider.entry.js +223 -0
  652. package/dist/esm/br-dropdown_2.entry.js +1853 -0
  653. package/dist/esm/br-footer-category.entry.js +100 -0
  654. package/dist/esm/br-footer-item.entry.js +50 -0
  655. package/dist/esm/br-footer-legal.entry.js +39 -0
  656. package/dist/esm/br-footer-logo.entry.js +102 -0
  657. package/dist/esm/br-footer-social.entry.js +69 -0
  658. package/dist/esm/br-footer.entry.js +90 -0
  659. package/dist/esm/br-header-function.entry.js +140 -0
  660. package/dist/esm/br-header-link.entry.js +58 -0
  661. package/dist/esm/br-header-list.entry.js +277 -0
  662. package/dist/esm/br-header-logo.entry.js +175 -0
  663. package/dist/esm/br-header.entry.js +640 -0
  664. package/dist/esm/br-icon.entry.js +483 -0
  665. package/dist/esm/br-input.entry.js +597 -0
  666. package/dist/esm/br-item.entry.js +354 -0
  667. package/dist/esm/br-link.entry.js +130 -0
  668. package/dist/esm/br-loading.entry.js +503 -0
  669. package/dist/esm/br-magic-button.entry.js +90 -0
  670. package/dist/esm/br-menu-group.entry.js +21 -0
  671. package/dist/esm/br-menu-header.entry.js +45 -0
  672. package/dist/esm/br-menu-info.entry.js +36 -0
  673. package/dist/esm/br-menu-item.entry.js +77 -0
  674. package/dist/esm/br-menu-link.entry.js +53 -0
  675. package/dist/esm/br-menu-list.entry.js +147 -0
  676. package/dist/esm/br-menu-logo.entry.js +73 -0
  677. package/dist/esm/br-menu-social.entry.js +63 -0
  678. package/dist/esm/br-menu.entry.js +991 -0
  679. package/dist/esm/br-modal.entry.js +494 -0
  680. package/dist/esm/br-notification-body.entry.js +69 -0
  681. package/dist/esm/br-notification-header.entry.js +46 -0
  682. package/dist/esm/br-notification-item.entry.js +108 -0
  683. package/dist/esm/br-notification.entry.js +332 -0
  684. package/dist/esm/br-pagination.entry.js +882 -0
  685. package/dist/esm/br-radio-group.entry.js +426 -0
  686. package/dist/esm/br-radio.entry.js +355 -0
  687. package/dist/esm/br-scrim.entry.js +1334 -0
  688. package/dist/esm/br-select-input_3.entry.js +950 -0
  689. package/dist/esm/br-sign-in.entry.js +123 -0
  690. package/dist/esm/br-skip-link-item.entry.js +18 -0
  691. package/dist/esm/br-skip-link.entry.js +360 -0
  692. package/dist/esm/br-skiplink-item.entry.js +190 -0
  693. package/dist/esm/br-slider.entry.js +686 -0
  694. package/dist/esm/br-step_2.entry.js +625 -0
  695. package/dist/esm/br-switch.entry.js +243 -0
  696. package/dist/esm/br-tab-item.entry.js +183 -0
  697. package/dist/esm/br-tab.entry.js +395 -0
  698. package/dist/esm/br-table-body.entry.js +35 -0
  699. package/dist/esm/br-table-cell.entry.js +182 -0
  700. package/dist/esm/br-table-header-cell.entry.js +171 -0
  701. package/dist/esm/br-table-header.entry.js +35 -0
  702. package/dist/esm/br-table-row.entry.js +79 -0
  703. package/dist/esm/br-table.entry.js +678 -0
  704. package/dist/esm/br-tag.entry.js +492 -0
  705. package/dist/esm/br-textarea.entry.js +304 -0
  706. package/dist/esm/br-tooltip.entry.js +625 -0
  707. package/dist/esm/br-upload.entry.js +580 -0
  708. package/dist/esm/br-wizard-panel.entry.js +52 -0
  709. package/dist/esm/br-wizard.entry.js +706 -0
  710. package/dist/esm/breakpoint-observer-DBmwzG9E.js +141 -0
  711. package/dist/esm/clamp-gvnfuTjd.js +23 -0
  712. package/dist/esm/cookiebar.utils-DYA74R1r.js +16 -0
  713. package/dist/esm/datetime-picker-constants-Bfm58jO6.js +3798 -0
  714. package/dist/esm/event-DFN_so7I.js +48 -0
  715. package/dist/esm/floating-surface-dismiss-BWXfdbQH.js +61 -0
  716. package/dist/esm/floating-ui-BavFwMnx.js +134 -0
  717. package/dist/esm/floating-ui.dom-DIK54tTj.js +1707 -0
  718. package/dist/esm/focus-DxZJrIyL.js +26 -0
  719. package/dist/esm/getNextElement-9S9bgUT0.js +28 -0
  720. package/dist/esm/iconify-icon-D3usVJE2.js +2303 -0
  721. package/dist/esm/id-BkS6ujyf.js +18 -0
  722. package/dist/esm/index-Bo-2igoO.js +671 -0
  723. package/dist/esm/index-C2RBydfd.js +3258 -0
  724. package/dist/esm/index.js +6 -0
  725. package/dist/esm/isNil-B-qLmYZC.js +17 -0
  726. package/dist/esm/isValid-DIUZX1qS.js +3684 -0
  727. package/dist/esm/loader.js +15 -0
  728. package/dist/esm/native-dialog-B55qsau4.js +46 -0
  729. package/dist/esm/navigation-bhULC15U.js +23 -0
  730. package/dist/esm/parts-Bb5vVlCC.js +17 -0
  731. package/dist/esm/props-DRVMm1Py.js +22 -0
  732. package/dist/esm/raf-batcher-cF3ia5e9.js +53 -0
  733. package/dist/esm/slot-BIG-yees.js +44 -0
  734. package/dist/esm/swipe-Dmfk7eEe.js +343 -0
  735. package/dist/esm/table-constants-CXMwM9m4.js +170 -0
  736. package/dist/esm/validator-D3tVP32U.js +113 -0
  737. package/dist/esm/webcomponents.js +46 -0
  738. package/dist/hydrate/index.d.ts +287 -0
  739. package/dist/hydrate/index.js +67323 -0
  740. package/dist/hydrate/index.mjs +67313 -0
  741. package/dist/hydrate/package.json +12 -0
  742. package/dist/index.cjs.js +1 -0
  743. package/dist/index.js +1 -0
  744. package/dist/loader/cdn.js +5 -0
  745. package/dist/loader/index.cjs.js +5 -0
  746. package/dist/loader/index.d.ts +24 -0
  747. package/dist/loader/index.es2017.js +5 -0
  748. package/dist/loader/index.js +6 -0
  749. package/dist/webcomponents/index.esm.js +5 -0
  750. package/dist/webcomponents/p-0196804a.entry.js +5 -0
  751. package/dist/webcomponents/p-0410186a.entry.js +5 -0
  752. package/dist/webcomponents/p-0415ef22.entry.js +5 -0
  753. package/dist/webcomponents/p-059c3d6c.entry.js +5 -0
  754. package/dist/webcomponents/p-0b8f39bc.entry.js +5 -0
  755. package/dist/webcomponents/p-0caa4d12.entry.js +5 -0
  756. package/dist/webcomponents/p-0d4f718d.entry.js +5 -0
  757. package/dist/webcomponents/p-0e84c9e8.entry.js +5 -0
  758. package/dist/webcomponents/p-12286e73.entry.js +5 -0
  759. package/dist/webcomponents/p-147ac8d3.entry.js +5 -0
  760. package/dist/webcomponents/p-1580beee.entry.js +5 -0
  761. package/dist/webcomponents/p-1b138f1c.entry.js +5 -0
  762. package/dist/webcomponents/p-1bca4499.entry.js +5 -0
  763. package/dist/webcomponents/p-1d6b0b6f.entry.js +5 -0
  764. package/dist/webcomponents/p-1d8cb8fd.entry.js +5 -0
  765. package/dist/webcomponents/p-22443c08.entry.js +5 -0
  766. package/dist/webcomponents/p-224daaac.entry.js +5 -0
  767. package/dist/webcomponents/p-28426d2a.entry.js +5 -0
  768. package/dist/webcomponents/p-2abd2da0.entry.js +5 -0
  769. package/dist/webcomponents/p-2fdc51ae.entry.js +5 -0
  770. package/dist/webcomponents/p-30c428b6.entry.js +5 -0
  771. package/dist/webcomponents/p-36bbea4e.entry.js +5 -0
  772. package/dist/webcomponents/p-3907ebfa.entry.js +5 -0
  773. package/dist/webcomponents/p-39a16f9d.entry.js +5 -0
  774. package/dist/webcomponents/p-3ebbd2f5.entry.js +5 -0
  775. package/dist/webcomponents/p-3ef7eac8.entry.js +5 -0
  776. package/dist/webcomponents/p-45356e9a.entry.js +5 -0
  777. package/dist/webcomponents/p-46513db4.entry.js +5 -0
  778. package/dist/webcomponents/p-4fe12a72.entry.js +5 -0
  779. package/dist/webcomponents/p-52df61cb.entry.js +5 -0
  780. package/dist/webcomponents/p-569134cf.entry.js +5 -0
  781. package/dist/webcomponents/p-5b257a4b.entry.js +5 -0
  782. package/dist/webcomponents/p-5ce7db4a.entry.js +5 -0
  783. package/dist/webcomponents/p-5f373708.entry.js +5 -0
  784. package/dist/webcomponents/p-5f6afb79.entry.js +5 -0
  785. package/dist/webcomponents/p-5fc7ba4c.entry.js +5 -0
  786. package/dist/webcomponents/p-60cc820c.entry.js +5 -0
  787. package/dist/webcomponents/p-66006312.entry.js +5 -0
  788. package/dist/webcomponents/p-66b13fd9.entry.js +5 -0
  789. package/dist/webcomponents/p-6OdfnwnK.js +5 -0
  790. package/dist/webcomponents/p-6c5f6cb6.entry.js +5 -0
  791. package/dist/webcomponents/p-6f1c4425.entry.js +5 -0
  792. package/dist/webcomponents/p-750799b7.entry.js +5 -0
  793. package/dist/webcomponents/p-756ff2ad.entry.js +5 -0
  794. package/dist/webcomponents/p-765bfe27.entry.js +5 -0
  795. package/dist/webcomponents/p-7ab96c11.entry.js +5 -0
  796. package/dist/webcomponents/p-7c2ff8b4.entry.js +5 -0
  797. package/dist/webcomponents/p-7cf9f4e5.entry.js +5 -0
  798. package/dist/webcomponents/p-7e1856e4.entry.js +5 -0
  799. package/dist/webcomponents/p-7f7506f0.entry.js +5 -0
  800. package/dist/webcomponents/p-7fb03a49.entry.js +5 -0
  801. package/dist/webcomponents/p-82200563.entry.js +5 -0
  802. package/dist/webcomponents/p-85f8063b.entry.js +5 -0
  803. package/dist/webcomponents/p-8b558233.entry.js +5 -0
  804. package/dist/webcomponents/p-8e6c2767.entry.js +5 -0
  805. package/dist/webcomponents/p-966ad32f.entry.js +5 -0
  806. package/dist/webcomponents/p-9679d230.entry.js +5 -0
  807. package/dist/webcomponents/p-96dd663b.entry.js +5 -0
  808. package/dist/webcomponents/p-98843fa3.entry.js +5 -0
  809. package/dist/webcomponents/p-9S9bgUT0.js +5 -0
  810. package/dist/webcomponents/p-9a375eff.entry.js +5 -0
  811. package/dist/webcomponents/p-9b358cff.entry.js +5 -0
  812. package/dist/webcomponents/p-9f7558c7.entry.js +5 -0
  813. package/dist/webcomponents/p-B-qLmYZC.js +5 -0
  814. package/dist/webcomponents/p-B55qsau4.js +5 -0
  815. package/dist/webcomponents/p-BIG-yees.js +5 -0
  816. package/dist/webcomponents/p-BWXfdbQH.js +5 -0
  817. package/dist/webcomponents/p-Bb5vVlCC.js +5 -0
  818. package/dist/webcomponents/p-Bfm58jO6.js +5 -0
  819. package/dist/webcomponents/p-BhMVJQ4-.js +5 -0
  820. package/dist/webcomponents/p-BkS6ujyf.js +5 -0
  821. package/dist/webcomponents/p-C2RBydfd.js +6 -0
  822. package/dist/webcomponents/p-CO5cOQQU.js +5 -0
  823. package/dist/webcomponents/p-CXMwM9m4.js +5 -0
  824. package/dist/webcomponents/p-D3tVP32U.js +5 -0
  825. package/dist/webcomponents/p-D3usVJE2.js +16 -0
  826. package/dist/webcomponents/p-DBmwzG9E.js +5 -0
  827. package/dist/webcomponents/p-DFN_so7I.js +5 -0
  828. package/dist/webcomponents/p-DIK54tTj.js +5 -0
  829. package/dist/webcomponents/p-DRVMm1Py.js +5 -0
  830. package/dist/webcomponents/p-DVjNHTTs.js +5 -0
  831. package/dist/webcomponents/p-DYA74R1r.js +5 -0
  832. package/dist/webcomponents/p-Dmfk7eEe.js +5 -0
  833. package/dist/webcomponents/p-DxZJrIyL.js +5 -0
  834. package/dist/webcomponents/p-a382e115.entry.js +5 -0
  835. package/dist/webcomponents/p-a9ff7c25.entry.js +5 -0
  836. package/dist/webcomponents/p-bba9fc09.entry.js +5 -0
  837. package/dist/webcomponents/p-bhULC15U.js +5 -0
  838. package/dist/webcomponents/p-c0b0f531.entry.js +5 -0
  839. package/dist/webcomponents/p-c211af17.entry.js +5 -0
  840. package/dist/webcomponents/p-c492d926.entry.js +5 -0
  841. package/dist/webcomponents/p-c4cfe599.entry.js +5 -0
  842. package/dist/webcomponents/p-c846e784.entry.js +5 -0
  843. package/dist/webcomponents/p-cF3ia5e9.js +5 -0
  844. package/dist/webcomponents/p-cedb8eea.entry.js +5 -0
  845. package/dist/webcomponents/p-d1e899cd.entry.js +5 -0
  846. package/dist/webcomponents/p-d38d82cc.entry.js +5 -0
  847. package/dist/webcomponents/p-dba376cb.entry.js +5 -0
  848. package/dist/webcomponents/p-e0ce536a.entry.js +5 -0
  849. package/dist/webcomponents/p-e1331288.entry.js +5 -0
  850. package/dist/webcomponents/p-e360a463.entry.js +5 -0
  851. package/dist/webcomponents/p-e80a1eb0.entry.js +5 -0
  852. package/dist/webcomponents/p-f078f972.entry.js +5 -0
  853. package/dist/webcomponents/p-f6318e94.entry.js +5 -0
  854. package/dist/webcomponents/p-fcd4ae48.entry.js +5 -0
  855. package/dist/webcomponents/p-gvnfuTjd.js +5 -0
  856. package/dist/webcomponents/webcomponents.esm.js +5 -0
  857. package/package.json +1 -1
  858. package/cem/.gitkeep +0 -0
@@ -0,0 +1,1420 @@
1
+ const CONTENT_ELEMENT = document.getElementById('content');
2
+ const COMPONENTS_FILTER = document.getElementById('components-filter');
3
+ const CLEAR_COMPONENTS_FILTER = document.getElementById('clear-components-filter');
4
+
5
+ let renderedFilesContent = {};
6
+ let currentLoadedPath = null;
7
+ const markdownParser = window.marked;
8
+ const DEV_SERVER_CONNECTOR_IFRAME_RE =
9
+ /<iframe\b[^>]*title=["']Stencil Dev Server Connector[^"']*["'][\s\S]*?<\/iframe>/gi;
10
+ let lzStringPromise;
11
+
12
+ function loadLzString() {
13
+ if (window.LZString) return Promise.resolve(window.LZString);
14
+ if (!lzStringPromise) {
15
+ lzStringPromise = new Promise((resolve, reject) => {
16
+ const script = document.createElement('script');
17
+ script.src = `${getBaseUrl()}/assets/lz-string.min.js`;
18
+ script.onload = () => resolve(window.LZString);
19
+ script.onerror = reject;
20
+ document.head.appendChild(script);
21
+ });
22
+ }
23
+ return lzStringPromise;
24
+ }
25
+
26
+ // Decode shared state from URL parameters on initialization
27
+ (() => {
28
+ const params = new URLSearchParams(window.location.search);
29
+ const stateParam = params.get('pg_state');
30
+ if (stateParam) {
31
+ const decode = () => {
32
+ try {
33
+ const decompressed = window.LZString?.decompressFromEncodedURIComponent(stateParam);
34
+ if (decompressed) window.SHARED_STATE = JSON.parse(decompressed);
35
+ } catch (e) {
36
+ console.error('Error decoding shared state:', e);
37
+ }
38
+ };
39
+ if (window.LZString) decode();
40
+ else
41
+ loadLzString()
42
+ .then(decode)
43
+ .catch(() => console.error('Error loading shared state decoder.'));
44
+ }
45
+ })();
46
+
47
+ function getBaseUrl() {
48
+ // Se o Pages injetou um prefixo conhecido, usa-o (terminado com /)
49
+ if (typeof window.WWW_PREFIX === 'string' && window.WWW_PREFIX.length > 0) {
50
+ return window.WWW_PREFIX.replace(/\/+$/, '');
51
+ }
52
+ const baseUrl = window.location.pathname.split('/').slice(0, -1).join('/');
53
+ return baseUrl === '' ? '' : baseUrl;
54
+ }
55
+
56
+ function renderExamplePreview(previewElement, source, edgeToEdge = false) {
57
+ const frame = previewElement.querySelector('iframe');
58
+ if (!frame) return;
59
+
60
+ const baseUrl = getBaseUrl();
61
+ const componentBundle = new URL(`${baseUrl}/build/webcomponents.esm.js`, window.location.href).href;
62
+ const frameSource = stripDevServerConnector(source);
63
+
64
+ frame.srcdoc = `<!doctype html>
65
+ <html lang="pt-BR">
66
+ <head>
67
+ <meta charset="UTF-8">
68
+ <meta name="viewport" content="width=device-width, initial-scale=1">
69
+ <base href="${window.location.href}">
70
+ <link rel="stylesheet" href="${new URL(`${baseUrl}/assets/core.min.css`, window.location.href).href}">
71
+ <link rel="stylesheet" href="${new URL(`${baseUrl}/assets/fonts/rawline/400.css`, window.location.href).href}">
72
+ <link rel="stylesheet" href="${new URL(`${baseUrl}/assets/fonts/raleway/wght.css`, window.location.href).href}">
73
+ <link rel="stylesheet" href="${new URL(`${baseUrl}/assets/fonts/fontawesome/css/all.min.css`, window.location.href).href}">
74
+ <style>
75
+ * { font-family: Rawline, Raleway, sans-serif; }
76
+ html, body { margin: 0; min-height: 1px; overflow: visible; }
77
+ body { box-sizing: border-box; padding: 24px 16px; }
78
+ body.wbc-preview-edge-to-edge { padding: 0; }
79
+ br-cookiebar, br-scrim { inset: 0; position: absolute; pointer-events: none; z-index: 1000; }
80
+ br-scrim { --scrim-display-mode: parent; }
81
+ </style>
82
+ </head>
83
+ <body${edgeToEdge ? ' class="wbc-preview-edge-to-edge"' : ''}><main data-wbc-preview-content>${frameSource}</main>
84
+ <script type="module" src="${componentBundle}"></script>
85
+ <script>
86
+ (() => {
87
+ const overlayContentSelector =
88
+ '[part="open-panel"], [part="default-panel"], [part="body"], .cookiebar-body, .content, .br-modal';
89
+ const getOverlayHeight = (overlay) => {
90
+ const measuredHeight = Array.from(overlay.shadowRoot?.querySelectorAll(overlayContentSelector) || []).reduce(
91
+ (height, element) =>
92
+ Math.max(height, element.scrollHeight, element.clientHeight, element.getBoundingClientRect().height),
93
+ 0,
94
+ );
95
+ if (measuredHeight > 0) return measuredHeight;
96
+
97
+ const modal = overlay.matches('br-scrim') ? overlay.querySelector('br-modal') : overlay;
98
+ return modal?.shadowRoot?.querySelector('.br-modal')?.getBoundingClientRect().height || 0;
99
+ };
100
+ const getElementsIncludingShadowRoots = (root = document) => {
101
+ const elements = [];
102
+ const visit = (tree) => {
103
+ tree.querySelectorAll('*').forEach((element) => {
104
+ elements.push(element);
105
+ if (element.shadowRoot) visit(element.shadowRoot);
106
+ });
107
+ };
108
+ visit(root);
109
+ return elements;
110
+ };
111
+ const getFloatingHeight = () => {
112
+ const bodyStyle = getComputedStyle(document.body);
113
+ const bottomPadding = parseFloat(bodyStyle.paddingBottom) || 0;
114
+ return getElementsIncludingShadowRoots().reduce((height, element) => {
115
+ if (element.matches('br-cookiebar, br-scrim, br-modal')) return height;
116
+ const style = getComputedStyle(element);
117
+ if (style.position !== 'absolute' && style.position !== 'fixed') return height;
118
+ if (style.display === 'none' || style.visibility === 'hidden') return height;
119
+ return Math.max(height, element.getBoundingClientRect().bottom + bottomPadding);
120
+ }, 0);
121
+ };
122
+ const sendHeight = () => {
123
+ const body = document.body;
124
+ const bodyStyle = getComputedStyle(body);
125
+ const overlayHeight = Array.from(document.querySelectorAll('br-cookiebar, br-scrim, br-modal')).reduce(
126
+ (height, overlay) => Math.max(height, getOverlayHeight(overlay)),
127
+ 0,
128
+ );
129
+ const verticalPadding = parseFloat(bodyStyle.paddingTop) + parseFloat(bodyStyle.paddingBottom);
130
+ const height = Math.ceil(
131
+ Math.max(
132
+ body.scrollHeight,
133
+ body.offsetHeight,
134
+ body.getBoundingClientRect().height,
135
+ overlayHeight + verticalPadding,
136
+ getFloatingHeight(),
137
+ ),
138
+ );
139
+ parent.postMessage({ type: 'wbc-preview-height', height }, '*');
140
+ };
141
+ document.querySelectorAll('br-cookiebar, br-scrim').forEach((overlay) => {
142
+ overlay.setAttribute('data-wbc-preview-contained', '');
143
+ if (overlay.matches('br-scrim')) overlay.setAttribute('display-mode', 'parent');
144
+ });
145
+ const serialize = (value, seen = new WeakSet()) => {
146
+ if (value instanceof Element) return '<' + value.localName + '>';
147
+ if (value instanceof Event) return { type: value.type };
148
+ if (value && typeof value === 'object') {
149
+ if (seen.has(value)) return '[Circular]';
150
+ seen.add(value);
151
+ if (Array.isArray(value)) return value.map((item) => serialize(item, seen));
152
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, serialize(item, seen)]));
153
+ }
154
+ return value;
155
+ };
156
+ const sendEvent = (event, dispatchedBy = event.target) => {
157
+ const target = dispatchedBy instanceof Element ? dispatchedBy : dispatchedBy?.host instanceof Element ? dispatchedBy.host : null;
158
+ parent.postMessage({
159
+ type: 'wbc-preview-event',
160
+ eventType: event.type,
161
+ custom: event instanceof CustomEvent,
162
+ detail: event instanceof CustomEvent ? serialize(event.detail) : undefined,
163
+ target: target ? target.localName + (target.id ? '#' + target.id : '') : 'window',
164
+ }, '*');
165
+ };
166
+ ['change', 'click', 'input', 'submit'].forEach((name) => document.addEventListener(name, sendEvent, true));
167
+ document.addEventListener('brInternalEvent', sendEvent, true);
168
+ const originalDispatchEvent = EventTarget.prototype.dispatchEvent;
169
+ EventTarget.prototype.dispatchEvent = function dispatchEvent(event) {
170
+ if (event instanceof CustomEvent) sendEvent(event, this);
171
+ return originalDispatchEvent.call(this, event);
172
+ };
173
+ let heightFrame = 0;
174
+ const scheduleHeight = () => {
175
+ cancelAnimationFrame(heightFrame);
176
+ heightFrame = requestAnimationFrame(sendHeight);
177
+ };
178
+ const resizeObserver = new ResizeObserver(scheduleHeight);
179
+ const observeOverlayContent = () => {
180
+ document.querySelectorAll('br-cookiebar, br-scrim, br-modal').forEach((overlay) => {
181
+ overlay.shadowRoot?.querySelectorAll(overlayContentSelector).forEach((element) => {
182
+ resizeObserver.observe(element);
183
+ });
184
+ });
185
+ getElementsIncludingShadowRoots().forEach((element) => {
186
+ const position = getComputedStyle(element).position;
187
+ if (position === 'absolute' || position === 'fixed') resizeObserver.observe(element);
188
+ });
189
+ };
190
+ resizeObserver.observe(document.documentElement);
191
+ resizeObserver.observe(document.body);
192
+ new MutationObserver(() =>
193
+ requestAnimationFrame(() => {
194
+ observeOverlayContent();
195
+ scheduleHeight();
196
+ }),
197
+ ).observe(document.body, { attributes: true, childList: true, subtree: true });
198
+ Promise.all(
199
+ [...document.querySelectorAll('*')]
200
+ .map((element) => element.localName)
201
+ .filter((tag, index, tags) => tag.includes('-') && tags.indexOf(tag) === index)
202
+ .map((tag) => customElements.whenDefined(tag)),
203
+ ).then(() =>
204
+ requestAnimationFrame(() =>
205
+ requestAnimationFrame(() => {
206
+ observeOverlayContent();
207
+ scheduleHeight();
208
+ }),
209
+ ),
210
+ );
211
+ addEventListener('load', scheduleHeight);
212
+ scheduleHeight();
213
+ })();
214
+ </script>
215
+ </body>
216
+ </html>`;
217
+ }
218
+
219
+ function stripDevServerConnector(source) {
220
+ return String(source || '')
221
+ .replace(DEV_SERVER_CONNECTOR_IFRAME_RE, '')
222
+ .trim();
223
+ }
224
+
225
+ function getFrameworkCode(source, framework) {
226
+ const html = String(source || '').trim();
227
+ const components = Array.from(html.matchAll(/<\/?(br-[a-z0-9-]+)/gi), (match) => match[1]);
228
+ const imports = [...new Set(components)].map((tag) =>
229
+ tag
230
+ .split('-')
231
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
232
+ .join(''),
233
+ );
234
+ const importList = imports.length > 0 ? imports.join(', ') : 'BrButton';
235
+ const pascalMarkup = html.replace(/(<\/?)(br-[a-z0-9-]+)/gi, (_match, prefix, tag) => {
236
+ return `${prefix}${tag
237
+ .split('-')
238
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
239
+ .join('')}`;
240
+ });
241
+
242
+ if (framework === 'javascript') {
243
+ return `import { ${importList} } from '@govbr-ds/webcomponents';\n\nconst example = document.querySelector('${components[0] || 'br-button'}');\n\n// Use o exemplo renderizado para adicionar comportamento com JavaScript.\nconsole.log(example);`;
244
+ }
245
+ if (framework === 'css') {
246
+ return `/* Customize os componentes usando CSS Parts */
247
+ /* Exemplo:
248
+ br-${String(location.pathname).split('/').filter(Boolean).pop() || 'component'}::part(container) {
249
+ background-color: #f8f9fa;
250
+ }
251
+ */`;
252
+ }
253
+ if (framework === 'angular') {
254
+ return `import { Component } from '@angular/core';\nimport { ${importList} } from '@govbr-ds/webcomponents-angular/standalone';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [${importList}],\n template: \`${html.replace(/`/g, '\\`')}\`,\n})\nexport class AppComponent {}`;
255
+ }
256
+ if (framework === 'react') {
257
+ return `import { ${importList} } from '@govbr-ds/webcomponents-react';\n\nexport default function App() {\n return (\n <>\n ${pascalMarkup.replace(/\n/g, '\n ')}\n </>\n );\n}`;
258
+ }
259
+ return `<script setup lang="ts">\nimport { ${importList} } from '@govbr-ds/webcomponents-vue';\n</script>\n\n<template>\n ${pascalMarkup.replace(/\n/g, '\n ')}\n</template>`;
260
+ }
261
+
262
+ function getFrameworkFiles(source, framework) {
263
+ if (framework !== 'angular') return null;
264
+
265
+ const html = String(source || '').trim();
266
+ const components = Array.from(html.matchAll(/<\/?(br-[a-z0-9-]+)/gi), (match) => match[1]);
267
+ const imports = [...new Set(components)].map((tag) =>
268
+ tag
269
+ .split('-')
270
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
271
+ .join(''),
272
+ );
273
+ const importList = imports.length > 0 ? imports.join(', ') : 'BrButton';
274
+
275
+ return [
276
+ {
277
+ filename: 'app.component.ts',
278
+ language: 'typescript',
279
+ code: `import { Component } from '@angular/core'\nimport { ${importList} } from '@govbr-ds/webcomponents-angular/standalone'\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [${importList}],\n templateUrl: './app.component.html',\n})\nexport class AppComponent {}`,
280
+ },
281
+ { filename: 'app.component.html', language: 'html', code: html },
282
+ ];
283
+ }
284
+
285
+ function createReadOnlyFrameworkTab(label, icon, tabId, source, framework) {
286
+ const tab = document.createElement('br-tab-item');
287
+ tab.setAttribute('label', label);
288
+ tab.setAttribute('icon', icon);
289
+ tab.setAttribute('icon-only', 'true');
290
+ tab.setAttribute('title', label);
291
+ tab.setAttribute('tab-item-id', tabId);
292
+ tab.dataset.framework = framework;
293
+
294
+ const files = getFrameworkFiles(source, framework);
295
+ tab._frameworkFiles = files;
296
+
297
+ if (files?.length > 1) {
298
+ const fileTabs = document.createElement('div');
299
+ fileTabs.className = 'wbc-framework-file-tabs';
300
+ fileTabs.setAttribute('role', 'tablist');
301
+ files.forEach((file, index) => {
302
+ const fileTab = document.createElement('button');
303
+ fileTab.className = `wbc-framework-file-tab${index === 0 ? ' is-active' : ''}`;
304
+ fileTab.type = 'button';
305
+ fileTab.dataset.filename = file.filename;
306
+ fileTab.setAttribute('aria-selected', String(index === 0));
307
+ fileTab.setAttribute('role', 'tab');
308
+ fileTab.textContent = file.filename;
309
+ fileTabs.appendChild(fileTab);
310
+ });
311
+ tab.appendChild(fileTabs);
312
+ }
313
+
314
+ const code = document.createElement('pre');
315
+ code.className = 'wbc-framework-code';
316
+ code.dataset.framework = framework;
317
+ code.dataset.filename = files?.[0]?.filename || '';
318
+ code.textContent = files?.[0]?.code || getFrameworkCode(source, framework);
319
+ tab.appendChild(code);
320
+ return tab;
321
+ }
322
+
323
+ async function getPreviewAxeContext(previewFrame) {
324
+ const previewDocument = previewFrame.contentDocument;
325
+ const previewWindow = previewFrame.contentWindow;
326
+ if (!previewDocument?.body || !previewWindow) {
327
+ throw new Error('O conteúdo do preview ainda não está disponível.');
328
+ }
329
+
330
+ if (!previewWindow.axe) {
331
+ const axeScriptUrl = new URL(`${getBaseUrl()}/assets/axe-core.min.js`, window.location.href).href;
332
+
333
+ const response = await fetch(axeScriptUrl);
334
+ if (!response.ok) throw new Error('Não foi possível carregar o Axe-Core no preview.');
335
+
336
+ const axeScript = previewDocument.createElement('script');
337
+ axeScript.textContent = await response.text();
338
+ previewDocument.head.appendChild(axeScript);
339
+ }
340
+
341
+ const previewContent = previewDocument.querySelector('[data-wbc-preview-content]');
342
+ if (!previewContent) throw new Error('Não foi possível localizar o conteúdo do exemplo.');
343
+
344
+ return { axe: previewWindow.axe, previewContent };
345
+ }
346
+
347
+ function getExampleHash(file) {
348
+ return `#${encodeURIComponent(file)}`;
349
+ }
350
+
351
+ function getRequestedExampleFile() {
352
+ if (!window.location.hash) return null;
353
+ try {
354
+ return decodeURIComponent(window.location.hash.slice(1));
355
+ } catch {
356
+ return window.location.hash.slice(1);
357
+ }
358
+ }
359
+
360
+ function createExampleElement(path, file, text, isExpanded = false, onOpen) {
361
+ text = stripDevServerConnector(text);
362
+ const contentDiv = document.createElement('br-item');
363
+ contentDiv.classList.add('file', 'wbc-example');
364
+ contentDiv.setAttribute('data-no-selection', '');
365
+ contentDiv.dataset.exampleFile = file;
366
+ const controlsScope = `wbc-example-${path}-${file}`.replace(/[^a-zA-Z0-9_-]/g, '-');
367
+ contentDiv.dataset.controlsScope = controlsScope;
368
+
369
+ const dropdown = document.createElement('br-dropdown');
370
+ dropdown.className = 'wbc-example-dropdown';
371
+ if (isExpanded) dropdown.setAttribute('is-open', '');
372
+ let initializeExample;
373
+ let isInitialized = false;
374
+
375
+ const preview = document.createElement('div');
376
+ preview.className = 'wbc-example-preview';
377
+ let previewFrame;
378
+
379
+ // --- EDITOR CONTAINER ---
380
+ const editorContainer = document.createElement('div');
381
+ editorContainer.className = 'wbc-example-editor-container';
382
+
383
+ const tabComponent = document.createElement('br-tab');
384
+ tabComponent.setAttribute('density', 'small');
385
+ tabComponent.setAttribute('active-tab-id', 'code-tab');
386
+
387
+ const codeTabItem = document.createElement('br-tab-item');
388
+ codeTabItem.setAttribute('label', 'HTML');
389
+ codeTabItem.setAttribute('icon', 'fab fa-html5');
390
+ codeTabItem.setAttribute('icon-only', 'true');
391
+ codeTabItem.setAttribute('title', 'HTML');
392
+ codeTabItem.setAttribute('tab-item-id', 'code-tab');
393
+ codeTabItem.setAttribute('active', 'true');
394
+ codeTabItem.setAttribute('is-active', 'true');
395
+
396
+ const eventsTabItem = document.createElement('br-tab-item');
397
+ eventsTabItem.setAttribute('label', 'Console');
398
+ eventsTabItem.setAttribute('icon', 'fas fa-terminal');
399
+ eventsTabItem.setAttribute('icon-only', 'true');
400
+ eventsTabItem.setAttribute('title', 'Console');
401
+ eventsTabItem.setAttribute('tab-item-id', 'events-tab');
402
+
403
+ const controlsTabItem = document.createElement('br-tab-item');
404
+ controlsTabItem.setAttribute('label', 'Controles');
405
+ controlsTabItem.setAttribute('icon', 'fas fa-sliders-h');
406
+ controlsTabItem.setAttribute('icon-only', 'true');
407
+ controlsTabItem.setAttribute('title', 'Controles');
408
+ controlsTabItem.setAttribute('tab-item-id', 'controls-tab');
409
+
410
+ const javascriptTabItem = createReadOnlyFrameworkTab('JS', 'fab fa-js', 'javascript-tab', text, 'javascript');
411
+ const cssTabItem = createReadOnlyFrameworkTab('CSS', 'fab fa-css3-alt', 'css-tab', text, 'css');
412
+ const angularTabItem = createReadOnlyFrameworkTab('Angular', 'fab fa-angular', 'angular-tab', text, 'angular');
413
+ const reactTabItem = createReadOnlyFrameworkTab('React', 'fab fa-react', 'react-tab', text, 'react');
414
+ const vueTabItem = createReadOnlyFrameworkTab('Vue', 'fab fa-vuejs', 'vue-tab', text, 'vue');
415
+ const frameworkTabItems = [javascriptTabItem, cssTabItem, angularTabItem, reactTabItem, vueTabItem];
416
+ const frameworkEditors = new Map();
417
+ const refreshFrameworkEditors = () => {
418
+ requestAnimationFrame(() => {
419
+ frameworkEditors.forEach((editor) => {
420
+ editor.refresh?.();
421
+ });
422
+ });
423
+ };
424
+ const getFrameworkEditorLanguage = (framework) => {
425
+ if (framework === 'css') return 'css';
426
+ if (framework === 'angular') return 'typescript';
427
+ if (framework === 'react') return 'tsx';
428
+ return 'html';
429
+ };
430
+
431
+ const selectFrameworkFile = (tab, filename, editor = frameworkEditors.get(tab)) => {
432
+ const files = tab._frameworkFiles || [];
433
+ const file = files.find((item) => item.filename === filename) || files[0];
434
+ if (!file) return;
435
+
436
+ tab.dataset.activeFilename = file.filename;
437
+ tab.querySelectorAll('.wbc-framework-file-tab').forEach((fileTab) => {
438
+ const isActive = fileTab.dataset.filename === file.filename;
439
+ fileTab.classList.toggle('is-active', isActive);
440
+ fileTab.setAttribute('aria-selected', String(isActive));
441
+ });
442
+
443
+ const code = tab.querySelector('.wbc-framework-code');
444
+ if (editor) {
445
+ editor.setLanguage?.(file.language);
446
+ editor.setValue(file.code);
447
+ } else if (code) {
448
+ code.dataset.filename = file.filename;
449
+ code.textContent = file.code;
450
+ }
451
+ };
452
+
453
+ const updateFrameworkCode = (source) => {
454
+ frameworkTabItems.forEach((tab) => {
455
+ const framework = tab.dataset.framework;
456
+ const files = getFrameworkFiles(source, framework);
457
+ tab._frameworkFiles = files;
458
+ const editor = frameworkEditors.get(tab);
459
+ if (files) {
460
+ selectFrameworkFile(tab, tab.dataset.activeFilename, editor);
461
+ return;
462
+ }
463
+
464
+ const value = getFrameworkCode(source, framework);
465
+ if (editor) editor.setValue(value);
466
+ else {
467
+ const code = tab.querySelector('.wbc-framework-code');
468
+ if (code) code.textContent = value;
469
+ }
470
+ });
471
+ };
472
+
473
+ const createActionButton = (iconClass, tooltipText, ariaLabel, onClick) => {
474
+ const tooltip = document.createElement('br-tooltip');
475
+ tooltip.setAttribute('position', 'bottom');
476
+
477
+ const button = document.createElement('br-button');
478
+ button.setAttribute('slot', 'trigger');
479
+ button.setAttribute('shape', 'circle');
480
+ button.setAttribute('density', 'small');
481
+ button.setAttribute('emphasis', 'secondary');
482
+ button.setAttribute('aria-label', ariaLabel);
483
+
484
+ const icon = document.createElement('i');
485
+ icon.className = iconClass;
486
+ button.appendChild(icon);
487
+
488
+ const tooltipContent = document.createElement('div');
489
+ tooltipContent.setAttribute('slot', 'content');
490
+ tooltipContent.textContent = tooltipText;
491
+
492
+ tooltip.appendChild(button);
493
+ tooltip.appendChild(tooltipContent);
494
+
495
+ button.addEventListener('click', onClick);
496
+
497
+ return { tooltip, button, icon, tooltipContent };
498
+ };
499
+
500
+ const editorState = { value: text };
501
+ let editorApi = null;
502
+ const getEditorValue = () => editorApi?.getValue() ?? editorState.value;
503
+ const refreshEditor = () => {
504
+ requestAnimationFrame(() => requestAnimationFrame(() => editorApi?.refresh?.()));
505
+ };
506
+
507
+ // 1. Copy Action
508
+ const copyAction = createActionButton('fas fa-copy', 'Copiar código', 'Copiar código', async () => {
509
+ try {
510
+ if (navigator.clipboard?.writeText) {
511
+ await navigator.clipboard.writeText(getEditorValue());
512
+ } else {
513
+ const fallback = document.createElement('textarea');
514
+ fallback.value = getEditorValue();
515
+ fallback.setAttribute('readonly', '');
516
+ fallback.style.position = 'fixed';
517
+ fallback.style.opacity = '0';
518
+ document.body.appendChild(fallback);
519
+ fallback.select();
520
+ document.execCommand('copy');
521
+ fallback.remove();
522
+ }
523
+ copyAction.icon.className = 'fas fa-check text-success';
524
+ copyAction.tooltipContent.textContent = 'Copiado!';
525
+ } catch {
526
+ copyAction.tooltipContent.textContent = 'Erro ao copiar';
527
+ }
528
+ setTimeout(() => {
529
+ copyAction.icon.className = 'fas fa-copy';
530
+ copyAction.tooltipContent.textContent = 'Copiar código';
531
+ }, 2000);
532
+ });
533
+
534
+ // 2. Share Action
535
+ const shareAction = createActionButton(
536
+ 'fas fa-share-alt',
537
+ 'Compartilhar exemplo',
538
+ 'Compartilhar exemplo',
539
+ async () => {
540
+ try {
541
+ await loadLzString();
542
+ } catch {
543
+ alert('Biblioteca de compartilhamento não carregada.');
544
+ return;
545
+ }
546
+ const state = {
547
+ p: path,
548
+ f: file,
549
+ h: getEditorValue(),
550
+ };
551
+ try {
552
+ const json = JSON.stringify(state);
553
+ const encoded = window.LZString.compressToEncodedURIComponent(json);
554
+ const url = new URL(window.location.href);
555
+ url.searchParams.set('pg_state', encoded);
556
+ url.hash = getExampleHash(file);
557
+
558
+ await navigator.clipboard.writeText(url.toString());
559
+
560
+ shareAction.icon.className = 'fas fa-check text-success';
561
+ shareAction.tooltipContent.textContent = 'Link copiado!';
562
+ setTimeout(() => {
563
+ shareAction.icon.className = 'fas fa-share-alt';
564
+ shareAction.tooltipContent.textContent = 'Compartilhar exemplo';
565
+ }, 2000);
566
+ } catch (err) {
567
+ console.error(err);
568
+ shareAction.tooltipContent.textContent = 'Erro ao compartilhar';
569
+ setTimeout(() => {
570
+ shareAction.icon.className = 'fas fa-share-alt';
571
+ shareAction.tooltipContent.textContent = 'Compartilhar exemplo';
572
+ }, 2000);
573
+ }
574
+ },
575
+ );
576
+
577
+ // 3. Fullscreen Action
578
+ const fsAction = createActionButton('fas fa-expand-arrows-alt', 'Tela cheia', 'Tela cheia', () => {
579
+ const isFullscreen = contentDiv.classList.toggle('is-fullscreen');
580
+ if (isFullscreen) {
581
+ fsAction.icon.className = 'fas fa-compress-arrows-alt';
582
+ fsAction.tooltipContent.textContent = 'Fechar tela cheia';
583
+ requestAnimationFrame(() => editorApi?.refresh?.());
584
+ } else {
585
+ fsAction.icon.className = 'fas fa-expand-arrows-alt';
586
+ fsAction.tooltipContent.textContent = 'Tela cheia';
587
+ }
588
+ });
589
+
590
+ // --- EXAMPLE CARD HEADER ---
591
+ const header = document.createElement('div');
592
+ header.className = 'wbc-example-header';
593
+
594
+ const title = document.createElement('h3');
595
+ title.textContent = file;
596
+ header.appendChild(title);
597
+
598
+ // Group all actions and toggle on the right
599
+ const headerActions = document.createElement('div');
600
+ headerActions.className = 'wbc-example-header-actions';
601
+
602
+ const exampleToggleTooltip = document.createElement('br-tooltip');
603
+ exampleToggleTooltip.setAttribute('position', 'bottom');
604
+
605
+ const exampleToggle = document.createElement('br-button');
606
+ exampleToggle.className = 'wbc-example-toggle';
607
+ exampleToggle.setAttribute('density', 'small');
608
+ exampleToggle.setAttribute('emphasis', 'secondary');
609
+ exampleToggle.setAttribute('shape', 'circle');
610
+ exampleToggle.setAttribute('aria-label', isExpanded ? 'Recolher exemplo' : 'Expandir exemplo');
611
+ exampleToggle.setAttribute('slot', 'trigger');
612
+
613
+ const exampleIcon = document.createElement('i');
614
+ exampleIcon.className = `fas fa-chevron-${isExpanded ? 'up' : 'down'}`;
615
+ exampleToggle.appendChild(exampleIcon);
616
+
617
+ const exampleToggleTooltipContent = document.createElement('div');
618
+ exampleToggleTooltipContent.setAttribute('slot', 'content');
619
+ exampleToggleTooltipContent.setAttribute('position', 'bottom');
620
+ exampleToggleTooltipContent.textContent = isExpanded ? 'Recolher exemplo' : 'Expandir exemplo';
621
+
622
+ exampleToggleTooltip.append(exampleToggle, exampleToggleTooltipContent);
623
+
624
+ header.setAttribute('slot', 'trigger');
625
+ header.addEventListener('click', (event) => {
626
+ if (event.target.closest('.wbc-example-header-actions') && !event.target.closest('.wbc-example-toggle')) {
627
+ event.stopPropagation();
628
+ }
629
+ });
630
+
631
+ const updateExampleToggle = (open) => {
632
+ exampleIcon.className = `fas fa-chevron-${open ? 'up' : 'down'}`;
633
+ exampleToggle.setAttribute('aria-label', open ? 'Recolher exemplo' : 'Expandir exemplo');
634
+ exampleToggleTooltipContent.textContent = open ? 'Recolher exemplo' : 'Expandir exemplo';
635
+ if (open) requestAnimationFrame(() => editorApi?.refresh?.());
636
+ };
637
+
638
+ dropdown.addEventListener('brDropdownOpenChange', (event) => {
639
+ const open = event.detail.open;
640
+ updateExampleToggle(open);
641
+ if (open) {
642
+ if (!isInitialized) {
643
+ dropdown.append(preview, fullscreenBottomPanel);
644
+ initializeExample?.();
645
+ isInitialized = true;
646
+ }
647
+ onOpen?.(file, contentDiv);
648
+ } else if (window.location.hash === getExampleHash(file)) {
649
+ window.history.replaceState({}, '', `${window.location.pathname}${window.location.search}`);
650
+ }
651
+ });
652
+
653
+ headerActions.append(copyAction.tooltip, shareAction.tooltip, fsAction.tooltip, exampleToggleTooltip);
654
+ header.appendChild(headerActions);
655
+
656
+ const editorWrapper = document.createElement('div');
657
+ editorWrapper.className = 'wbc-example-editor-wrapper';
658
+
659
+ const eventsWrapper = document.createElement('div');
660
+ eventsWrapper.className = 'wbc-example-events-wrapper';
661
+
662
+ const eventsHeader = document.createElement('div');
663
+ eventsHeader.className = 'wbc-events-header';
664
+
665
+ const filterContainer = document.createElement('div');
666
+ filterContainer.className = 'wbc-events-filter-container';
667
+ filterContainer.style.display = 'flex';
668
+ filterContainer.style.gap = '8px';
669
+ filterContainer.style.alignItems = 'flex-end';
670
+ filterContainer.style.marginBottom = '8px';
671
+
672
+ const eventFilterInput = document.createElement('br-input');
673
+ eventFilterInput.setAttribute('placeholder', 'Filtrar eventos...');
674
+ eventFilterInput.setAttribute('density', 'small');
675
+ eventFilterInput.style.flex = '1';
676
+
677
+ const copyEventsAction = createActionButton(
678
+ 'fas fa-copy',
679
+ 'Copiar lista de eventos',
680
+ 'Copiar lista de eventos',
681
+ async () => {
682
+ const visibleItems = Array.from(eventsList.querySelectorAll('li')).filter((li) => li.style.display !== 'none');
683
+ const textToCopy = visibleItems
684
+ .map((li) => {
685
+ const name = li.querySelector('.wbc-event-console-event-name').textContent;
686
+ const target = li.querySelector('.wbc-event-console-target').textContent;
687
+ const payload = li.querySelector('.wbc-event-console-detail')?.textContent || '';
688
+ return `${name}${target}${payload ? `\nPayload: ${payload}` : ''}`;
689
+ })
690
+ .join('\n---\n');
691
+
692
+ try {
693
+ if (navigator.clipboard?.writeText) {
694
+ await navigator.clipboard.writeText(textToCopy);
695
+ }
696
+ copyEventsAction.icon.className = 'fas fa-check text-success';
697
+ copyEventsAction.tooltipContent.textContent = 'Copiado!';
698
+ } catch (err) {
699
+ console.error('Erro ao copiar eventos:', err);
700
+ }
701
+ setTimeout(() => {
702
+ copyEventsAction.icon.className = 'fas fa-copy';
703
+ copyEventsAction.tooltipContent.textContent = 'Copiar lista de eventos';
704
+ }, 2000);
705
+ },
706
+ );
707
+
708
+ filterContainer.append(eventFilterInput, copyEventsAction.tooltip);
709
+
710
+ const eventsHelp = document.createElement('p');
711
+ eventsHelp.className = 'wbc-events-help';
712
+ eventsHelp.textContent = 'Eventos emitidos pelo componente aparecem abaixo.';
713
+
714
+ const eventsActions = document.createElement('div');
715
+ eventsActions.className = 'wbc-events-actions';
716
+ eventsActions.style.display = 'flex';
717
+ eventsActions.style.gap = '5px';
718
+
719
+ const pauseBtn = document.createElement('br-button');
720
+ pauseBtn.setAttribute('density', 'small');
721
+ pauseBtn.setAttribute('emphasis', 'secondary');
722
+ pauseBtn.textContent = 'Pausar';
723
+
724
+ const clearBtn = document.createElement('br-button');
725
+ clearBtn.setAttribute('density', 'small');
726
+ clearBtn.setAttribute('emphasis', 'secondary');
727
+ clearBtn.textContent = 'Limpar';
728
+
729
+ eventsActions.append(pauseBtn, clearBtn);
730
+ eventsHeader.append(eventsHelp, filterContainer, eventsActions);
731
+
732
+ const eventsList = document.createElement('ol');
733
+ eventsList.className = 'wbc-events-list';
734
+
735
+ eventsWrapper.append(eventsHeader, eventsList);
736
+
737
+ const applyFilter = () => {
738
+ const val = String(eventFilterInput.value ?? '').toLowerCase();
739
+ Array.from(eventsList.children).forEach((li) => {
740
+ const text = li.textContent.toLowerCase();
741
+ li.style.display = text.includes(val) ? '' : 'none';
742
+ });
743
+ };
744
+
745
+ eventFilterInput.addEventListener('input', applyFilter);
746
+ eventFilterInput.addEventListener('valueChange', applyFilter);
747
+
748
+ let newEventsCount = 0;
749
+ let isPaused = false;
750
+
751
+ pauseBtn.addEventListener('click', () => {
752
+ isPaused = !isPaused;
753
+ pauseBtn.textContent = isPaused ? 'Continuar' : 'Pausar';
754
+ });
755
+
756
+ clearBtn.addEventListener('click', () => {
757
+ eventsList.replaceChildren();
758
+ eventsTabItem.setAttribute('label', 'Console');
759
+ newEventsCount = 0;
760
+ });
761
+
762
+ const serialize = (value) => {
763
+ if (value === undefined) return '';
764
+ try {
765
+ return JSON.stringify(
766
+ value,
767
+ (_key, nestedValue) => {
768
+ if (nestedValue instanceof Element) {
769
+ return `<${nestedValue.localName}>`;
770
+ }
771
+ if (nestedValue instanceof Event) {
772
+ return { type: nestedValue.type };
773
+ }
774
+ return nestedValue;
775
+ },
776
+ 2,
777
+ );
778
+ } catch {
779
+ return String(value);
780
+ }
781
+ };
782
+
783
+ const describeTarget = (target) => {
784
+ if (!(target instanceof Element)) return 'window';
785
+ const id = target.id ? `#${target.id}` : '';
786
+ const classes = target.classList.length > 0 ? `.${Array.from(target.classList).slice(0, 2).join('.')}` : '';
787
+ return `${target.localName}${id}${classes}`;
788
+ };
789
+
790
+ const addEventEntry = (event, dispatchedBy, targetDescription) => {
791
+ if (isPaused) return;
792
+
793
+ const item = document.createElement('li');
794
+ const name = document.createElement('span');
795
+ const target = document.createElement('span');
796
+
797
+ name.className = 'wbc-event-console-event-name';
798
+ name.textContent = event.type;
799
+ target.className = 'wbc-event-console-target';
800
+ target.textContent = ` — ${targetDescription || describeTarget(event.target || dispatchedBy)}`;
801
+ item.append(name, target);
802
+
803
+ if (event instanceof CustomEvent && event.detail !== undefined && event.detail !== null) {
804
+ const detailsEl = document.createElement('details');
805
+ detailsEl.className = 'wbc-event-console-details-container';
806
+
807
+ const summaryEl = document.createElement('summary');
808
+ summaryEl.textContent = 'payload';
809
+
810
+ const preEl = document.createElement('pre');
811
+ preEl.className = 'wbc-event-console-detail';
812
+ preEl.textContent = serialize(event.detail);
813
+
814
+ detailsEl.append(summaryEl, preEl);
815
+ item.appendChild(detailsEl);
816
+ }
817
+
818
+ eventsList.prepend(item);
819
+ applyFilter(); // Garante que novos eventos respeitem o filtro atual
820
+
821
+ const maxEntries = 100;
822
+ while (eventsList.children.length > maxEntries) {
823
+ eventsList.lastElementChild?.remove();
824
+ }
825
+
826
+ const isActive = eventsTabItem.getAttribute('is-active') === 'true';
827
+ if (!isActive) {
828
+ newEventsCount++;
829
+ eventsTabItem.setAttribute('label', `Console (${newEventsCount})`);
830
+ }
831
+ };
832
+
833
+ window.WBCActiveRecorders = window.WBCActiveRecorders || [];
834
+ const recorder = {
835
+ preview,
836
+ addEvent: addEventEntry,
837
+ };
838
+ window.addEventListener('message', (event) => {
839
+ if (!previewFrame || event.source !== previewFrame.contentWindow || !event.data?.type?.startsWith('wbc-preview-'))
840
+ return;
841
+ if (event.data.type === 'wbc-preview-height') {
842
+ const maxHeight = contentDiv.classList.contains('is-fullscreen') ? Infinity : window.innerHeight * 0.75;
843
+ previewFrame.style.height = `${Math.max(1, Math.min(event.data.height, maxHeight))}px`;
844
+ } else if (event.data.type === 'wbc-preview-event') {
845
+ const bridgedEvent = event.data.custom
846
+ ? new CustomEvent(event.data.eventType, { detail: event.data.detail })
847
+ : new Event(event.data.eventType);
848
+ addEventEntry(bridgedEvent, previewFrame, event.data.target);
849
+ }
850
+ });
851
+ window.WBCActiveRecorders.push(recorder);
852
+ window.WBCRegisterNativeEventRecorder?.(recorder);
853
+
854
+ const setEditorValue = (value) => {
855
+ editorState.value = value;
856
+ editorApi?.setValue(value);
857
+ applyEditorValue(value);
858
+ };
859
+
860
+ tabComponent.addEventListener('brTabChange', (event) => {
861
+ const activeTabId = event.detail.tabId;
862
+ if (activeTabId !== 'code-tab') {
863
+ eventsTabItem.setAttribute('label', 'Console');
864
+ newEventsCount = 0;
865
+ }
866
+ if (frameworkTabItems.some((tab) => tab.getAttribute('tab-item-id') === activeTabId)) {
867
+ refreshFrameworkEditors();
868
+ }
869
+ });
870
+
871
+ codeTabItem.appendChild(editorWrapper);
872
+ eventsTabItem.appendChild(eventsWrapper);
873
+
874
+ // --- ACCESSIBILITY TAB ---
875
+ const a11yTabItem = document.createElement('br-tab-item');
876
+ a11yTabItem.setAttribute('label', 'Acessibilidade');
877
+ a11yTabItem.setAttribute('icon', 'fas fa-universal-access');
878
+ a11yTabItem.setAttribute('icon-only', 'true');
879
+ a11yTabItem.setAttribute('title', 'Acessibilidade');
880
+ a11yTabItem.setAttribute('tab-item-id', 'a11y-tab');
881
+
882
+ const a11yWrapper = document.createElement('div');
883
+ a11yWrapper.className = 'wbc-example-a11y-wrapper';
884
+
885
+ const a11yHeader = document.createElement('div');
886
+ a11yHeader.className = 'wbc-a11y-header';
887
+
888
+ const a11yHelp = document.createElement('p');
889
+ a11yHelp.className = 'wbc-a11y-help';
890
+ a11yHelp.textContent = 'Analisa a acessibilidade do exemplo acima usando o Axe-Core.';
891
+
892
+ a11yHeader.appendChild(a11yHelp);
893
+
894
+ const a11yResults = document.createElement('div');
895
+ a11yResults.className = 'wbc-a11y-results';
896
+
897
+ a11yWrapper.append(a11yHeader, a11yResults);
898
+ a11yTabItem.appendChild(a11yWrapper);
899
+
900
+ const runAccessibilityAudit = async () => {
901
+ if (!window.axe) {
902
+ a11yResults.innerHTML =
903
+ '<p class="text-danger mt-3">Axe-Core não está carregado. Verifique a conexão ou recarregue a página.</p>';
904
+ return;
905
+ }
906
+
907
+ a11yResults.innerHTML =
908
+ '<p class="mt-3"><i class="fas fa-spinner fa-spin mr-2"></i>Analisando acessibilidade...</p>';
909
+
910
+ try {
911
+ const { axe, previewContent } = await getPreviewAxeContext(previewFrame);
912
+ const results = await axe.run(previewContent);
913
+
914
+ if (results.violations.length === 0) {
915
+ a11yResults.innerHTML =
916
+ '<p class="text-success mt-3"><i class="fas fa-check-circle mr-2"></i>Nenhum problema de acessibilidade detectado!</p>';
917
+ } else {
918
+ a11yResults.innerHTML = '';
919
+
920
+ const violationsList = document.createElement('ul');
921
+ violationsList.className = 'wbc-a11y-violations-list mt-3';
922
+
923
+ results.violations.forEach((violation) => {
924
+ const item = document.createElement('li');
925
+ item.className = 'wbc-a11y-violation-item mb-3';
926
+
927
+ const title = document.createElement('div');
928
+ title.className = 'wbc-a11y-violation-title';
929
+
930
+ const impactBadge = document.createElement('span');
931
+ impactBadge.className = `badge-impact impact-${violation.impact}`;
932
+ impactBadge.textContent = violation.impact;
933
+
934
+ const helpText = document.createElement('span');
935
+ helpText.innerHTML = `<strong>${violation.help}</strong>`;
936
+
937
+ title.append(helpText, impactBadge);
938
+
939
+ const desc = document.createElement('p');
940
+ desc.className = 'wbc-a11y-violation-desc';
941
+ desc.textContent = violation.description;
942
+
943
+ const helpUrl = document.createElement('a');
944
+ helpUrl.href = violation.helpUrl;
945
+ helpUrl.target = '_blank';
946
+ helpUrl.className = 'wbc-a11y-violation-link';
947
+ helpUrl.textContent = 'Mais informações';
948
+
949
+ item.append(title, desc, helpUrl);
950
+ violationsList.appendChild(item);
951
+ });
952
+
953
+ a11yResults.appendChild(violationsList);
954
+ }
955
+ } catch (err) {
956
+ console.error(err);
957
+ a11yResults.innerHTML = `<p class="text-danger mt-3">Erro ao executar a análise: ${err.message}</p>`;
958
+ }
959
+ };
960
+
961
+ tabComponent.addEventListener('brTabChange', (event) => {
962
+ if (event.detail.tabId === 'a11y-tab') runAccessibilityAudit();
963
+ if (event.detail.tabId === 'code-tab') refreshEditor();
964
+ });
965
+
966
+ tabComponent.append(
967
+ codeTabItem,
968
+ controlsTabItem,
969
+ javascriptTabItem,
970
+ cssTabItem,
971
+ eventsTabItem,
972
+ angularTabItem,
973
+ reactTabItem,
974
+ vueTabItem,
975
+ a11yTabItem,
976
+ );
977
+ editorContainer.append(tabComponent);
978
+
979
+ let controlsCssSource = '';
980
+ const renderCurrentPreview = (source) => {
981
+ const managedStyle = controlsCssSource ? `<style data-playground-controls-css>${controlsCssSource}</style>` : '';
982
+ renderExamplePreview(preview, `${source}${managedStyle}`, path === 'templates');
983
+ };
984
+
985
+ const applyEditorValue = (source) => {
986
+ editorState.value = source;
987
+ updateFrameworkCode(source);
988
+ renderCurrentPreview(source);
989
+ renderedFilesContent[file] = { content: source.toLowerCase(), element: contentDiv };
990
+ // The example script lives in the preview iframe and is recreated with it.
991
+ };
992
+
993
+ const fullscreenBottomPanel = document.createElement('div');
994
+ fullscreenBottomPanel.className = 'wbc-example-fullscreen-bottom-panel';
995
+ fullscreenBottomPanel.appendChild(editorContainer);
996
+
997
+ preview.setAttribute('slot', 'target');
998
+ fullscreenBottomPanel.setAttribute('slot', 'target');
999
+ dropdown.appendChild(header);
1000
+ contentDiv.appendChild(dropdown);
1001
+
1002
+ initializeExample = () => {
1003
+ previewFrame = document.createElement('iframe');
1004
+ previewFrame.className = 'wbc-example-preview-frame';
1005
+ previewFrame.title = `Preview do exemplo ${file}`;
1006
+ previewFrame.dataset.path = path;
1007
+ previewFrame.setAttribute('loading', 'eager');
1008
+ preview.appendChild(previewFrame);
1009
+ renderCurrentPreview(text);
1010
+
1011
+ const editorReady = window.WBCCodeEditorReady || Promise.resolve(window.WBCCodeEditor);
1012
+ editorReady.then(() => {
1013
+ if (!editorContainer.closest('body')) return;
1014
+ editorWrapper.textContent = '';
1015
+ editorApi = window.WBCCodeEditor.create({
1016
+ ariaLabel: `Código fonte do exemplo ${file}`,
1017
+ onChange: applyEditorValue,
1018
+ parent: editorWrapper,
1019
+ value: editorState.value,
1020
+ language: 'html',
1021
+ });
1022
+
1023
+ const createFrameworkEditor = (tab) => {
1024
+ const code = tab.querySelector('.wbc-framework-code');
1025
+ if (!code) return;
1026
+ const editorContainer = document.createElement('div');
1027
+ editorContainer.className = 'wbc-framework-editor';
1028
+ code.replaceWith(editorContainer);
1029
+ const framework = code.dataset.framework;
1030
+ const editor = window.WBCCodeEditor.create({
1031
+ ariaLabel: `Código ${tab.getAttribute('label')}`,
1032
+ onChange: () => {},
1033
+ parent: editorContainer,
1034
+ value: code.textContent || '',
1035
+ language: getFrameworkEditorLanguage(framework),
1036
+ readOnly: true,
1037
+ });
1038
+ frameworkEditors.set(tab, editor);
1039
+ tab.querySelectorAll('.wbc-framework-file-tab').forEach((fileTab) => {
1040
+ fileTab.addEventListener('click', () => selectFrameworkFile(tab, fileTab.dataset.filename, editor));
1041
+ });
1042
+ selectFrameworkFile(tab, tab.dataset.activeFilename, editor);
1043
+ };
1044
+ frameworkTabItems.forEach(createFrameworkEditor);
1045
+ refreshEditor();
1046
+ refreshFrameworkEditors();
1047
+ });
1048
+
1049
+ customElements.whenDefined('br-tab').then(() => {
1050
+ requestAnimationFrame(async () => {
1051
+ await tabComponent.setActiveTab?.('code-tab');
1052
+ refreshEditor();
1053
+ });
1054
+ });
1055
+
1056
+ window.WBCComponentControls?.enhance({
1057
+ editorContainer,
1058
+ controlsTabItem,
1059
+ getCss: () => controlsCssSource,
1060
+ getHtml: getEditorValue,
1061
+ preferredTag: `br-${path}`,
1062
+ scopeSelector: 'body',
1063
+ setCss: (value) => {
1064
+ controlsCssSource = value;
1065
+ renderCurrentPreview(getEditorValue());
1066
+ },
1067
+ setHtml: (value) => {
1068
+ setEditorValue(value);
1069
+ },
1070
+ });
1071
+ };
1072
+
1073
+ renderedFilesContent[file] = { content: text.toLowerCase(), element: contentDiv };
1074
+
1075
+ return contentDiv;
1076
+ }
1077
+
1078
+ function createComponentTags(metadata) {
1079
+ const wrapper = document.createElement('div');
1080
+ wrapper.className = 'wbc-component-tags';
1081
+ wrapper.setAttribute('aria-label', 'Classificação do componente');
1082
+ const colors = { stable: 'var(--success)', beta: 'var(--warning)', deprecated: 'var(--danger)' };
1083
+ const labels = { stable: 'Estável', beta: 'Beta', deprecated: 'Depreciado' };
1084
+ (metadata?.categories || []).forEach((category) => {
1085
+ const tag = document.createElement('br-tag');
1086
+ tag.setAttribute('label', category);
1087
+ tag.setAttribute('bg-color', 'var(--interactive)');
1088
+ tag.className = 'wbc-component-category';
1089
+ wrapper.appendChild(tag);
1090
+ });
1091
+ const status = metadata?.status || 'stable';
1092
+ const statusTag = document.createElement('br-tag');
1093
+ statusTag.setAttribute('label', labels[status] || labels.stable);
1094
+ statusTag.setAttribute('bg-color', colors[status] || colors.stable);
1095
+ statusTag.className = `wbc-component-status wbc-component-status--${status}`;
1096
+ wrapper.appendChild(statusTag);
1097
+ return wrapper;
1098
+ }
1099
+
1100
+ function getInitialExampleFile(path, files) {
1101
+ const requestedFile = getRequestedExampleFile();
1102
+ if (files.includes(requestedFile)) return { initialFile: requestedFile, requestedFile };
1103
+ if (window.SHARED_STATE?.p === path) return { initialFile: window.SHARED_STATE.f, requestedFile };
1104
+ return { initialFile: 'default', requestedFile };
1105
+ }
1106
+
1107
+ function createExamplesList(path, results, initialFile) {
1108
+ let sharedElementToScroll = null;
1109
+ const examples = document.createElement('br-list');
1110
+ examples.className = 'wbc-examples-list';
1111
+ examples.setAttribute('list-role', 'group');
1112
+ examples.setAttribute('divider', '');
1113
+ results.sort((a, b) => Number(b.file === 'default') - Number(a.file === 'default'));
1114
+ results.forEach(({ file, text }, index) => {
1115
+ const element = createExampleElement(
1116
+ path,
1117
+ file,
1118
+ text,
1119
+ file === initialFile || (!initialFile && index === 0),
1120
+ (openedFile) => {
1121
+ const hash = getExampleHash(openedFile);
1122
+ if (window.location.hash !== hash) {
1123
+ window.history.replaceState({}, '', `${window.location.pathname}${window.location.search}${hash}`);
1124
+ }
1125
+ examples.querySelectorAll('br-dropdown').forEach((other) => {
1126
+ if (other !== element.querySelector('br-dropdown') && other.isOpen) other.isOpen = false;
1127
+ });
1128
+ },
1129
+ );
1130
+ examples.appendChild(element);
1131
+ if (window.SHARED_STATE?.p === path && window.SHARED_STATE?.f === file) sharedElementToScroll = element;
1132
+ });
1133
+ return { examples, sharedElementToScroll };
1134
+ }
1135
+
1136
+ function openInitialDropdown(examples, initialFile) {
1137
+ const initialDropdown = initialFile
1138
+ ? examples.querySelector(`[data-example-file="${CSS.escape(initialFile)}"] br-dropdown`)
1139
+ : null;
1140
+ if (!initialDropdown) return;
1141
+ customElements.whenDefined('br-dropdown').then(() => {
1142
+ initialDropdown.isOpen = false;
1143
+ initialDropdown.open();
1144
+ });
1145
+ }
1146
+
1147
+ function scrollToInitialExample(examples, requestedFile, sharedElementToScroll) {
1148
+ const hashElement = requestedFile
1149
+ ? examples.querySelector(`[data-example-file="${CSS.escape(requestedFile)}"]`)
1150
+ : null;
1151
+ if (hashElement) setTimeout(() => hashElement.scrollIntoView({ behavior: 'smooth', block: 'center' }), 500);
1152
+ if (sharedElementToScroll) {
1153
+ setTimeout(() => {
1154
+ sharedElementToScroll.scrollIntoView({ behavior: 'smooth', block: 'center' });
1155
+ sharedElementToScroll.classList.add('wbc-example-shared-highlight');
1156
+ }, 500);
1157
+ }
1158
+ }
1159
+
1160
+ function renderLoadedPage(path, files, results) {
1161
+ const metadata = window.MENU_ITEMS?.find((item) => item.path === path);
1162
+ if (metadata) CONTENT_ELEMENT.appendChild(createComponentTags(metadata));
1163
+ const { initialFile, requestedFile } = getInitialExampleFile(path, files);
1164
+ const { examples, sharedElementToScroll } = createExamplesList(path, results, initialFile);
1165
+ CONTENT_ELEMENT.appendChild(examples);
1166
+ openInitialDropdown(examples, initialFile);
1167
+ if (initialFile && files.includes(initialFile) && window.location.hash !== getExampleHash(initialFile)) {
1168
+ window.history.replaceState(
1169
+ {},
1170
+ '',
1171
+ `${window.location.pathname}${window.location.search}${getExampleHash(initialFile)}`,
1172
+ );
1173
+ }
1174
+ scrollToInitialExample(examples, requestedFile, sharedElementToScroll);
1175
+ currentLoadedPath = path;
1176
+ }
1177
+
1178
+ function loadPage(path, files) {
1179
+ window.WBCActiveRecorders = [];
1180
+ CONTENT_ELEMENT.innerHTML = '';
1181
+ renderedFilesContent = {};
1182
+ if (COMPONENTS_FILTER) COMPONENTS_FILTER.value = ''; // Limpa o campo de busca ao trocar de página
1183
+ if (CLEAR_COMPONENTS_FILTER) CLEAR_COMPONENTS_FILTER.style.display = 'none'; // Esconde o botão de limpar
1184
+
1185
+ const baseUrl = getBaseUrl();
1186
+ const promises = files.map((file) => {
1187
+ if (window.SHARED_STATE && window.SHARED_STATE.p === path && window.SHARED_STATE.f === file) {
1188
+ return Promise.resolve({ file, text: stripDevServerConnector(window.SHARED_STATE.h) });
1189
+ }
1190
+ return fetch(`${baseUrl}/pages/components/${path}/${file}.html`).then((response) =>
1191
+ response.text().then((text) => ({ file, text: stripDevServerConnector(text) })),
1192
+ );
1193
+ });
1194
+
1195
+ Promise.all(promises)
1196
+ .then((results) => renderLoadedPage(path, files, results))
1197
+ .catch((error) => {
1198
+ console.log('Erro ao carregar a página:', error);
1199
+ });
1200
+ }
1201
+
1202
+ function loadMarkdown(path) {
1203
+ CONTENT_ELEMENT.innerHTML = '';
1204
+ renderedFilesContent = {};
1205
+ if (COMPONENTS_FILTER) COMPONENTS_FILTER.value = ''; // Limpa o campo de busca ao trocar de página
1206
+ if (CLEAR_COMPONENTS_FILTER) CLEAR_COMPONENTS_FILTER.style.display = 'none'; // Esconde o botão de limpar
1207
+
1208
+ const baseUrl = getBaseUrl();
1209
+ fetch(`${baseUrl}/assets/stencil-generated-docs/${path}.md`)
1210
+ .then((response) => response.text())
1211
+ .then((text) => {
1212
+ const contentDiv = document.createElement('div');
1213
+ contentDiv.classList.add('file', 'mt-2', 'mb-5');
1214
+ const parsedMarkdown = typeof markdownParser?.parse === 'function' ? markdownParser.parse(text) : text;
1215
+ contentDiv.innerHTML = parsedMarkdown;
1216
+ CONTENT_ELEMENT.appendChild(contentDiv);
1217
+ currentLoadedPath = path;
1218
+
1219
+ renderedFilesContent[path] = { content: contentDiv.innerHTML.toLowerCase(), element: contentDiv };
1220
+ })
1221
+ .catch((error) => {
1222
+ console.error('Erro ao carregar a página:', error);
1223
+ });
1224
+ }
1225
+
1226
+ function filterContent() {
1227
+ const filterValue = (COMPONENTS_FILTER?.value || '').toLowerCase();
1228
+ const normalizedFilterValue = filterValue.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
1229
+
1230
+ Object.values(renderedFilesContent).forEach(({ content, element }) => {
1231
+ const titleElement = element.querySelector('h3');
1232
+ const titleText = titleElement ? titleElement.textContent.toLowerCase() : '';
1233
+ const normalizedTitleText = titleText.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
1234
+
1235
+ // Inicializa o conteúdo do shadow DOM para componentes personalizados
1236
+ let shadowContent = '';
1237
+
1238
+ // Função para coletar o conteúdo dos slots de um custom element
1239
+ const collectSlotContent = (customElement) => {
1240
+ if (customElement.shadowRoot) {
1241
+ const slots = customElement.shadowRoot.querySelectorAll('slot');
1242
+ slots.forEach((slot) => {
1243
+ const assignedNodes = slot.assignedNodes();
1244
+ assignedNodes.forEach((node) => {
1245
+ shadowContent += `${node.textContent.toLowerCase()} `;
1246
+ });
1247
+ });
1248
+ }
1249
+ };
1250
+
1251
+ // Procura todos os custom elements dentro do elemento
1252
+ const customElements = element.querySelectorAll('*');
1253
+ customElements.forEach((customElement) => {
1254
+ if (customElement.tagName.includes('-')) {
1255
+ // Identifica se é um custom element
1256
+ collectSlotContent(customElement);
1257
+ }
1258
+ });
1259
+
1260
+ // Filtra o conteúdo
1261
+ const combinedContent = `${content} ${shadowContent}`; // Combina conteúdo e shadow content
1262
+
1263
+ if (element.querySelector('table')) {
1264
+ const rows = element.querySelectorAll('table tr');
1265
+ rows.forEach((row, index) => {
1266
+ if (index === 0) {
1267
+ row.style.display = '';
1268
+ } else {
1269
+ const rowText = row.textContent
1270
+ .toLowerCase()
1271
+ .normalize('NFD')
1272
+ .replace(/[\u0300-\u036f]/g, '');
1273
+ row.style.display = rowText.includes(normalizedFilterValue) ? '' : 'none';
1274
+ }
1275
+ });
1276
+ } else if (
1277
+ normalizedFilterValue &&
1278
+ (combinedContent.includes(normalizedFilterValue) || normalizedTitleText.includes(normalizedFilterValue))
1279
+ ) {
1280
+ element.style.display = ''; // Exibe o elemento se o conteúdo combinado inclui o valor filtrado
1281
+ } else {
1282
+ element.style.display = normalizedFilterValue ? 'none' : ''; // Oculta se não houver filtro
1283
+ }
1284
+ });
1285
+
1286
+ if (CLEAR_COMPONENTS_FILTER) CLEAR_COMPONENTS_FILTER.style.display = filterValue ? 'block' : 'none';
1287
+ }
1288
+
1289
+ function processMenuItems(menuItems, menuBody, currentPath) {
1290
+ if (!Array.isArray(menuItems)) return;
1291
+ menuItems.forEach((page) => {
1292
+ if (!page?.path) return;
1293
+ const link = menuBody
1294
+ ? Array.from(menuBody.children).find((item) => item.getAttribute('href') === `/${page.path}`)
1295
+ : null;
1296
+ if (page.path === currentPath) {
1297
+ if (link) {
1298
+ link.active = true;
1299
+ link.classList.add('active');
1300
+ }
1301
+ if (Array.isArray(page.files)) loadPage(page.path, page.files);
1302
+ }
1303
+ });
1304
+ }
1305
+
1306
+ function processStaticItems(staticItems, menuBody, currentPath) {
1307
+ if (!Array.isArray(staticItems)) return;
1308
+ staticItems.forEach((page) => {
1309
+ if (!page?.path) return;
1310
+ const link = menuBody
1311
+ ? Array.from(menuBody.children).find((item) => item.getAttribute('href') === `/${page.path}`)
1312
+ : null;
1313
+ if (page.path === currentPath) {
1314
+ if (link) {
1315
+ link.active = true;
1316
+ link.classList.add('active');
1317
+ }
1318
+ loadMarkdown(page.path);
1319
+ }
1320
+ });
1321
+ }
1322
+
1323
+ // Liga eventos apenas se os elementos existirem
1324
+ if (COMPONENTS_FILTER) {
1325
+ COMPONENTS_FILTER.addEventListener('input', filterContent);
1326
+ }
1327
+
1328
+ if (CLEAR_COMPONENTS_FILTER) {
1329
+ CLEAR_COMPONENTS_FILTER.addEventListener('click', () => {
1330
+ if (COMPONENTS_FILTER) COMPONENTS_FILTER.value = '';
1331
+ filterContent();
1332
+ });
1333
+ }
1334
+
1335
+ function loadPageFromURL() {
1336
+ const baseUrl = getBaseUrl();
1337
+ const currentPath = window.location.pathname.replace(baseUrl, '').split('/').filter(Boolean)[0] || '';
1338
+
1339
+ // Evita recarregar a mesma rota em chamadas repetidas
1340
+ if (currentPath === currentLoadedPath) {
1341
+ return;
1342
+ }
1343
+
1344
+ const menuItems = Array.isArray(window.MENU_ITEMS) ? window.MENU_ITEMS : [];
1345
+ const menuBody = typeof window.MENU_BODY !== 'undefined' ? window.MENU_BODY : null;
1346
+
1347
+ // Remove seleções antigas
1348
+ if (menuBody) {
1349
+ Array.from(menuBody.children).forEach((item) => {
1350
+ item.active = false;
1351
+ item.classList.remove('active');
1352
+ });
1353
+ }
1354
+
1355
+ processMenuItems(menuItems, menuBody, currentPath);
1356
+ processStaticItems(window.MENU_STATIC_ITEMS, menuBody, currentPath);
1357
+
1358
+ if (currentPath.trim().length === 0 && menuItems.length > 0) {
1359
+ const firstPage = menuItems.find((p) => p?.path && Array.isArray(p.files));
1360
+ if (firstPage) {
1361
+ loadPage(firstPage.path, firstPage.files);
1362
+ const firstLink = menuBody
1363
+ ? Array.from(menuBody.children).find((item) => item.getAttribute('href') === `/${firstPage.path}`)
1364
+ : null;
1365
+ if (firstLink) {
1366
+ firstLink.active = true;
1367
+ firstLink.classList.add('active');
1368
+ }
1369
+ window.history.pushState({}, '', `${baseUrl}/${firstPage.path}`);
1370
+ }
1371
+ }
1372
+ }
1373
+
1374
+ // Aguarda DOM e dados do menu antes de tentar carregar a rota atual
1375
+ function isMenuReady() {
1376
+ const hasItems =
1377
+ (Array.isArray(window.MENU_ITEMS) && window.MENU_ITEMS.length > 0) ||
1378
+ (Array.isArray(window.MENU_STATIC_ITEMS) && window.MENU_STATIC_ITEMS.length > 0);
1379
+ return !!CONTENT_ELEMENT && hasItems;
1380
+ }
1381
+
1382
+ function bootstrapRouting(attempt = 0) {
1383
+ const maxAttempts = 200; // ~10s com 50ms
1384
+ if (!isMenuReady()) {
1385
+ if (attempt < maxAttempts) {
1386
+ setTimeout(() => bootstrapRouting(attempt + 1), 50);
1387
+ } else {
1388
+ // Última tentativa mesmo sem menu (evita ficar em branco caso os itens não sejam necessários)
1389
+ try {
1390
+ loadPageFromURL();
1391
+ } catch (err) {
1392
+ console.warn('Falha ao carregar rota sem menu pronto:', err);
1393
+ }
1394
+ }
1395
+ return;
1396
+ }
1397
+ loadPageFromURL();
1398
+ }
1399
+
1400
+ if (document.readyState === 'loading') {
1401
+ document.addEventListener('DOMContentLoaded', () => bootstrapRouting());
1402
+ } else {
1403
+ bootstrapRouting();
1404
+ }
1405
+
1406
+ // Garante atualização ao navegar com back/forward
1407
+ window.addEventListener('popstate', () => bootstrapRouting());
1408
+
1409
+ window.addEventListener('hashchange', () => {
1410
+ const file = getRequestedExampleFile();
1411
+ const example = file ? document.querySelector(`br-item[data-example-file="${CSS.escape(file)}"]`) : null;
1412
+ if (!example) return;
1413
+
1414
+ const dropdown = example.querySelector('br-dropdown');
1415
+ if (dropdown) dropdown.isOpen = true;
1416
+ document.querySelectorAll('.wbc-example-dropdown').forEach((other) => {
1417
+ if (other !== dropdown) other.isOpen = false;
1418
+ });
1419
+ setTimeout(() => example.scrollIntoView({ behavior: 'smooth', block: 'center' }), 100);
1420
+ });