@adyen/bento-vue3 1.94.0 → 1.95.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 (242) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +6 -9
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/anchor-scroller.js +1 -1
  6. package/dist/assets/accordion-item.css +1 -1
  7. package/dist/assets/action-bar.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions.css +1 -1
  10. package/dist/assets/card.css +1 -1
  11. package/dist/assets/dashed-underline.css +1 -1
  12. package/dist/assets/data-grid.css +1 -1
  13. package/dist/assets/date-picker.css +1 -1
  14. package/dist/assets/date-range-picker.css +1 -1
  15. package/dist/assets/date-time-picker.css +1 -0
  16. package/dist/assets/dialog-page.css +1 -1
  17. package/dist/assets/dropdown.css +1 -1
  18. package/dist/assets/file-uploader.css +1 -1
  19. package/dist/assets/form-layout-group.css +1 -0
  20. package/dist/assets/form-layout-title.css +1 -1
  21. package/dist/assets/header-meta.css +1 -1
  22. package/dist/assets/input-field.css +1 -1
  23. package/dist/assets/inspector.css +1 -1
  24. package/dist/assets/modal-fullscreen.css +1 -1
  25. package/dist/assets/navigation-menu-group.css +1 -1
  26. package/dist/assets/secondary-nav.css +1 -1
  27. package/dist/assets/sidepanel.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.jhGXgcQl.js → action-bar.CIVprT2U.js} +4 -4
  32. package/dist/chunks/{action-bar.jhGXgcQl.js.map → action-bar.CIVprT2U.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.DIdhvkaT.js → ai-tag.DkTlRY__.js} +2 -2
  34. package/dist/chunks/{ai-tag.DIdhvkaT.js.map → ai-tag.DkTlRY__.js.map} +1 -1
  35. package/dist/chunks/{anchor-scroller.BhppCt1n.js → anchor-scroller.J2mkf0uu.js} +5 -5
  36. package/dist/chunks/{anchor-scroller.BhppCt1n.js.map → anchor-scroller.J2mkf0uu.js.map} +1 -1
  37. package/dist/chunks/{base-modal.DxjZyGlG.js → base-modal.BKtpH-qh.js} +6 -6
  38. package/dist/chunks/{base-modal.DxjZyGlG.js.map → base-modal.BKtpH-qh.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.DJzCF9ja.js → button-actions-with-menu.cMAAF47d.js} +3 -3
  40. package/dist/chunks/{button-actions-with-menu.DJzCF9ja.js.map → button-actions-with-menu.cMAAF47d.js.map} +1 -1
  41. package/dist/chunks/{button-actions.uco5ptf5.js → button-actions.CxTxPprd.js} +2 -2
  42. package/dist/chunks/{button-actions.uco5ptf5.js.map → button-actions.CxTxPprd.js.map} +1 -1
  43. package/dist/chunks/{calendar.D8CM3XkW.js → calendar.74nP7Nu6.js} +18 -18
  44. package/dist/chunks/{calendar.D8CM3XkW.js.map → calendar.74nP7Nu6.js.map} +1 -1
  45. package/dist/chunks/{card.CWzJewQv.js → card.CQlyqa5-.js} +2 -2
  46. package/dist/chunks/{card.CWzJewQv.js.map → card.CQlyqa5-.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.Bq6PsVI_.js → checkbox-group.BWx4wn0F.js} +3 -3
  48. package/dist/chunks/{checkbox-group.Bq6PsVI_.js.map → checkbox-group.BWx4wn0F.js.map} +1 -1
  49. package/dist/chunks/{checkbox.DreTXMg0.js → checkbox.DwfrmbwI.js} +18 -18
  50. package/dist/chunks/{checkbox.DreTXMg0.js.map → checkbox.DwfrmbwI.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.CGOmdPc-.js → code-snippet.B9QFjFXf.js} +4 -4
  52. package/dist/chunks/{code-snippet.CGOmdPc-.js.map → code-snippet.B9QFjFXf.js.map} +1 -1
  53. package/dist/chunks/{controls-group.D4MEP6GO.js → controls-group.B-wIl-I7.js} +2 -2
  54. package/dist/chunks/{controls-group.D4MEP6GO.js.map → controls-group.B-wIl-I7.js.map} +1 -1
  55. package/dist/chunks/{copy.Dxqx884r.js → copy.XM_7RiIR.js} +3 -3
  56. package/dist/chunks/{copy.Dxqx884r.js.map → copy.XM_7RiIR.js.map} +1 -1
  57. package/dist/chunks/{dashboard-section.NWMwtxVX.js → dashboard-section.C4plNql-.js} +4 -4
  58. package/dist/chunks/{dashboard-section.NWMwtxVX.js.map → dashboard-section.C4plNql-.js.map} +1 -1
  59. package/dist/chunks/dashed-underline.DJmMXcdt.js +85 -0
  60. package/dist/chunks/dashed-underline.DJmMXcdt.js.map +1 -0
  61. package/dist/chunks/{data-grid-template.Bf-VZS0u.js → data-grid-template.Bwxo0AII.js} +4 -4
  62. package/dist/chunks/{data-grid-template.Bf-VZS0u.js.map → data-grid-template.Bwxo0AII.js.map} +1 -1
  63. package/dist/chunks/{data-grid.D_TrebJz.js → data-grid.Bx3Xy1tb.js} +884 -881
  64. package/dist/chunks/{data-grid.D_TrebJz.js.map → data-grid.Bx3Xy1tb.js.map} +1 -1
  65. package/dist/chunks/date-picker.89J8PGKn.js +277 -0
  66. package/dist/chunks/date-picker.89J8PGKn.js.map +1 -0
  67. package/dist/chunks/{date-range-picker.C5CSReZ5.js → date-range-picker.iaXigXuW.js} +428 -447
  68. package/dist/chunks/date-range-picker.iaXigXuW.js.map +1 -0
  69. package/dist/chunks/{dialog-page.CZN5-Ohm.js → dialog-page.BOwnhJze.js} +2 -2
  70. package/dist/chunks/{dialog-page.CZN5-Ohm.js.map → dialog-page.BOwnhJze.js.map} +1 -1
  71. package/dist/chunks/directive.D1-d-C2K.js +28 -0
  72. package/dist/chunks/directive.D1-d-C2K.js.map +1 -0
  73. package/dist/chunks/{draggable-handle.B_E-T3BS.js → draggable-handle.CKuHzAzS.js} +3 -3
  74. package/dist/chunks/{draggable-handle.B_E-T3BS.js.map → draggable-handle.CKuHzAzS.js.map} +1 -1
  75. package/dist/chunks/drawer.BQoyUVOW.js +64 -0
  76. package/dist/chunks/{drawer.GXqb2HPx.js.map → drawer.BQoyUVOW.js.map} +1 -1
  77. package/dist/chunks/{dropdown-tag.DUDW-Be6.js → dropdown-tag.DNWUbf7x.js} +3 -3
  78. package/dist/chunks/{dropdown-tag.DUDW-Be6.js.map → dropdown-tag.DNWUbf7x.js.map} +1 -1
  79. package/dist/chunks/{dropdown.Bsic3Nll.js → dropdown.CK8cdMyV.js} +458 -457
  80. package/dist/chunks/dropdown.CK8cdMyV.js.map +1 -0
  81. package/dist/chunks/{field-label.DFtyMriH.js → field-label.CLV3nSzz.js} +2 -2
  82. package/dist/chunks/{field-label.DFtyMriH.js.map → field-label.CLV3nSzz.js.map} +1 -1
  83. package/dist/chunks/{file-uploader.CKo27YzT.js → file-uploader.C9YOBRQg.js} +39 -38
  84. package/dist/chunks/{file-uploader.CKo27YzT.js.map → file-uploader.C9YOBRQg.js.map} +1 -1
  85. package/dist/chunks/{filter-bar.Dhghqmhb.js → filter-bar.CqbdRCQD.js} +21 -21
  86. package/dist/chunks/{filter-bar.Dhghqmhb.js.map → filter-bar.CqbdRCQD.js.map} +1 -1
  87. package/dist/chunks/{focus-trap.DcxrXRKl.js → focus-trap.Dl_rHbwH.js} +2 -2
  88. package/dist/chunks/{focus-trap.DcxrXRKl.js.map → focus-trap.Dl_rHbwH.js.map} +1 -1
  89. package/dist/chunks/{footer-actions.Dyi8PTyI.js → footer-actions.zlKq74F1.js} +2 -2
  90. package/dist/chunks/{footer-actions.Dyi8PTyI.js.map → footer-actions.zlKq74F1.js.map} +1 -1
  91. package/dist/chunks/form-layout-group.08QuvVmC.js +81 -0
  92. package/dist/chunks/form-layout-group.08QuvVmC.js.map +1 -0
  93. package/dist/chunks/form-layout-title.Kwve4xv2.js +179 -0
  94. package/dist/chunks/form-layout-title.Kwve4xv2.js.map +1 -0
  95. package/dist/chunks/header-meta.NFZo1ACP.js +243 -0
  96. package/dist/chunks/{header-meta.I2Tztkls.js.map → header-meta.NFZo1ACP.js.map} +1 -1
  97. package/dist/chunks/{header-with-views.MPJPxTzT.js → header-with-views.CB8M1Udi.js} +10 -10
  98. package/dist/chunks/{header-with-views.MPJPxTzT.js.map → header-with-views.CB8M1Udi.js.map} +1 -1
  99. package/dist/chunks/{header.CBzF5Ap9.js → header.Ds0sFKBB.js} +3 -3
  100. package/dist/chunks/{header.CBzF5Ap9.js.map → header.Ds0sFKBB.js.map} +1 -1
  101. package/dist/chunks/{index.Cqv1XuTj.js → index.oOAkh64h.js} +248 -225
  102. package/dist/chunks/{index.Cqv1XuTj.js.map → index.oOAkh64h.js.map} +1 -1
  103. package/dist/chunks/{info-icon.C_ZkQb1d.js → info-icon.1FtkyuYH.js} +3 -3
  104. package/dist/chunks/{info-icon.C_ZkQb1d.js.map → info-icon.1FtkyuYH.js.map} +1 -1
  105. package/dist/chunks/{input-field-password.CA16O5Gv.js → input-field-password.DJKloBB3.js} +24 -25
  106. package/dist/chunks/{input-field-password.CA16O5Gv.js.map → input-field-password.DJKloBB3.js.map} +1 -1
  107. package/dist/chunks/{input-field-phone-number.CTeDyk0e.js → input-field-phone-number.C3fQypln.js} +13 -14
  108. package/dist/chunks/{input-field-phone-number.CTeDyk0e.js.map → input-field-phone-number.C3fQypln.js.map} +1 -1
  109. package/dist/chunks/{input-field.DlEEFday.js → input-field.HgrRdDec.js} +104 -101
  110. package/dist/chunks/input-field.HgrRdDec.js.map +1 -0
  111. package/dist/chunks/{input-time.CIdcQBgS.js → input-time.DxCYIHSf.js} +7 -8
  112. package/dist/chunks/{input-time.CIdcQBgS.js.map → input-time.DxCYIHSf.js.map} +1 -1
  113. package/dist/chunks/{inspector.BdPLtQ1t.js → inspector.BvBC1ABK.js} +3 -3
  114. package/dist/chunks/{inspector.BdPLtQ1t.js.map → inspector.BvBC1ABK.js.map} +1 -1
  115. package/dist/chunks/{layout-row.PGFh3qzc.js → layout-row.BsGdHl3d.js} +8 -8
  116. package/dist/chunks/{layout-row.PGFh3qzc.js.map → layout-row.BsGdHl3d.js.map} +1 -1
  117. package/dist/chunks/{list-item.D34osEIh.js → list-item.E1o7yuEB.js} +2 -2
  118. package/dist/chunks/{list-item.D34osEIh.js.map → list-item.E1o7yuEB.js.map} +1 -1
  119. package/dist/chunks/{listbox-option-tag.12duL_ZH.js → listbox-option-tag.yF6p9iQw.js} +2 -2
  120. package/dist/chunks/{listbox-option-tag.12duL_ZH.js.map → listbox-option-tag.yF6p9iQw.js.map} +1 -1
  121. package/dist/chunks/{modal-fullscreen.BGpyGUGB.js → modal-fullscreen.DmruiE3n.js} +4 -4
  122. package/dist/chunks/{modal-fullscreen.BGpyGUGB.js.map → modal-fullscreen.DmruiE3n.js.map} +1 -1
  123. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js → modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js} +4 -4
  124. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js.map → modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map} +1 -1
  125. package/dist/chunks/navigation-menu-group.CQ6ImGsJ.js +336 -0
  126. package/dist/chunks/navigation-menu-group.CQ6ImGsJ.js.map +1 -0
  127. package/dist/chunks/{pagination.CbGLdXSQ.js → pagination.vqSlDmeK.js} +2 -2
  128. package/dist/chunks/{pagination.CbGLdXSQ.js.map → pagination.vqSlDmeK.js.map} +1 -1
  129. package/dist/chunks/popover.types.DATOPtuh.js +6 -0
  130. package/dist/chunks/{popover.types.63w2RF7Y.js.map → popover.types.DATOPtuh.js.map} +1 -1
  131. package/dist/chunks/{popper-container.WR8Hb24e.js → popper-container.BH4WxeUj.js} +2 -2
  132. package/dist/chunks/{popper-container.WR8Hb24e.js.map → popper-container.BH4WxeUj.js.map} +1 -1
  133. package/dist/chunks/{promo-banner.DS8jlFES.js → promo-banner.DvV9eXs4.js} +2 -2
  134. package/dist/chunks/{promo-banner.DS8jlFES.js.map → promo-banner.DvV9eXs4.js.map} +1 -1
  135. package/dist/chunks/{radio-group.DpLQ_Wnj.js → radio-group.Cg67ZU0c.js} +3 -3
  136. package/dist/chunks/{radio-group.DpLQ_Wnj.js.map → radio-group.Cg67ZU0c.js.map} +1 -1
  137. package/dist/chunks/{rich-text-editor.CRa59ETT.js → rich-text-editor.u_fKHVgZ.js} +4 -4
  138. package/dist/chunks/{rich-text-editor.CRa59ETT.js.map → rich-text-editor.u_fKHVgZ.js.map} +1 -1
  139. package/dist/chunks/{search-bar.tmX9JctT.js → search-bar.CgSUD89l.js} +5 -6
  140. package/dist/chunks/{search-bar.tmX9JctT.js.map → search-bar.CgSUD89l.js.map} +1 -1
  141. package/dist/chunks/{secondary-nav.KIu9A7pb.js → secondary-nav.BqqNrHZE.js} +20 -20
  142. package/dist/chunks/{secondary-nav.KIu9A7pb.js.map → secondary-nav.BqqNrHZE.js.map} +1 -1
  143. package/dist/chunks/{segmented-control.Dxfpt98K.js → segmented-control.D6Yvxxpc.js} +2 -2
  144. package/dist/chunks/{segmented-control.Dxfpt98K.js.map → segmented-control.D6Yvxxpc.js.map} +1 -1
  145. package/dist/chunks/{selection-card-group.BVxESHZH.js → selection-card-group.C2Av3uyz.js} +11 -11
  146. package/dist/chunks/{selection-card-group.BVxESHZH.js.map → selection-card-group.C2Av3uyz.js.map} +1 -1
  147. package/dist/chunks/set-time-in-date.9-8WOiMT.js +27 -0
  148. package/dist/chunks/set-time-in-date.9-8WOiMT.js.map +1 -0
  149. package/dist/chunks/{sidepanel.BwesEWP_.js → sidepanel.BVQt6Tac.js} +6 -6
  150. package/dist/chunks/{sidepanel.BwesEWP_.js.map → sidepanel.BVQt6Tac.js.map} +1 -1
  151. package/dist/chunks/{structured-list-item.DUWQ4ggz.js → structured-list-item.BhYtSw2f.js} +4 -4
  152. package/dist/chunks/{structured-list-item.DUWQ4ggz.js.map → structured-list-item.BhYtSw2f.js.map} +1 -1
  153. package/dist/chunks/{summary-grid.types.BvZUfgwA.js → summary-grid.types.9sUs0LS0.js} +5 -5
  154. package/dist/chunks/{summary-grid.types.BvZUfgwA.js.map → summary-grid.types.9sUs0LS0.js.map} +1 -1
  155. package/dist/chunks/{tab.DKVHFvuI.js → tab.DWoYKpTv.js} +2 -2
  156. package/dist/chunks/{tab.DKVHFvuI.js.map → tab.DWoYKpTv.js.map} +1 -1
  157. package/dist/chunks/{tag.DyNHhsGt.js → tag.Uu-6AQys.js} +2 -2
  158. package/dist/chunks/{tag.DyNHhsGt.js.map → tag.Uu-6AQys.js.map} +1 -1
  159. package/dist/chunks/{textarea.DNeZr2IZ.js → textarea.QgSLPL7S.js} +2 -2
  160. package/dist/chunks/{textarea.DNeZr2IZ.js.map → textarea.QgSLPL7S.js.map} +1 -1
  161. package/dist/chunks/{timeline-item.CfA1E0zq.js → timeline-item.DfwOm5do.js} +6 -6
  162. package/dist/chunks/{timeline-item.CfA1E0zq.js.map → timeline-item.DfwOm5do.js.map} +1 -1
  163. package/dist/chunks/{tooltip.CuwiX213.js → tooltip.Djn54E1O.js} +3 -3
  164. package/dist/chunks/{tooltip.CuwiX213.js.map → tooltip.Djn54E1O.js.map} +1 -1
  165. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4vdcgS4f.js → tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js} +4 -4
  166. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4vdcgS4f.js.map → tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js.map} +1 -1
  167. package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js +30 -0
  168. package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js.map +1 -0
  169. package/dist/chunks/{use-cached-selected-values.C2nbQ4g-.js → use-cached-selected-values.CtWNiy-e.js} +2 -2
  170. package/dist/chunks/{use-cached-selected-values.C2nbQ4g-.js.map → use-cached-selected-values.CtWNiy-e.js.map} +1 -1
  171. package/dist/chunks/{use-date-input-formatter.DaBZd09a.js → use-date-input-formatter.BshboCF9.js} +2 -2
  172. package/dist/chunks/{use-date-input-formatter.DaBZd09a.js.map → use-date-input-formatter.BshboCF9.js.map} +1 -1
  173. package/dist/code-snippet.js +1 -1
  174. package/dist/dashboard-template.js +1 -1
  175. package/dist/dashed-underline.js +1 -1
  176. package/dist/data-grid-template.js +1 -1
  177. package/dist/data-grid.js +1 -1
  178. package/dist/date-picker.js +2 -2
  179. package/dist/date-range-picker.js +2 -2
  180. package/dist/date-time-picker.js +123 -0
  181. package/dist/date-time-picker.js.map +1 -0
  182. package/dist/draggable.js +1 -1
  183. package/dist/drawer.js +1 -1
  184. package/dist/dropdown.js +3 -3
  185. package/dist/file-uploader.js +1 -1
  186. package/dist/filter-bar.js +1 -1
  187. package/dist/focus-trap.js +1 -1
  188. package/dist/form-layout.js +5 -4
  189. package/dist/form-layout.js.map +1 -1
  190. package/dist/header-with-views.js +1 -1
  191. package/dist/header.js +1 -1
  192. package/dist/index.js +217 -216
  193. package/dist/index.js.map +1 -1
  194. package/dist/info-icon.js +1 -1
  195. package/dist/input-field-password.js +1 -1
  196. package/dist/input-field-phone-number.js +1 -1
  197. package/dist/input-field.js +1 -1
  198. package/dist/input-time.js +1 -1
  199. package/dist/inspector.js +1 -1
  200. package/dist/internal.js +11 -11
  201. package/dist/layout.js +1 -1
  202. package/dist/list.js +1 -1
  203. package/dist/menu.js +1 -1
  204. package/dist/modal-fullscreen.js +1 -1
  205. package/dist/modal.js +2 -2
  206. package/dist/navigation-menu.js +1 -1
  207. package/dist/pagination.js +1 -1
  208. package/dist/popover.js +2 -2
  209. package/dist/popper-container.js +1 -1
  210. package/dist/promo-banner.js +1 -1
  211. package/dist/radio-group.js +1 -1
  212. package/dist/rich-text-editor.js +1 -1
  213. package/dist/search-bar.js +2 -2
  214. package/dist/secondary-nav.js +1 -1
  215. package/dist/segmented-control.js +1 -1
  216. package/dist/selection-card.js +1 -1
  217. package/dist/sidepanel.js +1 -1
  218. package/dist/structured-list.js +1 -1
  219. package/dist/summary-grid.js +1 -1
  220. package/dist/tabs.js +1 -1
  221. package/dist/tag.js +1 -1
  222. package/dist/textarea.js +1 -1
  223. package/dist/timeline.js +1 -1
  224. package/dist/tutorial.js +1 -1
  225. package/dist/web-types.json +1 -1
  226. package/package.json +6 -6
  227. package/dist/chunks/dashed-underline.DojqhvAa.js +0 -108
  228. package/dist/chunks/dashed-underline.DojqhvAa.js.map +0 -1
  229. package/dist/chunks/date-picker.DUUGSbot.js +0 -269
  230. package/dist/chunks/date-picker.DUUGSbot.js.map +0 -1
  231. package/dist/chunks/date-range-picker.C5CSReZ5.js.map +0 -1
  232. package/dist/chunks/directive.C8kY-ZW-.js +0 -23
  233. package/dist/chunks/directive.C8kY-ZW-.js.map +0 -1
  234. package/dist/chunks/drawer.GXqb2HPx.js +0 -55
  235. package/dist/chunks/dropdown.Bsic3Nll.js.map +0 -1
  236. package/dist/chunks/form-layout-title.B712PesH.js +0 -253
  237. package/dist/chunks/form-layout-title.B712PesH.js.map +0 -1
  238. package/dist/chunks/header-meta.I2Tztkls.js +0 -259
  239. package/dist/chunks/input-field.DlEEFday.js.map +0 -1
  240. package/dist/chunks/navigation-menu-group.D5HMMAuh.js +0 -320
  241. package/dist/chunks/navigation-menu-group.D5HMMAuh.js.map +0 -1
  242. package/dist/chunks/popover.types.63w2RF7Y.js +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.BdPLtQ1t.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":";;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;AAEI,IAAA,CAAAN,EAAA,SAAA,CAAAM,KAAA,CAAAN,EAAA,MAAA,SAAAM,CAAA,MAKAL,EAAA,MAAA,QAAAK,CAAA,GAEAL,EAAA,MAAA,SAAA,KACIA,EAAA,MAAA,IAAA;AAAA,EACJ,CAAA,GAkBJ;AAAA,IAAO,wBAVP,MAAA;AACI,iBAAAM,KAAAN,EAAA;AACI,YAAAM,KAAA,SAAA,KAAA,SAAAA,CAAA;AACI,iBAAAA;AAIR,aAAA;AAAA,IAAO;AAAA,EAIP;AAER;;;;;;;;;;;;yOCuLIC,KAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;;;AA7JA,UAAAC,IAAAC,GAUAC,IAAAC,GAeA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAN,EAAA,CAAA,GACAO,IAAAC,GAAA,gCAAA,GACAC,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,IAAA,GACAkB,IAAAlB,EAAA,IAAA,GACAmB,IAAAnB,EAAA,IAAA,GAEA,EAAA,OAAAoB,EAAA,IAAAC,GAAAL,CAAA,GAEAM,IAAAC,EAAA,MAAA;AAMI,YAAAC,IAAAhB,EAAA,SAAA,UAAA,MAAA;AAEA,aAAAY,EAAA,QAAA,KAAAA,EAAA,QAAAI;AAAA,IAAsD,CAAA,GAG1DC,IAAAF,EAAA,MAAAf,EAAA,eAAA,GAEAkB,IAAAH,EAAA,OAAA;AAAA,MAAyC,CAAA,g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ACJ;AAAA,IACJ,GAGJrB,EAAA,cACIoC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"inspector.BvBC1ABK.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":";;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;AAEI,IAAA,CAAAN,EAAA,SAAA,CAAAM,KAAA,CAAAN,EAAA,MAAA,SAAAM,CAAA,MAKAL,EAAA,MAAA,QAAAK,CAAA,GAEAL,EAAA,MAAA,SAAA,KACIA,EAAA,MAAA,IAAA;AAAA,EACJ,CAAA,GAkBJ;AAAA,IAAO,wBAVP,MAAA;AACI,iBAAAM,KAAAN,EAAA;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AqB,EAAA,MAAAF,MACIF,EAAA,eAAA,GACAf,EAAA,QAAA,SAAA,eACAa,EAAAP,EAAA,SAAAG,EAAA,CAAA,GAEAlB,EAAA,sBAAA,MAAA;AAAA,IACJ,GAGJ6B,IAAA,CAAAL,MAAA;AACI,YAAAM,IAAAN,EAAA,YAAAA,EAAA,WAAAA,EAAA,QAAA;AACA,MAAA1B,EAAA,UAAA,CAAAc,EAAA,SAAAkB,KACIC,EAAA;AAAA,IACJ,GAGJA,IAAA,MAAA;AACI,MAAAC,EAAAzB,EAAA,KAAA,KACIE,EAAA,QAAA,SAAA,eACAa,EAAAP,EAAA,SAAAG,EAAA,CAAA,GAEAlB,EAAA,sBAAA,MAAA,KAEAsB,EAAAb,EAAA,KAAA;AAAA,IACJ,GAGJa,IAAA,CAAAW,MAAA;AACI,MAAAA,MAGAA,GAAA,MAAA,GACA,SAAA,kBAAAA,KACIX,EAAAW,EAAA,aAAA;AAAA,IACJ;AAGJ,WAAAxC;AAAA,MAAA,MAAAK,EAAA;AAAA,MACgB,MAAA;AAER,QAAAA,EAAA,cACIqB,EAAA;AAAA,MACJ;AAAA,IACJ,GAGJrB,EAAA,cACIoC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as k, provide as R, toRef as S, computed as l, openBlock as i, createBlock as b, resolveDynamicComponent as T, unref as u, normalizeClass as c, withCtx as L, renderSlot as d, useSlots as g, inject as N, ref as r, watch as O, nextTick as j, onMounted as x, createElementBlock as h, createElementVNode as C, createCommentVNode as M } from "vue";
1
+ import { defineComponent as k, provide as R, toRef as S, computed as l, openBlock as i, createBlock as b, resolveDynamicComponent as T, unref as u, normalizeClass as c, withCtx as L, renderSlot as d, useSlots as g, inject as N, ref as r, watch as O, nextTick as x, onMounted as M, createElementBlock as h, createElementVNode as C, createCommentVNode as V } from "vue";
2
2
  import { _ as $ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
3
- import { B as V } from "./typography.B3J6_tYk.js";
3
+ import { B as j } from "./typography.B3J6_tYk.js";
4
4
  import { u as P } from "./use-has-slot.CyMiImRQ.js";
5
- import { j as W } from "./index.Cqv1XuTj.js";
5
+ import { k as W } from "./index.oOAkh64h.js";
6
6
  import "../assets/layout-row.css";
7
7
  const E = /* @__PURE__ */ Symbol("Layout size inject key"), Y = {}, A = /* @__PURE__ */ k({
8
8
  ...Y,
@@ -45,12 +45,12 @@ const E = /* @__PURE__ */ Symbol("Layout size inject key"), Y = {}, A = /* @__PU
45
45
  return O(
46
46
  W("(min-width: 768px)"),
47
47
  async (e) => {
48
- await j();
48
+ await x();
49
49
  const n = s.value?.firstChild === p.value;
50
50
  e && !n ? s.value?.prepend(p.value) : !e && (o.columnsLayout === "3-9" || o.columnsLayout === "4-8") && s.value?.prepend(v.value);
51
51
  },
52
52
  { immediate: !0 }
53
- ), x(() => {
53
+ ), M(() => {
54
54
  if (!_.value && (t("col-1") || t("col-2")))
55
55
  throw new Error(
56
56
  "Column slots can only be used with the `full-width` size. Please check documentation for more info."
@@ -59,7 +59,7 @@ const E = /* @__PURE__ */ Symbol("Layout size inject key"), Y = {}, A = /* @__PU
59
59
  throw new Error(
60
60
  `${o.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`
61
61
  );
62
- }), (e, n) => (i(), b(u(V), {
62
+ }), (e, n) => (i(), b(u(j), {
63
63
  el: "div",
64
64
  class: c(["b-layout-row", z.value])
65
65
  }, {
@@ -86,7 +86,7 @@ const E = /* @__PURE__ */ Symbol("Layout size inject key"), Y = {}, A = /* @__PU
86
86
  }, [
87
87
  d(e.$slots, "col-2", {}, void 0, !0)
88
88
  ], 2)
89
- ], 2)) : M("", !0)
89
+ ], 2)) : V("", !0)
90
90
  ]),
91
91
  _: 3
92
92
  }, 8, ["class"]));
@@ -96,4 +96,4 @@ export {
96
96
  X as a,
97
97
  G as l
98
98
  };
99
- //# sourceMappingURL=layout-row.PGFh3qzc.js.map
99
+ //# sourceMappingURL=layout-row.BsGdHl3d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-row.PGFh3qzc.js","sources":["../../../vue2/src/components/layout/layout.keys.ts","../../../vue2/src/components/layout/layout.vue","../../../vue2/src/components/layout/layout.types.ts","../../../vue2/src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { type BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = withDefaults(defineProps<BentoLayoutProps>(), {\n size: 'full-width',\n variant: 'page',\n });\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behavior of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, type Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = withDefaults(defineProps<BentoLayoutRowProps>(), {\n columnsLayout: '6-6',\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","props","__props","provide","toRef","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","onMounted"],"mappings":";;;;;;AAAO,MAAAA,IAAA,uBAAA,wBAAA,GC8CHC,IAAA,CAAA;;;;;;;;AAnCA,UAAAC,IAAAC;AAKA,IAAAC,EAAAJ,GAAAK,EAAAH,GAAA,MAAA,CAAA;AAEA,UAAAI,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAL,EAAA,YAAA;AAAA,IACE,EAAA,GAG7CM,IAAAN,EAAA,YAAA,SAAA,SAAA;;;;;;;;;;kECjBGO,IAAA,CAAA,OAAA,OAAA,OAAA,OAAA,KAAA,mBC2GHC,IAAA,CAAA;;;;;;;AAnFA,UAAAR,IAAAC,GAIAQ,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACAI,IAAAC,EAAAhB,GAAAiB,EAAA,YAAA,CAAA,GAEAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,IAAAH,EAAA,IAAA,GAEAI,IAAAd,EAAA,MAAAQ,EAAA,UAAA,YAAA,GACAO,IAAAf,EAAA,MAAAE,EAAA,SAAAP,EAAA,aAAA,CAAA,GAEAqB,IAAAhB,EAAA,MAAA,iBAAAQ,EAAA,KAAA,EAAA,GAEAS,IAAAjB,EAAA,OAAA;AAAA,MAAuD,gCAAAc,EAAA;AAAA,IACP,EAAA,GAGhDI,IAAAlB,EAAA,MAAA;AACI,YAAAmB,IAAAJ,EAAA,QAAApB,EAAA,cAAA,MAAA,GAAA,IAAA,CAAA,GAAA,CAAA,GACAyB,IAAA,CAAAC,MAAAP,EAAA,QAAAK,EAAAE,CAAA,IAAAb,EAAA;AAEA,aAAA;AAAA,QAAO,MAAA,yBAAAY,EAAA,CAAA,CAAA;AAAA,QACgD,MAAA,yBAAAA,EAAA,CAAA,CAAA;AAAA,MACA;AAAA,IACvD,CAAA;AAGJ,WAAAE;AAAA,MAAAC,EAAA,oBAAA;AAAA,MACsC,OAAAC,MAAA;AAE9B,cAAAC,EAAA;AACA,cAAAC,IAAAf,EAAA,OAAA,eAAAC,EAAA;AACA,QAAAY,KAAA,CAAAE,IACIf,EAAA,OAAA,QAAAC,EAAA,KAAA,IAA6B,CAAAY,MAAA7B,EAAA,kBAAA,SAAAA,EAAA,kBAAA,UAE7BgB,EAAA,OAAA,QAAAE,EAAA,KAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB,GAGtBc,EAAA,MAAA;AACI,UAAA,CAAAb,EAAA,UAAAR,EAAA,OAAA,KAAAA,EAAA,OAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAIR,UAAA,CAAAS,EAAA;AACI,cAAA,IAAA;AAAA,UAAU,GAAApB,EAAA,aAAA;AAAA,QACgB;AAAA,IAE9B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"layout-row.BsGdHl3d.js","sources":["../../../vue2/src/components/layout/layout.keys.ts","../../../vue2/src/components/layout/layout.vue","../../../vue2/src/components/layout/layout.types.ts","../../../vue2/src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { type BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = withDefaults(defineProps<BentoLayoutProps>(), {\n size: 'full-width',\n variant: 'page',\n });\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behavior of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, type Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = withDefaults(defineProps<BentoLayoutRowProps>(), {\n columnsLayout: '6-6',\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","props","__props","provide","toRef","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","onMounted"],"mappings":";;;;;;AAAO,MAAAA,IAAA,uBAAA,wBAAA,GC8CHC,IAAA,CAAA;;;;;;;;AAnCA,UAAAC,IAAAC;AAKA,IAAAC,EAAAJ,GAAAK,EAAAH,GAAA,MAAA,CAAA;AAEA,UAAAI,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAL,EAAA,YAAA;AAAA,IACE,E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MAAA;AACI,UAAA,CAAAb,EAAA,UAAAR,EAAA,OAAA,KAAAA,EAAA,OAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAIR,UAAA,CAAAS,EAAA;AACI,cAAA,IAAA;AAAA,UAAU,GAAApB,EAAA,aAAA;AAAA,QACgB;AAAA,IAE9B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { defineComponent as f, computed as b, openBlock as e, createBlock as n,
2
2
  import { _ as y } from "./_plugin-vue_export-helper.CHgC5LLL.js";
3
3
  import { C as E } from "./chevron-right-small.BCinNiMt.js";
4
4
  import { B as N } from "./status.H00BAmRx.js";
5
- import { B as V } from "./tag.DyNHhsGt.js";
5
+ import { B as V } from "./tag.Uu-6AQys.js";
6
6
  import { B as v } from "./typography.B3J6_tYk.js";
7
7
  import { u as x } from "./use-has-slot.CyMiImRQ.js";
8
8
  import "../assets/list-item.css";
@@ -125,4 +125,4 @@ export {
125
125
  tt as a,
126
126
  Z as l
127
127
  };
128
- //# sourceMappingURL=list-item.D34osEIh.js.map
128
+ //# sourceMappingURL=list-item.E1o7yuEB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.D34osEIh.js","sources":["../../../vue2/src/components/list/list.vue","../../../vue2/src/components/list/components/list-item/list-item.vue"],"sourcesContent":["<template>\n <component :is=\"listElement\" class=\"b-list\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import type { BentoListProps } from './list.types';\n\n const props = withDefaults(defineProps<BentoListProps>(), {\n type: 'unordered',\n });\n\n const listElement = computed(() => (props.type === 'ordered' ? 'ol' : 'ul'));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoList` renders an ordered or unordered list container for `BentoListItem` rows.\n *\n * @example\n * import { BentoList, BentoListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * />\n * <bento-list-item\n * label=\"Risk configuration\"\n * description=\"Updated yesterday\"\n * :tag=\"{ label: 'Review', variant: 'orange' }\"\n * />\n * </bento-list>\n * `\n * }\n */\n export default {\n name: 'bento-list',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list.scss\" />\n","<template>\n <li class=\"b-list-item\" @click=\"onItemClick\" @keydown=\"onItemKeydown\">\n <bento-typography\n class=\"b-list-item__inner\"\n :class=\"conditionalClasses\"\n el=\"div\"\n :role=\"props.withChevron ? 'button' : undefined\"\n :tabindex=\"props.withChevron ? 0 : undefined\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-list-item__image\">\n <slot name=\"image\" />\n </div>\n\n <div v-if=\"hasSlot('start')\" class=\"b-list-item__start\">\n <slot name=\"start\" />\n </div>\n\n <div class=\"b-list-item__content\">\n <div v-if=\"hasSlot('content')\" class=\"b-list-item__label\">\n <slot name=\"content\" />\n </div>\n\n <template v-else>\n <div class=\"b-list-item__header\">\n <bento-typography v-if=\"props.label\" class=\"b-list-item__label\" el=\"span\" stronger>\n {{ props.label }}\n </bento-typography>\n <bento-status\n v-if=\"props.showStatus\"\n class=\"b-list-item__status\"\n :variant=\"props.statusColor\"\n aria-hidden=\"true\"\n />\n <bento-tag v-if=\"props.tag\" v-bind=\"props.tag\" class=\"b-list-item__tag\" />\n </div>\n <span v-if=\"props.description\" class=\"b-list-item__description\">\n {{ props.description }}\n </span>\n </template>\n </div>\n\n <div v-if=\"hasSlot('end')\" class=\"b-list-item__end\">\n <slot name=\"end\" />\n </div>\n\n <chevron-right-icon v-if=\"props.withChevron\" class=\"b-list-item__chevron\" aria-hidden=\"true\" />\n </bento-typography>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n import { BentoStatus } from '@/components/status';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import type { BentoListItemProps } from './list-item.types';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(defineProps<BentoListItemProps>(), {\n showStatus: false,\n statusColor: 'blue',\n tag: undefined,\n withChevron: false,\n showTopDivider: false,\n showBottomDivider: false,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when a clickable list item is triggered.\n */\n (e: 'click'): void;\n }>();\n\n const onItemClick = (): void => {\n if (!props.withChevron) {\n return;\n }\n emit('click');\n };\n\n const onItemKeydown = (event: KeyboardEvent): void => {\n if (!props.withChevron) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n emit('click');\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-list-item__inner--clickable': props.withChevron,\n 'b-list-item__inner--top-divider': props.showTopDivider,\n 'b-list-item__inner--bottom-divider': props.showBottomDivider,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoListItem` renders an item to be used inside `BentoList`.\n *\n * @example\n * import { BentoList, BentoListItem, BentoButton, BentoToggle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem, BentoButton, BentoToggle },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * >\n * <template #start>\n * <bento-toggle />\n * </template>\n * <template #end>\n * <bento-button variant=\"secondary\">Edit</bento-button>\n * </template>\n * </bento-list-item>\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list-item',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list-item.scss\" />\n"],"names":["__default__$1","props","__props","listElement","computed","__default__","slots","useSlots","hasSlot","useHasSlot","emit","__emit","onItemClick","onItemKeydown","event","conditionalClasses"],"mappings":";;;;;;;;AA2CI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;AAnCA,UAAAC,IAAAC,GAIAC,IAAAC,EAAA,MAAAH,EAAA,SAAA,YAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;GCqHAI,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;AA1EA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAL,IAAAC,GASAQ,IAAAC,GAOAC,IAAA,MAAA;AACI,MAAAX,EAAA,eAGAS,EAAA,OAAA;AAAA,IAAY,GAGhBG,IAAA,CAAAC,MAAA;AACI,MAAAb,EAAA,gBAGAa,EAAA,QAAA,WAAAA,EAAA,QAAA,SACIA,EAAA,eAAA,GACAJ,EAAA,OAAA;AAAA,IACJ,GAGJK,IAAAX,EAAA,OAAA;AAAA,MAA2C,iCAAAH,EAAA;AAAA,MACA,mCAAAA,EAAA;AAAA,MACE,sCAAAA,EAAA;AAAA,IACG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"list-item.E1o7yuEB.js","sources":["../../../vue2/src/components/list/list.vue","../../../vue2/src/components/list/components/list-item/list-item.vue"],"sourcesContent":["<template>\n <component :is=\"listElement\" class=\"b-list\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import type { BentoListProps } from './list.types';\n\n const props = withDefaults(defineProps<BentoListProps>(), {\n type: 'unordered',\n });\n\n const listElement = computed(() => (props.type === 'ordered' ? 'ol' : 'ul'));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoList` renders an ordered or unordered list container for `BentoListItem` rows.\n *\n * @example\n * import { BentoList, BentoListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * />\n * <bento-list-item\n * label=\"Risk configuration\"\n * description=\"Updated yesterday\"\n * :tag=\"{ label: 'Review', variant: 'orange' }\"\n * />\n * </bento-list>\n * `\n * }\n */\n export default {\n name: 'bento-list',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list.scss\" />\n","<template>\n <li class=\"b-list-item\" @click=\"onItemClick\" @keydown=\"onItemKeydown\">\n <bento-typography\n class=\"b-list-item__inner\"\n :class=\"conditionalClasses\"\n el=\"div\"\n :role=\"props.withChevron ? 'button' : undefined\"\n :tabindex=\"props.withChevron ? 0 : undefined\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-list-item__image\">\n <slot name=\"image\" />\n </div>\n\n <div v-if=\"hasSlot('start')\" class=\"b-list-item__start\">\n <slot name=\"start\" />\n </div>\n\n <div class=\"b-list-item__content\">\n <div v-if=\"hasSlot('content')\" class=\"b-list-item__label\">\n <slot name=\"content\" />\n </div>\n\n <template v-else>\n <div class=\"b-list-item__header\">\n <bento-typography v-if=\"props.label\" class=\"b-list-item__label\" el=\"span\" stronger>\n {{ props.label }}\n </bento-typography>\n <bento-status\n v-if=\"props.showStatus\"\n class=\"b-list-item__status\"\n :variant=\"props.statusColor\"\n aria-hidden=\"true\"\n />\n <bento-tag v-if=\"props.tag\" v-bind=\"props.tag\" class=\"b-list-item__tag\" />\n </div>\n <span v-if=\"props.description\" class=\"b-list-item__description\">\n {{ props.description }}\n </span>\n </template>\n </div>\n\n <div v-if=\"hasSlot('end')\" class=\"b-list-item__end\">\n <slot name=\"end\" />\n </div>\n\n <chevron-right-icon v-if=\"props.withChevron\" class=\"b-list-item__chevron\" aria-hidden=\"true\" />\n </bento-typography>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n import { BentoStatus } from '@/components/status';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import type { BentoListItemProps } from './list-item.types';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(defineProps<BentoListItemProps>(), {\n showStatus: false,\n statusColor: 'blue',\n tag: undefined,\n withChevron: false,\n showTopDivider: false,\n showBottomDivider: false,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when a clickable list item is triggered.\n */\n (e: 'click'): void;\n }>();\n\n const onItemClick = (): void => {\n if (!props.withChevron) {\n return;\n }\n emit('click');\n };\n\n const onItemKeydown = (event: KeyboardEvent): void => {\n if (!props.withChevron) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n emit('click');\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-list-item__inner--clickable': props.withChevron,\n 'b-list-item__inner--top-divider': props.showTopDivider,\n 'b-list-item__inner--bottom-divider': props.showBottomDivider,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoListItem` renders an item to be used inside `BentoList`.\n *\n * @example\n * import { BentoList, BentoListItem, BentoButton, BentoToggle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem, BentoButton, BentoToggle },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * >\n * <template #start>\n * <bento-toggle />\n * </template>\n * <template #end>\n * <bento-button variant=\"secondary\">Edit</bento-button>\n * </template>\n * </bento-list-item>\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list-item',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list-item.scss\" />\n"],"names":["__default__$1","props","__props","listElement","computed","__default__","slots","useSlots","hasSlot","useHasSlot","emit","__emit","onItemClick","onItemKeydown","event","conditionalClasses"],"mappings":";;;;;;;;AA2CI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;AAnCA,UAAAC,IAAAC,GAIAC,IAAAC,EAAA,MAAAH,EAAA,SAAA,YAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;GCqHAI,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;AA1EA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAL,IAAAC,GASAQ,IAAAC,GAOAC,IAAA,MAAA;AACI,MAAAX,EAAA,eAGAS,EAAA,OAAA;AAAA,IAAY,GAGhBG,IAAA,CAAAC,MAAA;AACI,MAAAb,EAAA,gBAGAa,EAAA,QAAA,WAAAA,EAAA,QAAA,SACIA,EAAA,eAAA,GACAJ,EAAA,OAAA;AAAA,IACJ,GAGJK,IAAAX,EAAA,OAAA;AAAA,MAA2C,iCAAAH,EAAA;AAAA,MACA,mCAAAA,EAAA;AAAA,MACE,sCAAAA,EAAA;AAAA,IACG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, computed as i, resolveComponent as t, openBlock as e, createElementBlock as s, createElementVNode as l, createVNode as c, createBlock as m, withCtx as _, createTextVNode as b, toDisplayString as d, createCommentVNode as g } from "vue";
2
- import { B as f } from "./tag.DyNHhsGt.js";
2
+ import { B as f } from "./tag.Uu-6AQys.js";
3
3
  import { B as u } from "./typography.B3J6_tYk.js";
4
4
  import { _ as h } from "./_plugin-vue_export-helper.CHgC5LLL.js";
5
5
  import "../assets/listbox-option-tag.css";
@@ -54,4 +54,4 @@ const O = /* @__PURE__ */ h(y, [["render", x], ["__scopeId", "data-v-f55ef3b1"]]
54
54
  export {
55
55
  O as L
56
56
  };
57
- //# sourceMappingURL=listbox-option-tag.12duL_ZH.js.map
57
+ //# sourceMappingURL=listbox-option-tag.yF6p9iQw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listbox-option-tag.12duL_ZH.js","sources":["../../../vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span :aria-hidden=\"!!option.label\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types/listbox';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed","openBlock","createElementBlock","_hoisted_1","createElementVNode","_ctx","_hoisted_2","createTextVNode","toDisplayString","createCommentVNode"],"mappings":";;;;;AAmBI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA;AAAA,IACM,UAAAC;AAAA,IACR,iBAAAC;AAAA,EACA;AAAA,EACJ,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACO,QAAA;AAAA,MAKK,MAAA;AAAA,MACE,UAAA;AAAA,IACI;AAAA,EACd;AAAA,EACJ,MAAAC,GAAA;AAII,WAAA;AAAA;AAAA,MAAO,SAFPC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAII;AAAA,EACJ;AAER,CAAA;;;AAzCW,SAAAE,EAAA,GAAAC,EAAA,QAAAC,GAAA;AAAA,IAA2BC,EAAA,QAAA;AAAA;IACqE,GAAA;AAAA;QAAzB,OAAA;AAAA,QAAY,OAAAC,EAAA,OAAA,MAAA,SAAA;AAAA,QAHlG,SAAAA,EAAA;AAAA,MAAA,GAAA,MAAA,GAAA,CAAA,SAAA,SAAA,CAAA;AAAA,IAK4C,GAAA,GAAAC,CAAA;AAAA;MAAW,KAAA;AAAA,MAAM,IAAA;AAAA,MAL7D,OAAA;AAAA,IAAA,GAAA;AAAA;QAAAC,EAAAC,EAAAH,EAAA,OAAA,KAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,CAAA,KAAAI,EAAA,IAAA,EAAA;AAAA;;;"}
1
+ {"version":3,"file":"listbox-option-tag.yF6p9iQw.js","sources":["../../../vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span :aria-hidden=\"!!option.label\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types/listbox';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed","openBlock","createElementBlock","_hoisted_1","createElementVNode","_ctx","_hoisted_2","createTextVNode","toDisplayString","createCommentVNode"],"mappings":";;;;;AAmBI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA;AAAA,IACM,UAAAC;AAAA,IACR,iBAAAC;AAAA,EACA;AAAA,EACJ,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACO,QAAA;AAAA,MAKK,MAAA;AAAA,MACE,UAAA;AAAA,IACI;AAAA,EACd;AAAA,EACJ,MAAAC,GAAA;AAII,WAAA;AAAA;AAAA,MAAO,SAFPC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAII;AAAA,EACJ;AAER,CAAA;;;AAzCW,SAAAE,EAAA,GAAAC,EAAA,QAAAC,GAAA;AAAA,IAA2BC,EAAA,QAAA;AAAA;IACqE,GAAA;AAAA;QAAzB,OAAA;AAAA,QAAY,OAAAC,EAAA,OAAA,MAAA,SAAA;AAAA,QAHlG,SAAAA,EAAA;AAAA,MAAA,GAAA,MAAA,GAAA,CAAA,SAAA,SAAA,CAAA;AAAA,IAK4C,GAAA,GAAAC,CAAA;AAAA;MAAW,KAAA;AAAA,MAAM,IAAA;AAAA,MAL7D,OAAA;AAAA,IAAA,GAAA;AAAA;QAAAC,EAAAC,EAAAH,EAAA,OAAA,KAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,CAAA,KAAAI,EAAA,IAAA,EAAA;AAAA;;;"}
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as M, useSlots as x, inject as A, onMounted as R, openBlock as l, createBlock as c, unref as e, withCtx as n, renderSlot as h, createElementVNode as _, createTextVNode as O, toDisplayString as T, createCommentVNode as p, createElementBlock as w, createVNode as k, getCurrentInstance as X, toRefs as q, ref as r, computed as Q, onUnmounted as W, watch as Z, provide as g, withKeys as ee, withModifiers as te, normalizeClass as ae, createSlots as le } from "vue";
2
2
  import { B as oe } from "./toast.De4MTkiH.js";
3
- import { B as se } from "./focus-trap.DcxrXRKl.js";
3
+ import { B as se } from "./focus-trap.Dl_rHbwH.js";
4
4
  import { B as ne } from "./button.DWF7FSIw.js";
5
5
  import { B as D } from "./typography.B3J6_tYk.js";
6
6
  import { u as G } from "./use-has-slot.CyMiImRQ.js";
7
7
  import { u as ie } from "./index.B875RXHM.js";
8
- import { i as K, j as $, B as re, k as ce } from "./button-actions.uco5ptf5.js";
8
+ import { i as K, j as $, B as re, k as ce } from "./button-actions.CxTxPprd.js";
9
9
  import { C as ue } from "./cross.CCHdi6v3.js";
10
- import { b as de, B as fe, D as me, a as pe } from "./dialog-page.CZN5-Ohm.js";
10
+ import { b as de, B as fe, D as me, a as pe } from "./dialog-page.BOwnhJze.js";
11
11
  import { _ as J } from "./_plugin-vue_export-helper.CHgC5LLL.js";
12
12
  import { g as F } from "./generate-uid.DBWe4g6T.js";
13
13
  import "../assets/modal-fullscreen.css";
@@ -297,4 +297,4 @@ export {
297
297
  Ie as B,
298
298
  $e as m
299
299
  };
300
- //# sourceMappingURL=modal-fullscreen.BGpyGUGB.js.map
300
+ //# sourceMappingURL=modal-fullscreen.DmruiE3n.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-fullscreen.BGpyGUGB.js","sources":["../../../vue2/src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/index.ts","../../../vue2/src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n :id=\"computedTitleId\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n <div class=\"b-modal-fullscreen-page__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"handleClose\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </div>\n </div>\n </template>\n <template #content>\n <slot />\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { inject, onMounted, type PropType, useSlots } from 'vue';\n\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\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 *\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 * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * ID to be applied to the title to be used with aria-labelledby\n */\n titleId: {\n type: String,\n default: undefined,\n },\n });\n const emit = defineEmits<{\n /**\n * Emits event when close button is clicked\n */\n (e: 'close');\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const injectedTitleId = inject(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, undefined);\n const computedTitleId = props.titleId ?? injectedTitleId;\n\n const closeModal = inject(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, undefined);\n\n const handleClose = () => {\n emit('close');\n closeModal?.();\n };\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { getCurrentInstance } from 'vue';\n\n/**\n * A composable that provides access to the component's listeners.\n * The listeners are prefixed with \"on\" in camelCase and the colons are removed (e.g. \"onClick\", \"onUpdateValue\").\n * @returns The component's listeners.\n */\nexport function useListeners() {\n return getCurrentInstance()?.vnode.props ?? {};\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n data-dialog-element=\"modal-fullscreen\"\n :aria-labelledby=\"titleId\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page\n v-else\n :actions=\"actions\"\n :contextual-label=\"contextualLabel\"\n :title=\"title\"\n :title-id=\"titleId\"\n @close=\"closeModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n </bento-focus-trap>\n\n <!-- Enable the toast inside the fullscreen-modal -->\n <template v-if=\"isOpen\">\n <bento-toast />\n </template>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoToast } from '@/components/toast';\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import { generateUid } from '@/core/utils/ts';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\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 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 *\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 * @see BentoButton for a list of all the other props supported by each button action.\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 as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Handles closing the modal. The behavior changes depending on whether a `before-close` event listener is present.\n *\n * - **When listening for the `before-close` event:**\n * The `before-close` event is emitted immediately, skipping the animation. This allows for logic to run before the modal closes.\n * The `isOpen` prop must then be set to `false` to trigger the closing animation.\n *\n * - **When not listening for the `before-close` event:**\n * The closing animation plays, then `update:is-open` is emitted with `false`.\n * This is the default behavior, compatible with `v-model` or `.sync` on the `isOpen` prop.\n */\n (e: 'before-close'): void;\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emits 'update:is-open' event when the modal is closed\n */\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const titleId = generateUid('modal-fullscreen-title');\n const internalIsOpen = ref(false);\n const isMounted = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\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 internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value || !modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, modal],\n ([newIsOpen, newModalValue]) => {\n if (!isMounted.value || !newModalValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newModalValue.open) {\n newModalValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newModalValue.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n provide(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, titleId);\n provide(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, closeModal);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\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 provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","messages","t","useI18n","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","injectedTitleId","inject","MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY","computedTitleId","closeModal","MODAL_FULLSCREEN_CLOSE_INJECTION_KEY","handleClose","onMounted","useListeners","getCurrentInstance","__default__","activePage","isOpen","toRefs","modal","ref","isClosing","modalFullscreenId","generateUid","titleId","internalIsOpen","isMounted","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","startCloseModalAnimation","onUnmounted","watch","newIsOpen","newModalValue","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","DIALOG_PAGE_CONFIG_INJECTION_KEY","page","unregisterPage","pageIdToRemove","pageId","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;wKA4LIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAF,EAAA,CAAA,GACAG,IAAAC,GA0DAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAC,GAAA,MAAA,GACAC,IAAAX,EAAA,WAAAQ,GAEAI,IAAAH,EAAAI,GAAA,MAAA,GAEAC,IAAA,MAAA;AACI,MAAAZ,EAAA,OAAA,GACAU,IAAA;AAAA,IAAa;AAGjB,WAAAG,EAAA,MAAA;AACI,UAAAf,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3ID,SAAAgB,KAAA;AACH,SAAAC,EAAA,GAAA,MAAA,SAAA,CAAA;AACJ;mDCqRIC,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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L,EAAA,MAAA,UACIA,EAAA,MAAA,KAAAf,EAAA,KAAA,KACJoB,EAAA,QAEAJ,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC,GAIrCK,EAAAC,IAAAhB,CAAA,GACAe,EAAA9B,GAAAiB,CAAA,GACAa,EAAA3B,GAAAD,CAAA;AAGA,UAAA8B,IAAAnB,EAAAoB,GAAA,uBAAA,GACAC,IAAArB,EAAA,CAAA,CAAA,GACAW,IAAAX,EAAA,CAAA,CAAA;AAGA,IAAAiB,EAAAK,IAAA;AAAA,MAAqE,YAAA1B;AAAA,MACjE,WAAAuB;AAAA,MACA,QAAAd;AAAA,MACQ,OAAAgB;AAAA,MACR,eAAAV;AAAA,MACA,YAPJ,CAAAY,MAAA5C,EAAA,sBAAA4C,CAAA;AAAA,IAQI,CAAA;AAIJ,UAAAC,IAAA,CAAAC,MAAA,MAAA;AACI,MAAAJ,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAK,MAAAA,MAAAD,CAAA;AAAA,IAAqE;AAYzE,WAAAR,EAAAU,IARA,CAAAD,OACIA,KACIL,EAAA,MAAA,KAAAK,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA,EAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"modal-fullscreen.DmruiE3n.js","sources":["../../../vue2/src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/index.ts","../../../vue2/src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n :id=\"computedTitleId\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n <div class=\"b-modal-fullscreen-page__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"handleClose\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </div>\n </div>\n </template>\n <template #content>\n <slot />\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { inject, onMounted, type PropType, useSlots } from 'vue';\n\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\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 *\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 * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * ID to be applied to the title to be used with aria-labelledby\n */\n titleId: {\n type: String,\n default: undefined,\n },\n });\n const emit = defineEmits<{\n /**\n * Emits event when close button is clicked\n */\n (e: 'close');\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const injectedTitleId = inject(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, undefined);\n const computedTitleId = props.titleId ?? injectedTitleId;\n\n const closeModal = inject(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, undefined);\n\n const handleClose = () => {\n emit('close');\n closeModal?.();\n };\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { getCurrentInstance } from 'vue';\n\n/**\n * A composable that provides access to the component's listeners.\n * The listeners are prefixed with \"on\" in camelCase and the colons are removed (e.g. \"onClick\", \"onUpdateValue\").\n * @returns The component's listeners.\n */\nexport function useListeners() {\n return getCurrentInstance()?.vnode.props ?? {};\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n data-dialog-element=\"modal-fullscreen\"\n :aria-labelledby=\"titleId\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page\n v-else\n :actions=\"actions\"\n :contextual-label=\"contextualLabel\"\n :title=\"title\"\n :title-id=\"titleId\"\n @close=\"closeModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n </bento-focus-trap>\n\n <!-- Enable the toast inside the fullscreen-modal -->\n <template v-if=\"isOpen\">\n <bento-toast />\n </template>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoToast } from '@/components/toast';\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import { generateUid } from '@/core/utils/ts';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\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 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 *\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 * @see BentoButton for a list of all the other props supported by each button action.\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 as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Handles closing the modal. The behavior changes depending on whether a `before-close` event listener is present.\n *\n * - **When listening for the `before-close` event:**\n * The `before-close` event is emitted immediately, skipping the animation. This allows for logic to run before the modal closes.\n * The `isOpen` prop must then be set to `false` to trigger the closing animation.\n *\n * - **When not listening for the `before-close` event:**\n * The closing animation plays, then `update:is-open` is emitted with `false`.\n * This is the default behavior, compatible with `v-model` or `.sync` on the `isOpen` prop.\n */\n (e: 'before-close'): void;\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emits 'update:is-open' event when the modal is closed\n */\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const titleId = generateUid('modal-fullscreen-title');\n const internalIsOpen = ref(false);\n const isMounted = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\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 internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value || !modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, modal],\n ([newIsOpen, newModalValue]) => {\n if (!isMounted.value || !newModalValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newModalValue.open) {\n newModalValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newModalValue.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n provide(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, titleId);\n provide(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, closeModal);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\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 provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","messages","t","useI18n","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","injectedTitleId","inject","MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY","computedTitleId","closeModal","MODAL_FULLSCREEN_CLOSE_INJECTION_KEY","handleClose","onMounted","useListeners","getCurrentInstance","__default__","activePage","isOpen","toRefs","modal","ref","isClosing","modalFullscreenId","generateUid","titleId","internalIsOpen","isMounted","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","startCloseModalAnimation","onUnmounted","watch","newIsOpen","newModalValue","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","DIALOG_PAGE_CONFIG_INJECTION_KEY","page","unregisterPage","pageIdToRemove","pageId","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;wKA4LIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAF,EAAA,CAAA,GACAG,IAAAC,GA0DAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAC,GAAA,MAAA,GACAC,IAAAX,EAAA,WAAAQ,GAEAI,IAAAH,EAAAI,GAAA,MAAA,GAEAC,IAAA,MAAA;AACI,MAAAZ,EAAA,OAAA,GACAU,IAAA;AAAA,IAAa;AAGjB,WAAAG,EAAA,MAAA;AACI,UAAAf,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3ID,SAAAgB,KAAA;AACH,SAAAC,EAAA,GAAA,MAAA,SAAA,CAAA;AACJ;mDCqRIC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ACIV,EAAA,QAAA,IACAW,EAAA,QACIA,EAAA,UAAA,GAEJL,EAAA,MAAA,UACIA,EAAA,MAAA,KAAAf,EAAA,KAAA,KACJoB,EAAA,QAEAJ,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC,GAIrCK,EAAAC,IAAAhB,CAAA,GACAe,EAAA9B,GAAAiB,CAAA,GACAa,EAAA3B,GAAAD,CAAA;AAGA,UAAA8B,IAAAnB,EAAAoB,GAAA,uBAAA,GACAC,IAAArB,EAAA,CAAA,CAAA,GACAW,IAAAX,EAAA,CAAA,CAAA;AAGA,IAAAiB,EAAAK,IAAA;AAAA,MAAqE,YAAA1B;AAAA,MACjE,WAAAuB;AAAA,MACA,QAAAd;AAAA,MACQ,OAAAgB;AAAA,MACR,eAAAV;AAAA,MACA,YAPJ,CAAAY,MAAA5C,EAAA,sBAAA4C,CAAA;AAAA,IAQI,CAAA;AAIJ,UAAAC,IAAA,CAAAC,MAAA,MAAA;AACI,MAAAJ,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAK,MAAAA,MAAAD,CAAA;AAAA,IAAqE;AAYzE,WAAAR,EAAAU,IARA,CAAAD,OACIA,KACIL,EAAA,MAAA,KAAAK,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA,EAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as p, useSlots as w, onMounted as P, openBlock as b, createBlock as B, mergeProps as k, createSlots as z, unref as a, withCtx as i, renderSlot as s, createVNode as K, toRefs as j, ref as q, computed as O, createTextVNode as V, toDisplayString as I, useAttrs as U, resolveDynamicComponent as F } from "vue";
2
- import { B as C, h as $, a as f, d as G, e as D, g as h, f as W } from "./base-modal.DxjZyGlG.js";
2
+ import { B as C, h as $, a as f, d as G, e as D, g as h, f as W } from "./base-modal.BKtpH-qh.js";
3
3
  import { u as A } from "./use-has-slot.CyMiImRQ.js";
4
- import { F as Y } from "./footer-actions.Dyi8PTyI.js";
4
+ import { F as Y } from "./footer-actions.zlKq74F1.js";
5
5
  import { b as E } from "./button.DWF7FSIw.js";
6
6
  import { u as H } from "./index.B875RXHM.js";
7
- import { B as L } from "./button-actions.uco5ptf5.js";
7
+ import { B as L } from "./button-actions.CxTxPprd.js";
8
8
  import { d as J } from "./typography.B3J6_tYk.js";
9
9
  const X = p({
10
10
  name: "bento-modal-default"
@@ -491,4 +491,4 @@ const X = p({
491
491
  export {
492
492
  ce as _
493
493
  };
494
- //# sourceMappingURL=modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js.map
494
+ //# sourceMappingURL=modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js","sources":["../../../vue2/src/components/modal/components/modal-default/modal-default.vue","../../../vue2/src/components/modal/components/modal-dialog/modal-dialog.vue","../../../vue2/src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\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 * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\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 provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\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 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, default: false },\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 * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\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 onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\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 * </bento-modal-default>\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 name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits<{\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\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 * ```\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 * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\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 const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\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 *\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 * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\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 | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\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 * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\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 * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\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 computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["defineComponent","slots","useSlots","hasSlot","useHasSlot","emit","__emit","props","__props","onCloseModal","onMounted","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","BentoModalDialogType","modalDialogConditionalClasses","BentoModalDefault","BentoModalDialog","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","deprecate"],"mappings":";;;;;;;;AA8MI,UAAeA,EAAgB;AAAA,EAC3B,MAAM;AACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApK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C;AAAA,QACI,YAAY3B,EAAM;AAAA,QAClB,iBAAiBA,EAAM;AAAA,QACvB,MAAMA,EAAM;AAAA,QACZ,eAAeA,EAAM;AAAA,QACrB,cAAcA,EAAM;AAAA,QACpB,oBAAoBA,EAAM;AAAA,QAC1B,eAAeA,EAAM,iBAAiB;AAAA,QACtC,kBAAkBA,EAAM;AAAA,QACxB,aAAaA,EAAM;AAAA,QACnB,GAAGwB;AAAA,MAAA,IAEP;AAAA,QACI,YAAYxB,EAAM;AAAA,QAClB,YAAYA,EAAM;AAAA,QAClB,SAASA,EAAM;AAAA,QACf,eAAeA,EAAM,iBAAiB;AAAA,QACtC,GAAGwB;AAAA,MAAA;AAAA,IACP,GAGJtB,IAAe,MAAM;AACvB,MAAAJ,EAAK,aAAa;AAAA,IACtB;AAEA,WAAI,OAAO,KAAK0B,CAAK,EAAE,SAAS,kBAAkB,KAC9CK;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js","sources":["../../../vue2/src/components/modal/components/modal-default/modal-default.vue","../../../vue2/src/components/modal/components/modal-dialog/modal-dialog.vue","../../../vue2/src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\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 * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\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 provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\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 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, default: false },\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 * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\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 onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\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 * </bento-modal-default>\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 name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits<{\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\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 * ```\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 * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\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 const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\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 *\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 * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\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 | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\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 * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\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 * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\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 computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["defineComponent","slots","useSlots","hasSlot","useHasSlot","emit","__emit","props","__props","onCloseModal","onMounted","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","BentoModalDialogType","modalDialogConditionalClasses","BentoModalDefault","BentoModalDialog","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","deprecate"],"mappings":";;;;;;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