@adyen/bento-vue3 1.72.0 → 1.74.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 (333) hide show
  1. package/dist/@types/components.d.ts +2 -10
  2. package/dist/@types/index.d.ts +1543 -1703
  3. package/dist/@types/use-form-v4.d.ts +1 -1
  4. package/dist/accordion.js +1 -1
  5. package/dist/action-bar.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/assets/accordion-item.css +1 -1
  8. package/dist/assets/action-bar.css +1 -1
  9. package/dist/assets/avatar.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/button.css +1 -1
  13. package/dist/assets/calendar.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/country.css +1 -1
  16. package/dist/assets/currency.css +1 -1
  17. package/dist/assets/data-grid-template.css +1 -1
  18. package/dist/assets/data-grid.css +1 -1
  19. package/dist/assets/date-picker.css +1 -1
  20. package/dist/assets/date-range-picker.css +1 -1
  21. package/dist/assets/dialog-page.css +1 -1
  22. package/dist/assets/dropdown-default-textbox.css +1 -1
  23. package/dist/assets/dropdown-tag.css +1 -1
  24. package/dist/assets/dropdown.css +1 -1
  25. package/dist/assets/file-uploader.css +1 -1
  26. package/dist/assets/filter-bar.css +1 -1
  27. package/dist/assets/form-layout-title.css +1 -1
  28. package/dist/assets/header-meta.css +1 -1
  29. package/dist/assets/header-with-views.css +1 -1
  30. package/dist/assets/input-field-password.css +1 -1
  31. package/dist/assets/input-field-phone-number.css +1 -1
  32. package/dist/assets/input-field.css +1 -1
  33. package/dist/assets/inspector.css +1 -1
  34. package/dist/assets/listbox-option-tag.css +1 -1
  35. package/dist/assets/loading-indicator.css +1 -1
  36. package/dist/assets/modal-fullscreen.css +1 -1
  37. package/dist/assets/pagination.css +1 -1
  38. package/dist/assets/popper-container.css +1 -1
  39. package/dist/assets/radio-group.css +1 -1
  40. package/dist/assets/radio-input.css +1 -1
  41. package/dist/assets/secondary-nav.css +1 -1
  42. package/dist/assets/segmented-control.css +1 -1
  43. package/dist/assets/selection-card-group.css +1 -1
  44. package/dist/assets/sidepanel.css +1 -1
  45. package/dist/assets/step.css +1 -1
  46. package/dist/assets/tab.css +1 -1
  47. package/dist/assets/textarea.css +1 -1
  48. package/dist/assets/timeline-item.css +1 -1
  49. package/dist/assets/toggle.css +1 -1
  50. package/dist/assets/tooltip.css +1 -1
  51. package/dist/assets/tutorial.css +1 -1
  52. package/dist/assets/use-cached-selected-values.css +1 -1
  53. package/dist/avatar.js +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.6etqAJV9.js → accordion-item.Bd3v6erb.js} +2 -2
  59. package/dist/chunks/{accordion-item.6etqAJV9.js.map → accordion-item.Bd3v6erb.js.map} +1 -1
  60. package/dist/chunks/{action-bar.DDLTN9TB.js → action-bar.BZ04Y7Yi.js} +5 -5
  61. package/dist/chunks/{action-bar.DDLTN9TB.js.map → action-bar.BZ04Y7Yi.js.map} +1 -1
  62. package/dist/chunks/{ai-button.DsNrcgpK.js → ai-button.DaRuea3x.js} +2 -2
  63. package/dist/chunks/{ai-button.DsNrcgpK.js.map → ai-button.DaRuea3x.js.map} +1 -1
  64. package/dist/chunks/{alert.Dzx5MzgE.js → alert.C2pusd-_.js} +3 -3
  65. package/dist/chunks/{alert.Dzx5MzgE.js.map → alert.C2pusd-_.js.map} +1 -1
  66. package/dist/chunks/{avatar.Dq59yj6m.js → avatar.P2Fkz2I6.js} +27 -26
  67. package/dist/chunks/avatar.P2Fkz2I6.js.map +1 -0
  68. package/dist/chunks/{base-modal.Djw4pVal.js → base-modal.UA93s_8c.js} +7 -7
  69. package/dist/chunks/base-modal.UA93s_8c.js.map +1 -0
  70. package/dist/chunks/{button-actions-with-menu.DaKPEgPd.js → button-actions-with-menu.BeQ-j1bv.js} +2 -2
  71. package/dist/chunks/{button-actions-with-menu.DaKPEgPd.js.map → button-actions-with-menu.BeQ-j1bv.js.map} +1 -1
  72. package/dist/chunks/{button-actions.D1eBtYgZ.js → button-actions.BQ3AFQqt.js} +13 -16
  73. package/dist/chunks/button-actions.BQ3AFQqt.js.map +1 -0
  74. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
  75. package/dist/chunks/{button.C-MAa6ut.js → button.DhcxX2GJ.js} +2 -2
  76. package/dist/chunks/button.DhcxX2GJ.js.map +1 -0
  77. package/dist/chunks/{calendar.B1a_mV-Q.js → calendar.Cqjyxc69.js} +314 -310
  78. package/dist/chunks/calendar.Cqjyxc69.js.map +1 -0
  79. package/dist/chunks/{card.B9lWURmF.js → card.GxkxfBoV.js} +23 -23
  80. package/dist/chunks/card.GxkxfBoV.js.map +1 -0
  81. package/dist/chunks/{checkbox-group.CcgOK4yt.js → checkbox-group.8ebmaHsA.js} +4 -4
  82. package/dist/chunks/{checkbox-group.CcgOK4yt.js.map → checkbox-group.8ebmaHsA.js.map} +1 -1
  83. package/dist/chunks/{checkbox.73QYC0y8.js → checkbox.BI0dqARY.js} +4 -4
  84. package/dist/chunks/{checkbox.73QYC0y8.js.map → checkbox.BI0dqARY.js.map} +1 -1
  85. package/dist/chunks/{chip.CUwVpPVo.js → chip.DuLyhNCy.js} +2 -2
  86. package/dist/chunks/{chip.CUwVpPVo.js.map → chip.DuLyhNCy.js.map} +1 -1
  87. package/dist/chunks/{code-snippet.DL_1HNKV.js → code-snippet.CO78Nfj0.js} +7 -7
  88. package/dist/chunks/{code-snippet.DL_1HNKV.js.map → code-snippet.CO78Nfj0.js.map} +1 -1
  89. package/dist/chunks/{controls-group.CdTg-WDi.js → controls-group.cbGiHr7n.js} +2 -2
  90. package/dist/chunks/{controls-group.CdTg-WDi.js.map → controls-group.cbGiHr7n.js.map} +1 -1
  91. package/dist/chunks/{copy.Da1OGFTr.js → copy.ClKnDjMI.js} +5 -5
  92. package/dist/chunks/{copy.Da1OGFTr.js.map → copy.ClKnDjMI.js.map} +1 -1
  93. package/dist/chunks/country.DmnN9YIW.js +69 -0
  94. package/dist/chunks/country.DmnN9YIW.js.map +1 -0
  95. package/dist/chunks/country.types.C0Q_hhgJ.js.map +1 -1
  96. package/dist/chunks/{currency.CN4UnCx8.js → currency.CBZMwm21.js} +55 -38
  97. package/dist/chunks/currency.CBZMwm21.js.map +1 -0
  98. package/dist/chunks/{dashboard-section.BXE7_Y9R.js → dashboard-section.CVttsom5.js} +3 -3
  99. package/dist/chunks/{dashboard-section.BXE7_Y9R.js.map → dashboard-section.CVttsom5.js.map} +1 -1
  100. package/dist/chunks/{dashed-underline.28J-9i5D.js → dashed-underline.r62L_XBr.js} +3 -3
  101. package/dist/chunks/{dashed-underline.28J-9i5D.js.map → dashed-underline.r62L_XBr.js.map} +1 -1
  102. package/dist/chunks/{data-grid-template.B13OrA1T.js → data-grid-template.CFt1NV_4.js} +4 -4
  103. package/dist/chunks/{data-grid-template.B13OrA1T.js.map → data-grid-template.CFt1NV_4.js.map} +1 -1
  104. package/dist/chunks/data-grid.BjPdbx50.js +4071 -0
  105. package/dist/chunks/data-grid.BjPdbx50.js.map +1 -0
  106. package/dist/chunks/{date-input.BqBdAO1E.js → date-format.B8RU7D42.js} +6 -6
  107. package/dist/chunks/date-format.B8RU7D42.js.map +1 -0
  108. package/dist/chunks/date-picker.DSkvT_CA.js +234 -0
  109. package/dist/chunks/date-picker.DSkvT_CA.js.map +1 -0
  110. package/dist/chunks/date-range-picker.cmg75lC-.js +1117 -0
  111. package/dist/chunks/date-range-picker.cmg75lC-.js.map +1 -0
  112. package/dist/chunks/{date.4GAXrgy5.js → date.DZvVL-uz.js} +3 -3
  113. package/dist/chunks/{date.4GAXrgy5.js.map → date.DZvVL-uz.js.map} +1 -1
  114. package/dist/chunks/debounce.DUTu11PS.js.map +1 -1
  115. package/dist/chunks/{dialog-page.1ZVnUqpT.js → dialog-page.zWrBSgBD.js} +3 -3
  116. package/dist/chunks/dialog-page.zWrBSgBD.js.map +1 -0
  117. package/dist/chunks/{dropdown-default-textbox.CGsOngY1.js → dropdown-default-textbox.MkU0tMf1.js} +29 -29
  118. package/dist/chunks/dropdown-default-textbox.MkU0tMf1.js.map +1 -0
  119. package/dist/chunks/{dropdown-tag.hIiGmmBD.js → dropdown-tag.DvQQIJsw.js} +134 -122
  120. package/dist/chunks/dropdown-tag.DvQQIJsw.js.map +1 -0
  121. package/dist/chunks/{dropdown.GyDAswAO.js → dropdown.bLsoTZbw.js} +350 -339
  122. package/dist/chunks/dropdown.bLsoTZbw.js.map +1 -0
  123. package/dist/chunks/{empty-state.BsKJ-1pT.js → empty-state.Be6M8ivH.js} +2 -2
  124. package/dist/chunks/{empty-state.BsKJ-1pT.js.map → empty-state.Be6M8ivH.js.map} +1 -1
  125. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  126. package/dist/chunks/{field-label.DSeawpYh.js → field-label.C97CrBI_.js} +3 -3
  127. package/dist/chunks/{field-label.DSeawpYh.js.map → field-label.C97CrBI_.js.map} +1 -1
  128. package/dist/chunks/{file-uploader.DELe6_NM.js → file-uploader.By0MTfKk.js} +87 -88
  129. package/dist/chunks/file-uploader.By0MTfKk.js.map +1 -0
  130. package/dist/chunks/filter-bar.nX73NKNC.js +2948 -0
  131. package/dist/chunks/filter-bar.nX73NKNC.js.map +1 -0
  132. package/dist/chunks/{fixed-scroller.BASYH576.js → fixed-scroller.Dmg8r9QP.js} +3 -3
  133. package/dist/chunks/{fixed-scroller.BASYH576.js.map → fixed-scroller.Dmg8r9QP.js.map} +1 -1
  134. package/dist/chunks/focus-trap.CpNGD7PH.js.map +1 -1
  135. package/dist/chunks/{footer-actions.Bqn-Jp0p.js → footer-actions.BO52wpv-.js} +3 -3
  136. package/dist/chunks/{footer-actions.Bqn-Jp0p.js.map → footer-actions.BO52wpv-.js.map} +1 -1
  137. package/dist/chunks/{form-layout-title.DdRqnXXi.js → form-layout-title.61ESsGAY.js} +20 -12
  138. package/dist/chunks/form-layout-title.61ESsGAY.js.map +1 -0
  139. package/dist/chunks/get-slot-text.DQlZEsId.js.map +1 -1
  140. package/dist/chunks/{header-meta.BXOpbsSR.js → header-meta.C4iaUsfq.js} +13 -10
  141. package/dist/chunks/{header-meta.BXOpbsSR.js.map → header-meta.C4iaUsfq.js.map} +1 -1
  142. package/dist/chunks/{header-with-views.afPw_Czi.js → header-with-views.BLW817ZC.js} +207 -207
  143. package/dist/chunks/header-with-views.BLW817ZC.js.map +1 -0
  144. package/dist/chunks/{header.9kRuPR3K.js → header.DARVAeE9.js} +3 -3
  145. package/dist/chunks/{header.9kRuPR3K.js.map → header.DARVAeE9.js.map} +1 -1
  146. package/dist/chunks/index.pdBj0KQU.js +15 -0
  147. package/dist/chunks/index.pdBj0KQU.js.map +1 -0
  148. package/dist/chunks/{info-icon.CRnO5lpq.js → info-icon.BhOm72U4.js} +3 -3
  149. package/dist/chunks/{info-icon.CRnO5lpq.js.map → info-icon.BhOm72U4.js.map} +1 -1
  150. package/dist/chunks/{input-field-password.JZkGOiMd.js → input-field-password.BtM3-txc.js} +8 -8
  151. package/dist/chunks/input-field-password.BtM3-txc.js.map +1 -0
  152. package/dist/chunks/{input-field-phone-number.CF5P0_yu.js → input-field-phone-number.oaNB69nM.js} +631 -631
  153. package/dist/chunks/{input-field-phone-number.CF5P0_yu.js.map → input-field-phone-number.oaNB69nM.js.map} +1 -1
  154. package/dist/chunks/{input-field.2S8zBviE.js → input-field.D_tADgPG.js} +5 -5
  155. package/dist/chunks/input-field.D_tADgPG.js.map +1 -0
  156. package/dist/chunks/{inspector.C-yVhM15.js → inspector.BKP15cx6.js} +4 -4
  157. package/dist/chunks/inspector.BKP15cx6.js.map +1 -0
  158. package/dist/chunks/keyboard-navigation.pB8weElW.js.map +1 -1
  159. package/dist/chunks/{listbox-option-tag.CtJUykfB.js → listbox-option-tag.uHSB7MO6.js} +9 -9
  160. package/dist/chunks/listbox-option-tag.uHSB7MO6.js.map +1 -0
  161. package/dist/chunks/loading-indicator.Db794TT5.js +33 -0
  162. package/dist/chunks/loading-indicator.Db794TT5.js.map +1 -0
  163. package/dist/chunks/{modal-fullscreen.CIxazX33.js → modal-fullscreen.DTT-5rQX.js} +6 -6
  164. package/dist/chunks/{modal-fullscreen.CIxazX33.js.map → modal-fullscreen.DTT-5rQX.js.map} +1 -1
  165. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.D4TJY7o_.js → modal.vue_vue_type_script_setup_true_lang.c3Ma1oAL.js} +6 -6
  166. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.D4TJY7o_.js.map → modal.vue_vue_type_script_setup_true_lang.c3Ma1oAL.js.map} +1 -1
  167. package/dist/chunks/on-click-outside.D9aY9g8G.js.map +1 -1
  168. package/dist/chunks/{pagination.NDwXq6fh.js → pagination.D1Gdo5to.js} +5 -5
  169. package/dist/chunks/pagination.D1Gdo5to.js.map +1 -0
  170. package/dist/chunks/popover.types.BFFy1ChU.js +6 -0
  171. package/dist/chunks/{popover.types.Bp97CGc4.js.map → popover.types.BFFy1ChU.js.map} +1 -1
  172. package/dist/chunks/{popper-container.5cq-eu41.js → popper-container.Uod3yjsR.js} +2 -2
  173. package/dist/chunks/{popper-container.5cq-eu41.js.map → popper-container.Uod3yjsR.js.map} +1 -1
  174. package/dist/chunks/{promo-banner.ChT2zKkO.js → promo-banner.B-TLTLEd.js} +3 -3
  175. package/dist/chunks/promo-banner.B-TLTLEd.js.map +1 -0
  176. package/dist/chunks/radio-group.DWNqrkZ3.js +277 -0
  177. package/dist/chunks/radio-group.DWNqrkZ3.js.map +1 -0
  178. package/dist/chunks/{radio-input.odN9FOyr.js → radio-input.CBNE-AkM.js} +13 -14
  179. package/dist/chunks/radio-input.CBNE-AkM.js.map +1 -0
  180. package/dist/chunks/{rich-text-editor.D770fUpS.js → rich-text-editor.BK9AivIm.js} +6 -6
  181. package/dist/chunks/{rich-text-editor.D770fUpS.js.map → rich-text-editor.BK9AivIm.js.map} +1 -1
  182. package/dist/chunks/{search-bar.rZ_38y4j.js → search-bar.BD_R-vgA.js} +4 -4
  183. package/dist/chunks/{search-bar.rZ_38y4j.js.map → search-bar.BD_R-vgA.js.map} +1 -1
  184. package/dist/chunks/{secondary-nav.BBE8HyDR.js → secondary-nav.Du2PL7Ok.js} +5 -5
  185. package/dist/chunks/secondary-nav.Du2PL7Ok.js.map +1 -0
  186. package/dist/chunks/{segmented-control.D0SoqGlC.js → segmented-control.BCHGDSrf.js} +47 -45
  187. package/dist/chunks/segmented-control.BCHGDSrf.js.map +1 -0
  188. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
  189. package/dist/chunks/{selection-card-group.KK9ZPqiU.js → selection-card-group._RgLiMyQ.js} +5 -5
  190. package/dist/chunks/selection-card-group._RgLiMyQ.js.map +1 -0
  191. package/dist/chunks/{sidepanel.CyPW8jxA.js → sidepanel.CS9CfAWZ.js} +19 -19
  192. package/dist/chunks/{sidepanel.CyPW8jxA.js.map → sidepanel.CS9CfAWZ.js.map} +1 -1
  193. package/dist/chunks/{step.Ci-e1V9E.js → step.CoSuGK16.js} +4 -4
  194. package/dist/chunks/step.CoSuGK16.js.map +1 -0
  195. package/dist/chunks/{structured-list-item.CSkcduKn.js → structured-list-item.BTPh7SPj.js} +6 -6
  196. package/dist/chunks/{structured-list-item.CSkcduKn.js.map → structured-list-item.BTPh7SPj.js.map} +1 -1
  197. package/dist/chunks/{summary-grid.types.C-gcwqwB.js → summary-grid.types.ByQ4u19J.js} +6 -6
  198. package/dist/chunks/{summary-grid.types.C-gcwqwB.js.map → summary-grid.types.ByQ4u19J.js.map} +1 -1
  199. package/dist/chunks/{tab.8bEkiAkk.js → tab.CD5Eu6ql.js} +3 -3
  200. package/dist/chunks/tab.CD5Eu6ql.js.map +1 -0
  201. package/dist/chunks/{tag.BFYNxO6t.js → tag.CEmpyuYX.js} +2 -2
  202. package/dist/chunks/{tag.BFYNxO6t.js.map → tag.CEmpyuYX.js.map} +1 -1
  203. package/dist/chunks/textarea.C1jkfowf.js +246 -0
  204. package/dist/chunks/textarea.C1jkfowf.js.map +1 -0
  205. package/dist/chunks/{timeline-item.BiivSMPD.js → timeline-item.C8PA_w7m.js} +9 -9
  206. package/dist/chunks/timeline-item.C8PA_w7m.js.map +1 -0
  207. package/dist/chunks/{toast.DIhABAW8.js → toast.6oJx7SNq.js} +3 -3
  208. package/dist/chunks/{toast.DIhABAW8.js.map → toast.6oJx7SNq.js.map} +1 -1
  209. package/dist/chunks/toggle.Dd_NA8eH.js +143 -0
  210. package/dist/chunks/toggle.Dd_NA8eH.js.map +1 -0
  211. package/dist/chunks/tooltip.Dp9_ESm_.js +202 -0
  212. package/dist/chunks/tooltip.Dp9_ESm_.js.map +1 -0
  213. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BDCDB169.js → tutorial.vue_vue_type_script_setup_true_lang.KvlJ_dl9.js} +6 -6
  214. package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.KvlJ_dl9.js.map +1 -0
  215. package/dist/chunks/{use-cached-selected-values.CBOWMI4O.js → use-cached-selected-values.C32tjNKy.js} +114 -114
  216. package/dist/chunks/use-cached-selected-values.C32tjNKy.js.map +1 -0
  217. package/dist/chunks/{use-country-items.D_kamcYy.js → use-country-items.Dzbl2UsO.js} +7 -7
  218. package/dist/chunks/use-country-items.Dzbl2UsO.js.map +1 -0
  219. package/dist/chunks/use-country-phon-code.Bui3zD6W.js.map +1 -1
  220. package/dist/chunks/use-default-slot-validator.O02rzsob.js.map +1 -1
  221. package/dist/chunks/use-has-slot.B7eQSabc.js.map +1 -1
  222. package/dist/code-snippet.js +1 -1
  223. package/dist/country.js +1 -1
  224. package/dist/currency.js +1 -1
  225. package/dist/dashboard-template.js +1 -1
  226. package/dist/dashed-underline.js +1 -1
  227. package/dist/data-grid-template.js +1 -1
  228. package/dist/data-grid.js +1 -1
  229. package/dist/date-picker.js +5 -4
  230. package/dist/date-range-picker.js +5 -4
  231. package/dist/date.js +1 -1
  232. package/dist/dropdown.js +4 -4
  233. package/dist/empty-state.js +1 -1
  234. package/dist/file-uploader.js +1 -1
  235. package/dist/filter-bar.js +5 -4
  236. package/dist/form-layout.js +1 -1
  237. package/dist/header-with-views.js +1 -1
  238. package/dist/header.js +1 -1
  239. package/dist/index.js +405 -329
  240. package/dist/index.js.map +1 -1
  241. package/dist/info-icon.js +1 -1
  242. package/dist/input-field-password.js +1 -1
  243. package/dist/input-field-phone-number.js +1 -1
  244. package/dist/input-field.js +1 -1
  245. package/dist/inspector.js +1 -1
  246. package/dist/internal.js +12 -12
  247. package/dist/loading-indicator.js +1 -1
  248. package/dist/menu.js +1 -1
  249. package/dist/modal-fullscreen.js +1 -1
  250. package/dist/modal.js +2 -2
  251. package/dist/pagination.js +1 -1
  252. package/dist/popover.js +2 -2
  253. package/dist/popper-container.js +1 -1
  254. package/dist/promo-banner.js +1 -1
  255. package/dist/radio-group.js +2 -2
  256. package/dist/rich-text-editor.js +1 -1
  257. package/dist/search-bar.js +2 -2
  258. package/dist/secondary-nav.js +1 -1
  259. package/dist/segmented-control.js +1 -1
  260. package/dist/selection-card.js +1 -1
  261. package/dist/sidepanel.js +1 -1
  262. package/dist/stepper.js +1 -1
  263. package/dist/structured-list.js +1 -1
  264. package/dist/styles/bento-dark.css +25 -15
  265. package/dist/styles/bento-light.css +9 -3
  266. package/dist/styles/bento.css +9 -3
  267. package/dist/styles/legacy.css +9 -3
  268. package/dist/styles/styleguide.css +9 -3
  269. package/dist/summary-grid.js +1 -1
  270. package/dist/tabs.js +1 -1
  271. package/dist/tag.js +1 -1
  272. package/dist/textarea.js +1 -1
  273. package/dist/timeline.js +1 -1
  274. package/dist/toast.js +1 -1
  275. package/dist/toggle.js +1 -1
  276. package/dist/tutorial.js +1 -1
  277. package/dist/use-form-v4.js.map +1 -1
  278. package/dist/web-types.json +1 -1
  279. package/package.json +14 -12
  280. package/dist/chunks/avatar.Dq59yj6m.js.map +0 -1
  281. package/dist/chunks/base-modal.Djw4pVal.js.map +0 -1
  282. package/dist/chunks/button-actions.D1eBtYgZ.js.map +0 -1
  283. package/dist/chunks/button.C-MAa6ut.js.map +0 -1
  284. package/dist/chunks/calendar.B1a_mV-Q.js.map +0 -1
  285. package/dist/chunks/card.B9lWURmF.js.map +0 -1
  286. package/dist/chunks/country.RVvsGwuV.js +0 -99
  287. package/dist/chunks/country.RVvsGwuV.js.map +0 -1
  288. package/dist/chunks/currency.CN4UnCx8.js.map +0 -1
  289. package/dist/chunks/data-grid._xo6LEB-.js +0 -4010
  290. package/dist/chunks/data-grid._xo6LEB-.js.map +0 -1
  291. package/dist/chunks/date-input.BqBdAO1E.js.map +0 -1
  292. package/dist/chunks/date-picker.Bkz4GmyC.js +0 -319
  293. package/dist/chunks/date-picker.Bkz4GmyC.js.map +0 -1
  294. package/dist/chunks/date-range-picker.9Zlg9xnH.js +0 -1171
  295. package/dist/chunks/date-range-picker.9Zlg9xnH.js.map +0 -1
  296. package/dist/chunks/dialog-page.1ZVnUqpT.js.map +0 -1
  297. package/dist/chunks/dropdown-default-textbox.CGsOngY1.js.map +0 -1
  298. package/dist/chunks/dropdown-tag.hIiGmmBD.js.map +0 -1
  299. package/dist/chunks/dropdown.GyDAswAO.js.map +0 -1
  300. package/dist/chunks/file-uploader.DELe6_NM.js.map +0 -1
  301. package/dist/chunks/filter-bar.BLhRZzJa.js +0 -3005
  302. package/dist/chunks/filter-bar.BLhRZzJa.js.map +0 -1
  303. package/dist/chunks/form-layout-title.DdRqnXXi.js.map +0 -1
  304. package/dist/chunks/header-with-views.afPw_Czi.js.map +0 -1
  305. package/dist/chunks/i18n.B6g5VX0q.js +0 -3131
  306. package/dist/chunks/i18n.B6g5VX0q.js.map +0 -1
  307. package/dist/chunks/input-field-password.JZkGOiMd.js.map +0 -1
  308. package/dist/chunks/input-field.2S8zBviE.js.map +0 -1
  309. package/dist/chunks/inspector.C-yVhM15.js.map +0 -1
  310. package/dist/chunks/listbox-option-tag.CtJUykfB.js.map +0 -1
  311. package/dist/chunks/loading-indicator.VHi5tbZa.js +0 -44
  312. package/dist/chunks/loading-indicator.VHi5tbZa.js.map +0 -1
  313. package/dist/chunks/pagination.NDwXq6fh.js.map +0 -1
  314. package/dist/chunks/popover.types.Bp97CGc4.js +0 -6
  315. package/dist/chunks/promo-banner.ChT2zKkO.js.map +0 -1
  316. package/dist/chunks/radio-group.BNiif4On.js +0 -329
  317. package/dist/chunks/radio-group.BNiif4On.js.map +0 -1
  318. package/dist/chunks/radio-input.odN9FOyr.js.map +0 -1
  319. package/dist/chunks/secondary-nav.BBE8HyDR.js.map +0 -1
  320. package/dist/chunks/segmented-control.D0SoqGlC.js.map +0 -1
  321. package/dist/chunks/selection-card-group.KK9ZPqiU.js.map +0 -1
  322. package/dist/chunks/step.Ci-e1V9E.js.map +0 -1
  323. package/dist/chunks/tab.8bEkiAkk.js.map +0 -1
  324. package/dist/chunks/textarea.C7RmLKEx.js +0 -295
  325. package/dist/chunks/textarea.C7RmLKEx.js.map +0 -1
  326. package/dist/chunks/timeline-item.BiivSMPD.js.map +0 -1
  327. package/dist/chunks/toggle.C8k7NQ7y.js +0 -161
  328. package/dist/chunks/toggle.C8k7NQ7y.js.map +0 -1
  329. package/dist/chunks/tooltip.CEHc6lzU.js +0 -211
  330. package/dist/chunks/tooltip.CEHc6lzU.js.map +0 -1
  331. package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.BDCDB169.js.map +0 -1
  332. package/dist/chunks/use-cached-selected-values.CBOWMI4O.js.map +0 -1
  333. package/dist/chunks/use-country-items.D_kamcYy.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { ref as k, computed as r, defineComponent as _, toRefs as f, createElementBlock as i, openBlock as l, normalizeClass as R, createVNode as b, unref as n, withCtx as L, createTextVNode as h, toDisplayString as y, createBlock as B, createCommentVNode as S } from "vue";
1
+ import { ref as k, computed as r, defineComponent as _, toRefs as f, createElementBlock as d, openBlock as l, normalizeClass as R, createVNode as b, unref as n, withCtx as L, createTextVNode as y, toDisplayString as h, createBlock as B, createCommentVNode as S } from "vue";
2
2
  import { B as E } from "./typography.yBEME_Gu.js";
3
3
  import { _ as g } from "./_plugin-vue_export-helper.CHgC5LLL.js";
4
4
  import "../assets/avatar.css";
5
- const O = (a) => {
6
- const e = k(a);
7
- return r(() => e.value ? e.value.trim().charAt(0).toUpperCase() : null);
5
+ const O = (e) => {
6
+ const a = k(e);
7
+ return r(() => a.value ? a.value.trim().charAt(0).toUpperCase() : null);
8
8
  };
9
- var o = /* @__PURE__ */ ((a) => (a.LARGE = "large", a.SMALL = "small", a))(o || {}), t = /* @__PURE__ */ ((a) => (a.BLUE = "blue", a.GREEN = "green", a.RED = "red", a.YELLOW = "yellow", a))(t || {});
9
+ var o = /* @__PURE__ */ ((e) => (e.LARGE = "large", e.SMALL = "small", e))(o || {}), t = /* @__PURE__ */ ((e) => (e.BLUE = "blue", e.GREEN = "green", e.RED = "red", e.YELLOW = "yellow", e))(t || {});
10
10
  const N = ["src"], U = {
11
11
  key: 1,
12
12
  class: "b-avatar-image__default",
@@ -20,37 +20,37 @@ const N = ["src"], U = {
20
20
  username: { default: null },
21
21
  variant: { default: o.LARGE }
22
22
  },
23
- setup(a) {
24
- const e = a, { username: c } = f(e), d = O(c), m = r(() => ({
25
- [`b-avatar-image--${o.SMALL}`]: e.variant === o.SMALL,
26
- [`b-avatar-image--${e.color}`]: e.color
23
+ setup(e) {
24
+ const a = e, { username: c } = f(a), m = O(c), p = r(() => ({
25
+ [`b-avatar-image--${o.SMALL}`]: a.variant === o.SMALL,
26
+ [`b-avatar-image--${a.color}`]: a.color
27
27
  }));
28
- return (s, u) => (l(), i("div", {
29
- class: R(["b-avatar-image", m.value]),
28
+ return (s, u) => (l(), d("div", {
29
+ class: R(["b-avatar-image", p.value]),
30
30
  "aria-hidden": "true",
31
31
  "data-testid": "avatar"
32
32
  }, [
33
- s.src ? (l(), i("img", {
33
+ s.src ? (l(), d("img", {
34
34
  key: 0,
35
35
  src: s.src,
36
36
  class: "b-avatar-image__image",
37
37
  alt: "",
38
38
  "data-testid": "avatar-content"
39
- }, null, 8, N)) : (l(), i("div", U, [
39
+ }, null, 8, N)) : (l(), d("div", U, [
40
40
  b(n(E), {
41
41
  el: "span",
42
42
  variant: "body",
43
43
  strongest: ""
44
44
  }, {
45
45
  default: L(() => [
46
- h(y(n(d)), 1)
46
+ y(h(n(m)), 1)
47
47
  ]),
48
48
  _: 1
49
49
  })
50
50
  ]))
51
51
  ], 2));
52
52
  }
53
- }), M = /* @__PURE__ */ g(G, [["__scopeId", "data-v-32750732"]]), D = ["aria-label"], W = {
53
+ }), M = /* @__PURE__ */ g(G, [["__scopeId", "data-v-32750732"]]), D = ["role", "aria-label"], W = {
54
54
  name: "bento-avatar"
55
55
  }, Y = /* @__PURE__ */ _({
56
56
  ...W,
@@ -59,36 +59,37 @@ const N = ["src"], U = {
59
59
  src: { default: null },
60
60
  username: {}
61
61
  },
62
- setup(a) {
63
- const e = a, { username: c } = f(e), d = r(() => e.iconOnly ? e.username : null), m = r(() => e.src ? null : e.username), s = O(c), u = r(() => s.value ? s.value.charCodeAt(0) - 65 : null), A = r(() => {
62
+ setup(e) {
63
+ const a = e, { username: c } = f(a), m = r(() => a.iconOnly ? a.username : null), p = r(() => a.src ? null : a.username), s = O(c), u = r(() => s.value ? s.value.charCodeAt(0) - 65 : null), A = r(() => {
64
64
  const v = 26 / Object.keys(t).length;
65
65
  return u.value <= v ? t.YELLOW : u.value <= v * 2 ? t.BLUE : u.value <= v * 3 ? t.GREEN : t.RED;
66
66
  });
67
- return (p, C) => (l(), i("div", {
67
+ return (i, C) => (l(), d("div", {
68
68
  class: "b-avatar",
69
- "aria-label": d.value
69
+ role: i.iconOnly ? "img" : null,
70
+ "aria-label": m.value
70
71
  }, [
71
72
  b(n(M), {
72
- src: p.src,
73
- username: m.value,
73
+ src: i.src,
74
+ username: p.value,
74
75
  variant: n(o).SMALL,
75
76
  color: A.value
76
77
  }, null, 8, ["src", "username", "variant", "color"]),
77
- p.iconOnly ? S("", !0) : (l(), B(n(E), {
78
+ i.iconOnly ? S("", !0) : (l(), B(n(E), {
78
79
  key: 0,
79
80
  class: "b-avatar__label",
80
81
  el: "span",
81
82
  variant: "body"
82
83
  }, {
83
84
  default: L(() => [
84
- h(y(n(c)), 1)
85
+ y(h(n(c)), 1)
85
86
  ]),
86
87
  _: 1
87
88
  }))
88
89
  ], 8, D));
89
90
  }
90
- }), V = /* @__PURE__ */ g(Y, [["__scopeId", "data-v-e3fba390"]]);
91
+ }), j = /* @__PURE__ */ g(Y, [["__scopeId", "data-v-66e784fe"]]);
91
92
  export {
92
- V as B
93
+ j as B
93
94
  };
94
- //# sourceMappingURL=avatar.Dq59yj6m.js.map
95
+ //# sourceMappingURL=avatar.P2Fkz2I6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.P2Fkz2I6.js","sources":["../../../vue2/src/composables/initials.ts","../../../vue2/src/components/avatar/components/avatar-image/avatar-image.types.ts","../../../vue2/src/components/avatar/components/avatar-image/avatar-image.vue","../../../vue2/src/components/avatar/avatar.vue"],"sourcesContent":["import { computed, type ComputedRef, ref } from 'vue';\nimport { type MaybeRef } from '@/types/refs';\n\n/** Extracts the first letter of a username\n * @param username - The name to return the initials of\n * Common patterns:\n * 1. John => J\n * 2. John Smith => J\n * John Smith Doe Holly => J\n */\nexport const useInitials = (username: MaybeRef<string | null>): ComputedRef<string | null> => {\n const computedUsername = ref(username);\n return computed(() => (computedUsername.value ? computedUsername.value.trim().charAt(0).toUpperCase() : null));\n};\n","export enum BentoAvatarImageVariant {\n LARGE = 'large',\n SMALL = 'small',\n}\n\nexport enum BentoAvatarImageColor {\n BLUE = 'blue',\n GREEN = 'green',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-avatar-image\" :class=\"conditionalClasses\" aria-hidden=\"true\" data-testid=\"avatar\">\n <img v-if=\"src\" :src=\"src\" class=\"b-avatar-image__image\" alt=\"\" data-testid=\"avatar-content\" />\n <div v-else class=\"b-avatar-image__default\" data-testid=\"avatar-content\">\n <bento-typography el=\"span\" variant=\"body\" strongest>\n {{ initials }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { BentoAvatarImageColor, BentoAvatarImageVariant } from './avatar-image.types';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Avatar color. Defaults to yellow.\n */\n color?: BentoAvatarImageColor;\n\n /**\n * Image src to load the profile picture.\n */\n src?: string;\n\n /**\n * Name of the user that will be used to extract initials to display default value.\n * John => J\n * John Smith => JS\n * John Smith Doe => JD\n * John Smith Doe Holly => JH\n */\n username?: string;\n\n /**\n * Variants supported for small and large.\n * Default - large\n */\n variant?: BentoAvatarImageVariant;\n }>(),\n {\n color: BentoAvatarImageColor.YELLOW,\n src: null,\n username: null,\n variant: BentoAvatarImageVariant.LARGE,\n }\n );\n\n const { username } = toRefs(props);\n const initials = useInitials(username);\n\n const conditionalClasses = computed(() => ({\n [`b-avatar-image--${BentoAvatarImageVariant.SMALL}`]: props.variant === BentoAvatarImageVariant.SMALL,\n [`b-avatar-image--${props.color}`]: props.color,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Image used as user profile inside bento-avatar.\n *\n * @example\n * import { AvatarImage } from './components/avatar-image';\n *\n * export default {\n * components: { AvatarImage },\n * template: `<avatar-image :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar-image.scss\" />\n","<template>\n <div class=\"b-avatar\" :role=\"iconOnly ? 'img' : null\" :aria-label=\"computedAriaLabel\">\n <avatar-image\n :src=\"src\"\n :username=\"computedUsername\"\n :variant=\"BentoAvatarImageVariant.SMALL\"\n :color=\"avatarColor\"\n />\n <bento-typography v-if=\"!iconOnly\" class=\"b-avatar__label\" el=\"span\" variant=\"body\">\n {{ username }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { AvatarImage, BentoAvatarImageColor, BentoAvatarImageVariant } from './components/avatar-image';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Displays the user profile without the label.\n */\n iconOnly?: boolean;\n\n /**\n * Image src to load the profile picture.\n */\n src?: string;\n\n /**\n * Name of the user that will be used both in the label and to extract initials to display default value.\n * John => J\n * John Smith => JS\n * John Smith Doe => JD\n * John Smith Doe Holly => JH\n */\n username: string;\n }>(),\n {\n iconOnly: false,\n src: null,\n }\n );\n\n const { username } = toRefs(props);\n\n const computedAriaLabel = computed(() => (props.iconOnly ? props.username : null));\n const computedUsername = computed(() => (!props.src ? props.username : null));\n const initials = useInitials(username);\n\n // Returns the UTF-16 char code\n const charCode = computed(() => (initials.value ? initials.value.charCodeAt(0) - 65 : null));\n\n // Returns a computed color based on the letter passed\n const avatarColor = computed(() => {\n const numberOfAlphabetLetters = 26;\n const numberOfColors = Object.keys(BentoAvatarImageColor).length;\n const rangeStep = numberOfAlphabetLetters / numberOfColors;\n\n if (charCode.value <= rangeStep) {\n return BentoAvatarImageColor.YELLOW;\n }\n if (charCode.value <= rangeStep * 2) {\n return BentoAvatarImageColor.BLUE;\n }\n if (charCode.value <= rangeStep * 3) {\n return BentoAvatarImageColor.GREEN;\n }\n return BentoAvatarImageColor.RED;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Displays an user profile including an avatar and optionally a label.\n *\n * @example\n * import { BentoAvatar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAvatar },\n * template: `<bento-avatar :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {\n name: 'bento-avatar',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar.scss\" />\n"],"names":["useInitials","username","computedUsername","ref","computed","BentoAvatarImageVariant","BentoAvatarImageVariant2","BentoAvatarImageColor","BentoAvatarImageColor2","__default__$1","props","__props","toRefs","initials","conditionalClasses","__default__","computedAriaLabel","charCode","avatarColor","rangeStep"],"mappings":";;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAAC,IAAAC,EAAAF,CAAA;AACA,SAAAG,EAAA,MAAAF,EAAA,QAAAA,EAAA,MAAA,KAAA,EAAA,OAAA,CAAA,EAAA,YAAA,IAAA,IAAA;AACJ;ACbY,IAAAG,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UAJQA,IAAAD,KAAA,CAAA,CAAA;;;;;GCoERE,IAAA,CAAA;;;;;;;;;;AAxDA,UAAAC,IAAAC,GAmCA,EAAA,UAAAV,EAAA,IAAAW,EAAAF,CAAA,GACAG,IAAAb,EAAAC,CAAA,GAEAa,IAAAV,EAAA,OAAA;AAAA,MAA2C,CAAA,mBAAAC,EAAA,KAAA,EAAA,GAAAK,EAAA,YAAAL,EAAA;AAAA,MACyD,CAAA,mBAAAK,EAAA,KAAA,EAAA,GAAAA,EAAA;AAAA,IACtD,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;8FC8B9CK,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;AArEA,UAAAL,IAAAC,GA2BA,EAAA,UAAAV,EAAA,IAAAW,EAAAF,CAAA,GAEAM,IAAAZ,EAAA,MAAAM,EAAA,WAAAA,EAAA,WAAA,IAAA,GACAR,IAAAE,EAAA,MAAAM,EAAA,MAAA,OAAAA,EAAA,QAAA,GACAG,IAAAb,EAAAC,CAAA,GAGAgB,IAAAb,EAAA,MAAAS,EAAA,QAAAA,EAAA,MAAA,WAAA,CAAA,IAAA,KAAA,IAAA,GAGAK,IAAAd,EAAA,MAAA;AAGI,YAAAe,IAAA,KADA,OAAA,KAAAZ,CAAA,EAAA;AAGA,aAAAU,EAAA,SAAAE,IACIZ,EAAA,SAEJU,EAAA,SAAAE,IAAA,IACIZ,EAAA,OAEJU,EAAA,SAAAE,IAAA,IACIZ,EAAA,QAEJA,EAAA;AAAA,IAA6B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as $, useSlots as ee, ref as g, computed as d, inject as ce, watch as Y, nextTick as re, onUnmounted as me, createBlock as P, openBlock as A, normalizeClass as J, createSlots as te, withCtx as l, createElementVNode as L, normalizeStyle as O, createCommentVNode as w, unref as t, renderSlot as c, createVNode as j, useAttrs as ge, toRefs as ve, onMounted as pe, provide as G, createElementBlock as fe, withKeys as _e, withDirectives as ye } from "vue";
2
- import { B as be } from "./button.C-MAa6ut.js";
2
+ import { B as be } from "./button.DhcxX2GJ.js";
3
3
  import { B as he } from "./focus-trap.CpNGD7PH.js";
4
4
  import { u as ae } from "./use-has-slot.B7eQSabc.js";
5
- import { u as Le } from "./i18n.B6g5VX0q.js";
6
- import { j as Ae } from "./button-actions.D1eBtYgZ.js";
5
+ import { u as Le } from "./index.pdBj0KQU.js";
6
+ import { j as Ae } from "./button-actions.BQ3AFQqt.js";
7
7
  import { g as Ce } from "./generate-uid.NJ8tVoha.js";
8
8
  import { B as Ee } from "./directive.Cbdox5VL.js";
9
9
  import { C as Ie } from "./cross.B92GxFTY.js";
10
- import { D as Oe, B as Pe, b as Se, a as De } from "./dialog-page.1ZVnUqpT.js";
10
+ import { D as Oe, B as Pe, b as Se, a as De } from "./dialog-page.zWrBSgBD.js";
11
11
  import { B as x } from "./typography.yBEME_Gu.js";
12
- import { F as ke } from "./footer-actions.Bqn-Jp0p.js";
12
+ import { F as ke } from "./footer-actions.BO52wpv-.js";
13
13
  import { o as Be } from "./resize.Bqks3WUm.js";
14
14
  import { G as Te, a as Ne } from "./grid-layout.DDaRNz4-.js";
15
15
  import { _ as oe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
@@ -426,7 +426,7 @@ const ne = {
426
426
  ], 46, Ye)
427
427
  ]));
428
428
  }
429
- }), dt = /* @__PURE__ */ oe(je, [["__scopeId", "data-v-6a816307"]]);
429
+ }), dt = /* @__PURE__ */ oe(je, [["__scopeId", "data-v-05abca1c"]]);
430
430
  export {
431
431
  Ge as B,
432
432
  we as a,
@@ -438,4 +438,4 @@ export {
438
438
  Ke as g,
439
439
  dt as h
440
440
  };
441
- //# sourceMappingURL=base-modal.Djw4pVal.js.map
441
+ //# sourceMappingURL=base-modal.UA93s_8c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.UA93s_8c.js","sources":["../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/modal.keys.ts","../../../vue2/src/components/modal/components/modal-page/modal-page.vue","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["import { type ComputedRef, type Ref } from 'vue';\n\n/**\n * Public\n */\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the 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 for usage with properties since version 2.0. Use the 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\n/**\n * Private\n */\nexport interface BentoModalConfigData {\n activePage: Ref<string>;\n height: Ref<string>;\n isAnimationActive: Ref<boolean>;\n pageCustomPadding: Ref<string>;\n showCloseButton: ComputedRef<boolean>;\n size: Ref<BentoModalSize | `${BentoModalSize}`>;\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 {\n BentoModalColumnLayoutVariant,\n type BentoModalConfigData,\n BentoModalSize,\n } from '@/components/modal/modal.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 = withDefaults(defineProps<BentoModalPageProps>(), {\n actions: null,\n actionsLabel: null,\n columnsSize: BentoModalColumnLayoutVariant.SMALLER,\n customPadding: null,\n destructiveActions: false,\n withColumnLayout: false,\n pageId: undefined,\n previousPage: 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 class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"computedAriaLabel\"\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 {\n computed,\n defineComponent,\n onMounted,\n type PropType,\n provide,\n ref,\n toRefs,\n useAttrs,\n useSlots,\n watch,\n } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n type BentoModalConfigData,\n BentoModalRole,\n BentoModalSize,\n } from '@/components/modal/modal.types';\n import { BentoButton, type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { 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 '@/core/utils/ts';\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 slots = useSlots();\n const attrs = useAttrs();\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<{\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\n }>();\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 computedAriaLabel = computed(() => (attrs['aria-label'] as string) ?? (t('ariaLabelFallback') as string));\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) {\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 });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","MODAL_CONFIG_INJECTION_KEY","__default__$1","defineComponent","slots","useSlots","hasSlot","useHasSlot","page","ref","props","__props","modalPageConditionalClasses","computed","modalContentConditionalClasses","_a","customPaddingStyles","xPadding","content","hasColumnLayout","size","computedColumnWidth","activePage","height","isAnimationActive","pageCustomPadding","showCloseButton","inject","isCurrentPage","pageElementObserver","watch","value","oldValue","nextTick","_b","observeSizeOfElement","pageHeight","onUnmounted","__default__","messages","t","useI18n","attrs","useAttrs","modal","isClosing","modalId","generateUid","emit","__emit","computedAriaLabel","openModal","emitCloseEvent","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":";;;;;;;;;;;;;;;;AASY,IAAAA,KAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,SAAA,UAFQA,IAAAD,MAAA,CAAA,CAAA,GAQAE,KAAA,kBAAAC,OACRA,EAAA,UAAA,qBACAA,EAAA,SAAA,oBAFQA,IAAAD,MAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GASAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,eAAA,eAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,KAAA,kBAAAC,OACRA,EAAA,eAAA,gBACAA,EAAA,cAAA,eACAA,EAAA,OAAA,QACAA,EAAA,kBAAA,mBAJQA,IAAAD,MAAA,CAAA,CAAA,GAOAE,KAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,MAAA,CAAA,CAAA;;;;;;;;;;;;GCvDCE,KAAA,OAAA,iCAAA;;;GCoPTC,KAAAC,EAAA,CAAA,CAAA;;;;;;;;;;;;;;AAhKA,UAAAC,IAAAC,GAAA,GACAC,IAAAC,GAAAH,CAAA,GACAI,IAAAC,EAAA,IAAA,GAEAC,IAAAC,GAWAC,IAAAC,EAAA,OAAA;AAAA,MAAoD,gCAAAH,EAAA;AAAA,IACV,EAAA,GAG1CI,IAAAD,EAAA,MAAA;;AAAA;AAAA,QAAuD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AA,IAGJpD,IAAAd,EAAA,EAAA,GACAe,IAAAf,EAAA,EAAA;AAEA,WAAAwD,EAAAhE,IAAA;AAAA,MAA0D,YAAAqB;AAAA,MACtD,QAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAN;AAAA,IACA,CAAA,GAGJ6C,EAAAY,IAAA;AAAA,MAAqE,YAAAvD;AAAA,MACjE,WAAA+C;AAAA,MACA,QAAAF;AAAA,MACA,OAAAI;AAAA,MACA,eAAAjB;AAAA,MACA,YAAAkB;AAAA,IACA,CAAA,GAGJP,EAAAa,IAAAF,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ref as v, watch as h, nextTick as m, defineComponent as w, toRef as b, computed as p, provide as A, createElementBlock as B, openBlock as y, createElementVNode as N, normalizeClass as k, createVNode as E, createBlock as T, createCommentVNode as C, unref as I } from "vue";
2
- import { M as W, e as M, B as R, f as g } from "./button-actions.D1eBtYgZ.js";
2
+ import { M as W, e as M, B as R, f as g } from "./button-actions.BQ3AFQqt.js";
3
3
  import { u as O } from "./index.E60QniEu.js";
4
4
  import { _ as L } from "./_plugin-vue_export-helper.CHgC5LLL.js";
5
5
  import "../assets/button-actions-with-menu.css";
@@ -90,4 +90,4 @@ const S = (f) => {
90
90
  export {
91
91
  J as B
92
92
  };
93
- //# sourceMappingURL=button-actions-with-menu.DaKPEgPd.js.map
93
+ //# sourceMappingURL=button-actions-with-menu.BeQ-j1bv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.DaKPEgPd.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../../vue2/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 = withDefaults(defineProps<ButtonActionsWithMenuProps>(), {\n actionsLayout: 'buttons-end',\n disableResponsiveBehavior: false,\n displayedActions: undefined,\n inverse: false,\n hideDisplayedActionsBreakpoint: 0,\n menuPosition: '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","_a","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","__props","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":";;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GA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-responsive-actions.ts","../../../vue2/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 = withDefaults(defineProps<ButtonActionsWithMenuProps>(), {\n actionsLayout: 'buttons-end',\n disableResponsiveBehavior: false,\n displayedActions: undefined,\n inverse: false,\n hideDisplayedActionsBreakpoint: 0,\n menuPosition: '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","_a","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","__props","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_K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;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,24 +1,24 @@
1
1
  import { defineComponent as M, useSlots as Q, computed as _, createBlock as g, openBlock as u, withModifiers as X, normalizeClass as U, createSlots as H, withCtx as y, renderSlot as D, unref as p, createElementVNode as V, createCommentVNode as B, mergeProps as Y, renderList as x, normalizeProps as Be, guardReactiveProps as $e, resolveComponent as T, createVNode as E, createTextVNode as j, toDisplayString as G, onMounted as ee, onUnmounted as pe, useAttrs as Ee, inject as K, ref as v, toRefs as Se, Transition as ve, createElementBlock as k, Teleport as Le, resolveDynamicComponent as z, toHandlers as ie, withKeys as N, Fragment as Z, watch as be, nextTick as te, normalizeStyle as he, provide as Te, toRef as Me } from "vue";
2
- import { B as L } from "./button.C-MAa6ut.js";
3
- import { B as we } from "./loading-indicator.VHi5tbZa.js";
2
+ import { B as L } from "./button.DhcxX2GJ.js";
3
+ import { B as we } from "./loading-indicator.Db794TT5.js";
4
4
  import { C as Ne } from "./cross-circle-fill.CYLL7jfC.js";
5
5
  import { C as Re } from "./checkmark-circle-fill._6-d40ru.js";
6
6
  import { u as ae } from "./use-has-slot.B7eQSabc.js";
7
- import { u as ye } from "./i18n.B6g5VX0q.js";
7
+ import { u as ye } from "./index.pdBj0KQU.js";
8
8
  import { _ as w } from "./_plugin-vue_export-helper.CHgC5LLL.js";
9
9
  import { B as ge, D as Ae } from "./divider.DnKNNyWB.js";
10
10
  import { C as De } from "./cross.B92GxFTY.js";
11
11
  import { B as _e, a as re, p as Pe } from "./typography.yBEME_Gu.js";
12
- import { c as Fe, P as We, d as Ke } from "./popper-container.5cq-eu41.js";
12
+ import { c as Fe, P as We, d as Ke } from "./popper-container.Uod3yjsR.js";
13
13
  import { u as Ue } from "./aria-label.CaUURpnB.js";
14
14
  import { o as Ve } from "./on-click-outside.D9aY9g8G.js";
15
15
  import { g as Ge } from "./generate-uid.NJ8tVoha.js";
16
16
  import { C as je } from "./chevron-down.DCQ6ZLaq.js";
17
17
  /* empty css */
18
- import { i as Ce } from "./index.CWuzEfiV.js";
19
18
  import { a as He, C as ue } from "./chevron-left.Cfn1uGLH.js";
20
19
  import { a as de, B as Ye } from "./base-button.BYhf0xf3.js";
21
20
  import { t as Je } from "./truncate.BfIl_-71.js";
21
+ import { i as Ce } from "./index.CWuzEfiV.js";
22
22
  import { o as qe } from "./resize.Bqks3WUm.js";
23
23
  import { g as Xe } from "./es6.MoTTyETW.js";
24
24
  import "../assets/button-actions.css";
@@ -703,10 +703,7 @@ const Nt = Symbol("menu registering injection key"), Rt = {
703
703
  }, At = /* @__PURE__ */ M({
704
704
  ...Rt,
705
705
  setup(e) {
706
- const t = v(), o = v({}), s = K(
707
- Nt,
708
- !1
709
- );
706
+ const t = v(), o = v({}), s = K(Nt, !1);
710
707
  if (s) {
711
708
  const { registerMenuContainerElement: d } = s;
712
709
  d(t), o.value = {
@@ -722,7 +719,7 @@ const Nt = Symbol("menu registering injection key"), Rt = {
722
719
  D(d.$slots, "default", {}, void 0, !0)
723
720
  ], 16));
724
721
  }
725
- }), Oe = /* @__PURE__ */ w(At, [["__scopeId", "data-v-02a3ca45"]]), le = {
722
+ }), Oe = /* @__PURE__ */ w(At, [["__scopeId", "data-v-9ef14d73"]]), le = {
726
723
  "en-US": {
727
724
  backButton: "Go back",
728
725
  menuButton: "Open menu"
@@ -842,7 +839,7 @@ function Pt(e, t, o, s, d, m) {
842
839
  _: 1
843
840
  });
844
841
  }
845
- const Ft = /* @__PURE__ */ w(Dt, [["render", Pt], ["__scopeId", "data-v-56fb6d93"]]);
842
+ const Ft = /* @__PURE__ */ w(Dt, [["render", Pt], ["__scopeId", "data-v-e1de172e"]]);
846
843
  function Wt(e, t, o) {
847
844
  const m = v(0), l = v(0), f = (a) => {
848
845
  if (!a || !a.parentElement)
@@ -1021,7 +1018,7 @@ function Vt(e, t, o, s, d, m) {
1021
1018
  _: 1
1022
1019
  }, 8, ["style"]);
1023
1020
  }
1024
- const Gt = /* @__PURE__ */ w(Kt, [["render", Vt], ["__scopeId", "data-v-6ea090eb"]]), jt = Symbol("menu inverse style injection key"), Ht = {
1021
+ const Gt = /* @__PURE__ */ w(Kt, [["render", Vt], ["__scopeId", "data-v-968b28cb"]]), jt = Symbol("menu inverse style injection key"), Ht = {
1025
1022
  i18n: { messages: le },
1026
1023
  name: "bento-menu"
1027
1024
  }, Yt = /* @__PURE__ */ M({
@@ -1162,7 +1159,7 @@ const Gt = /* @__PURE__ */ w(Kt, [["render", Vt], ["__scopeId", "data-v-6ea090eb
1162
1159
  "without-space": ""
1163
1160
  }, {
1164
1161
  default: y(() => [
1165
- E(p(Gt), {
1162
+ E(Gt, {
1166
1163
  ref_key: "menuItemListRef",
1167
1164
  ref: a,
1168
1165
  "close-menu-on-item-select": I.closeMenuOnItemSelect,
@@ -1179,7 +1176,7 @@ const Gt = /* @__PURE__ */ w(Kt, [["render", Vt], ["__scopeId", "data-v-6ea090eb
1179
1176
  }, 8, ["disabled"])) : B("", !0)
1180
1177
  ], 34));
1181
1178
  }
1182
- }), Jt = /* @__PURE__ */ w(Yt, [["__scopeId", "data-v-ee8b682c"]]), qt = Symbol(
1179
+ }), Jt = /* @__PURE__ */ w(Yt, [["__scopeId", "data-v-4d921a39"]]), qt = Symbol(
1183
1180
  "button actions with menu container injection key"
1184
1181
  ), Xt = 242, me = parseInt(Xe, 10), zt = (e, t, o) => {
1185
1182
  const s = v(0);
@@ -1333,7 +1330,7 @@ const Gt = /* @__PURE__ */ w(Kt, [["render", Vt], ["__scopeId", "data-v-6ea090eb
1333
1330
  ], 2)
1334
1331
  ], 512));
1335
1332
  }
1336
- }), xt = /* @__PURE__ */ w(Qt, [["__scopeId", "data-v-0355d0d7"]]);
1333
+ }), xt = /* @__PURE__ */ w(Qt, [["__scopeId", "data-v-6c3554de"]]);
1337
1334
  export {
1338
1335
  xt as B,
1339
1336
  Nt as D,
@@ -1355,4 +1352,4 @@ export {
1355
1352
  dt as k,
1356
1353
  rt as u
1357
1354
  };
1358
- //# sourceMappingURL=button-actions.D1eBtYgZ.js.map
1355
+ //# sourceMappingURL=button-actions.BQ3AFQqt.js.map