@beeq/core 1.8.0-beta.4 → 1.8.0-beta.5

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 (355) hide show
  1. package/dist/beeq/beeq.esm.js +1 -1
  2. package/dist/beeq/beeq.esm.js.map +1 -1
  3. package/dist/beeq/index.esm.js +12 -12
  4. package/dist/beeq/{p-7ea146b8.entry.js → p-01fe8efb.entry.js} +1 -3
  5. package/dist/beeq/{p-7ea146b8.entry.js.map → p-01fe8efb.entry.js.map} +1 -1
  6. package/dist/beeq/{p-d9bcaeed.entry.js → p-03373320.entry.js} +1 -3
  7. package/dist/beeq/{p-d9bcaeed.entry.js.map → p-03373320.entry.js.map} +1 -1
  8. package/dist/beeq/{p-e06c8398.entry.js → p-03c586df.entry.js} +19 -21
  9. package/dist/beeq/p-03c586df.entry.js.map +1 -0
  10. package/dist/beeq/{p-a94d15f9.entry.js → p-0a981080.entry.js} +1 -3
  11. package/dist/beeq/{p-a94d15f9.entry.js.map → p-0a981080.entry.js.map} +1 -1
  12. package/dist/beeq/{p-03e23dca.entry.js → p-0ce76c54.entry.js} +1 -3
  13. package/dist/beeq/{p-03e23dca.entry.js.map → p-0ce76c54.entry.js.map} +1 -1
  14. package/dist/beeq/{p-f5eb8fff.entry.js → p-2bb049ae.entry.js} +2 -4
  15. package/dist/beeq/{p-f5eb8fff.entry.js.map → p-2bb049ae.entry.js.map} +1 -1
  16. package/dist/beeq/{p-8b6fc3ef.entry.js → p-3043c826.entry.js} +5 -7
  17. package/dist/beeq/{p-8b6fc3ef.entry.js.map → p-3043c826.entry.js.map} +1 -1
  18. package/dist/beeq/{p-fe57aa48.entry.js → p-38e70f78.entry.js} +1 -3
  19. package/dist/beeq/{p-fe57aa48.entry.js.map → p-38e70f78.entry.js.map} +1 -1
  20. package/dist/beeq/{p-818cd6d7.entry.js → p-398bfb48.entry.js} +1 -3
  21. package/dist/beeq/{p-818cd6d7.entry.js.map → p-398bfb48.entry.js.map} +1 -1
  22. package/dist/beeq/{p-cdd5b425.entry.js → p-3f9a348a.entry.js} +2 -4
  23. package/dist/beeq/{p-cdd5b425.entry.js.map → p-3f9a348a.entry.js.map} +1 -1
  24. package/dist/beeq/{p-27974392.entry.js → p-41ac1d84.entry.js} +2 -4
  25. package/dist/beeq/{p-27974392.entry.js.map → p-41ac1d84.entry.js.map} +1 -1
  26. package/dist/beeq/{p-908c57e9.entry.js → p-4eabcd51.entry.js} +1 -3
  27. package/dist/beeq/{p-908c57e9.entry.js.map → p-4eabcd51.entry.js.map} +1 -1
  28. package/dist/beeq/{p-d2f682a9.entry.js → p-544deac1.entry.js} +3 -5
  29. package/dist/beeq/{p-d2f682a9.entry.js.map → p-544deac1.entry.js.map} +1 -1
  30. package/dist/beeq/{p-f5d59aba.entry.js → p-5ff6621d.entry.js} +2 -4
  31. package/dist/beeq/{p-f5d59aba.entry.js.map → p-5ff6621d.entry.js.map} +1 -1
  32. package/dist/beeq/{p-3e3fd7b5.entry.js → p-60cbc966.entry.js} +1 -3
  33. package/dist/beeq/{p-3e3fd7b5.entry.js.map → p-60cbc966.entry.js.map} +1 -1
  34. package/dist/beeq/{p-98de0101.entry.js → p-68ff188d.entry.js} +1 -3
  35. package/dist/beeq/{p-98de0101.entry.js.map → p-68ff188d.entry.js.map} +1 -1
  36. package/dist/beeq/{p-7aa47927.entry.js → p-69c766a3.entry.js} +9 -11
  37. package/dist/beeq/p-69c766a3.entry.js.map +1 -0
  38. package/dist/beeq/{p-89665044.entry.js → p-76486949.entry.js} +2 -4
  39. package/dist/beeq/{p-89665044.entry.js.map → p-76486949.entry.js.map} +1 -1
  40. package/dist/beeq/{p-0fce4de9.js → p-83d6d9ad.js} +2 -4
  41. package/dist/beeq/{p-0fce4de9.js.map → p-83d6d9ad.js.map} +1 -1
  42. package/dist/beeq/{p-03749fbf.entry.js → p-8b16f130.entry.js} +1 -3
  43. package/dist/beeq/{p-03749fbf.entry.js.map → p-8b16f130.entry.js.map} +1 -1
  44. package/dist/beeq/{p-b877d662.entry.js → p-8e1c6978.entry.js} +80 -49
  45. package/dist/beeq/p-8e1c6978.entry.js.map +1 -0
  46. package/dist/beeq/p-8f1c68c0.js +71 -0
  47. package/dist/beeq/p-8f1c68c0.js.map +1 -0
  48. package/dist/beeq/{p-5d51cadd.entry.js → p-9cab14ee.entry.js} +1 -3
  49. package/dist/beeq/{p-5d51cadd.entry.js.map → p-9cab14ee.entry.js.map} +1 -1
  50. package/dist/beeq/{p-7695fc8d.entry.js → p-a23b23c4.entry.js} +1 -3
  51. package/dist/beeq/{p-7695fc8d.entry.js.map → p-a23b23c4.entry.js.map} +1 -1
  52. package/dist/beeq/{p-2b2d8b0c.entry.js → p-a608a4fb.entry.js} +2 -4
  53. package/dist/beeq/{p-2b2d8b0c.entry.js.map → p-a608a4fb.entry.js.map} +1 -1
  54. package/dist/beeq/{p-bc60faa1.entry.js → p-aacaaa35.entry.js} +1 -3
  55. package/dist/beeq/{p-bc60faa1.entry.js.map → p-aacaaa35.entry.js.map} +1 -1
  56. package/dist/beeq/{p-d8f7bf11.entry.js → p-b2df1479.entry.js} +1 -3
  57. package/dist/beeq/{p-d8f7bf11.entry.js.map → p-b2df1479.entry.js.map} +1 -1
  58. package/dist/beeq/{p-5d8d6717.entry.js → p-b77b52f2.entry.js} +2 -4
  59. package/dist/beeq/{p-5d8d6717.entry.js.map → p-b77b52f2.entry.js.map} +1 -1
  60. package/dist/beeq/{p-5fcbf15f.entry.js → p-c83bc7fd.entry.js} +10 -11
  61. package/dist/beeq/p-c83bc7fd.entry.js.map +1 -0
  62. package/dist/beeq/{p-e6911710.entry.js → p-cb2b0014.entry.js} +1 -3
  63. package/dist/beeq/{p-e6911710.entry.js.map → p-cb2b0014.entry.js.map} +1 -1
  64. package/dist/beeq/{p-60ab652b.entry.js → p-cfb8829b.entry.js} +1 -3
  65. package/dist/beeq/{p-60ab652b.entry.js.map → p-cfb8829b.entry.js.map} +1 -1
  66. package/dist/beeq/{p-3ed73068.entry.js → p-d7067dae.entry.js} +1 -3
  67. package/dist/beeq/{p-3ed73068.entry.js.map → p-d7067dae.entry.js.map} +1 -1
  68. package/dist/beeq/{p-f69d2900.entry.js → p-d7dc7086.entry.js} +1 -3
  69. package/dist/beeq/{p-f69d2900.entry.js.map → p-d7dc7086.entry.js.map} +1 -1
  70. package/dist/beeq/{p-5a9a73a0.js → p-edfd9767.js} +2 -2
  71. package/dist/beeq/p-edfd9767.js.map +1 -0
  72. package/dist/beeq/{p-ac0d84a6.entry.js → p-f979d79a.entry.js} +1 -3
  73. package/dist/beeq/{p-ac0d84a6.entry.js.map → p-f979d79a.entry.js.map} +1 -1
  74. package/dist/beeq/{p-5a12011a.entry.js → p-faa3be41.entry.js} +1 -3
  75. package/dist/beeq/{p-5a12011a.entry.js.map → p-faa3be41.entry.js.map} +1 -1
  76. package/dist/beeq/{p-bb14b231.entry.js → p-fb20c6eb.entry.js} +2 -4
  77. package/dist/beeq/{p-bb14b231.entry.js.map → p-fb20c6eb.entry.js.map} +1 -1
  78. package/dist/beeq/{p-be746e37.entry.js → p-fe278ecc.entry.js} +2 -4
  79. package/dist/beeq/{p-be746e37.entry.js.map → p-fe278ecc.entry.js.map} +1 -1
  80. package/dist/cjs/assetsPath-8bd8d221.js +77 -0
  81. package/dist/cjs/assetsPath-8bd8d221.js.map +1 -0
  82. package/dist/cjs/beeq.cjs.js +1 -1
  83. package/dist/cjs/bq-accordion-group.cjs.entry.js +0 -1
  84. package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
  85. package/dist/cjs/bq-accordion.cjs.entry.js +0 -1
  86. package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
  87. package/dist/cjs/bq-alert.cjs.entry.js +0 -1
  88. package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
  89. package/dist/cjs/bq-avatar.cjs.entry.js +0 -1
  90. package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
  91. package/dist/cjs/bq-badge.cjs.entry.js +1 -2
  92. package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
  93. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +1 -2
  94. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
  95. package/dist/cjs/bq-breadcrumb.cjs.entry.js +0 -1
  96. package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
  97. package/dist/cjs/bq-button_2.cjs.entry.js +52 -21
  98. package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
  99. package/dist/cjs/bq-card.cjs.entry.js +0 -1
  100. package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
  101. package/dist/cjs/bq-checkbox.cjs.entry.js +0 -1
  102. package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
  103. package/dist/cjs/bq-date-picker.cjs.entry.js +1 -2
  104. package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
  105. package/dist/cjs/bq-dialog.cjs.entry.js +1 -2
  106. package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
  107. package/dist/cjs/bq-divider.cjs.entry.js +1 -2
  108. package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
  109. package/dist/cjs/bq-drawer.cjs.entry.js +1 -2
  110. package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
  111. package/dist/cjs/bq-empty-state.cjs.entry.js +0 -1
  112. package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
  113. package/dist/cjs/bq-input.cjs.entry.js +1 -2
  114. package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
  115. package/dist/cjs/bq-notification.cjs.entry.js +4 -5
  116. package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
  117. package/dist/cjs/bq-option-list_2.cjs.entry.js +1 -2
  118. package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
  119. package/dist/cjs/bq-option.cjs.entry.js +0 -1
  120. package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
  121. package/dist/cjs/bq-page-title.cjs.entry.js +0 -1
  122. package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
  123. package/dist/cjs/bq-progress.cjs.entry.js +0 -1
  124. package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
  125. package/dist/cjs/bq-radio-group.cjs.entry.js +0 -1
  126. package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
  127. package/dist/cjs/bq-select.cjs.entry.js +2 -3
  128. package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
  129. package/dist/cjs/bq-side-menu-item.cjs.entry.js +0 -1
  130. package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
  131. package/dist/cjs/bq-side-menu.cjs.entry.js +4 -4
  132. package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
  133. package/dist/cjs/bq-slider.cjs.entry.js +0 -1
  134. package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
  135. package/dist/cjs/bq-spinner.cjs.entry.js +1 -2
  136. package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
  137. package/dist/cjs/bq-status.cjs.entry.js +0 -1
  138. package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
  139. package/dist/cjs/bq-step-item.cjs.entry.js +0 -1
  140. package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
  141. package/dist/cjs/bq-steps.cjs.entry.js +0 -1
  142. package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
  143. package/dist/cjs/bq-switch.cjs.entry.js +0 -1
  144. package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
  145. package/dist/cjs/bq-tab-group.cjs.entry.js +0 -1
  146. package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
  147. package/dist/cjs/bq-tab.cjs.entry.js +0 -1
  148. package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
  149. package/dist/cjs/bq-textarea.cjs.entry.js +0 -1
  150. package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
  151. package/dist/cjs/bq-toast.cjs.entry.js +3 -4
  152. package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
  153. package/dist/cjs/{cssVariables-a0e1e906.js → cssVariables-dd190bc2.js} +2 -2
  154. package/dist/cjs/cssVariables-dd190bc2.js.map +1 -0
  155. package/dist/cjs/index.cjs.js +3 -3
  156. package/dist/cjs/{isDefined-ee0026ed.js → isDefined-f3968296.js} +1 -2
  157. package/dist/cjs/isDefined-f3968296.js.map +1 -0
  158. package/dist/cjs/loader.cjs.js +1 -1
  159. package/dist/collection/components/button/bq-button.js +41 -16
  160. package/dist/collection/components/button/bq-button.js.map +1 -1
  161. package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
  162. package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
  163. package/dist/collection/components/icon/helper/request.js +2 -2
  164. package/dist/collection/components/icon/helper/request.js.map +1 -1
  165. package/dist/collection/components/notification/bq-notification.js +4 -4
  166. package/dist/collection/components/notification/bq-notification.js.map +1 -1
  167. package/dist/collection/components/select/scss/bq-select.css +1 -1
  168. package/dist/collection/components/side-menu/bq-side-menu.js +9 -3
  169. package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
  170. package/dist/collection/components/toast/bq-toast.js +3 -3
  171. package/dist/collection/components/toast/bq-toast.js.map +1 -1
  172. package/dist/collection/shared/utils/assetsPath.js +47 -35
  173. package/dist/collection/shared/utils/assetsPath.js.map +1 -1
  174. package/dist/collection/shared/utils/cssVariables.js +1 -1
  175. package/dist/collection/shared/utils/cssVariables.js.map +1 -1
  176. package/dist/components/bq-accordion-group.js +0 -1
  177. package/dist/components/bq-accordion-group.js.map +1 -1
  178. package/dist/components/bq-accordion.js +0 -1
  179. package/dist/components/bq-accordion.js.map +1 -1
  180. package/dist/components/bq-alert.js +0 -1
  181. package/dist/components/bq-alert.js.map +1 -1
  182. package/dist/components/bq-avatar.js +0 -1
  183. package/dist/components/bq-avatar.js.map +1 -1
  184. package/dist/components/bq-badge2.js +0 -1
  185. package/dist/components/bq-badge2.js.map +1 -1
  186. package/dist/components/bq-breadcrumb-item.js +0 -1
  187. package/dist/components/bq-breadcrumb-item.js.map +1 -1
  188. package/dist/components/bq-breadcrumb.js +0 -1
  189. package/dist/components/bq-breadcrumb.js.map +1 -1
  190. package/dist/components/bq-button2.js +42 -18
  191. package/dist/components/bq-button2.js.map +1 -1
  192. package/dist/components/bq-card.js +0 -1
  193. package/dist/components/bq-card.js.map +1 -1
  194. package/dist/components/bq-checkbox.js +0 -1
  195. package/dist/components/bq-checkbox.js.map +1 -1
  196. package/dist/components/bq-date-picker.js +0 -1
  197. package/dist/components/bq-date-picker.js.map +1 -1
  198. package/dist/components/bq-dialog.js +1 -2
  199. package/dist/components/bq-dialog.js.map +1 -1
  200. package/dist/components/bq-divider2.js +0 -1
  201. package/dist/components/bq-divider2.js.map +1 -1
  202. package/dist/components/bq-drawer.js +1 -2
  203. package/dist/components/bq-drawer.js.map +1 -1
  204. package/dist/components/bq-empty-state.js +0 -1
  205. package/dist/components/bq-empty-state.js.map +1 -1
  206. package/dist/components/bq-icon2.js +70 -4
  207. package/dist/components/bq-icon2.js.map +1 -1
  208. package/dist/components/bq-input.js +0 -1
  209. package/dist/components/bq-input.js.map +1 -1
  210. package/dist/components/bq-notification.js +4 -5
  211. package/dist/components/bq-notification.js.map +1 -1
  212. package/dist/components/bq-option-list2.js +0 -1
  213. package/dist/components/bq-option-list2.js.map +1 -1
  214. package/dist/components/bq-option.js +0 -1
  215. package/dist/components/bq-option.js.map +1 -1
  216. package/dist/components/bq-page-title.js +0 -1
  217. package/dist/components/bq-page-title.js.map +1 -1
  218. package/dist/components/bq-progress.js +0 -1
  219. package/dist/components/bq-progress.js.map +1 -1
  220. package/dist/components/bq-radio-group.js +0 -1
  221. package/dist/components/bq-radio-group.js.map +1 -1
  222. package/dist/components/bq-select.js +1 -2
  223. package/dist/components/bq-select.js.map +1 -1
  224. package/dist/components/bq-side-menu-item.js +0 -1
  225. package/dist/components/bq-side-menu-item.js.map +1 -1
  226. package/dist/components/bq-side-menu.js +5 -4
  227. package/dist/components/bq-side-menu.js.map +1 -1
  228. package/dist/components/bq-slider.js +0 -1
  229. package/dist/components/bq-slider.js.map +1 -1
  230. package/dist/components/bq-spinner.js +0 -1
  231. package/dist/components/bq-spinner.js.map +1 -1
  232. package/dist/components/bq-status.js +0 -1
  233. package/dist/components/bq-status.js.map +1 -1
  234. package/dist/components/bq-step-item.js +0 -1
  235. package/dist/components/bq-step-item.js.map +1 -1
  236. package/dist/components/bq-steps.js +0 -1
  237. package/dist/components/bq-steps.js.map +1 -1
  238. package/dist/components/bq-switch.js +0 -1
  239. package/dist/components/bq-switch.js.map +1 -1
  240. package/dist/components/bq-tab-group.js +0 -1
  241. package/dist/components/bq-tab-group.js.map +1 -1
  242. package/dist/components/bq-tab.js +0 -1
  243. package/dist/components/bq-tab.js.map +1 -1
  244. package/dist/components/bq-tag2.js +0 -1
  245. package/dist/components/bq-tag2.js.map +1 -1
  246. package/dist/components/bq-textarea.js +0 -1
  247. package/dist/components/bq-textarea.js.map +1 -1
  248. package/dist/components/bq-toast.js +3 -4
  249. package/dist/components/bq-toast.js.map +1 -1
  250. package/dist/components/cssVariables.js +1 -1
  251. package/dist/components/cssVariables.js.map +1 -1
  252. package/dist/components/index.js +1 -1
  253. package/dist/components/isDefined.js +0 -1
  254. package/dist/components/isDefined.js.map +1 -1
  255. package/dist/esm/assetsPath-beeee241.js +74 -0
  256. package/dist/esm/assetsPath-beeee241.js.map +1 -0
  257. package/dist/esm/beeq.js +1 -1
  258. package/dist/esm/bq-accordion-group.entry.js +0 -1
  259. package/dist/esm/bq-accordion-group.entry.js.map +1 -1
  260. package/dist/esm/bq-accordion.entry.js +0 -1
  261. package/dist/esm/bq-accordion.entry.js.map +1 -1
  262. package/dist/esm/bq-alert.entry.js +0 -1
  263. package/dist/esm/bq-alert.entry.js.map +1 -1
  264. package/dist/esm/bq-avatar.entry.js +0 -1
  265. package/dist/esm/bq-avatar.entry.js.map +1 -1
  266. package/dist/esm/bq-badge.entry.js +1 -2
  267. package/dist/esm/bq-badge.entry.js.map +1 -1
  268. package/dist/esm/bq-breadcrumb-item.entry.js +1 -2
  269. package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
  270. package/dist/esm/bq-breadcrumb.entry.js +0 -1
  271. package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
  272. package/dist/esm/bq-button_2.entry.js +52 -21
  273. package/dist/esm/bq-button_2.entry.js.map +1 -1
  274. package/dist/esm/bq-card.entry.js +0 -1
  275. package/dist/esm/bq-card.entry.js.map +1 -1
  276. package/dist/esm/bq-checkbox.entry.js +0 -1
  277. package/dist/esm/bq-checkbox.entry.js.map +1 -1
  278. package/dist/esm/bq-date-picker.entry.js +1 -2
  279. package/dist/esm/bq-date-picker.entry.js.map +1 -1
  280. package/dist/esm/bq-dialog.entry.js +1 -2
  281. package/dist/esm/bq-dialog.entry.js.map +1 -1
  282. package/dist/esm/bq-divider.entry.js +1 -2
  283. package/dist/esm/bq-divider.entry.js.map +1 -1
  284. package/dist/esm/bq-drawer.entry.js +1 -2
  285. package/dist/esm/bq-drawer.entry.js.map +1 -1
  286. package/dist/esm/bq-empty-state.entry.js +0 -1
  287. package/dist/esm/bq-empty-state.entry.js.map +1 -1
  288. package/dist/esm/bq-input.entry.js +1 -2
  289. package/dist/esm/bq-input.entry.js.map +1 -1
  290. package/dist/esm/bq-notification.entry.js +4 -5
  291. package/dist/esm/bq-notification.entry.js.map +1 -1
  292. package/dist/esm/bq-option-list_2.entry.js +1 -2
  293. package/dist/esm/bq-option-list_2.entry.js.map +1 -1
  294. package/dist/esm/bq-option.entry.js +0 -1
  295. package/dist/esm/bq-option.entry.js.map +1 -1
  296. package/dist/esm/bq-page-title.entry.js +0 -1
  297. package/dist/esm/bq-page-title.entry.js.map +1 -1
  298. package/dist/esm/bq-progress.entry.js +0 -1
  299. package/dist/esm/bq-progress.entry.js.map +1 -1
  300. package/dist/esm/bq-radio-group.entry.js +0 -1
  301. package/dist/esm/bq-radio-group.entry.js.map +1 -1
  302. package/dist/esm/bq-select.entry.js +2 -3
  303. package/dist/esm/bq-select.entry.js.map +1 -1
  304. package/dist/esm/bq-side-menu-item.entry.js +0 -1
  305. package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
  306. package/dist/esm/bq-side-menu.entry.js +4 -4
  307. package/dist/esm/bq-side-menu.entry.js.map +1 -1
  308. package/dist/esm/bq-slider.entry.js +0 -1
  309. package/dist/esm/bq-slider.entry.js.map +1 -1
  310. package/dist/esm/bq-spinner.entry.js +1 -2
  311. package/dist/esm/bq-spinner.entry.js.map +1 -1
  312. package/dist/esm/bq-status.entry.js +0 -1
  313. package/dist/esm/bq-status.entry.js.map +1 -1
  314. package/dist/esm/bq-step-item.entry.js +0 -1
  315. package/dist/esm/bq-step-item.entry.js.map +1 -1
  316. package/dist/esm/bq-steps.entry.js +0 -1
  317. package/dist/esm/bq-steps.entry.js.map +1 -1
  318. package/dist/esm/bq-switch.entry.js +0 -1
  319. package/dist/esm/bq-switch.entry.js.map +1 -1
  320. package/dist/esm/bq-tab-group.entry.js +0 -1
  321. package/dist/esm/bq-tab-group.entry.js.map +1 -1
  322. package/dist/esm/bq-tab.entry.js +0 -1
  323. package/dist/esm/bq-tab.entry.js.map +1 -1
  324. package/dist/esm/bq-textarea.entry.js +0 -1
  325. package/dist/esm/bq-textarea.entry.js.map +1 -1
  326. package/dist/esm/bq-toast.entry.js +3 -4
  327. package/dist/esm/bq-toast.entry.js.map +1 -1
  328. package/dist/esm/{cssVariables-23e3ca0d.js → cssVariables-000c23ad.js} +2 -2
  329. package/dist/esm/cssVariables-000c23ad.js.map +1 -0
  330. package/dist/esm/index.js +4 -4
  331. package/dist/esm/{isDefined-650befc3.js → isDefined-0cb07ee6.js} +1 -2
  332. package/dist/esm/isDefined-0cb07ee6.js.map +1 -0
  333. package/dist/esm/loader.js +1 -1
  334. package/dist/hydrate/index.js +113 -68
  335. package/dist/hydrate/index.mjs +113 -68
  336. package/dist/types/components/button/bq-button.d.ts +5 -0
  337. package/dist/types/shared/utils/assetsPath.d.ts +5 -9
  338. package/package.json +1 -1
  339. package/dist/beeq/p-5a9a73a0.js.map +0 -1
  340. package/dist/beeq/p-5fcbf15f.entry.js.map +0 -1
  341. package/dist/beeq/p-7aa47927.entry.js.map +0 -1
  342. package/dist/beeq/p-a84d4562.js +0 -64
  343. package/dist/beeq/p-a84d4562.js.map +0 -1
  344. package/dist/beeq/p-b877d662.entry.js.map +0 -1
  345. package/dist/beeq/p-e06c8398.entry.js.map +0 -1
  346. package/dist/cjs/assetsPath-6ac8935a.js +0 -65
  347. package/dist/cjs/assetsPath-6ac8935a.js.map +0 -1
  348. package/dist/cjs/cssVariables-a0e1e906.js.map +0 -1
  349. package/dist/cjs/isDefined-ee0026ed.js.map +0 -1
  350. package/dist/components/assetsPath.js +0 -62
  351. package/dist/components/assetsPath.js.map +0 -1
  352. package/dist/esm/assetsPath-e2f1ceb9.js +0 -62
  353. package/dist/esm/assetsPath-e2f1ceb9.js.map +0 -1
  354. package/dist/esm/cssVariables-23e3ca0d.js.map +0 -1
  355. package/dist/esm/isDefined-650befc3.js.map +0 -1
@@ -12,6 +12,7 @@ export declare class BqButton {
12
12
  private prefixElem;
13
13
  private suffixElem;
14
14
  el: HTMLBqButtonElement;
15
+ internals: ElementInternals;
15
16
  private hasPrefix;
16
17
  private hasSuffix;
17
18
  /** The appearance style to apply to the button */
@@ -55,6 +56,10 @@ export declare class BqButton {
55
56
  private handleBlur;
56
57
  private handleFocus;
57
58
  private handleClick;
59
+ private handleFormAction;
60
+ private formActions;
61
+ private submitAssociatedForm;
58
62
  private handleSlotChange;
63
+ private preventEvent;
59
64
  render(): any;
60
65
  }
@@ -3,17 +3,13 @@
3
3
  * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
4
4
  */
5
5
  /**
6
- * Sets the `bqSVGBasePath` in the global window object,
7
- * which is used to determine the SVG path in the BQIcon component.
8
- * This method is the only way to update the base path.
9
- *
10
- * @param path - The new base path to set.
6
+ * Sets the base path for the assets.
7
+ * @param {string} path - The base path to set.
11
8
  */
12
9
  export declare const setBasePath: (path: string) => void;
13
10
  /**
14
- * Retrieves the `bqSVGBasePath`, optionally appending a subpath.
15
- *
16
- * @param subpath - The subpath to append to the base path.
17
- * @returns The full base path including the subpath.
11
+ * Gets the base path for the assets.
12
+ * @param {string} subpath - An optional subpath to append to the base path.
13
+ * @returns {string} The base path of the assets.
18
14
  */
19
15
  export declare const getBasePath: (subpath?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beeq/core",
3
- "version": "1.8.0-beta.4",
3
+ "version": "1.8.0-beta.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "BEEQ, a Design System components ruled by Endavan developers :)",
6
6
  "main": "./dist/index.cjs.js",
@@ -1 +0,0 @@
1
- {"version":3,"names":["CSSVALUEPREFIX","getColorCSSVariable","colorName","document","undefined","token","value","getComputedStyle","documentElement","getPropertyValue","getCSSVariableValue","variable","component","styles","String","trim"],"sources":["../../packages/beeq/src/shared/utils/cssVariables.ts"],"sourcesContent":["const CSSVALUEPREFIX = '--bq-';\n\n/**\n * Get CSS custom property variable of a given color string value\n *\n * @param {string} colorName - Valid string value.\n * @return {string} The corresponding CSS custom property variable\n */\nexport function getColorCSSVariable(colorName: string): string | undefined {\n if (typeof document === 'undefined') return undefined;\n\n const token = `${CSSVALUEPREFIX}${colorName}`;\n const value = getComputedStyle(document.documentElement).getPropertyValue(token);\n if (!value) return undefined;\n\n return `var(${token})`;\n}\n\n/**\n * Get compiled CSS custom property value\n *\n * @param {string} variable - The variable name for which to get its value\n * @return {string} The corresponding value for the given CSS custom property\n */\nexport function getCSSVariableValue(variable: string, component: Element): string {\n const styles = getComputedStyle(component);\n return String(styles.getPropertyValue(`--${variable}`)).trim();\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAiB;;;;;;;aAQPC,oBAAoBC;EAClC,WAAWC,aAAa,aAAa,OAAOC;EAE5C,MAAMC,IAAQ,GAAGL,IAAiBE;EAClC,MAAMI,IAAQC,iBAAiBJ,SAASK,iBAAiBC,iBAAiBJ;EAC1E,KAAKC,GAAO,OAAOF;EAEnB,OAAO,OAAOC;AAChB;;;;;;;aAQgBK,oBAAoBC,GAAkBC;EACpD,MAAMC,IAASN,iBAAiBK;EAChC,OAAOE,OAAOD,EAAOJ,iBAAiB,KAAKE,MAAaI;AAC1D","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["bqSideMenuCss","BqSideMenuStyle0","BqSideMenu","menuItemCssSelector","bodyCss","bodyCssExpand","bodyCssCollapse","menuElem","documentBody","document","querySelector","onCollapsePropChange","this","handleCollapse","bqCollapse","emit","collapse","bqSelect","componentDidLoad","classList","add","disconnectedCallback","cleanDocumentBodyClass","onMenuItemClick","event","target","item","isHTMLElement","menuItems","forEach","menuItem","active","disabled","toggleCollapse","slot","assignedElements","flatten","filter","el","tagName","toLowerCase","length","collapseDocumentBody","expandDocumentBody","remove","render","h","key","class","part","name","ref","navElem","role"],"sources":["../../packages/beeq/src/components/side-menu/scss/bq-side-menu.scss?tag=bq-side-menu&encapsulation=shadow","../../packages/beeq/src/components/side-menu/bq-side-menu.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Side menu styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-side-menu.variables';\n\n:host {\n @apply flex overflow-hidden;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Aside container */\n/* -------------------------------------------------------------------------- */\n\n.bq-side-menu {\n @apply fixed flex h-dynamic-vh grow flex-col bg-[--bq-side-menu--bg-color] is-[--bq-side-menu--width] inset-bs-0 inset-is-0;\n @apply border-0 border-e-s border-solid border-[color:--bq-side-menu--border-color];\n @apply transition-[background-color,width] duration-150;\n @include hide-scrollbar;\n}\n\n.bq-side-menu.is-collapsed {\n @apply is-[--bq-side-menu--width-collapse];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Logo container */\n/* -------------------------------------------------------------------------- */\n\n.bq-side-menu--logo {\n @apply sticky top-0 z-[1] p-xs;\n @apply box-content flex items-center bg-[--bq-side-menu--bg-color] text-[color:--bq-side-menu--brand-color];\n}\n\n/* -------------------------------------------------------------------------- */\n/* APPEARANCE */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The following change the default values of some CSS custom properties\n * to make it complain with the side menu appearance selected\n */\n\n:host([size='small']) {\n ::slotted(bq-side-menu-item) {\n --bq-side-menu-item--paddingY: theme(space.s);\n }\n}\n\n:host([appearance='brand']) {\n --bq-focus: theme(colors.stroke.alt);\n --bq-side-menu--bg-color: theme(colors.ui.brand);\n --bq-side-menu--brand-color: theme(colors.stroke.inverse);\n --bq-side-menu--border-color: theme(colors.ui.brand);\n\n ::slotted(bq-side-menu-item) {\n --bq-side-menu-item--bg-hover: color-mix(in srgb, var(--bq-ui--brand), var(--bq-hover) 20%);\n\n --bq-side-menu-item--text-default: theme(textColor.text.alt);\n --bq-side-menu-item--text-hover: theme(textColor.text.alt);\n }\n\n .bq-side-menu--footer ::slotted([slot='footer']) {\n --bq-ui--secondary: theme(colors.transparent);\n --bq-text--primary: theme(textColor.text.inverse);\n }\n}\n\n:host([appearance='inverse']) {\n --bq-side-menu--bg-color: theme(colors.ui.inverse);\n --bq-side-menu--brand-color: theme(colors.stroke.inverse);\n --bq-side-menu--border-color: theme(colors.ui.inverse);\n\n ::slotted(bq-side-menu-item) {\n --bq-side-menu-item--bg-hover: color-mix(in srgb, var(--bq-ui--inverse), var(--bq-hover) 20%);\n --bq-side-menu-item--bg-active: color-mix(in srgb, var(--bq-ui--alt), var(--bq-active) 20%);\n\n --bq-side-menu-item--text-default: theme(textColor.text.inverse);\n --bq-side-menu-item--text-hover: theme(textColor.text.inverse);\n --bq-side-menu-item--text-active: theme(textColor.text.primary);\n }\n\n .bq-side-menu--footer ::slotted([slot='footer']) {\n --bq-ui--secondary: theme(colors.transparent);\n --bq-text--primary: theme(textColor.text.inverse);\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Method, Prop, Watch } from '@stencil/core';\n\nimport { TSideMenuAppearance, TSideMenuSize } from './bq-side-menu.types';\nimport { isHTMLElement } from '../../shared/utils';\n\n/**\n * @part base - HTML `<aside>` root container\n * @part footer - HTML `<div>` element that holds the footer\n * @part logo - HTML `<div>` element that holds the logo\n * @part nav - HTML `<nav>` element that holds the navigation items\n */\n@Component({\n tag: 'bq-side-menu',\n styleUrl: './scss/bq-side-menu.scss',\n shadow: true,\n})\nexport class BqSideMenu {\n // Own Properties\n // ====================\n\n private menuItemCssSelector = 'bq-side-menu-item';\n\n private bodyCss = 'bq-body--side-menu';\n private bodyCssExpand = 'bq-body--side-menu__expand';\n private bodyCssCollapse = 'bq-body--side-menu__collapse';\n\n private menuElem: HTMLElement;\n private documentBody: HTMLBodyElement = document.querySelector('body');\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** It sets a predefined appearance of the side menu */\n @Prop({ reflect: true }) appearance: TSideMenuAppearance = 'default';\n\n /** If true, the container will reduce its width */\n @Prop({ reflect: true }) collapse: boolean = false;\n\n /** It sets the size of the navigation menu items */\n @Prop({ reflect: true }) size: TSideMenuSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('collapse')\n onCollapsePropChange() {\n this.handleCollapse();\n this.bqCollapse.emit({ collapse: this.collapse });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the Side menu changes its width from expanded to collapse and vice versa */\n @Event() bqCollapse: EventEmitter<{ collapse: boolean }>;\n\n /** Callback handler to be called when the active/selected menu item changes */\n @Event() bqSelect: EventEmitter<HTMLBqSideMenuItemElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.documentBody.classList.add(this.bodyCss);\n this.handleCollapse();\n }\n\n disconnectedCallback() {\n this.cleanDocumentBodyClass();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqClick', { passive: true })\n onMenuItemClick(event: Event) {\n const { target: item } = event;\n if (!isHTMLElement(item, 'bq-side-menu-item')) return;\n\n this.menuItems.forEach(\n (menuItem: HTMLBqSideMenuItemElement) => (menuItem.active = !menuItem.disabled && menuItem === item),\n );\n this.bqSelect.emit(item);\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Toggle the collapse state of the side menu */\n @Method()\n async toggleCollapse() {\n this.collapse = !this.collapse;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private get menuItems() {\n if (!this.menuElem) return [];\n\n const slot = this.menuElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === this.menuItemCssSelector,\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private handleCollapse = () => {\n if (!this.menuItems.length) return;\n\n this.menuItems.forEach((menuItem: HTMLBqSideMenuItemElement) => (menuItem.collapse = this.collapse));\n if (this.collapse) {\n this.collapseDocumentBody();\n } else {\n this.expandDocumentBody();\n }\n };\n\n private collapseDocumentBody = () => {\n if (!this.collapse) return;\n\n this.documentBody.classList.remove(this.bodyCssExpand);\n this.documentBody.classList.add(this.bodyCssCollapse);\n };\n\n private expandDocumentBody = () => {\n if (this.collapse) return;\n\n this.documentBody.classList.remove(this.bodyCssCollapse);\n this.documentBody.classList.add(this.bodyCssExpand);\n };\n\n private cleanDocumentBodyClass = () => {\n this.documentBody.classList.remove(this.bodyCss, this.bodyCssCollapse, this.bodyCssExpand);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <aside class={{ 'bq-side-menu overflow-y-auto': true, 'is-collapsed': this.collapse }} part=\"base\">\n {/* Company logo and name */}\n <div class={{ 'bq-side-menu--logo': true, 'is-collapsed': this.collapse }} part=\"logo\">\n <slot name=\"logo\" />\n </div>\n {/* Navigation content */}\n <nav\n class=\"bq-side-menu--nav flex flex-col gap-y-xs px-xs pt-xs2\"\n ref={(navElem) => (this.menuElem = navElem)}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"menu\"\n part=\"nav\"\n >\n <slot />\n </nav>\n {/* Footer */}\n <div\n class=\"bq-side-menu--footer sticky flex justify-center bg-[var(--bq-side-menu--bg-color)] p-xs inset-be-0 m-bs-[auto]\"\n part=\"footer\"\n >\n <slot name=\"footer\"></slot>\n </div>\n </aside>\n );\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,IAAgB;;AACtB,MAAAC,IAAeD;;MCeFE,IAAU;;;;;sBAwBsC;oBAGd;gBAGE;;;;EA1BvCC,oBAAsB;EAEtBC,QAAU;EACVC,cAAgB;EAChBC,gBAAkB;EAElBC;EACAC,aAAgCC,SAASC,cAAc;;;EAyB/D,oBAAAC;IACEC,KAAKC;IACLD,KAAKE,WAAWC,KAAK;MAAEC,UAAUJ,KAAKI;;;;;;;EAQ/BF;;EAGAG;;;;EAMT,gBAAAC;IACEN,KAAKJ,aAAaW,UAAUC,IAAIR,KAAKR;IACrCQ,KAAKC;;EAGP,oBAAAQ;IACET,KAAKU;;;;EAOP,eAAAC,CAAgBC;IACd,OAAQC,QAAQC,KAASF;IACzB,KAAKG,EAAcD,GAAM,sBAAsB;IAE/Cd,KAAKgB,UAAUC,SACZC,KAAyCA,EAASC,UAAUD,EAASE,YAAYF,MAAaJ;IAEjGd,KAAKK,SAASF,KAAKW;;;;;;;;;EAYrB,oBAAMO;IACJrB,KAAKI,YAAYJ,KAAKI;;;;;;EAQxB,aAAYY;IACV,KAAKhB,KAAKL,UAAU,OAAO;IAE3B,MAAM2B,IAAOtB,KAAKL,SAASG,cAAc;IACzC,OAAO,KAAIwB,EAAKC,iBAAiB;MAAEC,SAAS;SAASC,QAClDC,KAAkCA,EAAGC,QAAQC,kBAAkB5B,KAAKT;;EAIjEU,eAAiB;IACvB,KAAKD,KAAKgB,UAAUa,QAAQ;IAE5B7B,KAAKgB,UAAUC,SAASC,KAAyCA,EAASd,WAAWJ,KAAKI;IAC1F,IAAIJ,KAAKI,UAAU;MACjBJ,KAAK8B;WACA;MACL9B,KAAK+B;;;EAIDD,qBAAuB;IAC7B,KAAK9B,KAAKI,UAAU;IAEpBJ,KAAKJ,aAAaW,UAAUyB,OAAOhC,KAAKP;IACxCO,KAAKJ,aAAaW,UAAUC,IAAIR,KAAKN;AAAgB;EAG/CqC,mBAAqB;IAC3B,IAAI/B,KAAKI,UAAU;IAEnBJ,KAAKJ,aAAaW,UAAUyB,OAAOhC,KAAKN;IACxCM,KAAKJ,aAAaW,UAAUC,IAAIR,KAAKP;AAAc;EAG7CiB,uBAAyB;IAC/BV,KAAKJ,aAAaW,UAAUyB,OAAOhC,KAAKR,SAASQ,KAAKN,iBAAiBM,KAAKP;AAAc;;;;EAO5F,MAAAwC;IACE,OACEC,EAAA;MAAAC,KAAA;MAAOC,OAAO;QAAE,gCAAgC;QAAM,gBAAgBpC,KAAKI;;MAAYiC,MAAK;OAE1FH,EAAA;MAAAC,KAAA;MAAKC,OAAO;QAAE,sBAAsB;QAAM,gBAAgBpC,KAAKI;;MAAYiC,MAAK;OAC9EH,EAAA;MAAAC,KAAA;MAAMG,MAAK;SAGbJ,EAAA;MAAAC,KAAA;MACEC,OAAM;MACNG,KAAMC,KAAaxC,KAAKL,WAAW6C;;;MAEnCC,MAAK;MACLJ,MAAK;OAELH,EAAA;MAAAC,KAAA;SAGFD,EAAA;MAAAC,KAAA;MACEC,OAAM;MACNC,MAAK;OAELH,EAAA;MAAAC,KAAA;MAAMG,MAAK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["TOAST_TYPE","TOAST_PLACEMENT","bqToastCss","BqToastStyle0","TOAST_PORTAL_SELECTOR","BqToast","document","querySelector","autoDismissDebounce","checkPropValues","validatePropValue","this","el","toastPortal","classList","remove","add","placement","handleTimeChange","cancel","time","Math","max","debounce","hide","handleOpenChange","open","bqHide","bqShow","connectedCallback","Object","assign","createElement","className","componentWillLoad","disconnectedCallback","onNotificationHide","removeChild","tagName","toLowerCase","error","DOMException","show","handleShow","handleHide","toast","parentElement","body","append","appendChild","requestAnimationFrame","ev","emit","defaultPrevented","iconName","typeMap","success","loading","alert","info","type","render","style","border","h","Host","key","class","hidden","role","part","hideIcon","name","size","slot","exportparts"],"sources":["../../packages/beeq/src/components/toast/bq-toast.types.ts","../../packages/beeq/src/components/toast/scss/bq-toast.scss?tag=bq-toast&encapsulation=shadow","../../packages/beeq/src/components/toast/bq-toast.tsx"],"sourcesContent":["export const TOAST_TYPE = ['info', 'success', 'alert', 'error', 'loading', 'custom'] as const;\nexport type TToastType = (typeof TOAST_TYPE)[number];\n\nexport const TOAST_PLACEMENT = [\n 'top-center',\n 'top-right',\n 'bottom-right',\n 'bottom-center',\n 'bottom-left',\n 'top-left',\n] as const;\nexport type TToastPlacement = (typeof TOAST_PLACEMENT)[number];\n\nexport const TOAST_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TToastBorderRadius = (typeof TOAST_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Toast styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-toast.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-toast {\n @include animation-slide-in;\n @apply flex items-center gap-[--bq-toast--gap] p-b-[--bq-toast--padding-y] p-i-[--bq-toast--padding-x];\n @apply rounded-[--bq-toast--border-radius] bg-[--bq-toast--background] shadow-[shadow:--bq-toast--box-shadow];\n @apply border-[length:--bq-toast--border-width] border-[color:--bq-toast--border-color];\n\n border-style: var(--bq-toast--border-style);\n}\n\n.bq-toast--icon {\n @apply flex;\n\n &.info {\n @apply text-[--bq-toast--icon-color-info];\n }\n\n &.success {\n @apply text-[--bq-toast--icon-color-success];\n }\n\n &.alert {\n @apply text-[--bq-toast--icon-color-alert];\n }\n\n &.error {\n @apply text-[--bq-toast--icon-color-error];\n }\n\n &.loading {\n @include animation-spin;\n @apply text-[--bq-toast--icon-color-loading];\n }\n\n &.custom {\n @apply text-[--bq-toast--icon-color-custom];\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TOAST_PLACEMENT, TOAST_TYPE, TToastBorderRadius, TToastPlacement, TToastType } from './bq-toast.types';\nimport { debounce, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst TOAST_PORTAL_SELECTOR = 'bq-toast-portal';\n\n/**\n * @part wrapper - The component's internal wrapper inside the shadow DOM.\n * @part icon-info - The `<div>` container that holds the icon component.\n * @part base - The `<div>` container of the internal bq-icon component.\n * @part svg - The `<svg>` element of the internal bq-icon component.\n *\n * @slot - The content to be displayed in the toast component.\n * @slot icon - The icon to be displayed in the toast component.\n */\n@Component({\n tag: 'bq-toast',\n styleUrl: './scss/bq-toast.scss',\n shadow: true,\n})\nexport class BqToast {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqToastElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);\n\n // Public Property API\n // ========================\n\n /** The corder radius of the toast component */\n @Prop({ reflect: true }) border: TToastBorderRadius = 's';\n\n /** Type of toast */\n @Prop({ reflect: true, mutable: true }) type: TToastType = 'info';\n\n /** Placement of toast */\n @Prop({ reflect: true, mutable: true }) placement: TToastPlacement = 'bottom-center';\n\n /** If true will hide toast icon */\n @Prop({ reflect: true, mutable: true }) hideIcon = false;\n\n /** If true, the toast will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the toast will close itself */\n @Prop({ reflect: true }) time: number = 3000;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TOAST_TYPE, 'default', this.el, 'type');\n validatePropValue(TOAST_PLACEMENT, 'bottom-center', this.el, 'placement');\n\n const { toastPortal } = this;\n toastPortal?.classList.remove(...TOAST_PLACEMENT);\n toastPortal?.classList.add(this.placement);\n }\n\n @Watch('time')\n handleTimeChange() {\n this.autoDismissDebounce?.cancel();\n\n this.time = Math.max(0, this.time);\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (this.open) {\n this.autoDismissDebounce?.();\n }\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide: EventEmitter<HTMLBqToastElement>;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow: EventEmitter<HTMLBqToastElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n const { toastPortal } = this;\n if (!toastPortal && typeof document !== 'undefined') {\n this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeChange();\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n this.autoDismissDebounce?.cancel();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqHide')\n onNotificationHide() {\n try {\n const { toastPortal } = this;\n toastPortal?.removeChild(this.el);\n // Remove the toast portal from the DOM when there are no more toasts\n if (toastPortal?.querySelector(this.el.tagName.toLowerCase()) === null) {\n toastPortal?.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to show the toast component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n /** Method to be called to hide the toast component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically */\n @Method()\n async toast() {\n const { toastPortal } = this;\n if (toastPortal?.parentElement === null) {\n document.body.append(toastPortal);\n }\n\n toastPortal?.appendChild(this.el);\n\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleShow = () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n }\n };\n\n private handleHide = () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = false;\n }\n };\n\n private get iconName() {\n const typeMap = {\n success: 'check-circle-bold',\n error: 'x-circle-bold',\n loading: 'spinner-gap-bold',\n alert: 'warning-bold',\n info: 'info-bold',\n };\n\n return typeMap[this.type] || 'info-bold';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"status\"\n >\n <output class=\"bq-toast\" part=\"wrapper\">\n <div class={{ [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }} part=\"icon\">\n <slot name=\"icon\">\n <bq-icon name={this.iconName} size=\"24\" slot=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <slot />\n </output>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAO,MAAMA,IAAa,EAAC,QAAQ,WAAW,SAAS,SAAS,WAAW;;AAGpE,MAAMC,IAAkB,EAC7B,cACA,aACA,gBACA,iBACA,eACA;;ACTF,MAAMC,IAAa;;AACnB,MAAAC,IAAeD;;ACIf,MAAME,IAAwB;;MAgB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,GAAaoC,YAAYtC,KAAKC;IAE9BsC,uBAAsB;MACpBvC,KAAK+B;AAAM;;;;;;EASPC,WAAa;IACnB,MAAMQ,IAAKxC,KAAKiB,OAAOwB,KAAKzC,KAAKC;IACjC,KAAKuC,EAAGE,kBAAkB;MACxB1C,KAAKe,OAAO;;;EAIRkB,WAAa;IACnB,MAAMO,IAAKxC,KAAKgB,OAAOyB,KAAKzC,KAAKC;IACjC,KAAKuC,EAAGE,kBAAkB;MACxB1C,KAAKe,OAAO;;;EAIhB,YAAY4B;IACV,MAAMC,IAAU;MACdC,SAAS;MACThB,OAAO;MACPiB,SAAS;MACTC,OAAO;MACPC,MAAM;;IAGR,OAAOJ,EAAQ5C,KAAKiD,SAAS;;;;;EAO/B,MAAAC;IACE,MAAMC,IAAQ;SACRnD,KAAKoD,UAAU;QAAE,6BAA6B,oBAAoBpD,KAAKoD;;;IAG7E,OACEC,EAACC,GAAI;MAAAC,KAAA;MACHJ,OAAOA;MACPK,OAAO;QAAE,cAAcxD,KAAKe;;MAAM,gBACpBf,KAAKe,OAAO,SAAS;MACnC0C,SAASzD,KAAKe,OAAO,SAAS;MAC9B2C,MAAK;OAELL,EAAA;MAAAE,KAAA;MAAQC,OAAM;MAAWG,MAAK;OAC5BN,EAAA;MAAAE,KAAA;MAAKC,OAAO;QAAE,CAAC,kBAAkBxD,KAAKiD,SAAS;QAAM,WAAWjD,KAAK4D;;MAAYD,MAAK;OACpFN,EAAA;MAAAE,KAAA;MAAMM,MAAK;OACTR,EAAA;MAAAE,KAAA;MAASM,MAAM7D,KAAK2C;MAAUmB,MAAK;MAAKC,MAAK;MAAOC,aAAY;UAGpEX,EAAA;MAAAE,KAAA","ignoreList":[]}
@@ -1,64 +0,0 @@
1
- /*!
2
- * Built by Endavans
3
- * © https://beeq.design - Apache 2 License.
4
- */
5
- /**
6
- * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.
7
- * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
8
- */
9
- let s = "";
10
-
11
- const t = "data-beeq";
12
-
13
- const n = "svg";
14
-
15
- const c = document && typeof document !== "undefined" ? [ ...document.getElementsByTagName("script") ] : [];
16
-
17
- /**
18
- * Sets the `bqSVGBasePath` in the global window object,
19
- * which is used to determine the SVG path in the BQIcon component.
20
- * This method is the only way to update the base path.
21
- *
22
- * @param path - The new base path to set.
23
- */ const setBasePath = t => {
24
- s = t;
25
- };
26
-
27
- /**
28
- * Retrieves the `bqSVGBasePath`, optionally appending a subpath.
29
- *
30
- * @param subpath - The subpath to append to the base path.
31
- * @returns The full base path including the subpath.
32
- */ const getBasePath = (t = "") => {
33
- if (!s) {
34
- initializeBasePath();
35
- }
36
- const n = t ? `/${t.replace(/^\//, "")}` : "";
37
- return s.replace(/\/$/, "") + n;
38
- };
39
-
40
- /**
41
- * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.
42
- * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.
43
- * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.
44
- * 3. If no scripts are found, the base path will be set to the default value `./svg`.
45
- */ const initializeBasePath = () => {
46
- const s = findConfigScript();
47
- const c = s ? null : findFallbackScript();
48
- const o = s || c;
49
- if (o) {
50
- const c = s ? o.getAttribute(t) : getScriptPath(o);
51
- setBasePath(`${c}/${n}`);
52
- } else {
53
- setBasePath(`./${n}`);
54
- }
55
- };
56
-
57
- const findConfigScript = () => c?.find((s => s.hasAttribute(t)));
58
-
59
- const findFallbackScript = () => c?.find((s => /beeq(\.esm)?\.js($|\?)/.test(s.src)));
60
-
61
- const getScriptPath = s => s?.getAttribute("src").split("/").slice(0, -1).join("/");
62
-
63
- export { getBasePath as g, setBasePath as s };
64
- //# sourceMappingURL=p-a84d4562.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["bqSVGBasePath","DATA_BEEQ_ATTRIBUTE","DEFAULT_SVG_PATH","scripts","document","getElementsByTagName","setBasePath","path","getBasePath","subpath","initializeBasePath","formattedSubpath","replace","configScript","findConfigScript","fallbackScript","findFallbackScript","script","getAttribute","getScriptPath","find","hasAttribute","test","src","split","slice","join"],"sources":["../../packages/beeq/src/shared/utils/assetsPath.ts"],"sourcesContent":["/**\n * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.\n * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n */\n\nlet bqSVGBasePath = '';\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n document && typeof document !== 'undefined'\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n bqSVGBasePath = path;\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string => {\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\n const configScript = findConfigScript();\n const fallbackScript = configScript ? null : findFallbackScript();\n\n const script = configScript || fallbackScript;\n if (script) {\n const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);\n setBasePath(`${path}/${DEFAULT_SVG_PATH}`);\n } else {\n setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement =>\n scripts?.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script?.getAttribute('src').split('/').slice(0, -1).join('/');\n"],"mappings":";;;;;;;;AAKA,IAAIA,IAAgB;;AAEpB,MAAMC,IAAsB;;AAC5B,MAAMC,IAAmB;;AACzB,MAAMC,IACJC,mBAAmBA,aAAa,cAC3B,KAAIA,SAASC,qBAAqB,cACnC;;;;;;;;UASOC,cAAeC;EAC1BP,IAAgBO;AAAI;;;;;;;UASTC,cAAc,CAACC,IAAU;EACpC,KAAKT,GAAe;IAClBU;;EAGF,MAAMC,IAAmBF,IAAU,IAAIA,EAAQG,QAAQ,OAAO,QAAQ;EACtE,OAAOZ,EAAcY,QAAQ,OAAO,MAAMD;AAAgB;;;;;;;GAS5D,OAAMD,qBAAqB;EACzB,MAAMG,IAAeC;EACrB,MAAMC,IAAiBF,IAAe,OAAOG;EAE7C,MAAMC,IAASJ,KAAgBE;EAC/B,IAAIE,GAAQ;IACV,MAAMV,IAAOM,IAAeI,EAAOC,aAAajB,KAAuBkB,cAAcF;IACrFX,YAAY,GAAGC,KAAQL;SAClB;IACLI,YAAY,KAAKJ;;;;AAIrB,MAAMY,mBAAmB,MAAyBX,GAASiB,MAAMH,KAAWA,EAAOI,aAAapB;;AAEhG,MAAMe,qBAAqB,MACzBb,GAASiB,MAAMH,KAAW,yBAAyBK,KAAKL,EAAOM;;AAEjE,MAAMJ,gBAAiBF,KACrBA,GAAQC,aAAa,OAAOM,MAAM,KAAKC,MAAM,IAAI,GAAGC,KAAK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["BUTTON_SIZE","BUTTON_TYPE","BUTTON_APPEARANCE","BUTTON_VARIANT","bqButtonCss","BqButtonStyle0","BqButton","prefixElem","suffixElem","checkPropValues","validatePropValue","this","el","bqBlur","bqFocus","bqClick","componentWillLoad","handleBlur","emit","handleFocus","handleClick","ev","disabled","loading","preventDefault","stopPropagation","type","wrapperForm","closest","isNil","btn","document","createElement","hidden","append","click","remove","handleSlotChange","hasPrefix","hasSlotContent","hasSuffix","render","isLink","isDefined","href","TagElem","style","border","h","Host","key","class","appearance","justifyContent","variant","size","block","download","undefined","part","rel","target","tabIndex","onBlur","onFocus","onClick","ref","spanElem","name","onSlotchange","role","title","requests","Map","fetchSvg","async","url","sanitize","fetch","has","get","response","ok","iconContent","set","svgContent","text","validateContent","error","console","getSvgContent","req","svgTag","iconCssClass","div","innerHTML","i","childNodes","length","nodeName","toLowerCase","removeChild","svgElm","firstElementChild","othersCssClasses","getAttribute","setAttribute","trim","removeAttribute","isValid","elm","nodeType","Node","ELEMENT_NODE","attribute","Array","from","attributes","value","isString","startsWith","childNode","children","bqIconCss","BqIconStyle0","BqIcon","handlePropsChange","loadIcon","handleWeightChange","includes","weight","warn","REGULAR","isWeightedIcon","weightSuffix","iconName","svgLoaded","connectedCallback","setupIconComponent","getIconSource","src","SVG_EXTENSION","iconFileName","getBasePath","then","_svgContent","styles","color","getColorCSSVariable","label"],"sources":["../../packages/beeq/src/components/button/bq-button.types.ts","../../packages/beeq/src/components/button/scss/bq-button.scss?tag=bq-button&encapsulation=shadow","../../packages/beeq/src/components/button/bq-button.tsx","../../packages/beeq/src/components/icon/helper/request.ts","../../packages/beeq/src/components/icon/scss/bq-icon.scss?tag=bq-icon&encapsulation=shadow","../../packages/beeq/src/components/icon/bq-icon.tsx"],"sourcesContent":["export const BUTTON_SIZE = ['small', 'medium', 'large'] as const;\nexport type TButtonSize = (typeof BUTTON_SIZE)[number];\n\nexport const BUTTON_TYPE = ['button', 'submit', 'reset'] as const;\nexport type TButtonType = (typeof BUTTON_TYPE)[number];\n\nexport const BUTTON_APPEARANCE = ['primary', 'secondary', 'link', 'text'] as const;\nexport type TButtonAppearance = (typeof BUTTON_APPEARANCE)[number];\n\nexport const BUTTON_VARIANT = ['standard', 'ghost', 'danger'] as const;\nexport type TButtonVariant = (typeof BUTTON_VARIANT)[number];\n\nexport const BUTTON_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TButtonBorderRadius = (typeof BUTTON_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Button styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-button.variables';\n\n@layer components {\n // Common button base style\n .bq-button {\n @apply box-border flex cursor-[inherit] items-center justify-center font-medium leading-regular;\n @apply rounded-[--bq-button--border-radius] border-[length:--bq-button--border-width] border-[color:--bq-button--border-color];\n @apply transition-[background-color,border-color,color] duration-300 ease-in-out;\n // `DISABLED` state\n @apply disabled:cursor-not-allowed disabled:opacity-60;\n // `FOCUS` state\n @apply focus-visible:focus;\n }\n}\n\n:host {\n @apply relative inline-block cursor-pointer is-auto;\n}\n\n:host([block]),\n.block {\n @apply is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Appearance */\n/* -------------------------------------------------------------------------- */\n\n.bq-button--primary {\n @apply bg-ui-brand text-text-alt;\n // Primary `HOVER` state\n @apply hover:enabled:bg-hover-ui-brand;\n // Primary `ACTIVE` state\n @apply active:enabled:bg-active-ui-brand active:enabled:hover:bg-active-ui-brand;\n}\n\n.bq-button--primary.ghost {\n @apply border-m border-solid border-stroke-brand bg-transparent text-text-brand;\n // Primary `HOVER` state\n @apply hover:enabled:bg-hover-ui-primary;\n // Primary `ACTIVE` state\n @apply active:enabled:bg-active-ui-primary active:enabled:hover:bg-active-ui-primary;\n}\n\n.bq-button--primary.danger {\n @apply bg-ui-danger text-text-alt;\n // Primary `HOVER` state\n @apply hover:enabled:bg-hover-ui-danger;\n // Primary `ACTIVE` state\n @apply active:enabled:bg-active-ui-danger active:enabled:hover:bg-active-ui-danger;\n}\n\n.bq-button--secondary {\n @apply bg-ui-secondary text-text-primary;\n // Secondary `HOVER` state\n @apply hover:enabled:bg-hover-ui-secondary;\n // Secondary `ACTIVE` state\n @apply active:enabled:bg-active-ui-secondary active:enabled:hover:bg-active-ui-secondary;\n}\n\n.bq-button--secondary.ghost {\n @apply border-m border-solid border-stroke-tertiary bg-transparent text-text-primary;\n // Secondary `HOVER` state\n @apply hover:enabled:bg-hover-ui-secondary;\n // Secondary `ACTIVE` state\n @apply active:enabled:bg-active-ui-secondary active:enabled:hover:bg-active-ui-secondary;\n}\n\n.bq-button--link {\n @apply bg-transparent text-text-brand no-underline;\n // Primary `HOVER` state\n @apply [&:not(.disabled)]:hover:bg-hover-ui-primary;\n // Primary `ACTIVE` state\n @apply [&:not(.disabled)]:active:bg-active-ui-secondary [&:not(.disabled)]:active:hover:bg-active-ui-secondary;\n // HTML `<a>` elements does not have a `disabled` state so we need to handle it manually\n &.disabled {\n @apply cursor-not-allowed opacity-60;\n }\n}\n\n.bq-button--text {\n @apply bg-transparent text-text-primary;\n // Primary `HOVER` state\n @apply hover:enabled:bg-hover-ui-primary;\n // Primary `ACTIVE` state\n @apply active:enabled:bg-active-ui-secondary active:enabled:hover:bg-active-ui-secondary;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Size */\n/* -------------------------------------------------------------------------- */\n\n.small {\n @apply text-[length:--bq-button--small-font-size] bs-[--bq-button--small-height] p-b-[--bq-button--small-paddingY] p-i-[--bq-button--small-paddingX];\n}\n\n.medium {\n @apply text-[length:--bq-button--medium-font-size] bs-[--bq-button--medium-height] p-b-[--bq-button--medium-paddingY] p-i-[--bq-button--medium-paddingX];\n}\n\n.large {\n @apply text-[length:--bq-button--large-font-size] bs-[--bq-button--large-height] p-b-[--bq-button--large-paddingY] p-i-[--bq-button--large-paddingX];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-button__label ::slotted(bq-icon) {\n @apply flex;\n}\n\n.content-left {\n @apply justify-start;\n}\n\n.content-right {\n @apply justify-end;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Prefix and Suffix slots */\n/* -------------------------------------------------------------------------- */\n\n.bq-button__prefix,\n.bq-button__suffix {\n @apply pointer-events-none flex shrink-0 grow-0 basis-auto items-center;\n}\n\n.bq-button.has-prefix .bq-button__label {\n @apply ps-xs2;\n}\n\n.bq-button.has-suffix .bq-button__label {\n @apply pe-xs2;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Loading */\n/* -------------------------------------------------------------------------- */\n\n.bq-button.loading {\n @apply relative cursor-wait;\n}\n\n.bq-button.loading .bq-button__prefix,\n.bq-button.loading .bq-button__label,\n.bq-button.loading .bq-button__suffix {\n @apply invisible;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Spinner icon */\n/* -------------------------------------------------------------------------- */\n\n.bq-button__loader {\n @include animation-spin;\n @apply absolute;\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\n\nimport {\n BUTTON_APPEARANCE,\n BUTTON_SIZE,\n BUTTON_TYPE,\n BUTTON_VARIANT,\n TButtonAppearance,\n TButtonBorderRadius,\n TButtonSize,\n TButtonType,\n TButtonVariant,\n} from './bq-button.types';\nimport { hasSlotContent, isDefined, isNil, validatePropValue } from '../../shared/utils';\n\n/**\n * Buttons are designed for users to take action on a page or a screen.\n *\n * @part button - The `<a>` or `<button>` HTML element used under the hood.\n * @part prefix - The `<span>` tag element that acts as prefix container.\n * @part label - The `<span>` tag element that renders the text of the button.\n * @part suffix - The `<span>` tag element that acts as suffix container.\n */\n@Component({\n tag: 'bq-button',\n styleUrl: './scss/bq-button.scss',\n shadow: true,\n})\nexport class BqButton {\n // Own Properties\n // ====================\n\n private prefixElem: HTMLElement;\n private suffixElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqButtonElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n @State() private hasSuffix = false;\n\n // Public Property API\n // ========================\n\n /** The appearance style to apply to the button */\n @Prop({ reflect: true }) appearance: TButtonAppearance = 'primary';\n\n /** If `true`, it will make the button fit to its parent width. */\n @Prop({ reflect: true }) block: boolean = false;\n\n /** The corner radius of the button */\n @Prop({ reflect: true }) border: TButtonBorderRadius = 'm';\n\n /** If true, the button will be disabled (no interaction allowed) */\n @Prop() disabled = false;\n\n /**\n * Tells the browser to treat the linked URL as a download. Only used when `href` is set.\n * Details: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n */\n @Prop() download?: string;\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>` */\n @Prop({ reflect: true }) href: string;\n\n /** It determinate how the content should be aligned */\n @Prop({ reflect: true }) justifyContent: 'left' | 'center' | 'right' = 'center';\n\n /** If `true` it will display the button in a loading state */\n @Prop() loading = false;\n\n /** The size of the button */\n @Prop({ reflect: true }) size: TButtonSize = 'medium';\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a `tab`, `window`, or `<iframe>`)\n * Details: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n */\n @Prop({ reflect: true }) target: '_blank' | '_parent' | '_self' | '_top';\n\n /** The default behavior of the button */\n @Prop({ reflect: true }) type: TButtonType = 'button';\n\n /** The variant of button to apply on top of the appearance (applicable only to `appearance=\"primary\"`) */\n @Prop({ reflect: true }) variant: TButtonVariant = 'standard';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('appearance')\n @Watch('type')\n @Watch('size')\n @Watch('variant')\n checkPropValues() {\n validatePropValue(BUTTON_APPEARANCE, 'primary', this.el, 'appearance');\n validatePropValue(BUTTON_TYPE, 'button', this.el, 'type');\n validatePropValue(BUTTON_SIZE, 'medium', this.el, 'size');\n validatePropValue(BUTTON_VARIANT, 'standard', this.el, 'variant');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the button loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqButtonElement>;\n\n /** Handler to be called when the button is clicked */\n @Event() bqFocus: EventEmitter<HTMLBqButtonElement>;\n\n /** Handler to be called when button gets focus */\n @Event() bqClick: EventEmitter<HTMLBqButtonElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleClick = (ev: Event) => {\n if (this.disabled || this.loading) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n\n if (this.type === 'submit' || this.type === 'reset') {\n const wrapperForm = this.el.closest('form');\n if (!isNil(wrapperForm)) {\n const btn = document.createElement('button');\n btn.type = this.type;\n btn.hidden = true;\n wrapperForm.append(btn);\n\n btn.click();\n btn.remove();\n }\n }\n\n this.bqClick.emit(this.el);\n };\n\n private handleSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n this.hasSuffix = hasSlotContent(this.suffixElem, 'suffix');\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const isLink = isDefined(this.href);\n const TagElem = isLink ? 'a' : 'button';\n const style = {\n ...(this.border && { '--bq-button--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host style={style}>\n <TagElem\n class={{\n 'bq-button': true,\n [`bq-button--${this.appearance}`]: true,\n [`content-${this.justifyContent}`]: true,\n [`${this.variant}`]: true,\n [`${this.size}`]: true,\n block: this.block,\n disabled: this.disabled,\n 'has-prefix': this.hasPrefix,\n 'has-suffix': this.hasSuffix,\n loading: this.loading,\n }}\n aria-disabled={this.disabled ? 'true' : 'false'}\n disabled={this.disabled}\n download={isLink ? this.download : undefined}\n href={isLink ? this.href : undefined}\n part=\"button\"\n rel={isLink && this.target ? 'noreferrer noopener' : undefined}\n target={isLink ? this.target : undefined}\n type={this.type}\n tabIndex={this.disabled ? -1 : 0}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onClick={this.handleClick}\n >\n <span class=\"bq-button__prefix\" ref={(spanElem) => (this.prefixElem = spanElem)} part=\"prefix\">\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <span class=\"bq-button__label\" part=\"label\">\n <slot />\n </span>\n <span class=\"bq-button__suffix\" ref={(spanElem) => (this.suffixElem = spanElem)} part=\"suffix\">\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange} />\n </span>\n {this.loading && (\n <bq-icon\n class=\"bq-button__loader\"\n name=\"spinner-gap\"\n role=\"img\"\n title={`${this.appearance} button loader`}\n />\n )}\n </TagElem>\n </Host>\n );\n }\n}\n","/* -------------------------------------------------------------------------- */\n/* Icon request helper */\n/* -------------------------------------------------------------------------- */\n\nimport { isNil, isString } from '../../../shared/utils';\n\nconst requests = new Map<string, Promise<unknown>>();\n\nconst fetchSvg = async (url: string, sanitize: boolean): Promise<unknown> => {\n if (typeof fetch === 'undefined' || typeof document === 'undefined') return;\n\n if (requests.has(url)) return requests.get(url);\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n iconContent.set(url, '');\n return;\n }\n\n let svgContent = (await response.text()) || '';\n\n if (svgContent && sanitize !== false) svgContent = validateContent(svgContent);\n\n iconContent.set(url, svgContent);\n } catch (error) {\n console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);\n iconContent.set(url, '');\n }\n};\n\nexport const iconContent = new Map<string, string>();\n\nexport const getSvgContent = async (url: string, sanitize: boolean) => {\n let req = requests.get(url);\n\n // NOTE: if the request does not exists we will cache it\n if (isNil(req)) {\n req = fetchSvg(url, sanitize);\n requests.set(url, req);\n }\n return req;\n};\n\nexport const validateContent = (svgContent: string): string => {\n if (typeof document === 'undefined') return '';\n\n const svgTag = 'svg';\n const iconCssClass = 'bq-icon__svg';\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== svgTag) {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === svgTag) {\n // keep other CSS classes (if there's any) and add the `bq-icon__svg` CSS class\n const othersCssClasses = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', `${othersCssClasses} ${iconCssClass}`.trim());\n // set the shadow DOM part for the SVG element\n svgElm.setAttribute('part', svgTag);\n\n // remove height and width attribute, if for some reason they are still present in the SVG tag\n svgElm.removeAttribute('height');\n svgElm.removeAttribute('width');\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) return div.innerHTML;\n }\n\n return '';\n};\n\nexport const isValid = (elm: HTMLElement): boolean => {\n if (elm.nodeType === Node.ELEMENT_NODE) {\n if (elm.nodeName.toLowerCase() === 'script') return false;\n\n for (const attribute of Array.from(elm.attributes)) {\n const value = attribute.value;\n if (isString(value) && value.toLowerCase().startsWith('on')) {\n return false;\n }\n }\n\n for (const childNode of Array.from(elm.children) as HTMLElement[]) {\n if (!isValid(childNode)) return false;\n }\n }\n return true;\n};\n","/* -------------------------------------------------------------------------- */\n/* Icon styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-icon.variables';\n\n:host {\n @apply inline-block;\n}\n\n/**\n * This class is added on packages/beeq/src/components/icon/helper/request.ts\n * See lines 42 and 58 for details.\n */\n.bq-icon__svg {\n @apply scale-x-[--bq-icon--direction];\n}\n","import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\n\nimport { TIconWeight } from './bq-icon.types';\nimport { getSvgContent, iconContent } from './helper/request';\nimport { getBasePath, getColorCSSVariable, isNil } from '../../shared/utils';\n\n/**\n * Icons are simplified images that graphically explain the meaning of an object on the screen.\n *\n * @part base - The component's internal wrapper that holds the icon SVG content.\n * @part svg - The `<svg>` tag element inside the component.\n */\n@Component({\n assetsDirs: ['svg'],\n tag: 'bq-icon',\n styleUrl: './scss/bq-icon.scss',\n shadow: true,\n})\nexport class BqIcon {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private _svgContent: string;\n\n // Public Property API\n // ========================\n\n /** Label for the icon, used for accessibility */\n @Prop({ reflect: true }) label?: string;\n\n /** Set the stroke color of the SVG. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) color?: string;\n\n /** Icon name to load. Please check all available icons [here](https://phosphoricons.com/) */\n @Prop({ reflect: true }) name?: string;\n\n /** Set the size of the SVG */\n @Prop({ reflect: true }) size?: string | number = 24;\n\n /** Set the source of the SVG. If the source is set, the name property will be ignored */\n @Prop({ reflect: true }) src?: string;\n\n /** @deprecated It set the icon weight/style */\n @Prop({ reflect: true }) weight?: TIconWeight = undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('color')\n @Watch('name')\n @Watch('size')\n handlePropsChange() {\n this.loadIcon(this.name);\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `weight` property is removed\n * We need to maintain retro-compatibility until the next major release\n */\n @Watch('weight')\n handleWeightChange() {\n if (this.name.includes(this.weight)) return;\n\n console.warn(\n `❗️ [bq-icon]: the 'weight' property is deprecated, you should add the weight to the icon name.\\n\n For example, '<bq-icon name=\"bell-fill\"></bq-icon>' instead of '<bq-icon name=\"bell\" weight=\"fill\"></bq-icon>'`,\n );\n // Check if the icon is weighted. An icon is considered weighted if its weight is not 'regular' and ENV_SVG_PATH is not set.\n // Eg: if the weight is 'bold' and ENV_SVG_PATH is not set, isWeightedIcon will be true.\n const REGULAR = 'regular';\n const isWeightedIcon = !isNil(this.weight) && this.weight !== REGULAR;\n // If the icon is weighted, append the weight to the icon name. Otherwise, append nothing.\n // Eg: if isWeightedIcon is true and the weight is 'bold', weightSuffix will be '-bold'.\n const weightSuffix = isWeightedIcon ? `-${this.weight}` : '';\n // Construct the icon name by appending the weight suffix (if any) and the file extension.\n // Eg: if the name is 'my-icon' and weightSuffix is '-bold', iconName will be 'my-icon-bold.svg'.\n const iconName = `${this.name}${weightSuffix}`;\n this.loadIcon(iconName);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the SVG has loaded */\n @Event() svgLoaded: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.setupIconComponent();\n }\n\n componentWillLoad() {\n this.setupIconComponent();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private setupIconComponent = () => {\n this.loadIcon(this.name);\n // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed\n if (!isNil(this.weight)) this.handleWeightChange();\n };\n\n private getIconSource = (name: string) => {\n if (!this.name && !this.src) return;\n // Return the src if it is set\n if (this.src) return this.src;\n\n const SVG_EXTENSION = '.svg';\n const iconFileName = `${name}${SVG_EXTENSION}`;\n\n return getBasePath(iconFileName);\n };\n\n private loadIcon = (name: string) => {\n const url = this.getIconSource(name);\n getSvgContent(url, true).then(() => {\n this._svgContent = iconContent.get(url);\n this.svgLoaded.emit(this._svgContent);\n });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const styles = {\n ...(this.color && { '--bq-icon--color': getColorCSSVariable(this.color) }),\n ...(this.size && { '--bq-icon--size': `${this.size}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n aria-label={this.label ?? `${this.name} icon`}\n class=\"flex text-[color:--bq-icon--color] bs-[--bq-icon--size] is-[--bq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H;;EAGP,iBAAA1H;IACEL,KAAK+H;;;;;;;;;;;;;;EAkBCA,mBAAqB;IAC3B/H,KAAKoH,SAASpH,KAAKyD;;QAEnB,KAAKvC,EAAMlB,KAAKuH,SAASvH,KAAKqH;AAAoB;EAG5CW,cAAiBvE;IACvB,KAAKzD,KAAKyD,SAASzD,KAAKiI,KAAK;;QAE7B,IAAIjI,KAAKiI,KAAK,OAAOjI,KAAKiI;IAE1B,MAAMC,IAAgB;IACtB,MAAMC,IAAe,GAAG1E,IAAOyE;IAE/B,OAAOE,EAAYD;AAAa;EAG1Bf,SAAY3D;IAClB,MAAMQ,IAAMjE,KAAKgI,cAAcvE;IAC/BsB,cAAcd,GAAK,MAAMoE,MAAK;MAC5BrI,KAAKsI,cAAc9D,EAAYH,IAAIJ;MACnCjE,KAAK6H,UAAUtH,KAAKP,KAAKsI;AAAY;AACrC;;;;EAOJ,MAAAxG;IACE,MAAMyG,IAAS;SACTvI,KAAKwI,SAAS;QAAE,oBAAoBC,EAAoBzI,KAAKwI;;SAC7DxI,KAAK4C,QAAQ;QAAE,mBAAmB,GAAG5C,KAAK4C;;;IAGhD,OACEP,EAACC,GAAI;MAAAC,KAAA;MAACJ,OAAOoG;OACXlG,EAAA;MAAAE,KAAA;MAAA,cACcvC,KAAK0I,SAAS,GAAG1I,KAAKyD;MAClCjB,OAAM;MACN4C,WAAWpF,KAAKsI;MAChBtF,MAAK;MACLW,MAAK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NOTIFICATION_TYPE","bqNotificationCss","BqNotificationStyle0","NOTIFICATION_PORTAL_SELECTOR","BqNotification","document","querySelector","autoDismissDebounce","bodyElem","footerElem","notificationElem","handleTimeout","this","cancel","autoDismiss","debounce","hide","time","open","handleOpenChange","checkPropValues","validatePropValue","el","bqHide","bqShow","bqAfterOpen","bqAfterClose","connectedCallback","notificationPortal","Object","assign","createElement","className","componentWillLoad","afterNotificationClose","removeChild","tagName","toLowerCase","remove","error","DOMException","handleHide","show","handleShow","toast","parentElement","body","append","appendChild","requestAnimationFrame","async","ev","emit","defaultPrevented","leave","handleTransitionEnd","enter","handleContentSlotChange","hasContent","hasSlotContent","handleFooterSlotChange","hasFooter","iconName","typeMap","success","warning","type","render","style","border","h","Host","key","class","hidden","role","ref","div","part","disableClose","appearance","size","onClick","name","hideIcon","exportparts","onSlotchange"],"sources":["../../packages/beeq/src/components/notification/bq-notification.types.ts","../../packages/beeq/src/components/notification/scss/bq-notification.scss?tag=bq-notification&encapsulation=shadow","../../packages/beeq/src/components/notification/bq-notification.tsx"],"sourcesContent":["export const NOTIFICATION_TYPE = ['error', 'info', 'neutral', 'success', 'warning'] as const;\nexport type TNotificationType = (typeof NOTIFICATION_TYPE)[number];\n\nexport const NOTIFICATION_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TNotificationBorderRadius = (typeof NOTIFICATION_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Notification styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-notification.variables';\n\n:host {\n @apply block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-notification {\n @apply relative flex transition-all min-is-[--bq-notification--min-width] p-b-[--bq-notification--padding] p-i-[--bq-notification--padding];\n @apply rounded-[--bq-notification--border-radius] bg-[--bq-notification--background] shadow-[shadow:--bq-notification--box-shadow];\n}\n\n/**\n * Set the notification icon color based on the type value selected\n */\n.notification--icon.color {\n &-error {\n @apply text-[color:--bq-notification--icon-color-error];\n }\n\n &-info {\n @apply text-[color:--bq-notification--icon-color-info];\n }\n\n &-neutral {\n @apply text-[color:--bq-notification--icon-color-neutral];\n }\n\n &-success {\n @apply text-[color:--bq-notification--icon-color-success];\n }\n\n &-warning {\n @apply text-[color:--bq-notification--icon-color-warning];\n }\n}\n\n/**\n * Tweak the close bq-button styles so it remain small without extra padding\n */\n.notification--close::part(button) {\n @apply rounded-s border-0 bs-fit p-b-0 p-i-0;\n}\n\n/**\n * Here we guarantee that if the footer actions are wrapped in a div container from the consumer side,\n * the styles get applied to the that wrapping container directly\n */\n[part='footer'] ::slotted(*) {\n @apply flex items-start gap-xs;\n}\n\n[part='body'],\n[part='footer'] {\n ::slotted(*) {\n @apply block m-bs-m;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { NOTIFICATION_TYPE, TNotificationBorderRadius, TNotificationType } from './bq-notification.types';\nimport { debounce, enter, hasSlotContent, leave, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst NOTIFICATION_PORTAL_SELECTOR = 'bq-notification-portal';\n\n/**\n * @part base - The `<div>` container of the predefined bq-icon component.\n * @part body - The container `<div>` that wraps the notification description content\n * @part btn-close - The `bq-button` used to close the notification\n * @part content - The container `<div>` that wraps all the notification content (title, description, footer)\n * @part footer - The container `<div>` that wraps the notification footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon based on the notification type\n * @part icon-outline - The container `<div>` that wraps the icon element\n * @part main - The container `<div>` that wraps the notification main content (title, description)\n * @part svg - The `<svg>` element of the predefined bq-icon component.\n * @part title - The container `<div>` that wraps the notification title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n *\n * @slot - The notification title content\n * @slot body - The notification description content\n * @slot footer - The notification footer content\n * @slot icon - The icon to be displayed in the notification\n * @slot btn-close - The close button of the notification\n */\n\n@Component({\n tag: 'bq-notification',\n styleUrl: './scss/bq-notification.scss',\n shadow: true,\n})\nexport class BqNotification {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n private notificationElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqNotificationElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasContent = false;\n @State() private hasFooter = false;\n @State() private notificationPortal = document.querySelector(`.${NOTIFICATION_PORTAL_SELECTOR}`);\n\n // Public Property API\n // ========================\n\n /** If true, the notification will automatically hide after the specified amount of time */\n @Prop({ reflect: true }) autoDismiss: boolean;\n\n /** The corder radius of the notification component */\n @Prop({ reflect: true }) border: TNotificationBorderRadius = 's';\n\n /** If true, the close button at the top right of the notification won't be shown */\n @Prop({ reflect: true }) disableClose: boolean;\n\n /** If true, the notification icon won't be shown */\n @Prop({ reflect: true }) hideIcon: boolean;\n\n /** If true, the notification will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the notification will close itself. Only valid if `autoDismiss=\"true\"` */\n @Prop({ reflect: true }) time: number = 3000;\n\n /** Type of Notification */\n @Prop({ reflect: true }) type: TNotificationType = 'info';\n\n // Prop lifecycle events\n // =======================\n @Watch('autoDismiss')\n @Watch('time')\n handleTimeout() {\n this.autoDismissDebounce?.cancel();\n if (!this.autoDismiss) return;\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n // Make sure to autodismiss the notification if the `auto-dismiss` value changed while open\n if (this.open) this.autoDismissDebounce();\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (!(this.autoDismiss && this.open)) return;\n this.autoDismissDebounce();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(NOTIFICATION_TYPE, 'info', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide!: EventEmitter;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow!: EventEmitter;\n\n /** Callback handler to be called after the notification has been opened */\n @Event() bqAfterOpen!: EventEmitter;\n\n /** Callback handler to be called after the notification has been closed */\n @Event() bqAfterClose!: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n const { notificationPortal } = this;\n if (!notificationPortal && typeof document !== 'undefined') {\n this.notificationPortal = Object.assign(document.createElement('div'), {\n className: NOTIFICATION_PORTAL_SELECTOR,\n });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeout();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqAfterClose')\n afterNotificationClose() {\n try {\n const { notificationPortal } = this;\n notificationPortal.removeChild(this.el);\n // Remove the notification portal from the DOM when there are no more notifications\n if (notificationPortal.querySelector(this.el.tagName.toLowerCase()) === null) {\n notificationPortal.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to hide the notification component */\n @Method()\n async hide(): Promise<void> {\n await this.handleHide();\n }\n\n /** Method to be called to show the notification component */\n @Method()\n async show(): Promise<void> {\n await this.handleShow();\n }\n\n /** This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically */\n @Method()\n async toast() {\n const { notificationPortal } = this;\n if (notificationPortal?.parentElement === null) {\n document.body.append(notificationPortal);\n }\n\n notificationPortal?.appendChild(this.el);\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = async () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n await leave(this.notificationElem);\n this.open = false;\n this.handleTransitionEnd();\n }\n };\n\n private handleShow = async () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n await enter(this.notificationElem);\n this.handleTransitionEnd();\n }\n };\n\n private handleTransitionEnd = () => {\n if (this.open) {\n this.bqAfterOpen.emit();\n return;\n }\n\n this.bqAfterClose.emit();\n };\n\n private handleContentSlotChange = () => {\n this.hasContent = hasSlotContent(this.bodyElem);\n };\n\n private handleFooterSlotChange = () => {\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconName(): string {\n const typeMap = {\n error: 'x-circle',\n success: 'check-circle',\n warning: 'warning-circle',\n };\n\n return typeMap[this.type] || 'info';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-notification--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"alert\"\n >\n <div\n class=\"bq-notification\"\n data-transition-enter=\"transform transition ease-out duration-300\"\n data-transition-enter-start=\"translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n data-transition-enter-end=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave=\"transform transition ease-in duration-100\"\n data-transition-leave-start=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave-end=\"-translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n ref={(div) => (this.notificationElem = div)}\n part=\"wrapper\"\n >\n {/* CLOSE BUTTON */}\n {!this.disableClose && (\n <bq-button\n class=\"notification--close absolute inset-ie-5 [&::part(label)]:inline-flex\"\n appearance=\"text\"\n size=\"small\"\n onClick={() => this.hide()}\n part=\"btn-close\"\n >\n <slot name=\"btn-close\">\n <bq-icon name=\"x\" />\n </slot>\n </bq-button>\n )}\n {/* ICON */}\n <div\n class={{\n '!hidden': this.hideIcon,\n [`color-${this.type}`]: true, // The icon color will be based on the type (info, success, warning, error)\n 'notification--icon me-xs flex text-left align-top': true,\n }}\n part=\"icon-outline\"\n >\n <slot name=\"icon\">\n <bq-icon name={this.iconName} part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n {/* MAIN */}\n <div class=\"flex flex-col items-start gap-[--bq-notification--content-footer-gap]\" part=\"main\">\n <div class=\"flex flex-col gap-[--bq-notification--title-body-gap]\" part=\"content\">\n {/* TITLE */}\n <div class=\"title-font font-semibold leading-regular\" part=\"title\">\n <slot />\n </div>\n {/* BODY */}\n <div\n class={{ 'text-s leading-regular': true, '!hidden': !this.hasContent }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleContentSlotChange} />\n </div>\n </div>\n {/* FOOTER */}\n <div\n class={{ 'flex items-start gap-xs': true, '!hidden': !this.hasFooter }}\n ref={(div) => (this.footerElem = div)}\n part=\"footer\"\n >\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAO,MAAMA,IAAoB,EAAC,SAAS,QAAQ,WAAW,WAAW;;ACAzE,MAAMC,IAAoB;;AAC1B,MAAAC,IAAeD;;ACIf,MAAME,IAA+B;;MA2BxBC,IAAc;;;;;;;sBAkBK;qBACD;8BACSC,SAASC,cAAc,IAAIH;;kBASJ;;;;gBAYrB;gBAGW;;;;EAxC3CI;EACAC;EACAC;EACAC;;;;;;EA2CR,aAAAC;IACEC,KAAKL,qBAAqBM;IAC1B,KAAKD,KAAKE,aAAa;IAEvBF,KAAKL,sBAAsBQ,GAAS;MAClCH,KAAKI;AAAM,QACVJ,KAAKK;;QAER,IAAIL,KAAKM,MAAMN,KAAKL;;EAItB,gBAAAY;IACEP,KAAKL,qBAAqBM;IAE1B,MAAMD,KAAKE,eAAeF,KAAKM,OAAO;IACtCN,KAAKL;;EAIP,eAAAa;IACEC,EAAkBrB,GAAmB,QAAQY,KAAKU,IAAI;;;;;;EAQ/CC;;EAGAC;;EAGAC;;EAGAC;;;;EAMT,iBAAAC;IACE,OAAMC,oBAAEA,KAAuBhB;IAC/B,KAAKgB,YAA6BvB,aAAa,aAAa;MAC1DO,KAAKgB,qBAAqBC,OAAOC,OAAOzB,SAAS0B,cAAc,QAAQ;QACrEC,WAAW7B;;;;EAKjB,iBAAA8B;IACErB,KAAKQ;IACLR,KAAKD;;;;EAOP,sBAAAuB;IACE;MACE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AA2B;QAAM,YAAY7D,KAAKiD;;MAC3De,KAAMC,KAASjE,KAAKH,aAAaoE;MACjCC,MAAK;OAELR,EAAA;MAAAE,KAAA;MAAMW,MAAK;MAASG,cAAc1E,KAAKgD","ignoreList":[]}
@@ -1,65 +0,0 @@
1
- /*!
2
- * Built by Endavans
3
- * © https://beeq.design - Apache 2 License.
4
- */
5
- 'use strict';
6
-
7
- /**
8
- * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.
9
- * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
10
- */
11
- let bqSVGBasePath = '';
12
- const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
13
- const DEFAULT_SVG_PATH = 'svg';
14
- const scripts = document && typeof document !== 'undefined'
15
- ? [...document.getElementsByTagName('script')]
16
- : [];
17
- /**
18
- * Sets the `bqSVGBasePath` in the global window object,
19
- * which is used to determine the SVG path in the BQIcon component.
20
- * This method is the only way to update the base path.
21
- *
22
- * @param path - The new base path to set.
23
- */
24
- const setBasePath = (path) => {
25
- bqSVGBasePath = path;
26
- };
27
- /**
28
- * Retrieves the `bqSVGBasePath`, optionally appending a subpath.
29
- *
30
- * @param subpath - The subpath to append to the base path.
31
- * @returns The full base path including the subpath.
32
- */
33
- const getBasePath = (subpath = '') => {
34
- if (!bqSVGBasePath) {
35
- initializeBasePath();
36
- }
37
- const formattedSubpath = subpath ? `/${subpath.replace(/^\//, '')}` : '';
38
- return bqSVGBasePath.replace(/\/$/, '') + formattedSubpath;
39
- };
40
- /**
41
- * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.
42
- * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.
43
- * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.
44
- * 3. If no scripts are found, the base path will be set to the default value `./svg`.
45
- */
46
- const initializeBasePath = () => {
47
- const configScript = findConfigScript();
48
- const fallbackScript = configScript ? null : findFallbackScript();
49
- const script = configScript || fallbackScript;
50
- if (script) {
51
- const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);
52
- setBasePath(`${path}/${DEFAULT_SVG_PATH}`);
53
- }
54
- else {
55
- setBasePath(`./${DEFAULT_SVG_PATH}`);
56
- }
57
- };
58
- const findConfigScript = () => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));
59
- const findFallbackScript = () => scripts?.find((script) => /beeq(\.esm)?\.js($|\?)/.test(script.src));
60
- const getScriptPath = (script) => script?.getAttribute('src').split('/').slice(0, -1).join('/');
61
-
62
- exports.getBasePath = getBasePath;
63
- exports.setBasePath = setBasePath;
64
-
65
- //# sourceMappingURL=assetsPath-6ac8935a.js.map
@@ -1 +0,0 @@
1
- {"file":"assetsPath-6ac8935a.js","mappings":";;;;;;AAAA;;;;AAKA,IAAI,aAAa,GAAG,EAAE,CAAC;AAEvB,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,OAAO,GACX,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW;MACtC,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAyB;MACrE,EAAE,CAAC;AAET;;;;;;;MAOa,WAAW,GAAG,CAAC,IAAY;IACtC,aAAa,GAAG,IAAI,CAAC;AACvB,EAAE;AAEF;;;;;;MAMa,WAAW,GAAG,CAAC,OAAO,GAAG,EAAE;IACtC,IAAI,CAAC,aAAa,EAAE;QAClB,kBAAkB,EAAE,CAAC;KACtB;IAED,MAAM,gBAAgB,GAAG,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACzE,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC7D,EAAE;AAEF;;;;;;AAMA,MAAM,kBAAkB,GAAG;IACzB,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;IACxC,MAAM,cAAc,GAAG,YAAY,GAAG,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAElE,MAAM,MAAM,GAAG,YAAY,IAAI,cAAc,CAAC;IAC9C,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7F,WAAW,CAAC,GAAG,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC;KAC5C;SAAM;QACL,WAAW,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAC;KACtC;AACH,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAyB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAEtH,MAAM,kBAAkB,GAAG,MACzB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvE,MAAM,aAAa,GAAG,CAAC,MAAyB,KAC9C,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/assetsPath.ts"],"sourcesContent":["/**\n * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.\n * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n */\n\nlet bqSVGBasePath = '';\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n document && typeof document !== 'undefined'\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n bqSVGBasePath = path;\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string => {\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\n const configScript = findConfigScript();\n const fallbackScript = configScript ? null : findFallbackScript();\n\n const script = configScript || fallbackScript;\n if (script) {\n const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);\n setBasePath(`${path}/${DEFAULT_SVG_PATH}`);\n } else {\n setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement =>\n scripts?.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script?.getAttribute('src').split('/').slice(0, -1).join('/');\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"cssVariables-a0e1e906.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;;;SAMgB,mBAAmB,CAAC,SAAiB;IACnD,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAEtD,MAAM,KAAK,GAAG,GAAG,cAAc,GAAG,SAAS,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjF,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,OAAO,OAAO,KAAK,GAAG,CAAC;AACzB,CAAC;AAED;;;;;;SAMgB,mBAAmB,CAAC,QAAgB,EAAE,SAAkB;IACtE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjE;;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/cssVariables.ts"],"sourcesContent":["const CSSVALUEPREFIX = '--bq-';\n\n/**\n * Get CSS custom property variable of a given color string value\n *\n * @param {string} colorName - Valid string value.\n * @return {string} The corresponding CSS custom property variable\n */\nexport function getColorCSSVariable(colorName: string): string | undefined {\n if (typeof document === 'undefined') return undefined;\n\n const token = `${CSSVALUEPREFIX}${colorName}`;\n const value = getComputedStyle(document.documentElement).getPropertyValue(token);\n if (!value) return undefined;\n\n return `var(${token})`;\n}\n\n/**\n * Get compiled CSS custom property value\n *\n * @param {string} variable - The variable name for which to get its value\n * @return {string} The corresponding value for the given CSS custom property\n */\nexport function getCSSVariableValue(variable: string, component: Element): string {\n const styles = getComputedStyle(component);\n return String(styles.getPropertyValue(`--${variable}`)).trim();\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"isDefined-ee0026ed.js","mappings":";;;;;;;;;AAEA;;;;;MAKa,SAAS,GAAG,CAAC,KAAc;IACtC,OAAOA,iBAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/D;;;;","names":["isString"],"sources":["../../packages/beeq/src/shared/utils/isDefined.ts"],"sourcesContent":["import { isString } from '.';\n\n/**\n * Check is a value is not falsy\n * @param value the value to be checked\n * @returns {boolean} the value is not falsy\n */\nexport const isDefined = (value: unknown): boolean => {\n return isString(value) ? value.length !== 0 : Boolean(value);\n};\n"],"version":3}
@@ -1,62 +0,0 @@
1
- /*!
2
- * Built by Endavans
3
- * © https://beeq.design - Apache 2 License.
4
- */
5
- /**
6
- * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.
7
- * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
8
- */
9
- let bqSVGBasePath = '';
10
- const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
11
- const DEFAULT_SVG_PATH = 'svg';
12
- const scripts = document && typeof document !== 'undefined'
13
- ? [...document.getElementsByTagName('script')]
14
- : [];
15
- /**
16
- * Sets the `bqSVGBasePath` in the global window object,
17
- * which is used to determine the SVG path in the BQIcon component.
18
- * This method is the only way to update the base path.
19
- *
20
- * @param path - The new base path to set.
21
- */
22
- const setBasePath = (path) => {
23
- bqSVGBasePath = path;
24
- };
25
- /**
26
- * Retrieves the `bqSVGBasePath`, optionally appending a subpath.
27
- *
28
- * @param subpath - The subpath to append to the base path.
29
- * @returns The full base path including the subpath.
30
- */
31
- const getBasePath = (subpath = '') => {
32
- if (!bqSVGBasePath) {
33
- initializeBasePath();
34
- }
35
- const formattedSubpath = subpath ? `/${subpath.replace(/^\//, '')}` : '';
36
- return bqSVGBasePath.replace(/\/$/, '') + formattedSubpath;
37
- };
38
- /**
39
- * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.
40
- * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.
41
- * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.
42
- * 3. If no scripts are found, the base path will be set to the default value `./svg`.
43
- */
44
- const initializeBasePath = () => {
45
- const configScript = findConfigScript();
46
- const fallbackScript = configScript ? null : findFallbackScript();
47
- const script = configScript || fallbackScript;
48
- if (script) {
49
- const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);
50
- setBasePath(`${path}/${DEFAULT_SVG_PATH}`);
51
- }
52
- else {
53
- setBasePath(`./${DEFAULT_SVG_PATH}`);
54
- }
55
- };
56
- const findConfigScript = () => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));
57
- const findFallbackScript = () => scripts?.find((script) => /beeq(\.esm)?\.js($|\?)/.test(script.src));
58
- const getScriptPath = (script) => script?.getAttribute('src').split('/').slice(0, -1).join('/');
59
-
60
- export { getBasePath as g, setBasePath as s };
61
-
62
- //# sourceMappingURL=assetsPath.js.map
@@ -1 +0,0 @@
1
- {"file":"assetsPath.js","mappings":";;;;AAAA;;;;AAKA,IAAI,aAAa,GAAG,EAAE,CAAC;AAEvB,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,OAAO,GACX,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW;MACtC,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAyB;MACrE,EAAE,CAAC;AAET;;;;;;;MAOa,WAAW,GAAG,CAAC,IAAY;IACtC,aAAa,GAAG,IAAI,CAAC;AACvB,EAAE;AAEF;;;;;;MAMa,WAAW,GAAG,CAAC,OAAO,GAAG,EAAE;IACtC,IAAI,CAAC,aAAa,EAAE;QAClB,kBAAkB,EAAE,CAAC;KACtB;IAED,MAAM,gBAAgB,GAAG,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACzE,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC7D,EAAE;AAEF;;;;;;AAMA,MAAM,kBAAkB,GAAG;IACzB,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;IACxC,MAAM,cAAc,GAAG,YAAY,GAAG,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAElE,MAAM,MAAM,GAAG,YAAY,IAAI,cAAc,CAAC;IAC9C,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7F,WAAW,CAAC,GAAG,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC;KAC5C;SAAM;QACL,WAAW,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAC;KACtC;AACH,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAyB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAEtH,MAAM,kBAAkB,GAAG,MACzB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvE,MAAM,aAAa,GAAG,CAAC,MAAyB,KAC9C,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/assetsPath.ts"],"sourcesContent":["/**\n * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.\n * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n */\n\nlet bqSVGBasePath = '';\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n document && typeof document !== 'undefined'\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n bqSVGBasePath = path;\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string => {\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\n const configScript = findConfigScript();\n const fallbackScript = configScript ? null : findFallbackScript();\n\n const script = configScript || fallbackScript;\n if (script) {\n const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);\n setBasePath(`${path}/${DEFAULT_SVG_PATH}`);\n } else {\n setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement =>\n scripts?.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script?.getAttribute('src').split('/').slice(0, -1).join('/');\n"],"version":3}
@@ -1,62 +0,0 @@
1
- /*!
2
- * Built by Endavans
3
- * © https://beeq.design - Apache 2 License.
4
- */
5
- /**
6
- * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.
7
- * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
8
- */
9
- let bqSVGBasePath = '';
10
- const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
11
- const DEFAULT_SVG_PATH = 'svg';
12
- const scripts = document && typeof document !== 'undefined'
13
- ? [...document.getElementsByTagName('script')]
14
- : [];
15
- /**
16
- * Sets the `bqSVGBasePath` in the global window object,
17
- * which is used to determine the SVG path in the BQIcon component.
18
- * This method is the only way to update the base path.
19
- *
20
- * @param path - The new base path to set.
21
- */
22
- const setBasePath = (path) => {
23
- bqSVGBasePath = path;
24
- };
25
- /**
26
- * Retrieves the `bqSVGBasePath`, optionally appending a subpath.
27
- *
28
- * @param subpath - The subpath to append to the base path.
29
- * @returns The full base path including the subpath.
30
- */
31
- const getBasePath = (subpath = '') => {
32
- if (!bqSVGBasePath) {
33
- initializeBasePath();
34
- }
35
- const formattedSubpath = subpath ? `/${subpath.replace(/^\//, '')}` : '';
36
- return bqSVGBasePath.replace(/\/$/, '') + formattedSubpath;
37
- };
38
- /**
39
- * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.
40
- * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.
41
- * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.
42
- * 3. If no scripts are found, the base path will be set to the default value `./svg`.
43
- */
44
- const initializeBasePath = () => {
45
- const configScript = findConfigScript();
46
- const fallbackScript = configScript ? null : findFallbackScript();
47
- const script = configScript || fallbackScript;
48
- if (script) {
49
- const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);
50
- setBasePath(`${path}/${DEFAULT_SVG_PATH}`);
51
- }
52
- else {
53
- setBasePath(`./${DEFAULT_SVG_PATH}`);
54
- }
55
- };
56
- const findConfigScript = () => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));
57
- const findFallbackScript = () => scripts?.find((script) => /beeq(\.esm)?\.js($|\?)/.test(script.src));
58
- const getScriptPath = (script) => script?.getAttribute('src').split('/').slice(0, -1).join('/');
59
-
60
- export { getBasePath as g, setBasePath as s };
61
-
62
- //# sourceMappingURL=assetsPath-e2f1ceb9.js.map
@@ -1 +0,0 @@
1
- {"file":"assetsPath-e2f1ceb9.js","mappings":";;;;AAAA;;;;AAKA,IAAI,aAAa,GAAG,EAAE,CAAC;AAEvB,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,OAAO,GACX,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW;MACtC,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAyB;MACrE,EAAE,CAAC;AAET;;;;;;;MAOa,WAAW,GAAG,CAAC,IAAY;IACtC,aAAa,GAAG,IAAI,CAAC;AACvB,EAAE;AAEF;;;;;;MAMa,WAAW,GAAG,CAAC,OAAO,GAAG,EAAE;IACtC,IAAI,CAAC,aAAa,EAAE;QAClB,kBAAkB,EAAE,CAAC;KACtB;IAED,MAAM,gBAAgB,GAAG,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACzE,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC7D,EAAE;AAEF;;;;;;AAMA,MAAM,kBAAkB,GAAG;IACzB,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;IACxC,MAAM,cAAc,GAAG,YAAY,GAAG,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAElE,MAAM,MAAM,GAAG,YAAY,IAAI,cAAc,CAAC;IAC9C,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7F,WAAW,CAAC,GAAG,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC;KAC5C;SAAM;QACL,WAAW,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAC;KACtC;AACH,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAyB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAEtH,MAAM,kBAAkB,GAAG,MACzB,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvE,MAAM,aAAa,GAAG,CAAC,MAAyB,KAC9C,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/assetsPath.ts"],"sourcesContent":["/**\n * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.\n * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n */\n\nlet bqSVGBasePath = '';\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n document && typeof document !== 'undefined'\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n bqSVGBasePath = path;\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string => {\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\n const configScript = findConfigScript();\n const fallbackScript = configScript ? null : findFallbackScript();\n\n const script = configScript || fallbackScript;\n if (script) {\n const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);\n setBasePath(`${path}/${DEFAULT_SVG_PATH}`);\n } else {\n setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement =>\n scripts?.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script?.getAttribute('src').split('/').slice(0, -1).join('/');\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"cssVariables-23e3ca0d.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;;;SAMgB,mBAAmB,CAAC,SAAiB;IACnD,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAEtD,MAAM,KAAK,GAAG,GAAG,cAAc,GAAG,SAAS,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjF,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,OAAO,OAAO,KAAK,GAAG,CAAC;AACzB,CAAC;AAED;;;;;;SAMgB,mBAAmB,CAAC,QAAgB,EAAE,SAAkB;IACtE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjE;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/cssVariables.ts"],"sourcesContent":["const CSSVALUEPREFIX = '--bq-';\n\n/**\n * Get CSS custom property variable of a given color string value\n *\n * @param {string} colorName - Valid string value.\n * @return {string} The corresponding CSS custom property variable\n */\nexport function getColorCSSVariable(colorName: string): string | undefined {\n if (typeof document === 'undefined') return undefined;\n\n const token = `${CSSVALUEPREFIX}${colorName}`;\n const value = getComputedStyle(document.documentElement).getPropertyValue(token);\n if (!value) return undefined;\n\n return `var(${token})`;\n}\n\n/**\n * Get compiled CSS custom property value\n *\n * @param {string} variable - The variable name for which to get its value\n * @return {string} The corresponding value for the given CSS custom property\n */\nexport function getCSSVariableValue(variable: string, component: Element): string {\n const styles = getComputedStyle(component);\n return String(styles.getPropertyValue(`--${variable}`)).trim();\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"isDefined-650befc3.js","mappings":";;;;;;;AAEA;;;;;MAKa,SAAS,GAAG,CAAC,KAAc;IACtC,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/D;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/isDefined.ts"],"sourcesContent":["import { isString } from '.';\n\n/**\n * Check is a value is not falsy\n * @param value the value to be checked\n * @returns {boolean} the value is not falsy\n */\nexport const isDefined = (value: unknown): boolean => {\n return isString(value) ? value.length !== 0 : Boolean(value);\n};\n"],"version":3}