@adyen/bento-vue2 2.0.0-rc.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/README.md +0 -38
  2. package/dist/@types/index.d.ts +148 -56
  3. package/dist/accordion.js +1 -1
  4. package/dist/action-bar.js +1 -1
  5. package/dist/ai-tag.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/anchor-scroller.js +1 -1
  8. package/dist/assets/accordion-item.css +1 -1
  9. package/dist/assets/action-bar.css +1 -1
  10. package/dist/assets/ai-tag.css +1 -1
  11. package/dist/assets/anchor-scroller.css +1 -1
  12. package/dist/assets/base-modal.css +1 -1
  13. package/dist/assets/button-actions.css +1 -1
  14. package/dist/assets/calendar.css +1 -1
  15. package/dist/assets/card.css +1 -1
  16. package/dist/assets/checkbox-group.css +1 -1
  17. package/dist/assets/checkbox.css +1 -1
  18. package/dist/assets/code-snippet.css +1 -1
  19. package/dist/assets/data-grid-template.css +1 -1
  20. package/dist/assets/data-grid.css +1 -1
  21. package/dist/assets/date-picker.css +1 -1
  22. package/dist/assets/date-range-picker.css +1 -1
  23. package/dist/assets/dialog-page.css +1 -1
  24. package/dist/assets/drawer.css +1 -1
  25. package/dist/assets/dropdown.css +1 -1
  26. package/dist/assets/file-uploader.css +1 -1
  27. package/dist/assets/filter-bar.css +1 -1
  28. package/dist/assets/header-with-views.css +1 -1
  29. package/dist/assets/header.css +1 -1
  30. package/dist/assets/info-icon-with-popover.css +1 -0
  31. package/dist/assets/input-field-password.css +1 -1
  32. package/dist/assets/input-field.css +1 -1
  33. package/dist/assets/inspector.css +1 -1
  34. package/dist/assets/link.css +1 -1
  35. package/dist/assets/modal-fullscreen.css +1 -1
  36. package/dist/assets/navigation-menu-group.css +1 -1
  37. package/dist/assets/pagination.css +1 -1
  38. package/dist/assets/popper-container.css +1 -1
  39. package/dist/assets/progress-bar.css +1 -1
  40. package/dist/assets/promo-banner.css +1 -1
  41. package/dist/assets/radio-group.css +1 -1
  42. package/dist/assets/rich-text-editor.css +1 -1
  43. package/dist/assets/secondary-nav.css +1 -1
  44. package/dist/assets/segmented-control.css +1 -1
  45. package/dist/assets/selection-card-group.css +1 -1
  46. package/dist/assets/sidepanel.css +1 -1
  47. package/dist/assets/tab.css +1 -1
  48. package/dist/assets/table-of-contents.css +1 -1
  49. package/dist/assets/tag.css +1 -1
  50. package/dist/assets/textarea.css +1 -1
  51. package/dist/assets/timeline-item.css +1 -1
  52. package/dist/assets/title-details.css +1 -0
  53. package/dist/assets/toggle.css +1 -1
  54. package/dist/button.js +3 -3
  55. package/dist/card.js +1 -1
  56. package/dist/checkbox.js +2 -2
  57. package/dist/chip.js +1 -1
  58. package/dist/chunks/{accordion-item.V3zpgTzM.js → accordion-item.DOj7vqeL.js} +2 -2
  59. package/dist/chunks/accordion-item.DOj7vqeL.js.map +1 -0
  60. package/dist/chunks/{action-bar.Br6mamx3.js → action-bar.BsXW7BI2.js} +77 -67
  61. package/dist/chunks/action-bar.BsXW7BI2.js.map +1 -0
  62. package/dist/chunks/{ai-button.CeT3y12R.js → ai-button.BnFk5CzK.js} +2 -2
  63. package/dist/chunks/{ai-button.CeT3y12R.js.map → ai-button.BnFk5CzK.js.map} +1 -1
  64. package/dist/chunks/{ai-tag.DtngkeLj.js → ai-tag.D2Q0xhFK.js} +3 -3
  65. package/dist/chunks/ai-tag.D2Q0xhFK.js.map +1 -0
  66. package/dist/chunks/{alert.DrGpzkQI.js → alert.DJDHwVeR.js} +2 -2
  67. package/dist/chunks/{alert.DrGpzkQI.js.map → alert.DJDHwVeR.js.map} +1 -1
  68. package/dist/chunks/{anchor-scroller.DT7QZd5b.js → anchor-scroller.BbvghQxZ.js} +8 -8
  69. package/dist/chunks/anchor-scroller.BbvghQxZ.js.map +1 -0
  70. package/dist/chunks/{base-button.edpjvY15.js → base-button.DOhHyU7x.js} +2 -2
  71. package/dist/chunks/{base-button.edpjvY15.js.map → base-button.DOhHyU7x.js.map} +1 -1
  72. package/dist/chunks/{base-modal.DsqIEM0p.js → base-modal.CcmoTJdc.js} +90 -82
  73. package/dist/chunks/base-modal.CcmoTJdc.js.map +1 -0
  74. package/dist/chunks/{button-actions-with-menu.BBuKZYuH.js → button-actions-with-menu.BY394ars.js} +2 -2
  75. package/dist/chunks/{button-actions-with-menu.BBuKZYuH.js.map → button-actions-with-menu.BY394ars.js.map} +1 -1
  76. package/dist/chunks/{button-actions.CFOxzahr.js → button-actions.bkcLUE1G.js} +51 -50
  77. package/dist/chunks/button-actions.bkcLUE1G.js.map +1 -0
  78. package/dist/chunks/{button.CBqJGWy5.js → button.DII5Ifwa.js} +2 -2
  79. package/dist/chunks/{button.CBqJGWy5.js.map → button.DII5Ifwa.js.map} +1 -1
  80. package/dist/chunks/{calendar.Bi7oa397.js → calendar.CXdLEeN4.js} +8 -8
  81. package/dist/chunks/calendar.CXdLEeN4.js.map +1 -0
  82. package/dist/chunks/card.b9PEJ7hm.js +139 -0
  83. package/dist/chunks/card.b9PEJ7hm.js.map +1 -0
  84. package/dist/chunks/{checkbox-group.FlQJn1Zm.js → checkbox-group.UYN1ljai.js} +7 -7
  85. package/dist/chunks/checkbox-group.UYN1ljai.js.map +1 -0
  86. package/dist/chunks/{checkbox.D7kTrRAJ.js → checkbox.Co4HoHKF.js} +15 -15
  87. package/dist/chunks/checkbox.Co4HoHKF.js.map +1 -0
  88. package/dist/chunks/{chip.CCBRXSGa.js → chip.DRsJylWl.js} +2 -2
  89. package/dist/chunks/{chip.CCBRXSGa.js.map → chip.DRsJylWl.js.map} +1 -1
  90. package/dist/chunks/{code-snippet.DOtmgwGx.js → code-snippet.CnThWqVb.js} +73 -74
  91. package/dist/chunks/code-snippet.CnThWqVb.js.map +1 -0
  92. package/dist/chunks/constructNow.Dl44Mvpp.js +8 -0
  93. package/dist/chunks/{constructNow.DyOJDyZZ.js.map → constructNow.Dl44Mvpp.js.map} +1 -1
  94. package/dist/chunks/{controls-group.C1YlswQH.js → controls-group.fdGc6epa.js} +2 -2
  95. package/dist/chunks/{controls-group.C1YlswQH.js.map → controls-group.fdGc6epa.js.map} +1 -1
  96. package/dist/chunks/{copy.DIRgGox4.js → copy.CSk1rCRo.js} +4 -4
  97. package/dist/chunks/{copy.DIRgGox4.js.map → copy.CSk1rCRo.js.map} +1 -1
  98. package/dist/chunks/{cross-circle-fill-small.Doaiq7Wx.js → cross-circle-fill-small.CZN966bc.js} +2 -2
  99. package/dist/chunks/cross-circle-fill-small.CZN966bc.js.map +1 -0
  100. package/dist/chunks/{dashboard-section.DvYJk8aj.js → dashboard-section.CYEoNH9Q.js} +3 -3
  101. package/dist/chunks/{dashboard-section.DvYJk8aj.js.map → dashboard-section.CYEoNH9Q.js.map} +1 -1
  102. package/dist/chunks/{dashed-underline.D3YXHh-k.js → dashed-underline.CzKc-fJW.js} +3 -3
  103. package/dist/chunks/{dashed-underline.D3YXHh-k.js.map → dashed-underline.CzKc-fJW.js.map} +1 -1
  104. package/dist/chunks/{data-grid-template.ZZNd2LWk.js → data-grid-template.DCwzh2G7.js} +4 -4
  105. package/dist/chunks/{data-grid-template.ZZNd2LWk.js.map → data-grid-template.DCwzh2G7.js.map} +1 -1
  106. package/dist/chunks/{data-grid.4_JJV1_Z.js → data-grid.B1lI07ze.js} +24 -24
  107. package/dist/chunks/data-grid.B1lI07ze.js.map +1 -0
  108. package/dist/chunks/{date-picker.EuvvrhtF.js → date-picker.gDsw8bn1.js} +8 -8
  109. package/dist/chunks/date-picker.gDsw8bn1.js.map +1 -0
  110. package/dist/chunks/{date-range-picker.Bi5j0eED.js → date-range-picker.CqixIJxG.js} +278 -275
  111. package/dist/chunks/{date-range-picker.Bi5j0eED.js.map → date-range-picker.CqixIJxG.js.map} +1 -1
  112. package/dist/chunks/{date-time-picker.DinENKL0.js → date-time-picker.Bktntun4.js} +6 -6
  113. package/dist/chunks/{date-time-picker.DinENKL0.js.map → date-time-picker.Bktntun4.js.map} +1 -1
  114. package/dist/chunks/{de.ctR_lBqr.js → de.D953eFBg.js} +2 -2
  115. package/dist/chunks/{de.ctR_lBqr.js.map → de.D953eFBg.js.map} +1 -1
  116. package/dist/chunks/{dialog-page.DM6imlbn.js → dialog-page.Bct3zOQO.js} +44 -44
  117. package/dist/chunks/dialog-page.Bct3zOQO.js.map +1 -0
  118. package/dist/chunks/{differenceInMonths.yz4Dfe-b.js → differenceInMonths.CPDkGea3.js} +2 -2
  119. package/dist/chunks/{differenceInMonths.yz4Dfe-b.js.map → differenceInMonths.CPDkGea3.js.map} +1 -1
  120. package/dist/chunks/{draggable-handle.UmaDf-G4.js → draggable-handle.DgVdGC1V.js} +2 -2
  121. package/dist/chunks/{draggable-handle.UmaDf-G4.js.map → draggable-handle.DgVdGC1V.js.map} +1 -1
  122. package/dist/chunks/{draggable.3Uuc40QN.js → draggable.DYKdXdbj.js} +2 -2
  123. package/dist/chunks/{draggable.3Uuc40QN.js.map → draggable.DYKdXdbj.js.map} +1 -1
  124. package/dist/chunks/{dropdown-tag.3mltTUPq.js → dropdown-tag.Dk7SooVv.js} +3 -3
  125. package/dist/chunks/{dropdown-tag.3mltTUPq.js.map → dropdown-tag.Dk7SooVv.js.map} +1 -1
  126. package/dist/chunks/{dropdown.BdfmQmO_.js → dropdown.Bnq4kP7k.js} +12 -12
  127. package/dist/chunks/dropdown.Bnq4kP7k.js.map +1 -0
  128. package/dist/chunks/{empty-state.DWnWb0jM.js → empty-state.C2wjdE3y.js} +3 -3
  129. package/dist/chunks/{empty-state.DWnWb0jM.js.map → empty-state.C2wjdE3y.js.map} +1 -1
  130. package/dist/chunks/{en-GB.BsQNm5GT.js → en-GB.DRXS-7tU.js} +2 -2
  131. package/dist/chunks/{en-GB.BsQNm5GT.js.map → en-GB.DRXS-7tU.js.map} +1 -1
  132. package/dist/chunks/{en-US.BR6y7foR.js → en-US.C412g-7U.js} +3 -3
  133. package/dist/chunks/{en-US.BR6y7foR.js.map → en-US.C412g-7U.js.map} +1 -1
  134. package/dist/chunks/{es.DxqH-QhP.js → es.DieAs0jD.js} +2 -2
  135. package/dist/chunks/{es.DxqH-QhP.js.map → es.DieAs0jD.js.map} +1 -1
  136. package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
  137. package/dist/chunks/{field-label.DsNcfZ6m.js → field-label.C7BCsofY.js} +2 -2
  138. package/dist/chunks/{field-label.DsNcfZ6m.js.map → field-label.C7BCsofY.js.map} +1 -1
  139. package/dist/chunks/{file-uploader.D1xDlbsu.js → file-uploader.DllKBmP8.js} +8 -8
  140. package/dist/chunks/file-uploader.DllKBmP8.js.map +1 -0
  141. package/dist/chunks/{filter-bar.DlSyWQQ0.js → filter-bar.DXpLhnxG.js} +1050 -974
  142. package/dist/chunks/filter-bar.DXpLhnxG.js.map +1 -0
  143. package/dist/chunks/{fixed-scroller.QHqymN36.js → fixed-scroller.YC4bZifw.js} +2 -2
  144. package/dist/chunks/{fixed-scroller.QHqymN36.js.map → fixed-scroller.YC4bZifw.js.map} +1 -1
  145. package/dist/chunks/{focus-trap.DK6-TX-N.js → focus-trap.fd6_d2EW.js} +3 -3
  146. package/dist/chunks/{focus-trap.DK6-TX-N.js.map → focus-trap.fd6_d2EW.js.map} +1 -1
  147. package/dist/chunks/{footer-actions.cJxmP0fK.js → footer-actions.C9STwwcv.js} +3 -3
  148. package/dist/chunks/{footer-actions.cJxmP0fK.js.map → footer-actions.C9STwwcv.js.map} +1 -1
  149. package/dist/chunks/{form-layout-title.CCsmZ9E8.js → form-layout-title.C0lwzPZz.js} +2 -2
  150. package/dist/chunks/{form-layout-title.CCsmZ9E8.js.map → form-layout-title.C0lwzPZz.js.map} +1 -1
  151. package/dist/chunks/{fr.DJtn8ron.js → fr.ChY2aIns.js} +2 -2
  152. package/dist/chunks/{fr.DJtn8ron.js.map → fr.ChY2aIns.js.map} +1 -1
  153. package/dist/chunks/generate-uid.DBWe4g6T.js.map +1 -1
  154. package/dist/chunks/{header-with-views.D8XDYW5N.js → header-with-views.HwbE278X.js} +671 -666
  155. package/dist/chunks/{header-with-views.D8XDYW5N.js.map → header-with-views.HwbE278X.js.map} +1 -1
  156. package/dist/chunks/{header.BLhATjz3.js → header.CmyqVXuG.js} +14 -13
  157. package/dist/chunks/header.CmyqVXuG.js.map +1 -0
  158. package/dist/chunks/info-icon-with-popover.BvYyGm4D.js +65 -0
  159. package/dist/chunks/info-icon-with-popover.BvYyGm4D.js.map +1 -0
  160. package/dist/chunks/{info-icon.-3-LB8Zq.js → info-icon.B-FAeceD.js} +3 -3
  161. package/dist/chunks/{info-icon.-3-LB8Zq.js.map → info-icon.B-FAeceD.js.map} +1 -1
  162. package/dist/chunks/{input-field-password.KgSx3KDe.js → input-field-password.9bWhLud0.js} +6 -6
  163. package/dist/chunks/input-field-password.9bWhLud0.js.map +1 -0
  164. package/dist/chunks/{input-field-phone-number.DE9XpiFH.js → input-field-phone-number.CCn1N9St.js} +2 -2
  165. package/dist/chunks/{input-field-phone-number.DE9XpiFH.js.map → input-field-phone-number.CCn1N9St.js.map} +1 -1
  166. package/dist/chunks/{input-field.Dz8yVBEl.js → input-field.D912rZS_.js} +4 -4
  167. package/dist/chunks/input-field.D912rZS_.js.map +1 -0
  168. package/dist/chunks/{input-time.Bc50jTCQ.js → input-time.CXMuvF9N.js} +3 -3
  169. package/dist/chunks/{input-time.Bc50jTCQ.js.map → input-time.CXMuvF9N.js.map} +1 -1
  170. package/dist/chunks/{inspector-page.BwPtRsaZ.js → inspector-page.BRC_7uro.js} +3 -3
  171. package/dist/chunks/{inspector-page.BwPtRsaZ.js.map → inspector-page.BRC_7uro.js.map} +1 -1
  172. package/dist/chunks/inspector.IOtNex1r.js +142 -0
  173. package/dist/chunks/inspector.IOtNex1r.js.map +1 -0
  174. package/dist/chunks/isSameWeek.CcrBd5ov.js +14 -0
  175. package/dist/chunks/{isSameWeek.CieN9XgL.js.map → isSameWeek.CcrBd5ov.js.map} +1 -1
  176. package/dist/chunks/{it.keS7oN5l.js → it.9ITe-tO1.js} +3 -3
  177. package/dist/chunks/{it.keS7oN5l.js.map → it.9ITe-tO1.js.map} +1 -1
  178. package/dist/chunks/{ja.cLwacUE6.js → ja.D1PTbbq5.js} +2 -2
  179. package/dist/chunks/{ja.cLwacUE6.js.map → ja.D1PTbbq5.js.map} +1 -1
  180. package/dist/chunks/{link.BzIDMKgE.js → link.Cls8XShm.js} +4 -4
  181. package/dist/chunks/link.Cls8XShm.js.map +1 -0
  182. package/dist/chunks/{list-item.CKKEar92.js → list-item.HjabBEb8.js} +3 -3
  183. package/dist/chunks/{list-item.CKKEar92.js.map → list-item.HjabBEb8.js.map} +1 -1
  184. package/dist/chunks/{listbox-option-tag.CQ7jWrle.js → listbox-option-tag.DhNxvqRO.js} +2 -2
  185. package/dist/chunks/{listbox-option-tag.CQ7jWrle.js.map → listbox-option-tag.DhNxvqRO.js.map} +1 -1
  186. package/dist/chunks/{modal-fullscreen.BMGoNT7r.js → modal-fullscreen.Bi1bQs4Z.js} +9 -9
  187. package/dist/chunks/modal-fullscreen.Bi1bQs4Z.js.map +1 -0
  188. package/dist/chunks/{modal.BNqEbVvC.js → modal.B3-pmL5s.js} +5 -5
  189. package/dist/chunks/{modal.BNqEbVvC.js.map → modal.B3-pmL5s.js.map} +1 -1
  190. package/dist/chunks/{navigation-menu-group.uRQvdRyU.js → navigation-menu-group.B-AV49Bn.js} +7 -7
  191. package/dist/chunks/navigation-menu-group.B-AV49Bn.js.map +1 -0
  192. package/dist/chunks/{pagination.QuT_65w4.js → pagination.cI_pc6oE.js} +5 -5
  193. package/dist/chunks/pagination.cI_pc6oE.js.map +1 -0
  194. package/dist/chunks/popover.types.DvIwSAAp.js +6 -0
  195. package/dist/chunks/{popover.types.hyPD5Kv1.js.map → popover.types.DvIwSAAp.js.map} +1 -1
  196. package/dist/chunks/{popper-container.scV0X0nk.js → popper-container.Cj3AWXSd.js} +355 -338
  197. package/dist/chunks/{popper-container.scV0X0nk.js.map → popper-container.Cj3AWXSd.js.map} +1 -1
  198. package/dist/chunks/{progress-bar.C2EFmk8E.js → progress-bar.RlF3a0Gb.js} +3 -3
  199. package/dist/chunks/progress-bar.RlF3a0Gb.js.map +1 -0
  200. package/dist/chunks/{promo-banner.BzTq9SMT.js → promo-banner.B5szTysj.js} +7 -7
  201. package/dist/chunks/{promo-banner.BzTq9SMT.js.map → promo-banner.B5szTysj.js.map} +1 -1
  202. package/dist/chunks/{pt-BR.ChPOra5s.js → pt-BR.DmEVD7V-.js} +2 -2
  203. package/dist/chunks/{pt-BR.ChPOra5s.js.map → pt-BR.DmEVD7V-.js.map} +1 -1
  204. package/dist/chunks/{radio-group.77fvFrmz.js → radio-group.CvsQDlHi.js} +5 -5
  205. package/dist/chunks/radio-group.CvsQDlHi.js.map +1 -0
  206. package/dist/chunks/{rich-text-editor.DL6h2H5r.js → rich-text-editor.DNmVJilP.js} +7 -7
  207. package/dist/chunks/{rich-text-editor.DL6h2H5r.js.map → rich-text-editor.DNmVJilP.js.map} +1 -1
  208. package/dist/chunks/{search-bar.CiEKUPNX.js → search-bar.--4KVNkf.js} +3 -3
  209. package/dist/chunks/{search-bar.CiEKUPNX.js.map → search-bar.--4KVNkf.js.map} +1 -1
  210. package/dist/chunks/{secondary-nav.ekia7NO0.js → secondary-nav.CXtDQAay.js} +50 -50
  211. package/dist/chunks/secondary-nav.CXtDQAay.js.map +1 -0
  212. package/dist/chunks/{segmented-control.qykQS10o.js → segmented-control.nYpRQTGc.js} +3 -3
  213. package/dist/chunks/segmented-control.nYpRQTGc.js.map +1 -0
  214. package/dist/chunks/{selection-card-group.BEjddn7D.js → selection-card-group.DjFWMqVZ.js} +22 -22
  215. package/dist/chunks/selection-card-group.DjFWMqVZ.js.map +1 -0
  216. package/dist/chunks/{set-time-in-date.BVfkl8K8.js → set-time-in-date.B3K4C7CB.js} +2 -2
  217. package/dist/chunks/{set-time-in-date.BVfkl8K8.js.map → set-time-in-date.B3K4C7CB.js.map} +1 -1
  218. package/dist/chunks/{sidepanel.DeX_rFk7.js → sidepanel.CntIcmx-.js} +7 -7
  219. package/dist/chunks/sidepanel.CntIcmx-.js.map +1 -0
  220. package/dist/chunks/{startOfWeek.muMEhS7U.js → startOfWeek.CzdYFzXX.js} +2 -2
  221. package/dist/chunks/{startOfWeek.muMEhS7U.js.map → startOfWeek.CzdYFzXX.js.map} +1 -1
  222. package/dist/chunks/{step.DWC-MMij.js → step.BCa9IOWB.js} +2 -2
  223. package/dist/chunks/{step.DWC-MMij.js.map → step.BCa9IOWB.js.map} +1 -1
  224. package/dist/chunks/{structured-list-item.Bfn0A2G8.js → structured-list-item.Bhe0CH1M.js} +5 -5
  225. package/dist/chunks/{structured-list-item.Bfn0A2G8.js.map → structured-list-item.Bhe0CH1M.js.map} +1 -1
  226. package/dist/chunks/{summary-grid.types.B4WEQPEz.js → summary-grid.types.C70ED6WD.js} +5 -5
  227. package/dist/chunks/{summary-grid.types.B4WEQPEz.js.map → summary-grid.types.C70ED6WD.js.map} +1 -1
  228. package/dist/chunks/{tab.DCLrEYwn.js → tab.BK1sIJAJ.js} +45 -45
  229. package/dist/chunks/tab.BK1sIJAJ.js.map +1 -0
  230. package/dist/chunks/{table-of-contents.f_6G1qFS.js → table-of-contents.BTy95Rrs.js} +2 -2
  231. package/dist/chunks/table-of-contents.BTy95Rrs.js.map +1 -0
  232. package/dist/chunks/tag.Dz1FQSZb.js +56 -0
  233. package/dist/chunks/tag.Dz1FQSZb.js.map +1 -0
  234. package/dist/chunks/{textarea.OTgZOHYu.js → textarea.CcV9U3I7.js} +5 -5
  235. package/dist/chunks/textarea.CcV9U3I7.js.map +1 -0
  236. package/dist/chunks/{timeline-item.Be0xWRey.js → timeline-item.BG2by0xf.js} +10 -10
  237. package/dist/chunks/{timeline-item.Be0xWRey.js.map → timeline-item.BG2by0xf.js.map} +1 -1
  238. package/dist/chunks/title-details.ChwPP7C5.js +119 -0
  239. package/dist/chunks/title-details.ChwPP7C5.js.map +1 -0
  240. package/dist/chunks/{toast.DL_9zlHB.js → toast.CO6ByH3n.js} +2 -2
  241. package/dist/chunks/{toast.DL_9zlHB.js.map → toast.CO6ByH3n.js.map} +1 -1
  242. package/dist/chunks/{toggle.BkTeqKsx.js → toggle.Dgh7aw1D.js} +2 -2
  243. package/dist/chunks/toggle.Dgh7aw1D.js.map +1 -0
  244. package/dist/chunks/{tooltip.BwD3JuFl.js → tooltip.DFYc5NKM.js} +11 -11
  245. package/dist/chunks/tooltip.DFYc5NKM.js.map +1 -0
  246. package/dist/chunks/{tutorial.BrKSt9Sb.js → tutorial.K0aOQWIg.js} +4 -4
  247. package/dist/chunks/{tutorial.BrKSt9Sb.js.map → tutorial.K0aOQWIg.js.map} +1 -1
  248. package/dist/chunks/use-bento-toast-controller.A5xraVqa.js.map +1 -1
  249. package/dist/chunks/{use-date-input-formatter.Du8KZnNZ.js → use-date-input-formatter.MgbFwUqJ.js} +4 -4
  250. package/dist/chunks/{use-date-input-formatter.Du8KZnNZ.js.map → use-date-input-formatter.MgbFwUqJ.js.map} +1 -1
  251. package/dist/chunks/use-dynamic-date-fns-locale.Bpb2DeYR.js +39 -0
  252. package/dist/chunks/use-dynamic-date-fns-locale.Bpb2DeYR.js.map +1 -0
  253. package/dist/chunks/{zh-CN.ZG6obniO.js → zh-CN.C-da5IoS.js} +3 -3
  254. package/dist/chunks/{zh-CN.ZG6obniO.js.map → zh-CN.C-da5IoS.js.map} +1 -1
  255. package/dist/code-snippet.js +1 -1
  256. package/dist/dashboard-template.js +1 -1
  257. package/dist/dashed-underline.js +1 -1
  258. package/dist/data-grid-template.js +1 -1
  259. package/dist/data-grid.js +1 -1
  260. package/dist/date-picker.js +2 -2
  261. package/dist/date-range-picker.js +2 -2
  262. package/dist/date-time-picker.js +1 -1
  263. package/dist/draggable.js +2 -2
  264. package/dist/dropdown.js +2 -2
  265. package/dist/empty-state.js +1 -1
  266. package/dist/file-uploader.js +1 -1
  267. package/dist/filter-bar.js +1 -1
  268. package/dist/focus-trap.js +1 -1
  269. package/dist/form-layout.js +1 -1
  270. package/dist/header-with-views.js +1 -1
  271. package/dist/header.js +1 -1
  272. package/dist/index.js +67 -67
  273. package/dist/info-icon.js +1 -1
  274. package/dist/input-field-password.js +1 -1
  275. package/dist/input-field-phone-number.js +1 -1
  276. package/dist/input-field.js +1 -1
  277. package/dist/input-time.js +1 -1
  278. package/dist/inspector.js +2 -2
  279. package/dist/internal.js +25 -24
  280. package/dist/internal.js.map +1 -1
  281. package/dist/link.js +1 -1
  282. package/dist/list.js +1 -1
  283. package/dist/menu.js +1 -1
  284. package/dist/modal-fullscreen.js +3 -3
  285. package/dist/modal.js +2 -2
  286. package/dist/navigation-menu.js +1 -1
  287. package/dist/pagination.js +1 -1
  288. package/dist/popover.js +2 -2
  289. package/dist/popper-container.js +1 -1
  290. package/dist/progress-bar.js +1 -1
  291. package/dist/promo-banner.js +1 -1
  292. package/dist/radio-group.js +1 -1
  293. package/dist/rich-text-editor.js +1 -1
  294. package/dist/search-bar.js +2 -2
  295. package/dist/secondary-nav.js +1 -1
  296. package/dist/segmented-control.js +1 -1
  297. package/dist/selection-card.js +1 -1
  298. package/dist/sidepanel.js +1 -1
  299. package/dist/stepper.js +1 -1
  300. package/dist/structured-list.js +1 -1
  301. package/dist/styles/bento-dark.css +3 -3
  302. package/dist/styles/bento-light.css +4 -4
  303. package/dist/styles/bento.css +4 -4
  304. package/dist/styles/legacy.css +4 -4
  305. package/dist/styles/styleguide.css +4 -4
  306. package/dist/styles/utility.css +4 -4
  307. package/dist/summary-grid.js +1 -1
  308. package/dist/table-of-contents.js +1 -1
  309. package/dist/tabs.js +1 -1
  310. package/dist/tag.js +1 -1
  311. package/dist/textarea.js +1 -1
  312. package/dist/timeline.js +1 -1
  313. package/dist/toast.js +1 -1
  314. package/dist/toggle.js +1 -1
  315. package/dist/tutorial.js +1 -1
  316. package/dist/web-types.json +381 -48
  317. package/package.json +6 -6
  318. package/dist/assets/header-meta.css +0 -1
  319. package/dist/chunks/accordion-item.V3zpgTzM.js.map +0 -1
  320. package/dist/chunks/action-bar.Br6mamx3.js.map +0 -1
  321. package/dist/chunks/ai-tag.DtngkeLj.js.map +0 -1
  322. package/dist/chunks/anchor-scroller.DT7QZd5b.js.map +0 -1
  323. package/dist/chunks/base-modal.DsqIEM0p.js.map +0 -1
  324. package/dist/chunks/button-actions.CFOxzahr.js.map +0 -1
  325. package/dist/chunks/calendar.Bi7oa397.js.map +0 -1
  326. package/dist/chunks/card.B2rIoYTV.js +0 -124
  327. package/dist/chunks/card.B2rIoYTV.js.map +0 -1
  328. package/dist/chunks/checkbox-group.FlQJn1Zm.js.map +0 -1
  329. package/dist/chunks/checkbox.D7kTrRAJ.js.map +0 -1
  330. package/dist/chunks/code-snippet.DOtmgwGx.js.map +0 -1
  331. package/dist/chunks/constructNow.DyOJDyZZ.js +0 -8
  332. package/dist/chunks/cross-circle-fill-small.Doaiq7Wx.js.map +0 -1
  333. package/dist/chunks/data-grid.4_JJV1_Z.js.map +0 -1
  334. package/dist/chunks/date-picker.EuvvrhtF.js.map +0 -1
  335. package/dist/chunks/dialog-page.DM6imlbn.js.map +0 -1
  336. package/dist/chunks/dropdown.BdfmQmO_.js.map +0 -1
  337. package/dist/chunks/file-uploader.D1xDlbsu.js.map +0 -1
  338. package/dist/chunks/filter-bar.DlSyWQQ0.js.map +0 -1
  339. package/dist/chunks/header-meta.C5Ojlg8H.js +0 -206
  340. package/dist/chunks/header-meta.C5Ojlg8H.js.map +0 -1
  341. package/dist/chunks/header.BLhATjz3.js.map +0 -1
  342. package/dist/chunks/input-field-password.KgSx3KDe.js.map +0 -1
  343. package/dist/chunks/input-field.Dz8yVBEl.js.map +0 -1
  344. package/dist/chunks/inspector.CUJSQfsX.js +0 -128
  345. package/dist/chunks/inspector.CUJSQfsX.js.map +0 -1
  346. package/dist/chunks/isSameWeek.CieN9XgL.js +0 -14
  347. package/dist/chunks/link.BzIDMKgE.js.map +0 -1
  348. package/dist/chunks/modal-fullscreen.BMGoNT7r.js.map +0 -1
  349. package/dist/chunks/navigation-menu-group.uRQvdRyU.js.map +0 -1
  350. package/dist/chunks/pagination.QuT_65w4.js.map +0 -1
  351. package/dist/chunks/popover.types.hyPD5Kv1.js +0 -6
  352. package/dist/chunks/progress-bar.C2EFmk8E.js.map +0 -1
  353. package/dist/chunks/radio-group.77fvFrmz.js.map +0 -1
  354. package/dist/chunks/secondary-nav.ekia7NO0.js.map +0 -1
  355. package/dist/chunks/segmented-control.qykQS10o.js.map +0 -1
  356. package/dist/chunks/selection-card-group.BEjddn7D.js.map +0 -1
  357. package/dist/chunks/sidepanel.DeX_rFk7.js.map +0 -1
  358. package/dist/chunks/tab.DCLrEYwn.js.map +0 -1
  359. package/dist/chunks/table-of-contents.f_6G1qFS.js.map +0 -1
  360. package/dist/chunks/tag.Bm-widp9.js +0 -50
  361. package/dist/chunks/tag.Bm-widp9.js.map +0 -1
  362. package/dist/chunks/textarea.OTgZOHYu.js.map +0 -1
  363. package/dist/chunks/toggle.BkTeqKsx.js.map +0 -1
  364. package/dist/chunks/tooltip.BwD3JuFl.js.map +0 -1
@@ -1,21 +1,28 @@
1
- import { defineComponent as I, useSlots as H, ref as c, computed as l, inject as Q, watch as T, nextTick as X, onUnmounted as Z, useAttrs as V, onMounted as tt, provide as O, toRefs as et } from "vue";
2
- import { B as at } from "./button.CBqJGWy5.js";
3
- import { B as ot } from "./focus-trap.DK6-TX-N.js";
4
- import { u as J } from "./use-has-slot.C9lQZ6nz.js";
5
- import { u as nt } from "./index.CPOlyau9.js";
6
- import { l as st } from "./button-actions.CFOxzahr.js";
7
- import { g as lt } from "./generate-uid.DBWe4g6T.js";
8
- import { C as it } from "./cross.szJ_ZUTI.js";
9
- import { B as rt, D as ct, a as ut } from "./dialog-page.keys.Dym9e6k3.js";
10
- import { B as dt } from "./typography.D1OZJbEa.js";
11
- import { F as mt } from "./footer-actions.cJxmP0fK.js";
12
- import { D as pt } from "./dialog-page.DM6imlbn.js";
13
- import { o as ft } from "./resize.Bqks3WUm.js";
14
- import { a as gt, G as _t } from "./grid-layout.BeCrjPgT.js";
15
- import { n as K } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
16
- import { B as vt } from "./directive.D1-d-C2K.js";
1
+ import { useAttrs as q, defineComponent as I, useSlots as W, ref as u, computed as l, inject as Q, watch as G, nextTick as X, onUnmounted as Z, onMounted as V, provide as O, toRefs as tt } from "vue";
2
+ import { B as et } from "./button.DII5Ifwa.js";
3
+ import { B as at } from "./focus-trap.fd6_d2EW.js";
4
+ import { u as j } from "./use-has-slot.C9lQZ6nz.js";
5
+ import { u as ot } from "./index.CPOlyau9.js";
6
+ import { l as st } from "./button-actions.bkcLUE1G.js";
7
+ import { g as nt } from "./generate-uid.DBWe4g6T.js";
8
+ import { C as lt } from "./cross.szJ_ZUTI.js";
9
+ import { B as it, D as rt, a as ct } from "./dialog-page.keys.Dym9e6k3.js";
10
+ import { B as ut } from "./typography.D1OZJbEa.js";
11
+ import { F as dt } from "./footer-actions.C9STwwcv.js";
12
+ import { D as mt } from "./dialog-page.Bct3zOQO.js";
13
+ import { o as pt } from "./resize.Bqks3WUm.js";
14
+ import { a as ft, G as gt } from "./grid-layout.BeCrjPgT.js";
15
+ import { n as H } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
16
+ import { B as _t } from "./directive.D1-d-C2K.js";
17
17
  import "../assets/base-modal.css";
18
- var yt = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.DIALOG = "dialog", a))(yt || {}), Ct = /* @__PURE__ */ ((a) => (a.DEFAULT = "BentoModalDefault", a.DIALOG = "BentoModalDialog", a))(Ct || {}), k = /* @__PURE__ */ ((a) => (a.SMALL = "small", a.MEDIUM = "medium", a.LARGE = "large", a))(k || {}), L = /* @__PURE__ */ ((a) => (a.SMALLER = "smaller", a.EQUAL = "equal", a.BIGGER = "bigger", a))(L || {}), R = /* @__PURE__ */ ((a) => (a.DIALOG = "dialog", a.ALERT_DIALOG = "alertdialog", a))(R || {}), bt = /* @__PURE__ */ ((a) => (a.CONFIRMATION = "confirmation", a.DESTRUCTIVE = "destructive", a.INFO = "info", a.ACKNOWLEDGEMENT = "acknowledgement", a))(bt || {}), ht = /* @__PURE__ */ ((a) => (a.CLOSE_MODAL = "close-modal", a))(ht || {});
18
+ const vt = () => {
19
+ const a = q(), e = (o, t) => Object.fromEntries(Object.entries(o).filter(([s]) => t(s)));
20
+ return {
21
+ getAriaAttributes: (o) => e(o ?? a, (t) => t.startsWith("aria-")),
22
+ getRootAttributes: (o) => e(o ?? a, (t) => !t.startsWith("aria-"))
23
+ };
24
+ };
25
+ var yt = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.DIALOG = "dialog", a))(yt || {}), bt = /* @__PURE__ */ ((a) => (a.DEFAULT = "BentoModalDefault", a.DIALOG = "BentoModalDialog", a))(bt || {}), k = /* @__PURE__ */ ((a) => (a.SMALL = "small", a.MEDIUM = "medium", a.LARGE = "large", a))(k || {}), L = /* @__PURE__ */ ((a) => (a.SMALLER = "smaller", a.EQUAL = "equal", a.BIGGER = "bigger", a))(L || {}), T = /* @__PURE__ */ ((a) => (a.DIALOG = "dialog", a.ALERT_DIALOG = "alertdialog", a))(T || {}), Ct = /* @__PURE__ */ ((a) => (a.CONFIRMATION = "confirmation", a.DESTRUCTIVE = "destructive", a.INFO = "info", a.ACKNOWLEDGEMENT = "acknowledgement", a))(Ct || {}), ht = /* @__PURE__ */ ((a) => (a.CLOSE_MODAL = "close-modal", a))(ht || {});
19
26
  const Lt = {
20
27
  "de-DE": { ariaLabelFallback: "Modal", close: "Schließen" },
21
28
  "en-GB": { ariaLabelFallback: "modal", close: "Close" },
@@ -28,7 +35,7 @@ const Lt = {
28
35
  "ja-JP": { ariaLabelFallback: "モーダル", close: "閉じる" },
29
36
  "pt-BR": { ariaLabelFallback: "modal", close: "Fechar" },
30
37
  "zh-CN": { ariaLabelFallback: "模态", close: "关闭" }
31
- }, Y = /* @__PURE__ */ Symbol("modal config data injection key"), At = I({}), St = /* @__PURE__ */ I({
38
+ }, J = /* @__PURE__ */ Symbol("modal config data injection key"), At = I({}), St = /* @__PURE__ */ I({
32
39
  ...At,
33
40
  __name: "modal-page",
34
41
  props: {
@@ -42,30 +49,30 @@ const Lt = {
42
49
  previousPage: { default: void 0 }
43
50
  },
44
51
  setup(a) {
45
- const e = a, o = 26, t = H(), n = J(t), d = c(null), A = l(() => ({
52
+ const e = a, o = 26, t = W(), s = j(t), _ = u(null), B = l(() => ({
46
53
  "b-modal-page--custom-padding": e.customPadding
47
- })), S = l(() => ({
48
- "b-modal-page__content--with-header": n("default"),
49
- "b-modal-page__content--with-actions": n("actions") || e.actions?.length
50
- })), B = l(() => {
54
+ })), A = l(() => ({
55
+ "b-modal-page__content--with-header": s("default"),
56
+ "b-modal-page__content--with-actions": s("actions") || e.actions?.length
57
+ })), D = l(() => {
51
58
  if (!e.customPadding)
52
59
  return {};
53
- const C = {
60
+ const r = {
54
61
  paddingLeft: e.customPadding,
55
62
  paddingRight: e.customPadding
56
- }, i = { ...C, paddingTop: void 0, paddingBottom: void 0 };
57
- return n("default") || (i.paddingTop = e.customPadding), n("actions") || (i.paddingBottom = e.customPadding), {
63
+ }, c = { ...r, paddingTop: void 0, paddingBottom: void 0 };
64
+ return s("default") || (c.paddingTop = e.customPadding), s("actions") || (c.paddingBottom = e.customPadding), {
58
65
  header: {
59
- ...C,
66
+ ...r,
60
67
  paddingTop: e.customPadding,
61
68
  paddingRight: `${parseInt(e.customPadding, 10) + o}px`,
62
69
  flex: 1
63
70
  },
64
- content: i,
65
- actions: { ...C, paddingBottom: e.customPadding },
71
+ content: c,
72
+ actions: { ...r, paddingBottom: e.customPadding },
66
73
  backButton: { top: e.customPadding, paddingLeft: e.customPadding }
67
74
  };
68
- }), r = l(() => e.withColumnLayout && b.value === k.LARGE), m = l(() => e.columnsSize === L.SMALLER ? [
75
+ }), i = l(() => e.withColumnLayout && v.value === k.LARGE), m = l(() => e.columnsSize === L.SMALLER ? [
69
76
  { small: 4, medium: 4, large: 4 },
70
77
  { small: 8, medium: 8, large: 8 }
71
78
  ] : e.columnsSize === L.BIGGER ? [
@@ -74,25 +81,25 @@ const Lt = {
74
81
  ] : [
75
82
  { small: 6, medium: 6, large: 6 },
76
83
  { small: 6, medium: 6, large: 6 }
77
- ]), { activePage: p, height: f, isAnimationActive: u, pageCustomPadding: P, showCloseButton: D, size: b } = Q(Y), v = l(() => p.value === e.pageId || !p.value);
78
- let y = null;
79
- return T(
84
+ ]), { activePage: p, height: f, isAnimationActive: d, pageCustomPadding: S, showCloseButton: P, size: v } = Q(J), y = l(() => p.value === e.pageId || !p.value);
85
+ let b = null;
86
+ return G(
80
87
  () => p.value,
81
- async (C, i) => {
82
- v.value && (await X(), f.value = `${d.value?.$el?.clientHeight}px`, P.value = e.customPadding, u.value = i !== void 0, y = ft(d.value, () => {
83
- const g = `${d.value?.$el?.clientHeight}px`;
84
- g && g !== f.value && (f.value = g);
88
+ async (r, c) => {
89
+ y.value && (await X(), f.value = `${_.value?.$el?.clientHeight}px`, S.value = e.customPadding, d.value = c !== void 0, b = pt(_.value, () => {
90
+ const C = `${_.value?.$el?.clientHeight}px`;
91
+ C && C !== f.value && (f.value = C);
85
92
  }));
86
93
  },
87
94
  { immediate: !0 }
88
95
  ), Z(() => {
89
- y?.disconnect();
90
- }), { __sfc: !0, CLOSE_BUTTON_ICON_WIDTH: o, slots: t, hasSlot: n, page: d, props: e, modalPageConditionalClasses: A, modalContentConditionalClasses: S, customPaddingStyles: B, hasColumnLayout: r, computedColumnWidth: m, activePage: p, height: f, isAnimationActive: u, pageCustomPadding: P, showCloseButton: D, size: b, isCurrentPage: v, pageElementObserver: y, BentoTypography: dt, GridLayout: _t, GridLayoutContainerType: gt, FooterActions: mt, DialogPage: pt };
96
+ b?.disconnect();
97
+ }), { __sfc: !0, CLOSE_BUTTON_ICON_WIDTH: o, slots: t, hasSlot: s, page: _, props: e, modalPageConditionalClasses: B, modalContentConditionalClasses: A, customPaddingStyles: D, hasColumnLayout: i, computedColumnWidth: m, activePage: p, height: f, isAnimationActive: d, pageCustomPadding: S, showCloseButton: P, size: v, isCurrentPage: y, pageElementObserver: b, BentoTypography: ut, GridLayout: gt, GridLayoutContainerType: ft, FooterActions: dt, DialogPage: mt };
91
98
  }
92
99
  });
93
100
  var Pt = function() {
94
101
  var e = this, o = e._self._c, t = e._self._setupProxy;
95
- return o(t.DialogPage, { ref: "page", staticClass: "b-modal-page", class: t.modalPageConditionalClasses, attrs: { "page-id": e.pageId, "always-show-border": t.hasColumnLayout, "back-button-styling": t.customPaddingStyles?.backButton, "previous-page": e.previousPage }, on: { animationend: function(n) {
102
+ return o(t.DialogPage, { ref: "page", staticClass: "b-modal-page", class: t.modalPageConditionalClasses, attrs: { "page-id": e.pageId, "always-show-border": t.hasColumnLayout, "back-button-styling": t.customPaddingStyles?.backButton, "previous-page": e.previousPage }, on: { animationend: function(s) {
96
103
  t.isAnimationActive = !1;
97
104
  } }, scopedSlots: e._u([t.hasSlot("default") || t.showCloseButton ? { key: "header", fn: function() {
98
105
  return [o("div", { staticClass: "b-modal-page__header-container", style: t.customPaddingStyles.header }, [o("div", { staticClass: "b-modal-page__header" }, [o(t.BentoTypography, { staticClass: "b-modal-page__title", attrs: { el: "span", variant: "title", stronger: "" } }, [t.hasSlot("default") ? e._t("default") : e._e()], 2)], 1)])];
@@ -107,7 +114,7 @@ var Pt = function() {
107
114
  }, proxy: !0 } : e.actions && e.actions.length > 0 ? { key: "footer", fn: function() {
108
115
  return [o("div", { staticClass: "b-modal-page__actions-container", style: t.customPaddingStyles.actions }, [o(t.FooterActions, { attrs: { actions: e.actions, "actions-label": e.actionsLabel, "destructive-actions": e.destructiveActions } })], 1)];
109
116
  }, proxy: !0 } : null], null, !0) });
110
- }, Et = [], Ot = /* @__PURE__ */ K(
117
+ }, Et = [], Ot = /* @__PURE__ */ H(
111
118
  St,
112
119
  Pt,
113
120
  Et,
@@ -117,7 +124,8 @@ var Pt = function() {
117
124
  );
118
125
  const kt = Ot.exports, It = I({
119
126
  i18n: { messages: Lt },
120
- name: "base-modal"
127
+ name: "base-modal",
128
+ inheritAttrs: !1
121
129
  }), Bt = /* @__PURE__ */ I({
122
130
  ...It,
123
131
  props: {
@@ -195,7 +203,7 @@ const kt = Ot.exports, It = I({
195
203
  /**
196
204
  * Defines whether the modal will be an alert modal
197
205
  */
198
- modalRole: { type: String, default: R.DIALOG },
206
+ modalRole: { type: String, default: T.DIALOG },
199
207
  /**
200
208
  * Sets the width of the modal
201
209
  */
@@ -210,66 +218,66 @@ const kt = Ot.exports, It = I({
210
218
  },
211
219
  emits: ["update:active-page", "close-modal"],
212
220
  setup(a, { expose: e, emit: o }) {
213
- const t = a, n = 500, { t: d } = nt(), A = H(), S = V(), B = J(A), r = c(null), m = c(!1), p = lt("modal"), f = l(() => t.isDismissible && !t.hideCloseButton), u = c(t.customPadding), P = l(() => u.value ? { top: u.value, right: u.value } : {}), D = l(() => S["aria-label"] ?? d("ariaLabelFallback")), b = l(() => t.withColumnLayout && t.size === k.LARGE), v = () => {
214
- r.value.showModal();
221
+ const t = a, s = 500, { t: _ } = ot(), { getRootAttributes: B } = vt(), A = W(), D = j(A), i = u(null), m = u(!1), p = nt("modal"), f = l(() => t.isDismissible && !t.hideCloseButton), d = u(t.customPadding), S = l(() => d.value ? { top: d.value, right: d.value } : {}), P = l(() => t.withColumnLayout && t.size === k.LARGE), v = () => {
222
+ i.value.showModal();
215
223
  }, y = () => {
216
224
  o("close-modal");
225
+ }, b = () => {
226
+ m.value && i.value && (i.value.close(), g.value[0] && o("update:active-page", g.value[0]), g.value = [], m.value = !1, y());
227
+ }, r = () => {
228
+ i.value.open && (m.value = !0);
229
+ }, c = (n) => {
230
+ n && n.preventDefault(), !(!t.isDismissible && t.modalRole === T.DIALOG) && r();
217
231
  }, C = () => {
218
- m.value && r.value && (r.value.close(), _.value[0] && o("update:active-page", _.value[0]), _.value = [], m.value = !1, y());
219
- }, i = () => {
220
- r.value.open && (m.value = !0);
221
- }, g = (s) => {
222
- s && s.preventDefault(), !(!t.isDismissible && t.modalRole === R.DIALOG) && i();
223
- }, q = () => {
224
- t.isDismissible && g();
225
- }, W = l(() => ({
232
+ t.isDismissible && c();
233
+ }, K = l(() => ({
226
234
  [`b-modal-base__container--${t.size}`]: t.size,
227
235
  "b-modal-base__container--hide": m.value,
228
- "b-modal-base__container--column-layout": b.value,
236
+ "b-modal-base__container--column-layout": P.value,
229
237
  "b-modal-base__container--animation": F.value
230
238
  }));
231
- T(
232
- () => [t.isOpen, r.value],
233
- ([s, G], [, j]) => {
234
- if (!G)
239
+ G(
240
+ () => [t.isOpen, i.value],
241
+ ([n, R], [, Y]) => {
242
+ if (!R)
235
243
  return;
236
- s ? (v(), _.value.length || _.value.push(E.value)) : !j || i();
244
+ n ? (v(), g.value.length || g.value.push(E.value)) : !Y || r();
237
245
  }
238
- ), T(
246
+ ), G(
239
247
  () => t.actions,
240
248
  () => {
241
- t.actions?.[0]?.state === "success" && setTimeout(i, n);
249
+ t.actions?.[0]?.state === "success" && setTimeout(r, s);
242
250
  },
243
251
  { deep: !0 }
244
- ), tt(() => {
245
- t.isOpen && r.value && v();
252
+ ), V(() => {
253
+ t.isOpen && i.value && v();
246
254
  }), e({
247
- internalModalActionClose: g
255
+ internalModalActionClose: c
248
256
  }), O(st, p);
249
- const { activePage: E, isOpen: M, size: x } = et(t), N = c(rt.TRANSITION_LEVEL_DEEPER), h = c([]), _ = c([]), w = (s) => o("update:active-page", s), z = (s) => () => {
250
- h.value = h.value?.filter((G) => G !== s);
251
- }, U = (s) => (s && h.value.push(s), { unregisterPage: z(s) }), $ = c(""), F = c(!1);
252
- return O(Y, {
257
+ const { activePage: E, isOpen: M, size: x } = tt(t), N = u(it.TRANSITION_LEVEL_DEEPER), h = u([]), g = u([]), w = (n) => o("update:active-page", n), z = (n) => () => {
258
+ h.value = h.value?.filter((R) => R !== n);
259
+ }, $ = (n) => (n && h.value.push(n), { unregisterPage: z(n) }), U = u(""), F = u(!1);
260
+ return O(J, {
253
261
  activePage: E,
254
- height: $,
262
+ height: U,
255
263
  isAnimationActive: F,
256
- pageCustomPadding: u,
264
+ pageCustomPadding: d,
257
265
  showCloseButton: f,
258
266
  size: x
259
- }), O(ct, {
267
+ }), O(rt, {
260
268
  activePage: E,
261
269
  animation: N,
262
270
  isOpen: M,
263
271
  pages: h,
264
- previousPages: _,
272
+ previousPages: g,
265
273
  updatePage: w
266
- }), O(ut, U), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: n, t: d, slots: A, attrs: S, hasSlot: B, modal: r, isClosing: m, modalId: p, emit: o, props: t, showCloseButton: f, pageCustomPadding: u, customPaddingStyles: P, computedAriaLabel: D, hasColumnLayout: b, openModal: v, emitCloseEvent: y, closeModalAfterAnimation: C, startCloseModalAnimation: i, internalModalActionClose: g, closeModalOnClickOutside: q, modalConditionalClasses: W, activePage: E, isOpen: M, size: x, animation: N, pages: h, previousPages: _, updatePage: w, unregisterPage: z, registerPage: U, height: $, isAnimationActive: F, BentoButton: at, BentoFocusTrap: ot, vBentoClickOutsideDirective: vt, BentoModalPage: kt, CrossIcon: it };
274
+ }), O(ct, $), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: s, t: _, getRootAttributes: B, slots: A, hasSlot: D, modal: i, isClosing: m, modalId: p, emit: o, props: t, showCloseButton: f, pageCustomPadding: d, customPaddingStyles: S, hasColumnLayout: P, openModal: v, emitCloseEvent: y, closeModalAfterAnimation: b, startCloseModalAnimation: r, internalModalActionClose: c, closeModalOnClickOutside: C, modalConditionalClasses: K, activePage: E, isOpen: M, size: x, animation: N, pages: h, previousPages: g, updatePage: w, unregisterPage: z, registerPage: $, height: U, isAnimationActive: F, BentoButton: et, BentoFocusTrap: at, vBentoClickOutsideDirective: _t, BentoModalPage: kt, CrossIcon: lt };
267
275
  }
268
276
  });
269
277
  var Dt = function() {
270
278
  var e = this, o = e._self._c, t = e._self._setupProxy;
271
- return o("div", { staticClass: "b-modal-base" }, [o("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: t.modalConditionalClasses, style: { height: t.height }, attrs: { role: e.modalRole, "aria-label": t.computedAriaLabel, open: e.initiallyOpen }, on: { animationend: t.closeModalAfterAnimation, keydown: function(n) {
272
- return !n.type.indexOf("key") && e._k(n.keyCode, "esc", 27, n.key, ["Esc", "Escape"]) ? null : t.internalModalActionClose.apply(null, arguments);
279
+ return o("div", e._b({ staticClass: "b-modal-base" }, "div", t.getRootAttributes(e.$attrs), !1), [o("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: t.modalConditionalClasses, style: { height: t.height }, attrs: { role: e.modalRole, "aria-label": e.$attrs?.["aria-label"] ?? t.t("ariaLabelFallback"), open: e.initiallyOpen }, on: { animationend: t.closeModalAfterAnimation, keydown: function(s) {
280
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : t.internalModalActionClose.apply(null, arguments);
273
281
  } } }, [t.isOpen || e.initiallyOpen ? o(t.BentoFocusTrap, { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: t.closeModalOnClickOutside, expression: "closeModalOnClickOutside" }], attrs: { id: t.modalId } }, [t.showCloseButton ? o(t.BentoButton, { staticClass: "b-modal-base__close-button", style: t.customPaddingStyles, attrs: { variant: "tertiary", type: "button" }, on: { click: t.internalModalActionClose } }, [o(t.CrossIcon, { attrs: { "svg-title": t.t("close") } })], 1) : e._e(), t.props.activePage ? [e._t("default")] : o(t.BentoModalPage, { attrs: { "with-column-layout": e.withColumnLayout, size: t.size, "custom-padding": e.customPadding, "columns-size": e.columnsSize }, scopedSlots: e._u([t.hasSlot("default") ? { key: "default", fn: function() {
274
282
  return [e._t("default")];
275
283
  }, proxy: !0 } : null, t.hasSlot("content-col-1") ? { key: "content-col-1", fn: function() {
@@ -281,24 +289,24 @@ var Dt = function() {
281
289
  }, proxy: !0 } : null, t.hasSlot("actions") ? { key: "actions", fn: function() {
282
290
  return [e._t("actions")];
283
291
  }, proxy: !0 } : null], null, !0) })], 2) : e._e()], 1)]);
284
- }, Ft = [], Gt = /* @__PURE__ */ K(
292
+ }, Ft = [], Rt = /* @__PURE__ */ H(
285
293
  Bt,
286
294
  Dt,
287
295
  Ft,
288
296
  !1,
289
297
  null,
290
- "ba2fa45c"
298
+ "47207cc7"
291
299
  );
292
- const Xt = Gt.exports;
300
+ const Xt = Rt.exports;
293
301
  export {
294
302
  L as B,
295
- bt as a,
303
+ Ct as a,
296
304
  ht as b,
297
305
  kt as c,
298
- R as d,
306
+ T as d,
299
307
  k as e,
300
308
  yt as f,
301
- Ct as g,
309
+ bt as g,
302
310
  Xt as h
303
311
  };
304
- //# sourceMappingURL=base-modal.DsqIEM0p.js.map
312
+ //# sourceMappingURL=base-modal.CcmoTJdc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.CcmoTJdc.js","sources":["../../src/composables/use-attribute-routing/use-attribute-routing.ts","../../src/components/modal/modal.types.ts","../../src/components/modal/modal.keys.ts","../../src/components/modal/components/modal-page/modal-page.vue","../../src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["import { type SetupContext, useAttrs } from 'vue';\n\nexport type Attributes = SetupContext['attrs'];\n\nexport interface AttributeRouting {\n getAriaAttributes: (attrs?: Attributes) => Attributes;\n getRootAttributes: (attrs?: Attributes) => Attributes;\n}\n\n/**\n * Routes ARIA attributes away from a component root to its semantic element.\n *\n * @returns Functions that return ARIA and root attribute groups.\n */\nexport const useAttributeRouting = (): AttributeRouting => {\n const attrs = useAttrs();\n\n const filterAttrs = (attrsArg: Attributes, shouldInclude: (key: string) => boolean): Attributes =>\n Object.fromEntries(Object.entries(attrsArg).filter(([key]) => shouldInclude(key)));\n\n return {\n getAriaAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => key.startsWith('aria-')),\n getRootAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => !key.startsWith('aria-')),\n };\n};\n","/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","export const MODAL_CONFIG_INJECTION_KEY = Symbol('modal config data injection key');\n","<template>\n <dialog-page\n ref=\"page\"\n class=\"b-modal-page\"\n :class=\"modalPageConditionalClasses\"\n :page-id=\"pageId\"\n :always-show-border=\"hasColumnLayout\"\n :back-button-styling=\"customPaddingStyles?.backButton\"\n :previous-page=\"previousPage\"\n @animationend=\"isAnimationActive = false\"\n >\n <template v-if=\"hasSlot('default') || showCloseButton\" #header>\n <div class=\"b-modal-page__header-container\" :style=\"customPaddingStyles.header\">\n <div class=\"b-modal-page__header\">\n <bento-typography class=\"b-modal-page__title\" el=\"span\" variant=\"title\" stronger>\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n </div>\n </div>\n </template>\n\n <template #content>\n <div\n class=\"b-modal-page__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n el=\"div\"\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-page__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"hasSlot('actions')\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <div aria-label=\"modal actions\" class=\"b-modal-page__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </template>\n <template v-else-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, nextTick, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoTypography } from '@/components/typography';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n\n import { FooterActions } from '@/components/internal/footer-actions';\n\n import DialogPage from '@/internal/dialog-page/dialog-page.vue';\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import type { BentoModalPageProps } from './modal-page.types';\n\n const CLOSE_BUTTON_ICON_WIDTH = 26;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const page = ref<InstanceType<typeof DialogPage>>(null);\n\n const props = defineProps({\n actions: { default: null },\n actionsLabel: { default: null },\n columnsSize: { default: BentoModalColumnLayoutVariant.SMALLER },\n customPadding: { default: null },\n destructiveActions: { type: Boolean, default: false },\n withColumnLayout: { type: Boolean, default: false },\n pageId: { default: undefined },\n previousPage: { default: undefined }\n});\n\n const modalPageConditionalClasses = computed(() => ({\n 'b-modal-page--custom-padding': props.customPadding,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-page__content--with-header': hasSlot('default'),\n 'b-modal-page__content--with-actions': hasSlot('actions') || props.actions?.length,\n }));\n\n // Setting custom padding styles\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: {\n ...xPadding,\n paddingTop: props.customPadding,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n flex: 1,\n },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n backButton: { top: props.customPadding, paddingLeft: props.customPadding },\n };\n });\n\n // Column layout styles\n const hasColumnLayout = computed(() => props.withColumnLayout && size.value === BentoModalSize.LARGE);\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n // Register page to parent component and inject data from parent component\n const { activePage, height, isAnimationActive, pageCustomPadding, showCloseButton, size } =\n inject<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY);\n\n const isCurrentPage = computed(() => activePage.value === props.pageId || !activePage.value);\n\n // Animation\n // Set resize observer on mount of update the height of the dialog on resize\n let pageElementObserver: ResizeObserver | null = null;\n\n // Watching activePage changes to set the height of the page and set isAnimationActive\n watch(\n () => activePage.value,\n async (value, oldValue) => {\n if (isCurrentPage.value) {\n await nextTick();\n height.value = `${page.value?.$el?.clientHeight}px`;\n pageCustomPadding.value = props.customPadding;\n // only set isAnimationActive to true if its going from two different pages and not from null to the first page\n isAnimationActive.value = oldValue !== undefined;\n\n pageElementObserver = observeSizeOfElement(page.value, () => {\n const pageHeight = `${page.value?.$el?.clientHeight}px`;\n if (pageHeight && pageHeight !== height.value) {\n height.value = pageHeight;\n }\n });\n }\n },\n { immediate: true }\n );\n\n // Disconnect observer on unmounting the page\n onUnmounted(() => {\n pageElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalPage is used to render different pages of the Modal component\n *\n * @example\n * import { BentoModal, BentoModalPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal, BentoModalPage },\n * template: `\n * <bento-modal active-page='page1' :is-open='true'>\n * <bento-modal-page\n * pageId='page1'\n * actions-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1\n * <template #content>\n * Page 1 content\n * </template>\n * </bento-modal-page>\n * <bento-modal-page\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2\n * <template #content>\n * Page 2 content\n * </template>\n * </bento-modal-page>\n * </bento-modal>\n * `\n * }\n */\n export default defineComponent({});\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-page.scss\" />\n","<template>\n <div v-bind=\"getRootAttributes($attrs)\" class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"$attrs?.['aria-label'] ?? t('ariaLabelFallback')\"\n :style=\"{ height: height }\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap\n v-if=\"isOpen || initiallyOpen\"\n :id=\"modalId\"\n v-bento-click-outside-directive=\"closeModalOnClickOutside\"\n >\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-page\n v-else\n :with-column-layout=\"withColumnLayout\"\n :size=\"size\"\n :custom-padding=\"customPadding\"\n :columns-size=\"columnsSize\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1\n ><slot name=\"content-col-1\"></slot\n ></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2\n ><slot name=\"content-col-2\"></slot\n ></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n <template v-if=\"hasSlot('actions')\" #actions><slot name=\"actions\"></slot></template>\n </bento-modal-page>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoButton, type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { useAttributeRouting, useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n import messages from './messages.json';\n\n import { BentoModalPage } from '@/components/modal/components/modal-page';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const { getRootAttributes } = useAttributeRouting();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const pageCustomPadding = ref(props.customPadding);\n\n const customPaddingStyles = computed(() => {\n if (!pageCustomPadding.value) {\n return {};\n }\n\n return { top: pageCustomPadding.value, right: pageCustomPadding.value };\n });\n\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit('close-modal');\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emitCloseEvent();\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n const closeModalOnClickOutside = () => {\n if (props.isDismissible) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n 'b-modal-base__container--animation': isAnimationActive.value,\n }));\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n // add the first page to the array when the modal opens\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n\n // Modal pagination\n const { activePage, isOpen, size } = toRefs(props);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n const height = ref('');\n const isAnimationActive = ref(false);\n\n provide<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY, {\n activePage,\n height,\n isAnimationActive,\n pageCustomPadding,\n showCloseButton,\n size,\n });\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["useAttributeRouting","attrs","useAttrs","filterAttrs","attrsArg","shouldInclude","key","overrideAttrs","BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","MODAL_CONFIG_INJECTION_KEY","__default__$1","defineComponent","CLOSE_BUTTON_ICON_WIDTH","slots","useSlots","hasSlot","useHasSlot","page","ref","modalPageConditionalClasses","computed","props","modalContentConditionalClasses","customPaddingStyles","xPadding","content","hasColumnLayout","size","computedColumnWidth","activePage","height","isAnimationActive","pageCustomPadding","showCloseButton","inject","isCurrentPage","pageElementObserver","watch","value","oldValue","nextTick","observeSizeOfElement","pageHeight","onUnmounted","__default__","messages","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","t","useI18n","getRootAttributes","modal","isClosing","modalId","generateUid","openModal","emitCloseEvent","emit","closeModalAfterAnimation","previousPages","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","modalConditionalClasses","newIsOpen","newModalValue","oldModalValue","onMounted","expose","provide","MODAL_DIALOG_ID_INJECTION_KEY","isOpen","toRefs","animation","BentoDialogPageAnimation","pages","updatePage","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,MAAA;AACH,QAAAC,IAAAC,EAAA,GAEAC,IAAA,CAAAC,GAAAC,MAAA,OAAA,YAAA,OAAA,QAAAD,CAAA,EAAA,OAAA,CAAA,CAAAE,CAAA,MAAAD,EAAAC,CAAA,CAAA,CAAA;AAGA,SAAA;AAAA,IAAO,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,IACmG,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAA,CAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,EACC;AAE/G;ACrBO,IAAAE,KAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,SAAA,UAFQA,IAAAD,MAAA,CAAA,CAAA,GAQLE,KAAA,kBAAAC,OACHA,EAAA,UAAA,q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a,0BAAAR;AAAA,IACT,CAAA,GAIJS,EAAAC,IAAAlB,CAAA;AAGA,UAAA,EAAA,YAAAvB,GAAA,QAAA0C,GAAA,MAAA5C,EAAA,IAAA6C,GAAAnD,CAAA,GACAoD,IAAAvD,EAAAwD,GAAA,uBAAA,GAEAC,IAAAzD,EAAA,CAAA,CAAA,GACAwC,IAAAxC,EAAA,CAAA,CAAA,GAEA0D,IAAA,CAAA3D,MAAAuC,EAAA,sBAAAvC,CAAA,GAGA4D,IAAA,CAAAC,MAAA,MAAA;AACI,MAAAH,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAI,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIJ,EAAA,MAAA,KAAAI,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA,IAGJjD,IAAAZ,EAAA,EAAA,GACAa,IAAAb,EAAA,EAAA;AAEA,WAAAmD,EAAA5D,GAAA;AAAA,MAA0D,YAAAoB;AAAA,MACtD,QAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAN;AAAA,IACA,CAAA,GAGJ0C,EAAAY,IAAA;AAAA,MAAqE,YAAApD;AAAA,MACjE,WAAA4C;AAAA,MACA,QAAAF;AAAA,MACA,OAAAI;AAAA,MACA,eAAAjB;AAAA,MACA,YAAAkB;AAAA,IACA,CAAA,GAGJP,EAAAa,IAAAF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ref as _, watch as m, nextTick as v, defineComponent as h, toRef as b, computed as f, provide as A } from "vue";
2
- import { M as w, d as y, f as B, B as C } from "./button-actions.CFOxzahr.js";
2
+ import { M as w, d as y, f as B, B as C } from "./button-actions.bkcLUE1G.js";
3
3
  import { b as M } from "./index.CL3TXc0a.js";
4
4
  import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
5
5
  import "../assets/button-actions-with-menu.css";
@@ -74,4 +74,4 @@ const S = k.exports;
74
74
  export {
75
75
  S as B
76
76
  };
77
- //# sourceMappingURL=button-actions-with-menu.BBuKZYuH.js.map
77
+ //# sourceMappingURL=button-actions-with-menu.BY394ars.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.BBuKZYuH.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, ref, type Ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: Ref<number>;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref(defaultActionsCount.value);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount.value) {\n displayedActionsCount.value += 1;\n\n await showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n await hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n await showActions();\n } else {\n await hideActions();\n }\n });\n\n watch(defaultActionsCount, async count => {\n displayedActionsCount.value = count;\n\n if (breakpoint && windowWidth.value <= breakpoint && container.value) {\n await hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions } from '@/components/button';\n import { type BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { computed, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { type ButtonActionsWithMenuProps } from './button-actions-with-menu.types';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n const props = defineProps({\n actions: null,\n actionsLayout: { default: 'buttons-end' },\n disableResponsiveBehavior: { type: Boolean, default: false },\n displayedActions: { default: undefined },\n inverse: { type: Boolean, default: false },\n hideDisplayedActionsBreakpoint: { default: 0 },\n menuPosition: { default: 'bottom-start' }\n});\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: toRef(props, 'displayedActions'),\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]: props.actionsLayout === 'buttons-end',\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]: props.actionsLayout === 'buttons-start',\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() => {\n if (displayedActionsCount.value === undefined || displayedActionsCount.value >= props.actions.length) {\n return [];\n }\n\n const actionsToProcess = props.actions.slice(displayedActionsCount.value, props.actions.length);\n\n return actionsToProcess.flatMap<BentoMenuItem>(action => {\n if (!action.data) {\n return {\n text: action.title,\n handler: () => action.event?.({} as Event),\n icon: action.icon,\n critical: action.critical,\n disabled: action.disabled,\n };\n }\n\n return action.data;\n });\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * {\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * },\n * {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\"\n * :displayedActions=\"2\"\n * />\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","computedMenuActions","action"],"mappings":";;;;;AAUO,MAAAA,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,EAAA,KAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA,KAAAK;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,EAAA,UACII,EAAA,SAAA,GAEA,MAAAG,EAAA;AAAA,EACJ,GAGJI,IAAA,YAAA;AACI,UAAAH,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA;AAGA,IAAAQ,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEA,MAAAO,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAV,GAAAH,CAAA,GAAA,OAAA,CAAAc,GAAAC,CAAA,GAAA,CAAAC,CAAA,MAAA;AACI,QAAA,CAAAD,KAAA,CAAAd,KAAAa,IAAAf;AACI;AAGJ,UAAAU,EAAA,GAEAK,IAAAE,IAGI,MAAAR,EAAA,IAEA,MAAAI,EAAA;AAAA,EACJ,CAAA,GAGJC,EAAAZ,GAAA,OAAAgB,MAAA;AACI,IAAAZ,EAAA,QAAAY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AA,MACI,UAAAA,EAAA;AAAA,IACA,CAIX,CACjB;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-actions-with-menu.BY394ars.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, ref, type Ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: Ref<number>;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref(defaultActionsCount.value);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount.value) {\n displayedActionsCount.value += 1;\n\n await showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n await hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n await showActions();\n } else {\n await hideActions();\n }\n });\n\n watch(defaultActionsCount, async count => {\n displayedActionsCount.value = count;\n\n if (breakpoint && windowWidth.value <= breakpoint && container.value) {\n await hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions } from '@/components/button';\n import { type BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { computed, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { type ButtonActionsWithMenuProps } from './button-actions-with-menu.types';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n const props = defineProps({\n actions: null,\n actionsLayout: { default: 'buttons-end' },\n disableResponsiveBehavior: { type: Boolean, default: false },\n displayedActions: { default: undefined },\n inverse: { type: Boolean, default: false },\n hideDisplayedActionsBreakpoint: { default: 0 },\n menuPosition: { default: 'bottom-start' }\n});\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: toRef(props, 'displayedActions'),\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]: props.actionsLayout === 'buttons-end',\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]: props.actionsLayout === 'buttons-start',\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() => {\n if (displayedActionsCount.value === undefined || displayedActionsCount.value >= props.actions.length) {\n return [];\n }\n\n const actionsToProcess = props.actions.slice(displayedActionsCount.value, props.actions.length);\n\n return actionsToProcess.flatMap<BentoMenuItem>(action => {\n if (!action.data) {\n return {\n text: action.title,\n handler: () => action.event?.({} as Event),\n icon: action.icon,\n critical: action.critical,\n disabled: action.disabled,\n };\n }\n\n return action.data;\n });\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * {\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * },\n * {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\"\n * :displayedActions=\"2\"\n * />\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","computedMenuActions","action"],"mappings":";;;;;AAUO,MAAAA,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,EAAA,KAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA,KAAAK;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,EAAA,UACII,EAAA,SAAA,GAEA,MAAAG,EAAA;AAAA,EACJ,GAGJI,IAAA,YAAA;AACI,UAAAH,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA;AAGA,IAAAQ,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEA,MAAAO,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAV,GAAAH,CAAA,GAAA,OAAA,CAAAc,GAAAC,CAAA,GAAA,CAAAC,CAAA,MAAA;AACI,QAAA,CAAAD,KAAA,CAAAd,KAAAa,IAAAf;AACI;AAGJ,UAAAU,EAAA,GAEAK,IAAAE,IAGI,MAAAR,EAAA,IAEA,MAAAI,EAAA;AAAA,EACJ,CAAA,GAGJC,EAAAZ,GAAA,OAAAgB,MAAA;AACI,IAAAZ,EAAA,QAAAY,GAEAlB,KAAAI,EAAA,SAAAJ,KAAAC,EAAA,SACI,MAAAY,EAAA;AAAA,EACJ,CAAA,GAGJ;AAAA,IAAO,uBAAAP;A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