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

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 (359) 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-b877d662.entry.js → p-06faf55b.entry.js} +127 -84
  9. package/dist/beeq/p-06faf55b.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-e06c8398.entry.js → p-2fe5f338.entry.js} +20 -22
  17. package/dist/beeq/p-2fe5f338.entry.js.map +1 -0
  18. package/dist/beeq/{p-8b6fc3ef.entry.js → p-3043c826.entry.js} +5 -7
  19. package/dist/beeq/{p-8b6fc3ef.entry.js.map → p-3043c826.entry.js.map} +1 -1
  20. package/dist/beeq/{p-fe57aa48.entry.js → p-38e70f78.entry.js} +1 -3
  21. package/dist/beeq/{p-fe57aa48.entry.js.map → p-38e70f78.entry.js.map} +1 -1
  22. package/dist/beeq/{p-818cd6d7.entry.js → p-398bfb48.entry.js} +1 -3
  23. package/dist/beeq/{p-818cd6d7.entry.js.map → p-398bfb48.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-f5d59aba.entry.js → p-5ff6621d.entry.js} +2 -4
  29. package/dist/beeq/{p-f5d59aba.entry.js.map → p-5ff6621d.entry.js.map} +1 -1
  30. package/dist/beeq/{p-3e3fd7b5.entry.js → p-60cbc966.entry.js} +1 -3
  31. package/dist/beeq/{p-3e3fd7b5.entry.js.map → p-60cbc966.entry.js.map} +1 -1
  32. package/dist/beeq/{p-98de0101.entry.js → p-68ff188d.entry.js} +1 -3
  33. package/dist/beeq/{p-98de0101.entry.js.map → p-68ff188d.entry.js.map} +1 -1
  34. package/dist/beeq/{p-7aa47927.entry.js → p-69c766a3.entry.js} +9 -11
  35. package/dist/beeq/p-69c766a3.entry.js.map +1 -0
  36. package/dist/beeq/{p-89665044.entry.js → p-76486949.entry.js} +2 -4
  37. package/dist/beeq/{p-89665044.entry.js.map → p-76486949.entry.js.map} +1 -1
  38. package/dist/beeq/{p-bb14b231.entry.js → p-8275d147.entry.js} +3 -5
  39. package/dist/beeq/{p-bb14b231.entry.js.map → p-8275d147.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-8f1c68c0.js +71 -0
  45. package/dist/beeq/p-8f1c68c0.js.map +1 -0
  46. package/dist/beeq/{p-5d51cadd.entry.js → p-9cab14ee.entry.js} +1 -3
  47. package/dist/beeq/{p-5d51cadd.entry.js.map → p-9cab14ee.entry.js.map} +1 -1
  48. package/dist/beeq/{p-7695fc8d.entry.js → p-a23b23c4.entry.js} +1 -3
  49. package/dist/beeq/{p-7695fc8d.entry.js.map → p-a23b23c4.entry.js.map} +1 -1
  50. package/dist/beeq/{p-2b2d8b0c.entry.js → p-a608a4fb.entry.js} +2 -4
  51. package/dist/beeq/{p-2b2d8b0c.entry.js.map → p-a608a4fb.entry.js.map} +1 -1
  52. package/dist/beeq/{p-bc60faa1.entry.js → p-aacaaa35.entry.js} +1 -3
  53. package/dist/beeq/{p-bc60faa1.entry.js.map → p-aacaaa35.entry.js.map} +1 -1
  54. package/dist/beeq/{p-5d8d6717.entry.js → p-b77b52f2.entry.js} +2 -4
  55. package/dist/beeq/{p-5d8d6717.entry.js.map → p-b77b52f2.entry.js.map} +1 -1
  56. package/dist/beeq/{p-d2f682a9.entry.js → p-bbf4aad4.entry.js} +3 -5
  57. package/dist/beeq/{p-d2f682a9.entry.js.map → p-bbf4aad4.entry.js.map} +1 -1
  58. package/dist/beeq/{p-5fcbf15f.entry.js → p-c83bc7fd.entry.js} +10 -11
  59. package/dist/beeq/p-c83bc7fd.entry.js.map +1 -0
  60. package/dist/beeq/{p-e6911710.entry.js → p-cb2b0014.entry.js} +1 -3
  61. package/dist/beeq/{p-e6911710.entry.js.map → p-cb2b0014.entry.js.map} +1 -1
  62. package/dist/beeq/{p-60ab652b.entry.js → p-cfb8829b.entry.js} +1 -3
  63. package/dist/beeq/{p-60ab652b.entry.js.map → p-cfb8829b.entry.js.map} +1 -1
  64. package/dist/beeq/{p-3ed73068.entry.js → p-d7067dae.entry.js} +1 -3
  65. package/dist/beeq/{p-3ed73068.entry.js.map → p-d7067dae.entry.js.map} +1 -1
  66. package/dist/beeq/{p-f69d2900.entry.js → p-d7dc7086.entry.js} +1 -3
  67. package/dist/beeq/{p-f69d2900.entry.js.map → p-d7dc7086.entry.js.map} +1 -1
  68. package/dist/beeq/{p-d8f7bf11.entry.js → p-df9ce322.entry.js} +2 -4
  69. package/dist/beeq/{p-d8f7bf11.entry.js.map → p-df9ce322.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-cdd5b425.entry.js → p-fb809932.entry.js} +2 -4
  77. package/dist/beeq/{p-cdd5b425.entry.js.map → p-fb809932.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 +1 -2
  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 +100 -53
  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 +2 -3
  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 +5 -6
  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/alert/scss/bq-alert.css +1 -1
  160. package/dist/collection/components/button/bq-button.js +41 -16
  161. package/dist/collection/components/button/bq-button.js.map +1 -1
  162. package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
  163. package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
  164. package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
  165. package/dist/collection/components/icon/helper/request.js +50 -34
  166. package/dist/collection/components/icon/helper/request.js.map +1 -1
  167. package/dist/collection/components/notification/bq-notification.js +4 -4
  168. package/dist/collection/components/notification/bq-notification.js.map +1 -1
  169. package/dist/collection/components/notification/scss/bq-notification.css +1 -1
  170. package/dist/collection/components/select/scss/bq-select.css +1 -1
  171. package/dist/collection/components/side-menu/bq-side-menu.js +9 -3
  172. package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
  173. package/dist/collection/components/toast/bq-toast.js +3 -3
  174. package/dist/collection/components/toast/bq-toast.js.map +1 -1
  175. package/dist/collection/shared/utils/assetsPath.js +47 -35
  176. package/dist/collection/shared/utils/assetsPath.js.map +1 -1
  177. package/dist/collection/shared/utils/cssVariables.js +1 -1
  178. package/dist/collection/shared/utils/cssVariables.js.map +1 -1
  179. package/dist/components/bq-accordion-group.js +0 -1
  180. package/dist/components/bq-accordion-group.js.map +1 -1
  181. package/dist/components/bq-accordion.js +0 -1
  182. package/dist/components/bq-accordion.js.map +1 -1
  183. package/dist/components/bq-alert.js +1 -2
  184. package/dist/components/bq-alert.js.map +1 -1
  185. package/dist/components/bq-avatar.js +0 -1
  186. package/dist/components/bq-avatar.js.map +1 -1
  187. package/dist/components/bq-badge2.js +0 -1
  188. package/dist/components/bq-badge2.js.map +1 -1
  189. package/dist/components/bq-breadcrumb-item.js +0 -1
  190. package/dist/components/bq-breadcrumb-item.js.map +1 -1
  191. package/dist/components/bq-breadcrumb.js +0 -1
  192. package/dist/components/bq-breadcrumb.js.map +1 -1
  193. package/dist/components/bq-button2.js +42 -18
  194. package/dist/components/bq-button2.js.map +1 -1
  195. package/dist/components/bq-card.js +0 -1
  196. package/dist/components/bq-card.js.map +1 -1
  197. package/dist/components/bq-checkbox.js +0 -1
  198. package/dist/components/bq-checkbox.js.map +1 -1
  199. package/dist/components/bq-date-picker.js +1 -2
  200. package/dist/components/bq-date-picker.js.map +1 -1
  201. package/dist/components/bq-dialog.js +1 -2
  202. package/dist/components/bq-dialog.js.map +1 -1
  203. package/dist/components/bq-divider2.js +0 -1
  204. package/dist/components/bq-divider2.js.map +1 -1
  205. package/dist/components/bq-drawer.js +1 -2
  206. package/dist/components/bq-drawer.js.map +1 -1
  207. package/dist/components/bq-empty-state.js +0 -1
  208. package/dist/components/bq-empty-state.js.map +1 -1
  209. package/dist/components/bq-icon2.js +118 -36
  210. package/dist/components/bq-icon2.js.map +1 -1
  211. package/dist/components/bq-input.js +0 -1
  212. package/dist/components/bq-input.js.map +1 -1
  213. package/dist/components/bq-notification.js +5 -6
  214. package/dist/components/bq-notification.js.map +1 -1
  215. package/dist/components/bq-option-list2.js +0 -1
  216. package/dist/components/bq-option-list2.js.map +1 -1
  217. package/dist/components/bq-option.js +0 -1
  218. package/dist/components/bq-option.js.map +1 -1
  219. package/dist/components/bq-page-title.js +0 -1
  220. package/dist/components/bq-page-title.js.map +1 -1
  221. package/dist/components/bq-progress.js +0 -1
  222. package/dist/components/bq-progress.js.map +1 -1
  223. package/dist/components/bq-radio-group.js +0 -1
  224. package/dist/components/bq-radio-group.js.map +1 -1
  225. package/dist/components/bq-select.js +1 -2
  226. package/dist/components/bq-select.js.map +1 -1
  227. package/dist/components/bq-side-menu-item.js +0 -1
  228. package/dist/components/bq-side-menu-item.js.map +1 -1
  229. package/dist/components/bq-side-menu.js +5 -4
  230. package/dist/components/bq-side-menu.js.map +1 -1
  231. package/dist/components/bq-slider.js +0 -1
  232. package/dist/components/bq-slider.js.map +1 -1
  233. package/dist/components/bq-spinner.js +0 -1
  234. package/dist/components/bq-spinner.js.map +1 -1
  235. package/dist/components/bq-status.js +0 -1
  236. package/dist/components/bq-status.js.map +1 -1
  237. package/dist/components/bq-step-item.js +0 -1
  238. package/dist/components/bq-step-item.js.map +1 -1
  239. package/dist/components/bq-steps.js +0 -1
  240. package/dist/components/bq-steps.js.map +1 -1
  241. package/dist/components/bq-switch.js +0 -1
  242. package/dist/components/bq-switch.js.map +1 -1
  243. package/dist/components/bq-tab-group.js +0 -1
  244. package/dist/components/bq-tab-group.js.map +1 -1
  245. package/dist/components/bq-tab.js +0 -1
  246. package/dist/components/bq-tab.js.map +1 -1
  247. package/dist/components/bq-tag2.js +0 -1
  248. package/dist/components/bq-tag2.js.map +1 -1
  249. package/dist/components/bq-textarea.js +0 -1
  250. package/dist/components/bq-textarea.js.map +1 -1
  251. package/dist/components/bq-toast.js +3 -4
  252. package/dist/components/bq-toast.js.map +1 -1
  253. package/dist/components/cssVariables.js +1 -1
  254. package/dist/components/cssVariables.js.map +1 -1
  255. package/dist/components/index.js +1 -1
  256. package/dist/components/isDefined.js +0 -1
  257. package/dist/components/isDefined.js.map +1 -1
  258. package/dist/esm/assetsPath-beeee241.js +74 -0
  259. package/dist/esm/assetsPath-beeee241.js.map +1 -0
  260. package/dist/esm/beeq.js +1 -1
  261. package/dist/esm/bq-accordion-group.entry.js +0 -1
  262. package/dist/esm/bq-accordion-group.entry.js.map +1 -1
  263. package/dist/esm/bq-accordion.entry.js +0 -1
  264. package/dist/esm/bq-accordion.entry.js.map +1 -1
  265. package/dist/esm/bq-alert.entry.js +1 -2
  266. package/dist/esm/bq-alert.entry.js.map +1 -1
  267. package/dist/esm/bq-avatar.entry.js +0 -1
  268. package/dist/esm/bq-avatar.entry.js.map +1 -1
  269. package/dist/esm/bq-badge.entry.js +1 -2
  270. package/dist/esm/bq-badge.entry.js.map +1 -1
  271. package/dist/esm/bq-breadcrumb-item.entry.js +1 -2
  272. package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
  273. package/dist/esm/bq-breadcrumb.entry.js +0 -1
  274. package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
  275. package/dist/esm/bq-button_2.entry.js +100 -53
  276. package/dist/esm/bq-button_2.entry.js.map +1 -1
  277. package/dist/esm/bq-card.entry.js +0 -1
  278. package/dist/esm/bq-card.entry.js.map +1 -1
  279. package/dist/esm/bq-checkbox.entry.js +0 -1
  280. package/dist/esm/bq-checkbox.entry.js.map +1 -1
  281. package/dist/esm/bq-date-picker.entry.js +2 -3
  282. package/dist/esm/bq-date-picker.entry.js.map +1 -1
  283. package/dist/esm/bq-dialog.entry.js +1 -2
  284. package/dist/esm/bq-dialog.entry.js.map +1 -1
  285. package/dist/esm/bq-divider.entry.js +1 -2
  286. package/dist/esm/bq-divider.entry.js.map +1 -1
  287. package/dist/esm/bq-drawer.entry.js +1 -2
  288. package/dist/esm/bq-drawer.entry.js.map +1 -1
  289. package/dist/esm/bq-empty-state.entry.js +0 -1
  290. package/dist/esm/bq-empty-state.entry.js.map +1 -1
  291. package/dist/esm/bq-input.entry.js +1 -2
  292. package/dist/esm/bq-input.entry.js.map +1 -1
  293. package/dist/esm/bq-notification.entry.js +5 -6
  294. package/dist/esm/bq-notification.entry.js.map +1 -1
  295. package/dist/esm/bq-option-list_2.entry.js +1 -2
  296. package/dist/esm/bq-option-list_2.entry.js.map +1 -1
  297. package/dist/esm/bq-option.entry.js +0 -1
  298. package/dist/esm/bq-option.entry.js.map +1 -1
  299. package/dist/esm/bq-page-title.entry.js +0 -1
  300. package/dist/esm/bq-page-title.entry.js.map +1 -1
  301. package/dist/esm/bq-progress.entry.js +0 -1
  302. package/dist/esm/bq-progress.entry.js.map +1 -1
  303. package/dist/esm/bq-radio-group.entry.js +0 -1
  304. package/dist/esm/bq-radio-group.entry.js.map +1 -1
  305. package/dist/esm/bq-select.entry.js +2 -3
  306. package/dist/esm/bq-select.entry.js.map +1 -1
  307. package/dist/esm/bq-side-menu-item.entry.js +0 -1
  308. package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
  309. package/dist/esm/bq-side-menu.entry.js +4 -4
  310. package/dist/esm/bq-side-menu.entry.js.map +1 -1
  311. package/dist/esm/bq-slider.entry.js +0 -1
  312. package/dist/esm/bq-slider.entry.js.map +1 -1
  313. package/dist/esm/bq-spinner.entry.js +1 -2
  314. package/dist/esm/bq-spinner.entry.js.map +1 -1
  315. package/dist/esm/bq-status.entry.js +0 -1
  316. package/dist/esm/bq-status.entry.js.map +1 -1
  317. package/dist/esm/bq-step-item.entry.js +0 -1
  318. package/dist/esm/bq-step-item.entry.js.map +1 -1
  319. package/dist/esm/bq-steps.entry.js +0 -1
  320. package/dist/esm/bq-steps.entry.js.map +1 -1
  321. package/dist/esm/bq-switch.entry.js +0 -1
  322. package/dist/esm/bq-switch.entry.js.map +1 -1
  323. package/dist/esm/bq-tab-group.entry.js +0 -1
  324. package/dist/esm/bq-tab-group.entry.js.map +1 -1
  325. package/dist/esm/bq-tab.entry.js +0 -1
  326. package/dist/esm/bq-tab.entry.js.map +1 -1
  327. package/dist/esm/bq-textarea.entry.js +0 -1
  328. package/dist/esm/bq-textarea.entry.js.map +1 -1
  329. package/dist/esm/bq-toast.entry.js +3 -4
  330. package/dist/esm/bq-toast.entry.js.map +1 -1
  331. package/dist/esm/{cssVariables-23e3ca0d.js → cssVariables-000c23ad.js} +2 -2
  332. package/dist/esm/cssVariables-000c23ad.js.map +1 -0
  333. package/dist/esm/index.js +4 -4
  334. package/dist/esm/{isDefined-650befc3.js → isDefined-0cb07ee6.js} +1 -2
  335. package/dist/esm/isDefined-0cb07ee6.js.map +1 -0
  336. package/dist/esm/loader.js +1 -1
  337. package/dist/hydrate/index.js +164 -103
  338. package/dist/hydrate/index.mjs +164 -103
  339. package/dist/types/components/button/bq-button.d.ts +5 -0
  340. package/dist/types/components/icon/helper/request.d.ts +17 -1
  341. package/dist/types/shared/utils/assetsPath.d.ts +5 -9
  342. package/package.json +1 -1
  343. package/dist/beeq/p-5a9a73a0.js.map +0 -1
  344. package/dist/beeq/p-5fcbf15f.entry.js.map +0 -1
  345. package/dist/beeq/p-7aa47927.entry.js.map +0 -1
  346. package/dist/beeq/p-a84d4562.js +0 -64
  347. package/dist/beeq/p-a84d4562.js.map +0 -1
  348. package/dist/beeq/p-b877d662.entry.js.map +0 -1
  349. package/dist/beeq/p-e06c8398.entry.js.map +0 -1
  350. package/dist/cjs/assetsPath-6ac8935a.js +0 -65
  351. package/dist/cjs/assetsPath-6ac8935a.js.map +0 -1
  352. package/dist/cjs/cssVariables-a0e1e906.js.map +0 -1
  353. package/dist/cjs/isDefined-ee0026ed.js.map +0 -1
  354. package/dist/components/assetsPath.js +0 -62
  355. package/dist/components/assetsPath.js.map +0 -1
  356. package/dist/esm/assetsPath-e2f1ceb9.js +0 -62
  357. package/dist/esm/assetsPath-e2f1ceb9.js.map +0 -1
  358. package/dist/esm/cssVariables-23e3ca0d.js.map +0 -1
  359. package/dist/esm/isDefined-650befc3.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"bq-steps.js","mappings":";;;;;;;;;;AAAA,MAAM,UAAU,GAAG,w+nBAAw+nB,CAAC;AAC5/nB,sBAAe,UAAU;;MCeZA,SAAO;;;;;4BAmB8B,iBAAiB;oBAGrB,QAAQ;;;;;IAlB5C,QAAQ,CAAc;;;;IA4B9B,eAAe;QACb,iBAAiB,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzD,iBAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE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ages/beeq/src/components/steps/bq-steps.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Steps styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-steps.variables';\n\n:host {\n @apply block;\n}\n\n::slotted(bq-step-item:not(:first-child)) {\n @apply ps-[--bq-steps--gap];\n}\n\n::slotted(bq-step-item:not(:last-child)) {\n @apply pe-[--bq-steps--gap];\n}\n","import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport { STEPS_SIZE, STEPS_TYPE, TStepsSize, TStepsType } from './bq-steps.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * @part container - The container wrapper of the Steps component\n * @part divider-base - The base wrapper of the divider component\n * @part divider-dash-start - The dash start wrapper of the divider component\n * @part divider-dash-end - The dash end wrapper of the divider component\n */\n@Component({\n tag: 'bq-steps',\n styleUrl: './scss/bq-steps.scss',\n shadow: true,\n})\nexport class BqSteps {\n // Own Properties\n // ====================\n\n private stepElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqStepsElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** The color of the line that connects the steps. It should be a valid declarative color token. */\n @Prop({ reflect: true }) dividerColor: string = 'stroke--primary';\n\n /** The size of the steps */\n @Prop({ reflect: true }) size: TStepsSize = 'medium';\n\n /** The type of prefix element to use on the step items */\n @Prop({ reflect: true }) type: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('size')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEPS_TYPE, 'numeric', this.el, 'type');\n\n this.setStepItemProps();\n }\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.setStepItemProps();\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 get bqSteps(): HTMLBqStepItemElement[] {\n if (!this.stepElem) return [];\n\n const slot = this.stepElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === 'bq-step-item',\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private setStepItemProps = () => {\n this.bqSteps.forEach((bqStepElem: HTMLBqStepItemElement) => {\n bqStepElem.size = this.size;\n bqStepElem.type = this.type;\n });\n };\n\n // private handleChange = (event) => {\n // this.bqChange.emit(event);\n // }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';\n\n return (\n <div\n class=\"relative flex w-full items-start justify-between\"\n ref={(div) => (this.stepElem = div)}\n part=\"container\"\n >\n <slot />\n <bq-divider\n class={`absolute -z-10 p-i-s inset-ie-0 inset-is-0 ${dividerPaddingTop}`}\n strokeColor={this.dividerColor}\n strokeThickness={2}\n exportparts=\"base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end\"\n />\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-steps.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,w+nBAAw+nB,CAAC;AAC5/nB,sBAAe,UAAU;;MCeZA,SAAO;;;;;4BAmB8B,iBAAiB;oBAGrB,QAAQ;;;;;IAlB5C,QAAQ,CAAc;;;;IA4B9B,eAAe;QACb,iBAAiB,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzD,iBAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE1D,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;;;;;;;IASD,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;;;;;;;;;;;;;IAiBD,IAAY,OAAO;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAE9B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CACzD,CAAC,EAA6B,KAAK,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,cAAc,CAChD,CAAC;KAClC;IAEO,gBAAgB,GAAG;QACzB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,UAAiC;YACrD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC5B,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SAC7B,CAAC,CAAC;KACJ,CAAC;;;;;;;IAUF,MAAM;QACJ,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;QAEtE,QACE,4DACE,KAAK,EAAC,kDAAkD,EACxD,GAAG,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,EACnC,IAAI,EAAC,WAAW,IAEhB,8DAAQ,EACR,mEACE,KAAK,EAAE,8CAA8C,iBAAiB,EAAE,EACxE,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,eAAe,EAAE,CAAC,EAClB,WAAW,EAAC,2EAA2E,GACvF,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqSteps"],"sources":["../../packages/beeq/src/components/steps/scss/bq-steps.scss?tag=bq-steps&encapsulation=shadow","../../packages/beeq/src/components/steps/bq-steps.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Steps styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-steps.variables';\n\n:host {\n @apply block;\n}\n\n::slotted(bq-step-item:not(:first-child)) {\n @apply ps-[--bq-steps--gap];\n}\n\n::slotted(bq-step-item:not(:last-child)) {\n @apply pe-[--bq-steps--gap];\n}\n","import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport { STEPS_SIZE, STEPS_TYPE, TStepsSize, TStepsType } from './bq-steps.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * @part container - The container wrapper of the Steps component\n * @part divider-base - The base wrapper of the divider component\n * @part divider-dash-start - The dash start wrapper of the divider component\n * @part divider-dash-end - The dash end wrapper of the divider component\n */\n@Component({\n tag: 'bq-steps',\n styleUrl: './scss/bq-steps.scss',\n shadow: true,\n})\nexport class BqSteps {\n // Own Properties\n // ====================\n\n private stepElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqStepsElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** The color of the line that connects the steps. It should be a valid declarative color token. */\n @Prop({ reflect: true }) dividerColor: string = 'stroke--primary';\n\n /** The size of the steps */\n @Prop({ reflect: true }) size: TStepsSize = 'medium';\n\n /** The type of prefix element to use on the step items */\n @Prop({ reflect: true }) type: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('size')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEPS_TYPE, 'numeric', this.el, 'type');\n\n this.setStepItemProps();\n }\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.setStepItemProps();\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 get bqSteps(): HTMLBqStepItemElement[] {\n if (!this.stepElem) return [];\n\n const slot = this.stepElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === 'bq-step-item',\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private setStepItemProps = () => {\n this.bqSteps.forEach((bqStepElem: HTMLBqStepItemElement) => {\n bqStepElem.size = this.size;\n bqStepElem.type = this.type;\n });\n };\n\n // private handleChange = (event) => {\n // this.bqChange.emit(event);\n // }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';\n\n return (\n <div\n class=\"relative flex w-full items-start justify-between\"\n ref={(div) => (this.stepElem = div)}\n part=\"container\"\n >\n <slot />\n <bq-divider\n class={`absolute -z-10 p-i-s inset-ie-0 inset-is-0 ${dividerPaddingTop}`}\n strokeColor={this.dividerColor}\n strokeThickness={2}\n exportparts=\"base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end\"\n />\n </div>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,6 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
6
- import './assetsPath.js';
7
6
  import { i as isNil } from './isNil.js';
8
7
  import { a as getTextContent } from './slot.js';
9
8
  import { d as defineCustomElement$2 } from './bq-icon2.js';
@@ -1 +1 @@
1
- {"file":"bq-switch.js","mappings":";;;;;;;;;;AAAA,MAAM,WAAW,GAAG,muvBAAmuvB,CAAC;AACxvvB,uBAAe,WAAW;;MCsBbA,UAAQ;;;;;;;;wBAiBC,KAAK;iCAM8B,KAAK;uBAGA,KAAK;wBAGnB,KAAK;yBAGJ,KAAK;0BAGM,SAAS;8BAMD,OAAO;;wBAM3B,KAAK;4BAGD,KAAK;;;;;IA9C/C,SAAS,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AE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,EACxC,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,EAEF,4DACE,KAAK,EAAC,mNAAmN,EACzN,IAAI,EAAC,SAAS,IAEb,IAAI,CAAC,UAAU,KAAK,MAAM,KACzB,gEACE,KAAK,EAAC,6BAA6B,EACnC,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,WAAW,EACjB,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,IAAI,EACV,IAAI,EAAC,SAAS,GACd,CACH,EAED,4DAAK,KAAK,EAAC,yBAAyB,EAAC,IAAI,EAAC,KAAK,GAAG,EACjD,IAAI,CAAC,UAAU,KAAK,MAAM,KACzB,gEACE,KAAK,EAAC,8BAA8B,EACpC,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,KAAK,EACX,IAAI,EAAC,UAAU,GACf,CACH,CACG,EAEN,6DACE,KAAK,EAAE;gBACL,sGAAsG,EACpG,IAAI;gBACN,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY;gBAC3C,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY;aAC3C,EACD,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EACtC,IAAI,EAAC,OAAO,IAEZ,6DAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACxC,CACD,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqSwitch"],"sources":["../../packages/beeq/src/components/switch/scss/bq-switch.scss?tag=bq-switch&encapsulation=shadow","../../packages/beeq/src/components/switch/bq-switch.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Switch styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-switch.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.full-width) {\n @apply is-full;\n}\n\n.bq-switch {\n @apply flex cursor-pointer select-none items-center rounded-s transition-colors duration-300 p-b-2 p-i-2;\n\n justify-content: var(--bq-switch--justify-content);\n\n // Display background on hover (if enabled)\n &.has-background:not(.is-disabled):hover {\n @apply bg-hover-ui-primary;\n }\n\n &.is-disabled {\n @apply cursor-not-allowed opacity-60;\n }\n}\n\n.bq-switch--input:not(:disabled):focus-visible {\n ~ .bq-switch--control {\n @apply focus;\n }\n}\n\n.bq-switch--control__dot {\n @apply absolute start-xs2 rounded-full bg-icon-inverse bs-[--bq-switch--dot-size] is-[--bq-switch--dot-size];\n @apply group-[&.is-checked]:start-[calc(100%_-_var(--bq-switch--dot-size)_-_var(--bq-spacing-xs2))] group-[&.is-checked]:bg-[--bq-icon--alt];\n @apply transition-all duration-300;\n}\n\n.bq-switch--control__icon {\n --bq-icon--size: var(--bq-switch--dot-size) !important;\n\n &::part(base) {\n @apply flex;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\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 /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-text-primary transition-colors duration-300':\n true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-switch.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,muvBAAmuvB,CAAC;AACxvvB,uBAAe,WAAW;;MCsBbA,UAAQ;;;;;;;;wBAiBC,KAAK;iCAM8B,KAAK;uBAGA,KAAK;wBAGnB,KAAK;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tag=bq-switch&encapsulation=shadow","../../packages/beeq/src/components/switch/bq-switch.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Switch styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-switch.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.full-width) {\n @apply is-full;\n}\n\n.bq-switch {\n @apply flex cursor-pointer select-none items-center rounded-s transition-colors duration-300 p-b-2 p-i-2;\n\n justify-content: var(--bq-switch--justify-content);\n\n // Display background on hover (if enabled)\n &.has-background:not(.is-disabled):hover {\n @apply bg-hover-ui-primary;\n }\n\n &.is-disabled {\n @apply cursor-not-allowed opacity-60;\n }\n}\n\n.bq-switch--input:not(:disabled):focus-visible {\n ~ .bq-switch--control {\n @apply focus;\n }\n}\n\n.bq-switch--control__dot {\n @apply absolute start-xs2 rounded-full bg-icon-inverse bs-[--bq-switch--dot-size] is-[--bq-switch--dot-size];\n @apply group-[&.is-checked]:start-[calc(100%_-_var(--bq-switch--dot-size)_-_var(--bq-spacing-xs2))] group-[&.is-checked]:bg-[--bq-icon--alt];\n @apply transition-all duration-300;\n}\n\n.bq-switch--control__icon {\n --bq-icon--size: var(--bq-switch--dot-size) !important;\n\n &::part(base) {\n @apply flex;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\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 /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-text-primary transition-colors duration-300':\n true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,6 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
6
- import './assetsPath.js';
7
6
  import { d as debounce } from './debounce.js';
8
7
  import { i as isHTMLElement } from './isHTMLElement.js';
9
8
  import { i as isNil } from './isNil.js';
@@ -1 +1 @@
1
- {"file":"bq-tab-group.js","mappings":";;;;;;;;;;;;AAAA;;;;;;;;MASa,cAAc,GAAG,CAC5B,QAAa,EACb,OAAO,GAAG,CAAC,EACX,YAAoC,SAAS;IAE7C,IAAI,YAAY,GAAG,OAAO,CAAC;IAE3B,GAAG;QACD,YAAY,GAAG,YAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACtE,IAAI,YAAY,KAAK,OAAO,EAAE;YAC5B,MAAM;SACP;KACF,QAAQ,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IAE1C,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;AAChC,EAAE;AAEF,MAAM,YAAY,GAAG,CAAC,YAAoB,EAAE,MAAc,EAAE,SAAiC;IAC3F,MAAM,SAAS,GAAG,YAAY,IAAI,SAAS,KAAK,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,MAAM,GAAG,SAAS,IAAI,MAAM,CAAC;AACvC,CAAC;;AC7BD,MAAM,aAAa,GAAG,irqBAAirqB,CAAC;AACxsqB,yBAAe,aAAa;;MCoBfA,YAAU;;;;;;;oBAsBqB,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;4BAGL,CAAC;8BAGd,KAAK;;;;IA9BvC,iBAAiB,CAAyD;;;;IAoClF,mBAAmB;QACjB,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;SACpD;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,iBAAiB,CAAC,MAAM,EA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ACvF,YAAY,EAAE,IAAI,CAAC,cAAc;aAClC,EACD,IAAI,EAAC,MAAM,IAEX,4DACE,KAAK,EAAE;gBACL,8CAA8C,EAAE,IAAI;gBACpD,UAAU,EAAE,IAAI,CAAC,WAAW,KAAK,YAAY;aAC9C,EACD,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM,IAEX,8DAAQ,CACJ,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqTabGroup"],"sources":["../../packages/beeq/src/shared/utils/getNextElement.ts","../../packages/beeq/src/components/tab-group/scss/bq-tab-group.scss?tag=bq-tab-group&encapsulation=shadow","../../packages/beeq/src/components/tab-group/bq-tab-group.tsx"],"sourcesContent":["/**\n * Gets the next element that is not disabled\n *\n * @param {Array} elements - The array to search in\n * @param {Numebr} startAt - Position to start at\n * @param {String} direction - The direction to look on\n * @returns {Element} Next available element\n */\n\nexport const getNextElement = <T extends { disabled: boolean }>(\n elements: T[],\n startAt = 0,\n direction: 'forward' | 'backward' = 'forward',\n): T => {\n let elementIndex = startAt;\n\n do {\n elementIndex = getNextIndex(elementIndex, elements.length, direction);\n if (elementIndex === startAt) {\n break;\n }\n } while (elements[elementIndex].disabled);\n\n return elements[elementIndex];\n};\n\nconst getNextIndex = (currentIndex: number, length: number, direction: 'forward' | 'backward'): number => {\n const nextIndex = currentIndex + (direction === 'forward' ? 1 : -1);\n return (length + nextIndex) % length;\n};\n","/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply block;\n}\n\n.bq-tab-group {\n @apply relative;\n\n &::after {\n @apply absolute flex border-0 border-solid border-bg-tertiary content-empty;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n @apply is-full inset-be-0 [border-block-end-width:--bq-stroke-s];\n }\n }\n\n &--horizontal-start {\n @apply justify-start;\n }\n\n &--horizontal-end {\n @apply justify-end;\n }\n\n &--vertical-start::after {\n @apply end-0 bs-full is-0 [border-block-end-width:0px] [border-inline-end-width:--bq-stroke-s];\n }\n\n &--vertical-end::after {\n @apply start-0 bs-full is-0 [border-block-end-width:0px] [border-inline-start-width:--bq-stroke-s];\n }\n}\n\n.bq-tab-group.no-divider {\n &::after {\n @apply content-none;\n }\n}\n\n.bq-tab-group--container {\n @include hide-scrollbar;\n @apply gap-xs2 p-xs2; // This will avoid cutting the outline focus style\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\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 focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-tab-group.js","mappings":";;;;;;;;;;;AAAA;;;;;;;;MASa,cAAc,GAAG,CAC5B,QAAa,EACb,OAAO,GAAG,CAAC,EACX,YAAoC,SAAS;IAE7C,IAAI,YAAY,GAAG,OAAO,CAAC;IAE3B,GAAG;QACD,YAAY,GAAG,YAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACtE,IAAI,YAAY,KAAK,OAAO,EAAE;YAC5B,MAAM;SACP;KACF,QAAQ,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IAE1C,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;AAChC,EAAE;AAEF,MAAM,YAAY,GAAG,CAAC,YAAoB,EAAE,MAAc,EAAE,SAAiC;IAC3F,MAAM,SAAS,GAAG,YAAY,IAAI,SAAS,KAAK,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,MAAM,GAAG,SAAS,IAAI,MAAM,CAAC;AACvC,CAAC;;AC7BD,MAAM,aAAa,GAAG,irqBAAirqB,CAAC;AACxsqB,yBAAe,aAAa;;MCoBfA,YAAU;;;;;;;oBAsBqB,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;4BAGL,CAAC;8BAGd,KAAK;;;;IA9BvC,iBAAiB,CAAyD;;;;IAoClF,mBAAmB;QACjB,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CA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AAK,UAAU,EAAE,IAC9D,4DACE,KAAK,EAAE;gBACL,CAAC,8BAA8B,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,eAAe,GAAG,IAAI;gBACvF,YAAY,EAAE,IAAI,CAAC,cAAc;aAClC,EACD,IAAI,EAAC,MAAM,IAEX,4DACE,KAAK,EAAE;gBACL,8CAA8C,EAAE,IAAI;gBACpD,UAAU,EAAE,IAAI,CAAC,WAAW,KAAK,YAAY;aAC9C,EACD,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM,IAEX,8DAAQ,CACJ,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqTabGroup"],"sources":["../../packages/beeq/src/shared/utils/getNextElement.ts","../../packages/beeq/src/components/tab-group/scss/bq-tab-group.scss?tag=bq-tab-group&encapsulation=shadow","../../packages/beeq/src/components/tab-group/bq-tab-group.tsx"],"sourcesContent":["/**\n * Gets the next element that is not disabled\n *\n * @param {Array} elements - The array to search in\n * @param {Numebr} startAt - Position to start at\n * @param {String} direction - The direction to look on\n * @returns {Element} Next available element\n */\n\nexport const getNextElement = <T extends { disabled: boolean }>(\n elements: T[],\n startAt = 0,\n direction: 'forward' | 'backward' = 'forward',\n): T => {\n let elementIndex = startAt;\n\n do {\n elementIndex = getNextIndex(elementIndex, elements.length, direction);\n if (elementIndex === startAt) {\n break;\n }\n } while (elements[elementIndex].disabled);\n\n return elements[elementIndex];\n};\n\nconst getNextIndex = (currentIndex: number, length: number, direction: 'forward' | 'backward'): number => {\n const nextIndex = currentIndex + (direction === 'forward' ? 1 : -1);\n return (length + nextIndex) % length;\n};\n","/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply block;\n}\n\n.bq-tab-group {\n @apply relative;\n\n &::after {\n @apply absolute flex border-0 border-solid border-bg-tertiary content-empty;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n @apply is-full inset-be-0 [border-block-end-width:--bq-stroke-s];\n }\n }\n\n &--horizontal-start {\n @apply justify-start;\n }\n\n &--horizontal-end {\n @apply justify-end;\n }\n\n &--vertical-start::after {\n @apply end-0 bs-full is-0 [border-block-end-width:0px] [border-inline-end-width:--bq-stroke-s];\n }\n\n &--vertical-end::after {\n @apply start-0 bs-full is-0 [border-block-end-width:0px] [border-inline-start-width:--bq-stroke-s];\n }\n}\n\n.bq-tab-group.no-divider {\n &::after {\n @apply content-none;\n }\n}\n\n.bq-tab-group--container {\n @include hide-scrollbar;\n @apply gap-xs2 p-xs2; // This will avoid cutting the outline focus style\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\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 focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
6
6
  import { T as TAB_SIZE, a as TAB_ORIENTATION, b as TAB_PLACEMENT } from './bq-tab.types.js';
7
- import './assetsPath.js';
8
7
  import { v as validatePropValue } from './props.js';
9
8
  import { b as hasSlotContent } from './slot.js';
10
9
 
@@ -1 +1 @@
1
- {"file":"bq-tab.js","mappings":";;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,mgyBAAmgyB,CAAC;AACrhyB,oBAAe,QAAQ;;MCgBVA,OAAK;;;;;;;;;wBAgBmB,IAAI;uBACX,KAAK;;wBASG,KAAK;oBAGC,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;;;;;;IA/BpD,aAAa,CAAoB;IACjC,WAAW,CAAkB;;;;IA4CrC,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzE,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;KACjE;;;;;IAOQ,OAAO,CAAiC;;IAGxC,OAAO,CAAiC;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&encapsulation=shadow","../../packages/beeq/src/components/tab/bq-tab.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tab.variables';\n\n:host {\n @apply inline-block;\n}\n\n.bq-tab {\n @apply relative flex cursor-pointer items-center justify-center rounded-s disabled:cursor-not-allowed disabled:opacity-60;\n @apply text-[length:--bq-tab--font-size] font-[--bq-tab--font-weight] leading-[--bq-tab--line-height] [&:not([disabled])]:hover:bg-hover-ui-primary [&:not([disabled])]:hover:text-hover-text-brand;\n @apply border-0 bg-transparent focus-visible:focus;\n @apply transition-[color,background-color,border-color,box-shadow] duration-300;\n\n &::after {\n @apply absolute z-[1] block bg-stroke-brand opacity-0 content-empty -inset-be-1;\n @apply transition-opacity duration-300 ease-linear;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n /**\n * This hack will make the underline larger so it fits till the tab bar edges for the first and last tab button,\n * because the parent container applies some padding to not cut the focus outline style.\n */\n @apply -start-xs3 bs-[2px] is-[calc(100%_+_var(--bq-spacing-xs2))];\n }\n }\n\n &--vertical-start {\n @apply justify-end is-full;\n\n &::after {\n @apply -end-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &--vertical-end {\n @apply justify-start is-full;\n\n &::after {\n @apply -start-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &[aria-selected='true']::after {\n @apply opacity-100;\n }\n\n &--small {\n @apply p-b-[--bq-tab--padding-vertical-small] p-i-[--bq-tab--padding-horizontal-small];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-small) #{!important};\n }\n }\n\n &--medium {\n @apply p-b-[--bq-tab--padding-vertical-medium] p-i-[--bq-tab--padding-horizontal-medium];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-medium) #{!important};\n }\n }\n\n &--large {\n @apply text-l p-b-[--bq-tab--padding-vertical-large] p-i-[--bq-tab--padding-horizontal-large];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-large) #{!important};\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\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 * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-text-brand': this.active,\n 'text-text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-tab.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,mgyBAAmgyB,CAAC;AACrhyB,oBAAe,QAAQ;;MCgBVA,OAAK;;;;;;;;;wBAgBmB,IAAI;uBACX,KAAK;;wBASG,KAAK;oBAGC,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;;;;;;IA/BpD,aAAa,CAAoB;IACjC,WAAW,CAAkB;;;;IA4CrC,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzE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,CACF,CACC,EACT;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqTab"],"sources":["../../packages/beeq/src/components/tab/scss/bq-tab.scss?tag=bq-tab&encapsulation=shadow","../../packages/beeq/src/components/tab/bq-tab.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tab.variables';\n\n:host {\n @apply inline-block;\n}\n\n.bq-tab {\n @apply relative flex cursor-pointer items-center justify-center rounded-s disabled:cursor-not-allowed disabled:opacity-60;\n @apply text-[length:--bq-tab--font-size] font-[--bq-tab--font-weight] leading-[--bq-tab--line-height] [&:not([disabled])]:hover:bg-hover-ui-primary [&:not([disabled])]:hover:text-hover-text-brand;\n @apply border-0 bg-transparent focus-visible:focus;\n @apply transition-[color,background-color,border-color,box-shadow] duration-300;\n\n &::after {\n @apply absolute z-[1] block bg-stroke-brand opacity-0 content-empty -inset-be-1;\n @apply transition-opacity duration-300 ease-linear;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n /**\n * This hack will make the underline larger so it fits till the tab bar edges for the first and last tab button,\n * because the parent container applies some padding to not cut the focus outline style.\n */\n @apply -start-xs3 bs-[2px] is-[calc(100%_+_var(--bq-spacing-xs2))];\n }\n }\n\n &--vertical-start {\n @apply justify-end is-full;\n\n &::after {\n @apply -end-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &--vertical-end {\n @apply justify-start is-full;\n\n &::after {\n @apply -start-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &[aria-selected='true']::after {\n @apply opacity-100;\n }\n\n &--small {\n @apply p-b-[--bq-tab--padding-vertical-small] p-i-[--bq-tab--padding-horizontal-small];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-small) #{!important};\n }\n }\n\n &--medium {\n @apply p-b-[--bq-tab--padding-vertical-medium] p-i-[--bq-tab--padding-horizontal-medium];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-medium) #{!important};\n }\n }\n\n &--large {\n @apply text-l p-b-[--bq-tab--padding-vertical-large] p-i-[--bq-tab--padding-horizontal-large];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-large) #{!important};\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\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 * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-text-brand': this.active,\n 'text-text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,6 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
6
- import './assetsPath.js';
7
6
  import { g as getColorCSSVariable } from './cssVariables.js';
8
7
  import { v as validatePropValue } from './props.js';
9
8
  import { b as hasSlotContent } from './slot.js';
@@ -1 +1 @@
1
- {"file":"bq-tag2.js","mappings":";;;;;;;;;;;;AAAO,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAA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IAAI,CAAC,OAAO,CAAC,GAAG,eAAe,GACjG,CACQ,CACb,CACM,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tag/bq-tag.types.ts","../../packages/beeq/src/components/tag/helper/index.ts","../../packages/beeq/src/components/tag/scss/bq-tag.scss?tag=bq-tag&encapsulation=shadow","../../packages/beeq/src/components/tag/bq-tag.tsx"],"sourcesContent":["export const TAG_SIZE = ['xsmall', 'small', 'medium'] as const;\nexport type TTagSize = (typeof TAG_SIZE)[number];\n\nexport const TAG_COLOR = ['error', 'gray', 'info', 'success', 'warning'] as const;\nexport type TTagColor = (typeof TAG_COLOR)[number];\n\nexport const TAG_VARIANT = ['outline', 'filled'] as const;\nexport type TTagVariant = (typeof TAG_VARIANT)[number];\n\nexport const TAG_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TTagBorderRadius = (typeof TAG_BORDER_RADIUS)[number];\n","import { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagColor, TTagSize, TTagVariant } from '../bq-tag.types';\n\n/**\n * Function to determine the icon size based on the provided tag size.\n *\n * @param {TTagSize} size - The size of the tag.\n * @returns {number} The corresponding icon size. If the provided size does not match any predefined sizes, the function returns the size for 'medium'.\n */\nexport const iconSize = (size: TTagSize): number => {\n const xsmall = TAG_SIZE[0];\n const small = TAG_SIZE[1];\n const medium = TAG_SIZE[2];\n\n const SIZE = {\n [xsmall]: 16,\n [small]: 20,\n [medium]: 24,\n };\n\n return SIZE[size] || SIZE[medium];\n};\n\n/**\n * Function to determine the tag text color scheme for a given tag type.\n *\n * @param {TTagType} color - The color of the tag.\n * @returns {Object} An object containing the color scheme for the given tag type. If the provided type does not match any predefined types, the function returns the color scheme for 'default'.\n */\nexport const textColor = (color: TTagColor): Partial<{ [K in TTagVariant]: string }> => {\n const typeError = TAG_COLOR[0];\n const typeGray = TAG_COLOR[1];\n const typeInfo = TAG_COLOR[2];\n const typeSuccess = TAG_COLOR[3];\n const typeWarning = TAG_COLOR[4];\n\n const variantOutline = TAG_VARIANT[0];\n const variantFilled = TAG_VARIANT[1];\n\n const COLORS = {\n [typeError]: {\n [variantOutline]: 'text--danger',\n [variantFilled]: 'text--alt',\n },\n [typeGray]: {\n [variantOutline]: 'text--primary',\n [variantFilled]: 'text--alt',\n },\n [typeInfo]: {\n [variantOutline]: 'text--brand',\n [variantFilled]: 'text--alt',\n },\n [typeSuccess]: {\n [variantOutline]: 'text--success',\n [variantFilled]: 'text--alt',\n },\n [typeWarning]: {\n [variantOutline]: 'text--warning',\n [variantFilled]: 'text--alt',\n },\n };\n\n return COLORS[color];\n};\n","/* -------------------------------------------------------------------------- */\n/* Tag styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tag.variables';\n\n:host {\n @apply relative inline-block;\n}\n\n:host([removable][hidden]) {\n @apply hidden;\n}\n\n.bq-tag {\n @apply box-border inline-flex select-none flex-row items-center justify-center bg-[--bq-tag--background-color];\n @apply gap-[--bq-tag--medium-gap] font-medium leading-regular text-text-primary p-b-[--bq-tag--medium-padding-y] p-i-[--bq-tag--medium-padding-x];\n @apply rounded-[--bq-tag--border-radius] border-[length:--bq-tag--border-width] border-[color:--bq-tag--border-color];\n @apply transition-colors duration-300 ease-in-out;\n\n border-style: var(--bq-tag--border-style);\n}\n\n/* ---------------------------------- Size ---------------------------------- */\n\n.bq-tag__xsmall,\n.bq-tag__small {\n @apply gap-[--bq-tag--small-gap] p-b-[--bq-tag--small-padding-y] p-i-[--bq-tag--small-padding-x];\n\n /* Apply predefined border radius only if the border property have NO VALUE */\n &:not(.has-border) {\n @apply rounded-[--bq-tag--small-border-radius];\n }\n}\n\n/* --------------------------------- Action --------------------------------- */\n\n.bq-tag__default.is-clickable {\n @apply cursor-pointer;\n // Focus\n @apply focus-visible:focus;\n // Hover\n @apply hover:enabled:bg-[color-mix(in_srgb,_var(--bq-tag--background-color),_white_20%)];\n // Active/Selected\n @apply [&.active]:text-[--bq-text--alt] [&.active]:[--bq-tag--background-color:--bq-ui--brand];\n // Disabled\n @apply disabled:cursor-not-allowed disabled:border-none disabled:opacity-60;\n}\n\n/* ------------------------------ Color styles ------------------------------ */\n\n.bq-tag__error {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--danger] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--danger-alt] text-[color:--bq-text--danger] [--bq-tag--border-color:--bq-stroke--danger];\n }\n}\n\n.bq-tag__gray {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--tertiary] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--primary] text-[color:--bq-text--primary] [--bq-tag--border-color:--bq-stroke--tertiary];\n }\n}\n\n.bq-tag__info {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--brand] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--brand-alt] text-[color:--bq-text--brand] [--bq-tag--border-color:--bq-stroke--brand];\n }\n}\n\n.bq-tag__success {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--success] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--success-alt] text-[color:--bq-text--success] [--bq-tag--border-color:--bq-tag--border-success];\n }\n}\n\n.bq-tag__warning {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--warning] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply border-[color:--bq-stroke--warning] bg-[color:--bq-ui--warning-alt] text-[color:--bq-text--warning];\n }\n}\n\n/* ------------------------------ Close button ------------------------------ */\n\n.bq-tag__close::part(button) {\n @apply pointer-events-none border-0 bs-fit p-b-0 p-i-0;\n}\n\n/* --------------- Apply the right size to the bq-icon prefix --------------- */\n\n.bq-tag__prefix ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tag--icon-prefix-size) !important;\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagBorderRadius, TTagColor, TTagSize, TTagVariant } from './bq-tag.types';\nimport { iconSize, textColor } from './helper';\nimport { getColorCSSVariable, hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM.\n * @part prefix - The `<span>` tag element that acts as prefix container (when icon exists in front of tag).\n * @part text - The `<div>` element containing the text of the tag component.\n * @part btn-close - The close button element to remove the tag component.\n */\n@Component({\n tag: 'bq-tag',\n styleUrl: './scss/bq-tag.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTag {\n // Own Properties\n // ====================\n\n private prefixElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTagElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n\n // Public Property API\n // ========================\n\n /** The corner radius of the Tag (will override size's predefined border) */\n @Prop({ reflect: true }) border: TTagBorderRadius;\n\n /** If true, the Tag can be clickable */\n @Prop({ reflect: true }) clickable: boolean = false;\n\n /** The color style of the Tag */\n @Prop({ reflect: true }) color: TTagColor;\n\n /** If true, the Tag will be disabled (only if clickable = `true`, no interaction allowed) */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the Tag component will hidden (only if removable = `true`) */\n @Prop({ reflect: true, mutable: true }) hidden: boolean;\n\n /** If true, the Tag component can be removed */\n @Prop({ reflect: true }) removable: boolean = false;\n\n /** If true, the Tag is selected (only if clickable = `true`) */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /** The size of the Tag component */\n @Prop({ reflect: true }) size: TTagSize = 'medium';\n\n /** The variant of Tag to apply on top of the variant */\n @Prop({ reflect: true }) variant: TTagVariant = 'filled';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('variant')\n checkPropValues() {\n validatePropValue(TAG_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAG_VARIANT, 'filled', this.el, 'variant');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the tag is close/hidden */\n @Event() bqClose: EventEmitter;\n\n /** Callback handler to be called when the tag is not open/shown */\n @Event() bqOpen: EventEmitter;\n\n /** Handler to be called when tag loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is clicked */\n @Event() bqClick: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is focused */\n @Event() bqFocus: EventEmitter<HTMLBqTagElement>;\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 /** Method to be called to remove the tag component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** Method to be called to show the tag component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqClose.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = true;\n }\n };\n\n private handleShow = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqOpen.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = false;\n }\n };\n\n private handleClick = () => {\n // If the tag is not clickable or the tag is disabled, we don't want to handle the click\n if (!this.isClickable || this.disabled) return;\n\n // Emit a click event on the element\n const ev = this.bqClick.emit(this.el);\n // If the event was not prevented, toggle the clickable state\n if (!ev.defaultPrevented) {\n this.selected = !this.selected;\n }\n };\n\n private handleBlur = () => {\n if (!this.isClickable) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (!this.isClickable) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private get isClickable(): boolean {\n return this.clickable && !this.color && !this.hasCustomColor && !this.removable;\n }\n\n private get isRemovable(): boolean {\n return this.removable && !this.isClickable;\n }\n\n private get isHidden(): boolean {\n return this.isRemovable && this.hidden;\n }\n\n private get hasCustomColor(): boolean {\n return this.color !== undefined ? !TAG_COLOR.includes(this.color) : false;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n '--bq-tag--icon-prefix-size': `${iconSize(this.size)}px`,\n ...(this.border && { '--bq-tag--border-radius': `var(--bq-radius--${this.border})` }),\n ...(this.color && { '--bq-tag--background-color': getColorCSSVariable(this.color) ?? this.color }),\n ...(this.hasCustomColor && { '--bq-text--primary': `var(--bq-text--alt)` }),\n };\n\n return (\n <Host style={style} aria-hidden={this.isHidden ? 'true' : 'false'} hidden={this.isHidden ? 'true' : 'false'}>\n <button\n class={{\n [`bq-tag bq-tag__${this.size}`]: true,\n [`bq-tag__${this.color || 'default'} bq-tag__${this.variant}`]: !this.hasCustomColor,\n 'is-clickable': this.isClickable,\n 'is-removable': this.removable,\n // Active/Selected state when clickable\n active: this.isClickable && this.selected,\n // Fixed border radius\n 'has-border': !!this.border,\n }}\n disabled={this.disabled}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n tabindex={this.isClickable ? 0 : -1}\n part=\"wrapper\"\n >\n <span\n class={{ 'bq-tag__prefix inline-flex': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div\n class={{\n 'text-xs': this.size === 'xsmall',\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n }}\n part=\"text\"\n >\n <slot />\n </div>\n {this.isRemovable && !this.disabled && (\n <bq-button class=\"bq-tag__close\" appearance=\"text\" size=\"small\" onClick={this.handleHide} part=\"btn-close\">\n <bq-icon\n size={iconSize(this.size)}\n name=\"x-circle\"\n color={this.color && !this.hasCustomColor ? textColor(this.color)[this.variant] : 'text--primary'}\n />\n </bq-button>\n )}\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-tag2.js","mappings":";;;;;;;;;;;AAAO,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGxD,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAG3E,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU;;ACJzD;;;;;;AAMO,MAAM,QAAQ,GAAG,CAAC,IAAc;IACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE3B,MAAM,IAAI,GAAG;QACX,CAAC,MAAM,GAAG,EAAE;QACZ,CAAC,KAAK,GAAG,EAAE;QACX,CAAC,MAAM,GAAG,EAAE;KACb,CAAC;IAEF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF;;;;;;AAMO,MAAM,SAAS,GAAG,CAAC,KAAgB;IACxC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,SAAS,CAAC,CAA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AU,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAC,WAAW,IACxG,gEACE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EACzB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,eAAe,GACjG,CACQ,CACb,CACM,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tag/bq-tag.types.ts","../../packages/beeq/src/components/tag/helper/index.ts","../../packages/beeq/src/components/tag/scss/bq-tag.scss?tag=bq-tag&encapsulation=shadow","../../packages/beeq/src/components/tag/bq-tag.tsx"],"sourcesContent":["export const TAG_SIZE = ['xsmall', 'small', 'medium'] as const;\nexport type TTagSize = (typeof TAG_SIZE)[number];\n\nexport const TAG_COLOR = ['error', 'gray', 'info', 'success', 'warning'] as const;\nexport type TTagColor = (typeof TAG_COLOR)[number];\n\nexport const TAG_VARIANT = ['outline', 'filled'] as const;\nexport type TTagVariant = (typeof TAG_VARIANT)[number];\n\nexport const TAG_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TTagBorderRadius = (typeof TAG_BORDER_RADIUS)[number];\n","import { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagColor, TTagSize, TTagVariant } from '../bq-tag.types';\n\n/**\n * Function to determine the icon size based on the provided tag size.\n *\n * @param {TTagSize} size - The size of the tag.\n * @returns {number} The corresponding icon size. If the provided size does not match any predefined sizes, the function returns the size for 'medium'.\n */\nexport const iconSize = (size: TTagSize): number => {\n const xsmall = TAG_SIZE[0];\n const small = TAG_SIZE[1];\n const medium = TAG_SIZE[2];\n\n const SIZE = {\n [xsmall]: 16,\n [small]: 20,\n [medium]: 24,\n };\n\n return SIZE[size] || SIZE[medium];\n};\n\n/**\n * Function to determine the tag text color scheme for a given tag type.\n *\n * @param {TTagType} color - The color of the tag.\n * @returns {Object} An object containing the color scheme for the given tag type. If the provided type does not match any predefined types, the function returns the color scheme for 'default'.\n */\nexport const textColor = (color: TTagColor): Partial<{ [K in TTagVariant]: string }> => {\n const typeError = TAG_COLOR[0];\n const typeGray = TAG_COLOR[1];\n const typeInfo = TAG_COLOR[2];\n const typeSuccess = TAG_COLOR[3];\n const typeWarning = TAG_COLOR[4];\n\n const variantOutline = TAG_VARIANT[0];\n const variantFilled = TAG_VARIANT[1];\n\n const COLORS = {\n [typeError]: {\n [variantOutline]: 'text--danger',\n [variantFilled]: 'text--alt',\n },\n [typeGray]: {\n [variantOutline]: 'text--primary',\n [variantFilled]: 'text--alt',\n },\n [typeInfo]: {\n [variantOutline]: 'text--brand',\n [variantFilled]: 'text--alt',\n },\n [typeSuccess]: {\n [variantOutline]: 'text--success',\n [variantFilled]: 'text--alt',\n },\n [typeWarning]: {\n [variantOutline]: 'text--warning',\n [variantFilled]: 'text--alt',\n },\n };\n\n return COLORS[color];\n};\n","/* -------------------------------------------------------------------------- */\n/* Tag styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tag.variables';\n\n:host {\n @apply relative inline-block;\n}\n\n:host([removable][hidden]) {\n @apply hidden;\n}\n\n.bq-tag {\n @apply box-border inline-flex select-none flex-row items-center justify-center bg-[--bq-tag--background-color];\n @apply gap-[--bq-tag--medium-gap] font-medium leading-regular text-text-primary p-b-[--bq-tag--medium-padding-y] p-i-[--bq-tag--medium-padding-x];\n @apply rounded-[--bq-tag--border-radius] border-[length:--bq-tag--border-width] border-[color:--bq-tag--border-color];\n @apply transition-colors duration-300 ease-in-out;\n\n border-style: var(--bq-tag--border-style);\n}\n\n/* ---------------------------------- Size ---------------------------------- */\n\n.bq-tag__xsmall,\n.bq-tag__small {\n @apply gap-[--bq-tag--small-gap] p-b-[--bq-tag--small-padding-y] p-i-[--bq-tag--small-padding-x];\n\n /* Apply predefined border radius only if the border property have NO VALUE */\n &:not(.has-border) {\n @apply rounded-[--bq-tag--small-border-radius];\n }\n}\n\n/* --------------------------------- Action --------------------------------- */\n\n.bq-tag__default.is-clickable {\n @apply cursor-pointer;\n // Focus\n @apply focus-visible:focus;\n // Hover\n @apply hover:enabled:bg-[color-mix(in_srgb,_var(--bq-tag--background-color),_white_20%)];\n // Active/Selected\n @apply [&.active]:text-[--bq-text--alt] [&.active]:[--bq-tag--background-color:--bq-ui--brand];\n // Disabled\n @apply disabled:cursor-not-allowed disabled:border-none disabled:opacity-60;\n}\n\n/* ------------------------------ Color styles ------------------------------ */\n\n.bq-tag__error {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--danger] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--danger-alt] text-[color:--bq-text--danger] [--bq-tag--border-color:--bq-stroke--danger];\n }\n}\n\n.bq-tag__gray {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--tertiary] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--primary] text-[color:--bq-text--primary] [--bq-tag--border-color:--bq-stroke--tertiary];\n }\n}\n\n.bq-tag__info {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--brand] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--brand-alt] text-[color:--bq-text--brand] [--bq-tag--border-color:--bq-stroke--brand];\n }\n}\n\n.bq-tag__success {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--success] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply bg-[color:--bq-ui--success-alt] text-[color:--bq-text--success] [--bq-tag--border-color:--bq-tag--border-success];\n }\n}\n\n.bq-tag__warning {\n &.bq-tag__filled {\n @apply bg-[color:--bq-ui--warning] text-[color:--bq-text--alt];\n }\n\n &.bq-tag__outline {\n @apply border-[color:--bq-stroke--warning] bg-[color:--bq-ui--warning-alt] text-[color:--bq-text--warning];\n }\n}\n\n/* ------------------------------ Close button ------------------------------ */\n\n.bq-tag__close::part(button) {\n @apply pointer-events-none border-0 bs-fit p-b-0 p-i-0;\n}\n\n/* --------------- Apply the right size to the bq-icon prefix --------------- */\n\n.bq-tag__prefix ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tag--icon-prefix-size) !important;\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagBorderRadius, TTagColor, TTagSize, TTagVariant } from './bq-tag.types';\nimport { iconSize, textColor } from './helper';\nimport { getColorCSSVariable, hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM.\n * @part prefix - The `<span>` tag element that acts as prefix container (when icon exists in front of tag).\n * @part text - The `<div>` element containing the text of the tag component.\n * @part btn-close - The close button element to remove the tag component.\n */\n@Component({\n tag: 'bq-tag',\n styleUrl: './scss/bq-tag.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTag {\n // Own Properties\n // ====================\n\n private prefixElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTagElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n\n // Public Property API\n // ========================\n\n /** The corner radius of the Tag (will override size's predefined border) */\n @Prop({ reflect: true }) border: TTagBorderRadius;\n\n /** If true, the Tag can be clickable */\n @Prop({ reflect: true }) clickable: boolean = false;\n\n /** The color style of the Tag */\n @Prop({ reflect: true }) color: TTagColor;\n\n /** If true, the Tag will be disabled (only if clickable = `true`, no interaction allowed) */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the Tag component will hidden (only if removable = `true`) */\n @Prop({ reflect: true, mutable: true }) hidden: boolean;\n\n /** If true, the Tag component can be removed */\n @Prop({ reflect: true }) removable: boolean = false;\n\n /** If true, the Tag is selected (only if clickable = `true`) */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /** The size of the Tag component */\n @Prop({ reflect: true }) size: TTagSize = 'medium';\n\n /** The variant of Tag to apply on top of the variant */\n @Prop({ reflect: true }) variant: TTagVariant = 'filled';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('variant')\n checkPropValues() {\n validatePropValue(TAG_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAG_VARIANT, 'filled', this.el, 'variant');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the tag is close/hidden */\n @Event() bqClose: EventEmitter;\n\n /** Callback handler to be called when the tag is not open/shown */\n @Event() bqOpen: EventEmitter;\n\n /** Handler to be called when tag loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is clicked */\n @Event() bqClick: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is focused */\n @Event() bqFocus: EventEmitter<HTMLBqTagElement>;\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 /** Method to be called to remove the tag component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** Method to be called to show the tag component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqClose.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = true;\n }\n };\n\n private handleShow = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqOpen.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = false;\n }\n };\n\n private handleClick = () => {\n // If the tag is not clickable or the tag is disabled, we don't want to handle the click\n if (!this.isClickable || this.disabled) return;\n\n // Emit a click event on the element\n const ev = this.bqClick.emit(this.el);\n // If the event was not prevented, toggle the clickable state\n if (!ev.defaultPrevented) {\n this.selected = !this.selected;\n }\n };\n\n private handleBlur = () => {\n if (!this.isClickable) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (!this.isClickable) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private get isClickable(): boolean {\n return this.clickable && !this.color && !this.hasCustomColor && !this.removable;\n }\n\n private get isRemovable(): boolean {\n return this.removable && !this.isClickable;\n }\n\n private get isHidden(): boolean {\n return this.isRemovable && this.hidden;\n }\n\n private get hasCustomColor(): boolean {\n return this.color !== undefined ? !TAG_COLOR.includes(this.color) : false;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n '--bq-tag--icon-prefix-size': `${iconSize(this.size)}px`,\n ...(this.border && { '--bq-tag--border-radius': `var(--bq-radius--${this.border})` }),\n ...(this.color && { '--bq-tag--background-color': getColorCSSVariable(this.color) ?? this.color }),\n ...(this.hasCustomColor && { '--bq-text--primary': `var(--bq-text--alt)` }),\n };\n\n return (\n <Host style={style} aria-hidden={this.isHidden ? 'true' : 'false'} hidden={this.isHidden ? 'true' : 'false'}>\n <button\n class={{\n [`bq-tag bq-tag__${this.size}`]: true,\n [`bq-tag__${this.color || 'default'} bq-tag__${this.variant}`]: !this.hasCustomColor,\n 'is-clickable': this.isClickable,\n 'is-removable': this.removable,\n // Active/Selected state when clickable\n active: this.isClickable && this.selected,\n // Fixed border radius\n 'has-border': !!this.border,\n }}\n disabled={this.disabled}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n tabindex={this.isClickable ? 0 : -1}\n part=\"wrapper\"\n >\n <span\n class={{ 'bq-tag__prefix inline-flex': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div\n class={{\n 'text-xs': this.size === 'xsmall',\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n }}\n part=\"text\"\n >\n <slot />\n </div>\n {this.isRemovable && !this.disabled && (\n <bq-button class=\"bq-tag__close\" appearance=\"text\" size=\"small\" onClick={this.handleHide} part=\"btn-close\">\n <bq-icon\n size={iconSize(this.size)}\n name=\"x-circle\"\n color={this.color && !this.hasCustomColor ? textColor(this.color)[this.variant] : 'text--primary'}\n />\n </bq-button>\n )}\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,6 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
6
- import './assetsPath.js';
7
6
  import { d as debounce } from './debounce.js';
8
7
  import { i as isHTMLElement } from './isHTMLElement.js';
9
8
  import { b as hasSlotContent } from './slot.js';
@@ -1 +1 @@
1
- {"file":"bq-textarea.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,uh0BAAuh0B,CAAC;AAC9i0B,yBAAe,aAAa;;MCoBfA,YAAU;;;;;;;;;;6BAoBY,KAAK;wBACV,KAAK;8BAUkC,KAAK;4BAMxB,KAAK;2BAMA,KAAK;;wBASb,KAAK;4BAMM,CAAC;wBAGZ,KAAK;6BAGC,KAAK;;;;;wBAkBV,KAAK;wBAGL,KAAK;oBAGX,CAAC;0BAGM,KAAK;gCAWU,MAAM;;oBAMrB,MAAM;;;;IAxG7C,eAAe,CAAkB;IACjC,UAAU,GAAG,UAAU,CAAC;IAExB,cAAc,CAAe;IAC7B,SAAS,CAAoB;IAC7B,QAAQ,CAAsB;;;;IAyGtC,iBAAiB;QACf,I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I,EACf,GAAG,EAAE,CAAC,IAAyB,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,EAC1D,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,OAAO,IAEX,IAAI,CAAC,KAAK,CACF,EACX,4DACE,KAAK,EAAE;gBACL,uDAAuD,EAAE,IAAI;gBAC7D,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI;gBAC7C,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,SAAS;aAClD,EACD,IAAI,EAAC,aAAa,IAElB,6DACE,KAAK,EAAC,2BAA2B,EACjC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EACxD,IAAI,EAAC,aAAa,IAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,GAAI,CACrE,EACP,6DAAM,KAAK,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAC,gBAAgB,IACrG,IAAI,CAAC,kBAAkB,OAAG,IAAI,CAAC,SAAS,CACpC,CACH,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqTextarea"],"sources":["../../packages/beeq/src/components/textarea/scss/bq-textarea.scss?tag=bq-textarea&encapsulation=shadow","../../packages/beeq/src/components/textarea/bq-textarea.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Textarea styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-textarea.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__label {\n @apply text-[length:--bq-textarea--label-text-size] text-[color:--bq-textarea--label-text-color] m-be-[--bq-textarea--label-margin-bottom];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Textarea control */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__input {\n @apply flex-auto resize-y bg-[--bq-textarea--background-color] bs-[inherit];\n // Border\n @apply rounded-[--bq-textarea--border-radius] border-[length:--bq-textarea--border-width] border-[color:--bq-textarea--border-color];\n // Padding\n @apply pe-[--bq-textarea--padding-end] ps-[--bq-textarea--padding-start] p-b-[--bq-textarea--paddingY];\n // Text\n @apply text-[length:--bq-textarea--text-size] text-[color:--bq-textarea--text-color] placeholder:text-[color:--bq-textarea--text-placeholder-color];\n // Transition\n @apply transition-colors ease-in-out;\n // Hover\n @apply [&:not([disabled]):not(:focus-within)]:hover:border-hover-stroke-brand;\n // Disabled\n @apply disabled:cursor-not-allowed disabled:opacity-60;\n // Focus\n &:not([disabled]):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-textarea--border-color-focus);\n\n @apply focus border-[color:--bq-ring-color-focus];\n }\n}\n\n/* ------------------------------- Validations ------------------------------- */\n\n.bq-textarea__input.validation-error {\n @apply border-stroke-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.danger);\n\n @apply border-active-stroke-danger;\n }\n}\n\n.bq-textarea__input.validation-success {\n @apply border-stroke-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.success);\n\n @apply border-active-stroke-success;\n }\n}\n\n.bq-textarea__input.validation-warning {\n @apply border-stroke-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.warning);\n\n @apply border-active-stroke-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__helper {\n @apply text-[length:--bq-textarea--helper-text-size] text-[color:--bq-textarea--helper-text-color] m-bs-[--bq-textarea--helper-margin-top];\n}\n\n/* ------------------------------- Validations ------------------------------ */\n\n.bq-textarea__helper.validation-error {\n @apply text-text-danger;\n}\n\n.bq-textarea__helper.validation-success {\n @apply text-text-success;\n}\n\n.bq-textarea__helper.validation-warning {\n @apply text-text-warning;\n}\n\n/* ----------------------------- Helper counter ----------------------------- */\n\n/** Apply a disabled text color style to the textarea counter when the validation is none. */\n.bq-textarea__helper[class~='validation-none'] {\n .bq-textarea__helper--counter {\n @apply opacity-60;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TTextareaAutoCapitalize, TTextareaWrap } from './bq-textarea.types';\nimport { debounce, hasSlotContent, isHTMLElement, TDebounce } from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part input - The textarea element.\n * @part label - The textarea label.\n * @part helper-info - The helper info container.\n * @part helper-text - The helper text.\n * @part helper-counter - The helper counter.\n */\n@Component({\n tag: 'bq-textarea',\n styleUrl: './scss/bq-textarea.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTextarea {\n // Own Properties\n // ====================\n\n private debounceBqInput: TDebounce<void>;\n private fallbackId = 'textarea';\n\n private helperTextElem?: HTMLElement;\n private labelElem?: HTMLLabelElement;\n private textarea: HTMLTextAreaElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTextareaElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasHelperText = false;\n @State() private hasLabel = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the textarea field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: TTextareaAutoCapitalize = 'off';\n\n /**\n * Specifies whether or not the textarea field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the textarea field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the textarea will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /**\n * If `true`, the textarea will automatically grow and shrink to fit its contents.\n * If `false`, the textarea will have a fixed height specified by the `rows` property.\n */\n @Prop({ reflect: true }) autoGrow: boolean = false;\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the textarea value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /** If `true`, the user cannot interact with the textarea. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If `true`, it will block the user's ability to resize the textarea. */\n @Prop({ reflect: true }) disableResize?: boolean = false;\n\n /** The ID of the form that the textarea field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The maximum number of characters that can be entered into the textarea (`0`: no limit).\n * When enabled, a character counter will be shown underneath the textarea.\n */\n @Prop({ reflect: true }) maxlength: number;\n\n /** The name of the textarea element. */\n @Prop({ reflect: true }) name!: string;\n\n /** The placeholder text to show when there is no value. */\n @Prop({ reflect: true }) placeholder!: string;\n\n /** If true, the textarea field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean = false;\n\n /** Indicates whether or not the textarea field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** The number of visible text lines for the control. It must be a positive integer. */\n @Prop({ reflect: true }) rows: number = 5;\n\n /** If true, the textarea content may be checked for spelling errors. */\n @Prop({ reflect: true }) spellcheck: boolean = false;\n /**\n * The validation status of the textarea.\n *\n * @remarks\n * This property is used to indicate the validation status of the textarea. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The textarea has a validation error.\n * - `'warning'`: The textarea has a validation warning.\n * - `'success'`: The textarea has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The value of the textarea. It can be used to reset the textarea to a previous value. */\n @Prop({ mutable: true }) value: string;\n\n /** Specifies how the text in a text area is to be wrapped when submitted in a form */\n @Prop({ reflect: true }) wrap: TTextareaWrap = 'soft';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (!this.textarea) return;\n if (!this.maxlength || this.value.length < this.maxlength) return;\n // If the value is longer than the maxlength, we need to truncate it\n this.value = this.value.substring(0, this.maxlength);\n this.textarea.value = this.value;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the textarea loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value has changed and the textarea loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the textarea field and then clicks outside of the textarea field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n /** Callback handler emitted when the textarea value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqTextareaElement>;\n\n /** Callback handler emitted when the textarea has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value changes.\n * This handler is called whenever the user types or pastes text into the textarea field.\n */\n @Event() bqInput!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n // Listeners\n // ==============\n\n componentDidLoad() {\n this.handleValueChange();\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 get numberOfCharacters() {\n if (!this.maxlength || !this.textarea) return 0;\n\n return this.value.length;\n }\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n\n this.autoResize();\n };\n\n private autoResize = () => {\n if (!this.autoGrow) return;\n\n const inputElem = this.textarea;\n if (!inputElem) return;\n\n inputElem.style.height = 'auto';\n inputElem.style.height = `${inputElem.scrollHeight}px`;\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-textarea flex flex-auto flex-col\" part=\"base\">\n <label\n class={{ 'bq-textarea__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name ?? this.fallbackId}\n aria-label={this.name ?? this.fallbackId}\n ref={(label: HTMLLabelElement) => (this.labelElem = label)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n <textarea\n id={this.name ?? this.fallbackId}\n class={{\n 'bq-textarea__input': true,\n 'resize-none': this.disableResize,\n [`validation-${this.validationStatus}`]: true,\n }}\n autocapitalize={this.autocapitalize}\n autocomplete={this.autocomplete}\n autocorrect={this.autocorrect}\n autofocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n maxLength={this.maxlength > 0 ? this.maxlength : undefined}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n spellcheck={this.spellcheck}\n wrap={this.wrap}\n ref={(elem: HTMLTextAreaElement) => (this.textarea = elem)}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n part=\"input\"\n >\n {this.value}\n </textarea>\n <div\n class={{\n 'bq-textarea__helper flex items-center justify-between': true,\n [`validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText && !this.maxlength,\n }}\n part=\"helper-info\"\n >\n <span\n class=\"bq-textarea__helper--text\"\n ref={(span: HTMLElement) => (this.helperTextElem = span)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </span>\n <span class={{ 'bq-textarea__helper--counter': true, '!hidden': !this.maxlength }} part=\"helper-counter\">\n {this.numberOfCharacters}/{this.maxlength}\n </span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bq-textarea.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,uh0BAAuh0B,CAAC;AAC9i0B,yBAAe,aAAa;;MCoBfA,YAAU;;;;;;;;;;6BAoBY,KAAK;wBACV,KAAK;8BAUkC,KAAK;4BAMxB,KAAK;2BAMA,KAAK;;wBASb,KAAK;4BAMM,CAAC;wBAGZ,KAAK;6BAGC,KAAK;;;;;wBAkBV,KAAK;wBAGL,KAAK;oBAGX,CAAC;0BAGM,KAAK;gCAWU,MAAM;;oBAMrB,MAAM;;;;IAxG7C,eAAe,CAAkB;IACjC,UAAU,GAAG,UAAU,CAAC;IAExB,cAAc,CAAe;IAC7B,SAAS,CAAoB;IAC7B,QAAQ,CAAsB;;;;IAyGtC,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QA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IAAyB,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,EAC1D,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,OAAO,IAEX,IAAI,CAAC,KAAK,CACF,EACX,4DACE,KAAK,EAAE;gBACL,uDAAuD,EAAE,IAAI;gBAC7D,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI;gBAC7C,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,SAAS;aAClD,EACD,IAAI,EAAC,aAAa,IAElB,6DACE,KAAK,EAAC,2BAA2B,EACjC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EACxD,IAAI,EAAC,aAAa,IAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,GAAI,CACrE,EACP,6DAAM,KAAK,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAC,gBAAgB,IACrG,IAAI,CAAC,kBAAkB,OAAG,IAAI,CAAC,SAAS,CACpC,CACH,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqTextarea"],"sources":["../../packages/beeq/src/components/textarea/scss/bq-textarea.scss?tag=bq-textarea&encapsulation=shadow","../../packages/beeq/src/components/textarea/bq-textarea.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Textarea styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-textarea.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__label {\n @apply text-[length:--bq-textarea--label-text-size] text-[color:--bq-textarea--label-text-color] m-be-[--bq-textarea--label-margin-bottom];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Textarea control */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__input {\n @apply flex-auto resize-y bg-[--bq-textarea--background-color] bs-[inherit];\n // Border\n @apply rounded-[--bq-textarea--border-radius] border-[length:--bq-textarea--border-width] border-[color:--bq-textarea--border-color];\n // Padding\n @apply pe-[--bq-textarea--padding-end] ps-[--bq-textarea--padding-start] p-b-[--bq-textarea--paddingY];\n // Text\n @apply text-[length:--bq-textarea--text-size] text-[color:--bq-textarea--text-color] placeholder:text-[color:--bq-textarea--text-placeholder-color];\n // Transition\n @apply transition-colors ease-in-out;\n // Hover\n @apply [&:not([disabled]):not(:focus-within)]:hover:border-hover-stroke-brand;\n // Disabled\n @apply disabled:cursor-not-allowed disabled:opacity-60;\n // Focus\n &:not([disabled]):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-textarea--border-color-focus);\n\n @apply focus border-[color:--bq-ring-color-focus];\n }\n}\n\n/* ------------------------------- Validations ------------------------------- */\n\n.bq-textarea__input.validation-error {\n @apply border-stroke-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.danger);\n\n @apply border-active-stroke-danger;\n }\n}\n\n.bq-textarea__input.validation-success {\n @apply border-stroke-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.success);\n\n @apply border-active-stroke-success;\n }\n}\n\n.bq-textarea__input.validation-warning {\n @apply border-stroke-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.warning);\n\n @apply border-active-stroke-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__helper {\n @apply text-[length:--bq-textarea--helper-text-size] text-[color:--bq-textarea--helper-text-color] m-bs-[--bq-textarea--helper-margin-top];\n}\n\n/* ------------------------------- Validations ------------------------------ */\n\n.bq-textarea__helper.validation-error {\n @apply text-text-danger;\n}\n\n.bq-textarea__helper.validation-success {\n @apply text-text-success;\n}\n\n.bq-textarea__helper.validation-warning {\n @apply text-text-warning;\n}\n\n/* ----------------------------- Helper counter ----------------------------- */\n\n/** Apply a disabled text color style to the textarea counter when the validation is none. */\n.bq-textarea__helper[class~='validation-none'] {\n .bq-textarea__helper--counter {\n @apply opacity-60;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TTextareaAutoCapitalize, TTextareaWrap } from './bq-textarea.types';\nimport { debounce, hasSlotContent, isHTMLElement, TDebounce } from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part input - The textarea element.\n * @part label - The textarea label.\n * @part helper-info - The helper info container.\n * @part helper-text - The helper text.\n * @part helper-counter - The helper counter.\n */\n@Component({\n tag: 'bq-textarea',\n styleUrl: './scss/bq-textarea.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTextarea {\n // Own Properties\n // ====================\n\n private debounceBqInput: TDebounce<void>;\n private fallbackId = 'textarea';\n\n private helperTextElem?: HTMLElement;\n private labelElem?: HTMLLabelElement;\n private textarea: HTMLTextAreaElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTextareaElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasHelperText = false;\n @State() private hasLabel = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the textarea field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: TTextareaAutoCapitalize = 'off';\n\n /**\n * Specifies whether or not the textarea field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the textarea field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the textarea will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /**\n * If `true`, the textarea will automatically grow and shrink to fit its contents.\n * If `false`, the textarea will have a fixed height specified by the `rows` property.\n */\n @Prop({ reflect: true }) autoGrow: boolean = false;\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the textarea value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /** If `true`, the user cannot interact with the textarea. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If `true`, it will block the user's ability to resize the textarea. */\n @Prop({ reflect: true }) disableResize?: boolean = false;\n\n /** The ID of the form that the textarea field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The maximum number of characters that can be entered into the textarea (`0`: no limit).\n * When enabled, a character counter will be shown underneath the textarea.\n */\n @Prop({ reflect: true }) maxlength: number;\n\n /** The name of the textarea element. */\n @Prop({ reflect: true }) name!: string;\n\n /** The placeholder text to show when there is no value. */\n @Prop({ reflect: true }) placeholder!: string;\n\n /** If true, the textarea field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean = false;\n\n /** Indicates whether or not the textarea field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** The number of visible text lines for the control. It must be a positive integer. */\n @Prop({ reflect: true }) rows: number = 5;\n\n /** If true, the textarea content may be checked for spelling errors. */\n @Prop({ reflect: true }) spellcheck: boolean = false;\n /**\n * The validation status of the textarea.\n *\n * @remarks\n * This property is used to indicate the validation status of the textarea. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The textarea has a validation error.\n * - `'warning'`: The textarea has a validation warning.\n * - `'success'`: The textarea has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The value of the textarea. It can be used to reset the textarea to a previous value. */\n @Prop({ mutable: true }) value: string;\n\n /** Specifies how the text in a text area is to be wrapped when submitted in a form */\n @Prop({ reflect: true }) wrap: TTextareaWrap = 'soft';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (!this.textarea) return;\n if (!this.maxlength || this.value.length < this.maxlength) return;\n // If the value is longer than the maxlength, we need to truncate it\n this.value = this.value.substring(0, this.maxlength);\n this.textarea.value = this.value;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the textarea loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value has changed and the textarea loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the textarea field and then clicks outside of the textarea field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n /** Callback handler emitted when the textarea value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqTextareaElement>;\n\n /** Callback handler emitted when the textarea has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value changes.\n * This handler is called whenever the user types or pastes text into the textarea field.\n */\n @Event() bqInput!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n // Listeners\n // ==============\n\n componentDidLoad() {\n this.handleValueChange();\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 get numberOfCharacters() {\n if (!this.maxlength || !this.textarea) return 0;\n\n return this.value.length;\n }\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n\n this.autoResize();\n };\n\n private autoResize = () => {\n if (!this.autoGrow) return;\n\n const inputElem = this.textarea;\n if (!inputElem) return;\n\n inputElem.style.height = 'auto';\n inputElem.style.height = `${inputElem.scrollHeight}px`;\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-textarea flex flex-auto flex-col\" part=\"base\">\n <label\n class={{ 'bq-textarea__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name ?? this.fallbackId}\n aria-label={this.name ?? this.fallbackId}\n ref={(label: HTMLLabelElement) => (this.labelElem = label)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n <textarea\n id={this.name ?? this.fallbackId}\n class={{\n 'bq-textarea__input': true,\n 'resize-none': this.disableResize,\n [`validation-${this.validationStatus}`]: true,\n }}\n autocapitalize={this.autocapitalize}\n autocomplete={this.autocomplete}\n autocorrect={this.autocorrect}\n autofocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n maxLength={this.maxlength > 0 ? this.maxlength : undefined}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n spellcheck={this.spellcheck}\n wrap={this.wrap}\n ref={(elem: HTMLTextAreaElement) => (this.textarea = elem)}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n part=\"input\"\n >\n {this.value}\n </textarea>\n <div\n class={{\n 'bq-textarea__helper flex items-center justify-between': true,\n [`validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText && !this.maxlength,\n }}\n part=\"helper-info\"\n >\n <span\n class=\"bq-textarea__helper--text\"\n ref={(span: HTMLElement) => (this.helperTextElem = span)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </span>\n <span class={{ 'bq-textarea__helper--counter': true, '!hidden': !this.maxlength }} part=\"helper-counter\">\n {this.numberOfCharacters}/{this.maxlength}\n </span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,6 @@
3
3
  * © https://beeq.design - Apache 2 License.
4
4
  */
5
5
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
6
- import './assetsPath.js';
7
6
  import { d as debounce } from './debounce.js';
8
7
  import { v as validatePropValue } from './props.js';
9
8
  import { d as defineCustomElement$2 } from './bq-icon2.js';
@@ -29,7 +28,7 @@ const BqToast$1 = /*@__PURE__*/ proxyCustomElement(class BqToast extends HTMLEle
29
28
  this.__attachShadow();
30
29
  this.bqHide = createEvent(this, "bqHide", 7);
31
30
  this.bqShow = createEvent(this, "bqShow", 7);
32
- this.toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);
31
+ this.toastPortal = typeof window !== 'undefined' ? document.querySelector(`.${TOAST_PORTAL_SELECTOR}`) : null;
33
32
  this.border = 's';
34
33
  this.type = 'info';
35
34
  this.placement = 'bottom-center';
@@ -75,7 +74,7 @@ const BqToast$1 = /*@__PURE__*/ proxyCustomElement(class BqToast extends HTMLEle
75
74
  // =====================================
76
75
  connectedCallback() {
77
76
  const { toastPortal } = this;
78
- if (!toastPortal && typeof document !== 'undefined') {
77
+ if (!toastPortal && typeof window !== 'undefined') {
79
78
  this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });
80
79
  }
81
80
  }
@@ -166,7 +165,7 @@ const BqToast$1 = /*@__PURE__*/ proxyCustomElement(class BqToast extends HTMLEle
166
165
  const style = {
167
166
  ...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),
168
167
  };
169
- return (h(Host, { key: '06ff4fce530e9b3d43ef319215a5a3be5abf6565', style: style, class: { 'is-hidden': !this.open }, "aria-hidden": !this.open ? 'true' : 'false', hidden: !this.open ? 'true' : 'false', role: "status" }, h("output", { key: '4686d298c9e0b3ddba33ee2c753bbb6dfe7a1d7e', class: "bq-toast", part: "wrapper" }, h("div", { key: '5e47a9e376fbba1ae806db0135d36862ffdcefaf', class: { [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }, part: "icon" }, h("slot", { key: '47711e80d9fafd776880106208c01748a9313c75', name: "icon" }, h("bq-icon", { key: '2e295a304800b3bc1665a82aa38a2c68322f2574', name: this.iconName, size: "24", slot: "icon", exportparts: "base,svg" }))), h("slot", { key: '0a5a1f76f8bcd11edb75d17ef1f2ea40620a5b79' }))));
168
+ return (h(Host, { key: '0c720b655e1ccfb620eb3a317bf77e31f328308b', style: style, class: { 'is-hidden': !this.open }, "aria-hidden": !this.open ? 'true' : 'false', hidden: !this.open ? 'true' : 'false', role: "status" }, h("output", { key: 'a7f39180143c475d6554799eccb52fb52b61b978', class: "bq-toast", part: "wrapper" }, h("div", { key: '10a989822386e2abd536a58fd84fb8cc431b387e', class: { [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }, part: "icon" }, h("slot", { key: '6ac3e6c871ce1fd6b5a1f3202cc68c55bb8384fd', name: "icon" }, h("bq-icon", { key: '2de92ed1b7051b57f8979cbbef6fe03e6eec6880', name: this.iconName, size: "24", slot: "icon", exportparts: "base,svg" }))), h("slot", { key: '2794332bcd8fc1e2d314bcbb950d517f775d457e' }))));
170
169
  }
171
170
  static get watchers() { return {
172
171
  "type": ["checkPropValues"],