@adyen/bento-vue3 2.0.0-rc.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/dist/@types/index.d.ts +47 -89
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/anchor-scroller.js +1 -1
  7. package/dist/assets/accordion-item.css +1 -1
  8. package/dist/assets/action-bar.css +1 -1
  9. package/dist/assets/ai-tag.css +1 -1
  10. package/dist/assets/anchor-scroller.css +1 -1
  11. package/dist/assets/base-modal.css +1 -1
  12. package/dist/assets/button-actions.css +1 -1
  13. package/dist/assets/calendar.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/checkbox-group.css +1 -1
  16. package/dist/assets/checkbox.css +1 -1
  17. package/dist/assets/data-grid-template.css +1 -1
  18. package/dist/assets/data-grid.css +1 -1
  19. package/dist/assets/date-picker.css +1 -1
  20. package/dist/assets/date-range-picker.css +1 -1
  21. package/dist/assets/dialog-page.css +1 -1
  22. package/dist/assets/dropdown.css +1 -1
  23. package/dist/assets/file-uploader.css +1 -1
  24. package/dist/assets/filter-bar.css +1 -1
  25. package/dist/assets/header-with-views.css +1 -1
  26. package/dist/assets/info-icon-with-popover.css +1 -1
  27. package/dist/assets/input-field-password.css +1 -1
  28. package/dist/assets/input-field.css +1 -1
  29. package/dist/assets/inspector.css +1 -1
  30. package/dist/assets/link.css +1 -1
  31. package/dist/assets/modal-fullscreen.css +1 -1
  32. package/dist/assets/navigation-menu-group.css +1 -1
  33. package/dist/assets/pagination.css +1 -1
  34. package/dist/assets/progress-bar.css +1 -1
  35. package/dist/assets/promo-banner.css +1 -1
  36. package/dist/assets/radio-group.css +1 -1
  37. package/dist/assets/rich-text-editor.css +1 -1
  38. package/dist/assets/secondary-nav.css +1 -1
  39. package/dist/assets/segmented-control.css +1 -1
  40. package/dist/assets/selection-card-group.css +1 -1
  41. package/dist/assets/sidepanel.css +1 -1
  42. package/dist/assets/tab.css +1 -1
  43. package/dist/assets/table-of-contents.css +1 -1
  44. package/dist/assets/tag.css +1 -1
  45. package/dist/assets/textarea.css +1 -1
  46. package/dist/assets/timeline-item.css +1 -1
  47. package/dist/assets/toggle.css +1 -1
  48. package/dist/button.js +3 -3
  49. package/dist/card.js +1 -1
  50. package/dist/checkbox.js +2 -2
  51. package/dist/chip.js +1 -1
  52. package/dist/chunks/{accordion-item.CDqXAJ_o.js → accordion-item.l88yjGPT.js} +2 -2
  53. package/dist/chunks/accordion-item.l88yjGPT.js.map +1 -0
  54. package/dist/chunks/{action-bar.Y0-Y1Lxb.js → action-bar.CWjLoeOU.js} +166 -149
  55. package/dist/chunks/action-bar.CWjLoeOU.js.map +1 -0
  56. package/dist/chunks/{ai-button.HyFL1Urc.js → ai-button.CYaCMWFk.js} +2 -2
  57. package/dist/chunks/{ai-button.HyFL1Urc.js.map → ai-button.CYaCMWFk.js.map} +1 -1
  58. package/dist/chunks/{ai-tag.BQQA6de2.js → ai-tag.CjrOE5yl.js} +3 -3
  59. package/dist/chunks/ai-tag.CjrOE5yl.js.map +1 -0
  60. package/dist/chunks/{alert.DPb3_p0K.js → alert.C8Pe1-OO.js} +2 -2
  61. package/dist/chunks/{alert.DPb3_p0K.js.map → alert.C8Pe1-OO.js.map} +1 -1
  62. package/dist/chunks/{anchor-scroller.B2TgWdCo.js → anchor-scroller.C3zkcfPH.js} +13 -13
  63. package/dist/chunks/anchor-scroller.C3zkcfPH.js.map +1 -0
  64. package/dist/chunks/{base-button.C8hw-h9-.js → base-button.Bi5JR_6k.js} +2 -2
  65. package/dist/chunks/{base-button.C8hw-h9-.js.map → base-button.Bi5JR_6k.js.map} +1 -1
  66. package/dist/chunks/base-modal.Bn4ZXwv6.js +441 -0
  67. package/dist/chunks/base-modal.Bn4ZXwv6.js.map +1 -0
  68. package/dist/chunks/{button-actions-with-menu.LF1NNScj.js → button-actions-with-menu.CrbF2BSQ.js} +2 -2
  69. package/dist/chunks/{button-actions-with-menu.LF1NNScj.js.map → button-actions-with-menu.CrbF2BSQ.js.map} +1 -1
  70. package/dist/chunks/{button-actions.BjSTWgNC.js → button-actions.uIjzze43.js} +5 -5
  71. package/dist/chunks/{button-actions.BjSTWgNC.js.map → button-actions.uIjzze43.js.map} +1 -1
  72. package/dist/chunks/{button.D6d4P8nC.js → button.Ciflfide.js} +2 -2
  73. package/dist/chunks/{button.D6d4P8nC.js.map → button.Ciflfide.js.map} +1 -1
  74. package/dist/chunks/{calendar.Dndck6oT.js → calendar.Dtba7fcs.js} +5 -5
  75. package/dist/chunks/calendar.Dtba7fcs.js.map +1 -0
  76. package/dist/chunks/card.ID7LqObu.js +254 -0
  77. package/dist/chunks/card.ID7LqObu.js.map +1 -0
  78. package/dist/chunks/{checkbox-group.BqLVduAB.js → checkbox-group.BCzNXT1-.js} +8 -8
  79. package/dist/chunks/checkbox-group.BCzNXT1-.js.map +1 -0
  80. package/dist/chunks/{checkbox.OqIysGJA.js → checkbox.0RmIkniU.js} +15 -15
  81. package/dist/chunks/checkbox.0RmIkniU.js.map +1 -0
  82. package/dist/chunks/{chip.REcSE76u.js → chip.Bv6IGch0.js} +2 -2
  83. package/dist/chunks/{chip.REcSE76u.js.map → chip.Bv6IGch0.js.map} +1 -1
  84. package/dist/chunks/{code-snippet.B9poUCAs.js → code-snippet.BbswO6TU.js} +5 -5
  85. package/dist/chunks/{code-snippet.B9poUCAs.js.map → code-snippet.BbswO6TU.js.map} +1 -1
  86. package/dist/chunks/{copy.BqYryk37.js → copy.C92qFRaR.js} +2 -2
  87. package/dist/chunks/{copy.BqYryk37.js.map → copy.C92qFRaR.js.map} +1 -1
  88. package/dist/chunks/{cross-circle-fill-small.ganKvfe0.js → cross-circle-fill-small.C87G_8OX.js} +2 -2
  89. package/dist/chunks/cross-circle-fill-small.C87G_8OX.js.map +1 -0
  90. package/dist/chunks/{dashboard-section.D1GPmEU2.js → dashboard-section.Bv-SveGN.js} +3 -3
  91. package/dist/chunks/{dashboard-section.D1GPmEU2.js.map → dashboard-section.Bv-SveGN.js.map} +1 -1
  92. package/dist/chunks/{dashed-underline.E65uUWYF.js → dashed-underline.C3lSC1_R.js} +2 -2
  93. package/dist/chunks/{dashed-underline.E65uUWYF.js.map → dashed-underline.C3lSC1_R.js.map} +1 -1
  94. package/dist/chunks/{data-grid-template.DsZI-ISc.js → data-grid-template.DqZmPeze.js} +4 -4
  95. package/dist/chunks/{data-grid-template.DsZI-ISc.js.map → data-grid-template.DqZmPeze.js.map} +1 -1
  96. package/dist/chunks/{data-grid.oiH-QM7_.js → data-grid.Ca27H24r.js} +20 -20
  97. package/dist/chunks/data-grid.Ca27H24r.js.map +1 -0
  98. package/dist/chunks/{date-picker.94wdYFML.js → date-picker.Dnr2HuxA.js} +7 -7
  99. package/dist/chunks/date-picker.Dnr2HuxA.js.map +1 -0
  100. package/dist/chunks/{date-range-picker.D45JX1VD.js → date-range-picker.CuBygd3O.js} +10 -10
  101. package/dist/chunks/{date-range-picker.D45JX1VD.js.map → date-range-picker.CuBygd3O.js.map} +1 -1
  102. package/dist/chunks/{dialog-page.yakmJ6Bc.js → dialog-page.D60pjDsQ.js} +2 -2
  103. package/dist/chunks/{dialog-page.yakmJ6Bc.js.map → dialog-page.D60pjDsQ.js.map} +1 -1
  104. package/dist/chunks/{draggable-handle.DnvrxRxK.js → draggable-handle.Cvc8gHzx.js} +2 -2
  105. package/dist/chunks/{draggable-handle.DnvrxRxK.js.map → draggable-handle.Cvc8gHzx.js.map} +1 -1
  106. package/dist/chunks/{draggable.Cp2Qnooa.js → draggable.BZsgR26I.js} +2 -2
  107. package/dist/chunks/{draggable.Cp2Qnooa.js.map → draggable.BZsgR26I.js.map} +1 -1
  108. package/dist/chunks/{dropdown-tag.C3ybYQxd.js → dropdown-tag.Bn5FPeEL.js} +3 -3
  109. package/dist/chunks/{dropdown-tag.C3ybYQxd.js.map → dropdown-tag.Bn5FPeEL.js.map} +1 -1
  110. package/dist/chunks/{dropdown.DivEbn7p.js → dropdown.D_jkFrMd.js} +194 -194
  111. package/dist/chunks/dropdown.D_jkFrMd.js.map +1 -0
  112. package/dist/chunks/{empty-state.Bto2psKu.js → empty-state.DpUC-3wv.js} +3 -3
  113. package/dist/chunks/{empty-state.Bto2psKu.js.map → empty-state.DpUC-3wv.js.map} +1 -1
  114. package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
  115. package/dist/chunks/{file-uploader.BuOQRa-V.js → file-uploader.BglImnqw.js} +6 -6
  116. package/dist/chunks/file-uploader.BglImnqw.js.map +1 -0
  117. package/dist/chunks/{filter-bar.B14faBNI.js → filter-bar.DG4GTi8L.js} +514 -533
  118. package/dist/chunks/filter-bar.DG4GTi8L.js.map +1 -0
  119. package/dist/chunks/{fixed-scroller.B3kEBipG.js → fixed-scroller.DoOR83iH.js} +2 -2
  120. package/dist/chunks/{fixed-scroller.B3kEBipG.js.map → fixed-scroller.DoOR83iH.js.map} +1 -1
  121. package/dist/chunks/{footer-actions.NpAByudT.js → footer-actions.Dl20Q1WX.js} +3 -3
  122. package/dist/chunks/{footer-actions.NpAByudT.js.map → footer-actions.Dl20Q1WX.js.map} +1 -1
  123. package/dist/chunks/{form-layout-title.Dh45kd1K.js → form-layout-title.BZFh_nGD.js} +2 -2
  124. package/dist/chunks/{form-layout-title.Dh45kd1K.js.map → form-layout-title.BZFh_nGD.js.map} +1 -1
  125. package/dist/chunks/generate-uid.DBWe4g6T.js.map +1 -1
  126. package/dist/chunks/{header-with-views.DufmtnZ2.js → header-with-views.WJlXgGI5.js} +875 -849
  127. package/dist/chunks/{header-with-views.DufmtnZ2.js.map → header-with-views.WJlXgGI5.js.map} +1 -1
  128. package/dist/chunks/{header.Jtie5-7g.js → header.Bi3MPZKE.js} +4 -4
  129. package/dist/chunks/{header.Jtie5-7g.js.map → header.Bi3MPZKE.js.map} +1 -1
  130. package/dist/chunks/{info-icon-with-popover.CLGZteKS.js → info-icon-with-popover.uSr6-jzR.js} +3 -3
  131. package/dist/chunks/info-icon-with-popover.uSr6-jzR.js.map +1 -0
  132. package/dist/chunks/{input-field-password.BPjmZ2vh.js → input-field-password.CJZxudne.js} +5 -5
  133. package/dist/chunks/input-field-password.CJZxudne.js.map +1 -0
  134. package/dist/chunks/{input-field-phone-number.BViae6Ex.js → input-field-phone-number.OJ4MG9Gf.js} +2 -2
  135. package/dist/chunks/{input-field-phone-number.BViae6Ex.js.map → input-field-phone-number.OJ4MG9Gf.js.map} +1 -1
  136. package/dist/chunks/{input-field.DgQG5TCW.js → input-field.IyNujUZt.js} +3 -3
  137. package/dist/chunks/input-field.IyNujUZt.js.map +1 -0
  138. package/dist/chunks/{input-time.DYbJUHP5.js → input-time.BJ6YqkFi.js} +3 -3
  139. package/dist/chunks/{input-time.DYbJUHP5.js.map → input-time.BJ6YqkFi.js.map} +1 -1
  140. package/dist/chunks/{inspector-page.BdfORbVT.js → inspector-page.D42_PXHM.js} +3 -3
  141. package/dist/chunks/{inspector-page.BdfORbVT.js.map → inspector-page.D42_PXHM.js.map} +1 -1
  142. package/dist/chunks/{inspector.CEiwH5Pt.js → inspector.BBgrupfO.js} +3 -3
  143. package/dist/chunks/inspector.BBgrupfO.js.map +1 -0
  144. package/dist/chunks/{link.DHhC2vrX.js → link.types.BGj7apK3.js} +36 -36
  145. package/dist/chunks/link.types.BGj7apK3.js.map +1 -0
  146. package/dist/chunks/{list-item.QB0YYGW9.js → list-item.CT7dyMQH.js} +3 -3
  147. package/dist/chunks/{list-item.QB0YYGW9.js.map → list-item.CT7dyMQH.js.map} +1 -1
  148. package/dist/chunks/{listbox-option-tag.DCuA8MoL.js → listbox-option-tag.CwrFdsY1.js} +2 -2
  149. package/dist/chunks/{listbox-option-tag.DCuA8MoL.js.map → listbox-option-tag.CwrFdsY1.js.map} +1 -1
  150. package/dist/chunks/{modal-fullscreen.DtG6vHhq.js → modal-fullscreen.I5bjqzfd.js} +6 -6
  151. package/dist/chunks/modal-fullscreen.I5bjqzfd.js.map +1 -0
  152. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CKWzgLgL.js → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js} +5 -5
  153. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CKWzgLgL.js.map → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js.map} +1 -1
  154. package/dist/chunks/{navigation-menu-group.E-24hOWI.js → navigation-menu-group.BSGdcUDN.js} +6 -6
  155. package/dist/chunks/navigation-menu-group.BSGdcUDN.js.map +1 -0
  156. package/dist/chunks/{pagination.B2Kgh-MF.js → pagination.C5gZxtZY.js} +5 -5
  157. package/dist/chunks/pagination.C5gZxtZY.js.map +1 -0
  158. package/dist/chunks/{promo-banner.DuottTum.js → promo-banner.kE1-WkzI.js} +9 -9
  159. package/dist/chunks/{promo-banner.DuottTum.js.map → promo-banner.kE1-WkzI.js.map} +1 -1
  160. package/dist/chunks/{radio-group.BANaG-Fa.js → radio-group.XmRPh03c.js} +4 -4
  161. package/dist/chunks/radio-group.XmRPh03c.js.map +1 -0
  162. package/dist/chunks/{rich-text-editor.Dbc9Y2YC.js → rich-text-editor.Cv_Vwt-6.js} +6 -6
  163. package/dist/chunks/{rich-text-editor.Dbc9Y2YC.js.map → rich-text-editor.Cv_Vwt-6.js.map} +1 -1
  164. package/dist/chunks/{search-bar.CAsAh02R.js → search-bar.5tObtLfW.js} +3 -3
  165. package/dist/chunks/{search-bar.CAsAh02R.js.map → search-bar.5tObtLfW.js.map} +1 -1
  166. package/dist/chunks/{secondary-nav.DOgZJUTd.js → secondary-nav.Bhn5bVYI.js} +5 -5
  167. package/dist/chunks/secondary-nav.Bhn5bVYI.js.map +1 -0
  168. package/dist/chunks/{segmented-control.6XApEjVS.js → segmented-control.CEt2dz4n.js} +2 -2
  169. package/dist/chunks/segmented-control.CEt2dz4n.js.map +1 -0
  170. package/dist/chunks/{selection-card-group.emQVruZd.js → selection-card-group.DHXtJpoB.js} +11 -11
  171. package/dist/chunks/selection-card-group.DHXtJpoB.js.map +1 -0
  172. package/dist/chunks/{sidepanel.DcrakBM9.js → sidepanel._30g8POM.js} +6 -6
  173. package/dist/chunks/sidepanel._30g8POM.js.map +1 -0
  174. package/dist/chunks/{step.Ch6oovwT.js → step.5_ZukVqJ.js} +2 -2
  175. package/dist/chunks/{step.Ch6oovwT.js.map → step.5_ZukVqJ.js.map} +1 -1
  176. package/dist/chunks/{structured-list-item.exe4zQXe.js → structured-list-item.CBzznwcF.js} +3 -3
  177. package/dist/chunks/{structured-list-item.exe4zQXe.js.map → structured-list-item.CBzznwcF.js.map} +1 -1
  178. package/dist/chunks/{summary-grid.types.BYqz5zdo.js → summary-grid.types.BR_EGvRg.js} +4 -4
  179. package/dist/chunks/{summary-grid.types.BYqz5zdo.js.map → summary-grid.types.BR_EGvRg.js.map} +1 -1
  180. package/dist/chunks/{tab.Bat55rEc.js → tab.D_k5AVHk.js} +4 -4
  181. package/dist/chunks/tab.D_k5AVHk.js.map +1 -0
  182. package/dist/chunks/{table-of-contents.DIDNJXqh.js → table-of-contents.CJ2yMbAG.js} +15 -15
  183. package/dist/chunks/table-of-contents.CJ2yMbAG.js.map +1 -0
  184. package/dist/chunks/tag.BE1j0Oid.js +69 -0
  185. package/dist/chunks/tag.BE1j0Oid.js.map +1 -0
  186. package/dist/chunks/{textarea.-owTWdhj.js → textarea.BYshPd98.js} +4 -4
  187. package/dist/chunks/textarea.BYshPd98.js.map +1 -0
  188. package/dist/chunks/{timeline-item.DvlhZ_-D.js → timeline-item.Sy_DSw6p.js} +9 -9
  189. package/dist/chunks/{timeline-item.DvlhZ_-D.js.map → timeline-item.Sy_DSw6p.js.map} +1 -1
  190. package/dist/chunks/title-details.C4ZvxPMu.js +144 -0
  191. package/dist/chunks/title-details.C4ZvxPMu.js.map +1 -0
  192. package/dist/chunks/{toast.N4m58lr8.js → toast.u5Y_CGe_.js} +2 -2
  193. package/dist/chunks/{toast.N4m58lr8.js.map → toast.u5Y_CGe_.js.map} +1 -1
  194. package/dist/chunks/{toggle.BqQ7NGMb.js → toggle.BW8ww0Ih.js} +2 -2
  195. package/dist/chunks/toggle.BW8ww0Ih.js.map +1 -0
  196. package/dist/chunks/tooltip.TFOGHOO0.js.map +1 -1
  197. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CMkHWnq2.js → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js} +2 -2
  198. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CMkHWnq2.js.map → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js.map} +1 -1
  199. package/dist/chunks/use-bento-toast-controller.BAoPbtq7.js.map +1 -1
  200. package/dist/chunks/{use-date-input-formatter.DTQ7YmPb.js → use-date-input-formatter._ik1DYYV.js} +2 -2
  201. package/dist/chunks/{use-date-input-formatter.DTQ7YmPb.js.map → use-date-input-formatter._ik1DYYV.js.map} +1 -1
  202. package/dist/chunks/use-dynamic-date-fns-locale.BMO9rsEh.js +39 -0
  203. package/dist/chunks/use-dynamic-date-fns-locale.BMO9rsEh.js.map +1 -0
  204. package/dist/code-snippet.js +1 -1
  205. package/dist/dashboard-template.js +1 -1
  206. package/dist/dashed-underline.js +1 -1
  207. package/dist/data-grid-template.js +1 -1
  208. package/dist/data-grid.js +1 -1
  209. package/dist/date-picker.js +2 -2
  210. package/dist/date-range-picker.js +2 -2
  211. package/dist/date-time-picker.js +4 -4
  212. package/dist/draggable.js +2 -2
  213. package/dist/dropdown.js +2 -2
  214. package/dist/empty-state.js +1 -1
  215. package/dist/file-uploader.js +1 -1
  216. package/dist/filter-bar.js +1 -1
  217. package/dist/form-layout.js +1 -1
  218. package/dist/header-with-views.js +1 -1
  219. package/dist/header.js +1 -1
  220. package/dist/index.js +62 -62
  221. package/dist/input-field-password.js +1 -1
  222. package/dist/input-field-phone-number.js +1 -1
  223. package/dist/input-field.js +1 -1
  224. package/dist/input-time.js +1 -1
  225. package/dist/inspector.js +2 -2
  226. package/dist/internal.js +10 -10
  227. package/dist/link.js +1 -1
  228. package/dist/list.js +1 -1
  229. package/dist/menu.js +1 -1
  230. package/dist/modal-fullscreen.js +1 -1
  231. package/dist/modal.js +2 -2
  232. package/dist/navigation-menu.js +1 -1
  233. package/dist/pagination.js +1 -1
  234. package/dist/popover.js +1 -1
  235. package/dist/progress-bar.js +6 -6
  236. package/dist/progress-bar.js.map +1 -1
  237. package/dist/promo-banner.js +1 -1
  238. package/dist/radio-group.js +1 -1
  239. package/dist/rich-text-editor.js +1 -1
  240. package/dist/search-bar.js +2 -2
  241. package/dist/secondary-nav.js +1 -1
  242. package/dist/segmented-control.js +1 -1
  243. package/dist/selection-card.js +1 -1
  244. package/dist/sidepanel.js +1 -1
  245. package/dist/stepper.js +1 -1
  246. package/dist/structured-list.js +1 -1
  247. package/dist/styles/bento-dark.css +3 -3
  248. package/dist/styles/bento-light.css +4 -4
  249. package/dist/styles/bento.css +4 -4
  250. package/dist/styles/legacy.css +4 -4
  251. package/dist/styles/styleguide.css +4 -4
  252. package/dist/styles/utility.css +4 -4
  253. package/dist/summary-grid.js +1 -1
  254. package/dist/table-of-contents.js +1 -1
  255. package/dist/tabs.js +1 -1
  256. package/dist/tag.js +1 -1
  257. package/dist/textarea.js +1 -1
  258. package/dist/timeline.js +1 -1
  259. package/dist/toast.js +1 -1
  260. package/dist/toggle.js +1 -1
  261. package/dist/tutorial.js +1 -1
  262. package/dist/web-types.json +2 -2
  263. package/package.json +6 -6
  264. package/dist/chunks/accordion-item.CDqXAJ_o.js.map +0 -1
  265. package/dist/chunks/action-bar.Y0-Y1Lxb.js.map +0 -1
  266. package/dist/chunks/ai-tag.BQQA6de2.js.map +0 -1
  267. package/dist/chunks/anchor-scroller.B2TgWdCo.js.map +0 -1
  268. package/dist/chunks/base-modal.CD51pnsZ.js +0 -433
  269. package/dist/chunks/base-modal.CD51pnsZ.js.map +0 -1
  270. package/dist/chunks/calendar.Dndck6oT.js.map +0 -1
  271. package/dist/chunks/card.DKvGbswE.js +0 -224
  272. package/dist/chunks/card.DKvGbswE.js.map +0 -1
  273. package/dist/chunks/checkbox-group.BqLVduAB.js.map +0 -1
  274. package/dist/chunks/checkbox.OqIysGJA.js.map +0 -1
  275. package/dist/chunks/cross-circle-fill-small.ganKvfe0.js.map +0 -1
  276. package/dist/chunks/data-grid.oiH-QM7_.js.map +0 -1
  277. package/dist/chunks/date-picker.94wdYFML.js.map +0 -1
  278. package/dist/chunks/dropdown.DivEbn7p.js.map +0 -1
  279. package/dist/chunks/file-uploader.BuOQRa-V.js.map +0 -1
  280. package/dist/chunks/filter-bar.B14faBNI.js.map +0 -1
  281. package/dist/chunks/info-icon-with-popover.CLGZteKS.js.map +0 -1
  282. package/dist/chunks/input-field-password.BPjmZ2vh.js.map +0 -1
  283. package/dist/chunks/input-field.DgQG5TCW.js.map +0 -1
  284. package/dist/chunks/inspector.CEiwH5Pt.js.map +0 -1
  285. package/dist/chunks/link.DHhC2vrX.js.map +0 -1
  286. package/dist/chunks/modal-fullscreen.DtG6vHhq.js.map +0 -1
  287. package/dist/chunks/navigation-menu-group.E-24hOWI.js.map +0 -1
  288. package/dist/chunks/pagination.B2Kgh-MF.js.map +0 -1
  289. package/dist/chunks/radio-group.BANaG-Fa.js.map +0 -1
  290. package/dist/chunks/secondary-nav.DOgZJUTd.js.map +0 -1
  291. package/dist/chunks/segmented-control.6XApEjVS.js.map +0 -1
  292. package/dist/chunks/selection-card-group.emQVruZd.js.map +0 -1
  293. package/dist/chunks/sidepanel.DcrakBM9.js.map +0 -1
  294. package/dist/chunks/tab.Bat55rEc.js.map +0 -1
  295. package/dist/chunks/table-of-contents.DIDNJXqh.js.map +0 -1
  296. package/dist/chunks/tag.DmGI_QZ-.js +0 -63
  297. package/dist/chunks/tag.DmGI_QZ-.js.map +0 -1
  298. package/dist/chunks/textarea.-owTWdhj.js.map +0 -1
  299. package/dist/chunks/title-details.DoGThvsa.js +0 -176
  300. package/dist/chunks/title-details.DoGThvsa.js.map +0 -1
  301. package/dist/chunks/toggle.BqQ7NGMb.js.map +0 -1
@@ -0,0 +1,441 @@
1
+ import { useAttrs as ue, defineComponent as F, useSlots as V, ref as f, computed as d, inject as ce, watch as U, nextTick as de, onUnmounted as me, openBlock as L, createBlock as E, normalizeClass as K, createSlots as X, withCtx as i, createElementVNode as y, normalizeStyle as C, unref as a, renderSlot as c, createCommentVNode as G, createVNode as H, onMounted as ge, provide as N, toRefs as ve, createElementBlock as fe, mergeProps as pe, withKeys as be, withDirectives as _e } from "vue";
2
+ import { B as ye } from "./button.Ciflfide.js";
3
+ import { B as Le } from "./focus-trap.Co-S6goa.js";
4
+ import { u as Z } from "./use-has-slot.CyMiImRQ.js";
5
+ import { u as he } from "./index.B875RXHM.js";
6
+ import { l as Ae } from "./button-actions.uIjzze43.js";
7
+ import { g as Ce } from "./generate-uid.DBWe4g6T.js";
8
+ import { B as Ee } from "./directive.D1-d-C2K.js";
9
+ import { _ as Oe } from "./cross.Daa8LxjC.js";
10
+ import { B as Ie, D as ke, a as Pe } from "./dialog-page.keys.Dym9e6k3.js";
11
+ import { B as Q } from "./typography.wIM07Hbl.js";
12
+ import { F as Se } from "./footer-actions.Dl20Q1WX.js";
13
+ import { D as De } from "./dialog-page.D60pjDsQ.js";
14
+ import { o as Be } from "./resize.Bqks3WUm.js";
15
+ import { G as Te, a as Ne } from "./grid-layout.CCWNscU_.js";
16
+ import { _ as x } from "./_plugin-vue_export-helper.CHgC5LLL.js";
17
+ import "../assets/base-modal.css";
18
+ const Ge = () => {
19
+ const e = ue(), O = (m, n) => Object.fromEntries(Object.entries(m).filter(([g]) => n(g)));
20
+ return {
21
+ getAriaAttributes: (m) => O(m ?? e, (n) => n.startsWith("aria-")),
22
+ getRootAttributes: (m) => O(m ?? e, (n) => !n.startsWith("aria-"))
23
+ };
24
+ };
25
+ var Re = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.DIALOG = "dialog", e))(Re || {}), Fe = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(Fe || {}), R = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(R || {}), k = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(k || {}), W = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(W || {}), we = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(we || {}), $e = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))($e || {});
26
+ const ee = {
27
+ "de-DE": { ariaLabelFallback: "Modal", close: "Schließen" },
28
+ "en-GB": { ariaLabelFallback: "modal", close: "Close" },
29
+ "en-US": { ariaLabelFallback: "modal", close: "Close" },
30
+ "es-419": { ariaLabelFallback: "modal", close: "Cerrar" },
31
+ "es-ES": { ariaLabelFallback: "modal", close: "Cerrar" },
32
+ "es-MX": { ariaLabelFallback: "modal", close: "Cerrar" },
33
+ "fr-FR": { ariaLabelFallback: "fenêtre modale", close: "Fermer" },
34
+ "it-IT": { ariaLabelFallback: "modale", close: "Chiudi" },
35
+ "ja-JP": { ariaLabelFallback: "モーダル", close: "閉じる" },
36
+ "pt-BR": { ariaLabelFallback: "modal", close: "Fechar" },
37
+ "zh-CN": { ariaLabelFallback: "模态", close: "关闭" }
38
+ }, ae = /* @__PURE__ */ Symbol("modal config data injection key"), Me = { class: "b-modal-page__header" }, ze = {
39
+ "aria-label": "modal actions",
40
+ class: "b-modal-page__actions"
41
+ }, Ue = F({}), Ke = /* @__PURE__ */ F({
42
+ ...Ue,
43
+ __name: "modal-page",
44
+ props: {
45
+ actions: { default: null },
46
+ actionsLabel: { default: null },
47
+ columnsSize: { default: k.SMALLER },
48
+ customPadding: { default: null },
49
+ destructiveActions: { type: Boolean, default: !1 },
50
+ withColumnLayout: { type: Boolean, default: !1 },
51
+ pageId: { default: void 0 },
52
+ previousPage: { default: void 0 }
53
+ },
54
+ setup(e) {
55
+ const m = V(), n = Z(m), g = f(null), l = e, w = d(() => ({
56
+ "b-modal-page--custom-padding": l.customPadding
57
+ })), p = d(() => ({
58
+ "b-modal-page__content--with-header": n("default"),
59
+ "b-modal-page__content--with-actions": n("actions") || l.actions?.length
60
+ })), r = d(() => {
61
+ if (!l.customPadding)
62
+ return {};
63
+ const s = {
64
+ paddingLeft: l.customPadding,
65
+ paddingRight: l.customPadding
66
+ }, u = { ...s, paddingTop: void 0, paddingBottom: void 0 };
67
+ return n("default") || (u.paddingTop = l.customPadding), n("actions") || (u.paddingBottom = l.customPadding), {
68
+ header: {
69
+ ...s,
70
+ paddingTop: l.customPadding,
71
+ paddingRight: `${parseInt(l.customPadding, 10) + 26}px`,
72
+ flex: 1
73
+ },
74
+ content: u,
75
+ actions: { ...s, paddingBottom: l.customPadding },
76
+ backButton: { top: l.customPadding, paddingLeft: l.customPadding }
77
+ };
78
+ }), b = d(() => l.withColumnLayout && M.value === R.LARGE), P = d(() => l.columnsSize === k.SMALLER ? [
79
+ { small: 4, medium: 4, large: 4 },
80
+ { small: 8, medium: 8, large: 8 }
81
+ ] : l.columnsSize === k.BIGGER ? [
82
+ { small: 8, medium: 8, large: 8 },
83
+ { small: 4, medium: 4, large: 4 }
84
+ ] : [
85
+ { small: 6, medium: 6, large: 6 },
86
+ { small: 6, medium: 6, large: 6 }
87
+ ]), { activePage: _, height: o, isAnimationActive: I, pageCustomPadding: h, showCloseButton: $, size: M } = ce(ae), S = d(() => _.value === l.pageId || !_.value);
88
+ let D = null;
89
+ return U(
90
+ () => _.value,
91
+ async (s, u) => {
92
+ S.value && (await de(), o.value = `${g.value?.$el?.clientHeight}px`, h.value = l.customPadding, I.value = u !== void 0, D = Be(g.value, () => {
93
+ const v = `${g.value?.$el?.clientHeight}px`;
94
+ v && v !== o.value && (o.value = v);
95
+ }));
96
+ },
97
+ { immediate: !0 }
98
+ ), me(() => {
99
+ D?.disconnect();
100
+ }), (s, u) => (L(), E(De, {
101
+ ref_key: "page",
102
+ ref: g,
103
+ class: K(["b-modal-page", w.value]),
104
+ "page-id": s.pageId,
105
+ "always-show-border": b.value,
106
+ "back-button-styling": r.value?.backButton,
107
+ "previous-page": s.previousPage,
108
+ onAnimationend: u[0] || (u[0] = (v) => I.value = !1)
109
+ }, X({
110
+ content: i(() => [
111
+ y("div", {
112
+ class: K(["b-modal-page__content", p.value]),
113
+ style: C(r.value.content)
114
+ }, [
115
+ a(n)("content") || a(n)("content-col-1") && a(n)("content-col-2") ? (L(), E(a(Q), {
116
+ key: 0,
117
+ el: "div"
118
+ }, {
119
+ default: i(() => [
120
+ b.value ? (L(), E(a(Te), {
121
+ key: 0,
122
+ "column-width": P.value,
123
+ "container-type": a(Ne).NORMAL,
124
+ "no-gap": "",
125
+ class: "b-modal-page__grid"
126
+ }, {
127
+ "col-1": i(() => [
128
+ c(s.$slots, "content-col-1", {}, void 0, !0)
129
+ ]),
130
+ "col-2": i(() => [
131
+ c(s.$slots, "content-col-2", {}, void 0, !0)
132
+ ]),
133
+ _: 3
134
+ }, 8, ["column-width", "container-type"])) : c(s.$slots, "content", { key: 1 }, void 0, !0)
135
+ ]),
136
+ _: 3
137
+ })) : G("", !0)
138
+ ], 6)
139
+ ]),
140
+ _: 2
141
+ }, [
142
+ a(n)("default") || a($) ? {
143
+ name: "header",
144
+ fn: i(() => [
145
+ y("div", {
146
+ class: "b-modal-page__header-container",
147
+ style: C(r.value.header)
148
+ }, [
149
+ y("div", Me, [
150
+ H(a(Q), {
151
+ class: "b-modal-page__title",
152
+ el: "span",
153
+ variant: "title",
154
+ stronger: ""
155
+ }, {
156
+ default: i(() => [
157
+ a(n)("default") ? c(s.$slots, "default", { key: 0 }, void 0, !0) : G("", !0)
158
+ ]),
159
+ _: 3
160
+ })
161
+ ])
162
+ ], 4)
163
+ ]),
164
+ key: "0"
165
+ } : void 0,
166
+ a(n)("actions") ? {
167
+ name: "footer",
168
+ fn: i(() => [
169
+ y("div", {
170
+ class: "b-modal-page__actions-container",
171
+ style: C(r.value.actions)
172
+ }, [
173
+ y("div", ze, [
174
+ c(s.$slots, "actions", {}, void 0, !0)
175
+ ])
176
+ ], 4)
177
+ ]),
178
+ key: "1"
179
+ } : s.actions && s.actions.length > 0 ? {
180
+ name: "footer",
181
+ fn: i(() => [
182
+ y("div", {
183
+ class: "b-modal-page__actions-container",
184
+ style: C(r.value.actions)
185
+ }, [
186
+ H(a(Se), {
187
+ actions: s.actions,
188
+ "actions-label": s.actionsLabel,
189
+ "destructive-actions": s.destructiveActions
190
+ }, null, 8, ["actions", "actions-label", "destructive-actions"])
191
+ ], 4)
192
+ ]),
193
+ key: "2"
194
+ } : void 0
195
+ ]), 1032, ["class", "page-id", "always-show-border", "back-button-styling", "previous-page"]));
196
+ }
197
+ }), He = /* @__PURE__ */ x(Ke, [["__scopeId", "data-v-16a88a6c"]]), We = ["role", "aria-label", "open"], Ye = F({
198
+ i18n: { messages: ee },
199
+ name: "base-modal",
200
+ inheritAttrs: !1
201
+ }), je = /* @__PURE__ */ F({
202
+ ...Ye,
203
+ props: {
204
+ /**
205
+ * List of actions that will be used to render the buttons.
206
+ * First element in the list will be rendered as "primary".
207
+ * All elements after the first will be rendered as "secondary".
208
+ * But you may change the color of 1-st action to red with 'critial' key
209
+ * Not more than 3 action buttons can be provided
210
+ * Or 2 action buttons and 1 Label for them
211
+ *
212
+ * Each object in the list should have a `title`, an `event` and
213
+ * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
214
+ *
215
+ * `title`: Button's text.
216
+ *
217
+ * `event`: Event triggered when clicking the Button.
218
+ *
219
+ * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.
220
+ *
221
+ * ```
222
+ * [{
223
+ * title: 'Primary',2
224
+ * event: () => { ... },
225
+ * icon: FourPeopleIcon
226
+ * }, {
227
+ * title: 'Secondary',
228
+ * event: () => { ... }
229
+ * }]
230
+ * ```
231
+ */
232
+ actions: {
233
+ type: Array,
234
+ default: null
235
+ },
236
+ /**
237
+ * The id of the current active page
238
+ * Should be the same id as the BentoModalPage to be displayed
239
+ */
240
+ activePage: {
241
+ type: String,
242
+ default: null
243
+ },
244
+ /**
245
+ * 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.
246
+ */
247
+ columnsSize: {
248
+ type: String,
249
+ default: k.SMALLER
250
+ },
251
+ /**
252
+ * If provided, manages the padding of the whole modal container
253
+ */
254
+ customPadding: { type: String, default: null },
255
+ /**
256
+ * If passed - sets first button color to red
257
+ */
258
+ destructiveActions: { type: Boolean, default: !1 },
259
+ /**
260
+ * Hides a cross icon on the right side of the title
261
+ */
262
+ hideCloseButton: { type: Boolean, required: !0 },
263
+ /**
264
+ * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.
265
+ */
266
+ initiallyOpen: { type: Boolean, default: !1 },
267
+ /**
268
+ * If set to true, it allows the modal to be closed by clicking outside of it
269
+ */
270
+ isDismissible: { type: Boolean, required: !0 },
271
+ /**
272
+ * Controls the modal's state from the outside. Set it to true to open the modal
273
+ */
274
+ isOpen: { type: Boolean, required: !0 },
275
+ /**
276
+ * Defines whether the modal will be an alert modal
277
+ */
278
+ modalRole: { type: String, default: W.DIALOG },
279
+ /**
280
+ * Sets the width of the modal
281
+ */
282
+ size: {
283
+ type: String,
284
+ default: R.SMALL
285
+ },
286
+ /**
287
+ * If provided, renders the modal's content in a two-column layout an wth dividers separating its content
288
+ */
289
+ withColumnLayout: { type: Boolean, default: !1 }
290
+ },
291
+ emits: ["update:active-page", "close-modal"],
292
+ setup(e, { expose: O, emit: m }) {
293
+ const { t: g } = he({ messages: ee }), { getRootAttributes: l } = Ge(), w = V(), p = Z(w), r = f(null), b = f(!1), P = Ce("modal"), _ = m, o = e, I = d(() => o.isDismissible && !o.hideCloseButton), h = f(o.customPadding), $ = d(() => h.value ? { top: h.value, right: h.value } : {}), M = d(() => o.withColumnLayout && o.size === R.LARGE), S = () => {
294
+ r.value.showModal();
295
+ }, D = () => {
296
+ _("close-modal");
297
+ }, s = () => {
298
+ b.value && r.value && (r.value.close(), A.value[0] && _("update:active-page", A.value[0]), A.value = [], b.value = !1, D());
299
+ }, u = () => {
300
+ r.value.open && (b.value = !0);
301
+ }, v = (t) => {
302
+ t && t.preventDefault(), !(!o.isDismissible && o.modalRole === W.DIALOG) && u();
303
+ }, te = () => {
304
+ o.isDismissible && v();
305
+ }, oe = d(() => ({
306
+ [`b-modal-base__container--${o.size}`]: o.size,
307
+ "b-modal-base__container--hide": b.value,
308
+ "b-modal-base__container--column-layout": M.value,
309
+ "b-modal-base__container--animation": q.value
310
+ }));
311
+ U(
312
+ () => [o.isOpen, r.value],
313
+ ([t, T], [, re]) => {
314
+ if (!T)
315
+ return;
316
+ t ? (S(), A.value.length || A.value.push(z.value)) : !re || u();
317
+ }
318
+ ), U(
319
+ () => o.actions,
320
+ () => {
321
+ o.actions?.[0]?.state === "success" && setTimeout(u, 500);
322
+ },
323
+ { deep: !0 }
324
+ ), ge(() => {
325
+ o.isOpen && r.value && S();
326
+ }), O({
327
+ internalModalActionClose: v
328
+ }), N(Ae, P);
329
+ const { activePage: z, isOpen: Y, size: j } = ve(o), le = f(Ie.TRANSITION_LEVEL_DEEPER), B = f([]), A = f([]), se = (t) => _("update:active-page", t), ne = (t) => () => {
330
+ B.value = B.value?.filter((T) => T !== t);
331
+ }, ie = (t) => (t && B.value.push(t), { unregisterPage: ne(t) }), J = f(""), q = f(!1);
332
+ return N(ae, {
333
+ activePage: z,
334
+ height: J,
335
+ isAnimationActive: q,
336
+ pageCustomPadding: h,
337
+ showCloseButton: I,
338
+ size: j
339
+ }), N(ke, {
340
+ activePage: z,
341
+ animation: le,
342
+ isOpen: Y,
343
+ pages: B,
344
+ previousPages: A,
345
+ updatePage: se
346
+ }), N(Pe, ie), (t, T) => (L(), fe("div", pe(a(l)(t.$attrs), { class: "b-modal-base" }), [
347
+ y("dialog", {
348
+ ref_key: "modal",
349
+ ref: r,
350
+ role: e.modalRole,
351
+ "aria-label": t.$attrs?.["aria-label"] ?? a(g)("ariaLabelFallback"),
352
+ style: C({ height: J.value }),
353
+ class: K(["b-modal-base__container", oe.value]),
354
+ open: e.initiallyOpen,
355
+ onAnimationend: s,
356
+ onKeydown: be(v, ["esc"])
357
+ }, [
358
+ a(Y) || e.initiallyOpen ? _e((L(), E(a(Le), {
359
+ key: 0,
360
+ id: a(P)
361
+ }, {
362
+ default: i(() => [
363
+ I.value ? (L(), E(a(ye), {
364
+ key: 0,
365
+ class: "b-modal-base__close-button",
366
+ variant: "tertiary",
367
+ type: "button",
368
+ style: C($.value),
369
+ onClick: v
370
+ }, {
371
+ default: i(() => [
372
+ H(a(Oe), {
373
+ "svg-title": a(g)("close")
374
+ }, null, 8, ["svg-title"])
375
+ ]),
376
+ _: 1
377
+ }, 8, ["style"])) : G("", !0),
378
+ o.activePage ? c(t.$slots, "default", { key: 1 }, void 0, !0) : (L(), E(a(He), {
379
+ key: 2,
380
+ "with-column-layout": e.withColumnLayout,
381
+ size: a(j),
382
+ "custom-padding": e.customPadding,
383
+ "columns-size": e.columnsSize
384
+ }, X({ _: 2 }, [
385
+ a(p)("default") ? {
386
+ name: "default",
387
+ fn: i(() => [
388
+ c(t.$slots, "default", {}, void 0, !0)
389
+ ]),
390
+ key: "0"
391
+ } : void 0,
392
+ a(p)("content-col-1") ? {
393
+ name: "content-col-1",
394
+ fn: i(() => [
395
+ c(t.$slots, "content-col-1", {}, void 0, !0)
396
+ ]),
397
+ key: "1"
398
+ } : void 0,
399
+ a(p)("content-col-2") ? {
400
+ name: "content-col-2",
401
+ fn: i(() => [
402
+ c(t.$slots, "content-col-2", {}, void 0, !0)
403
+ ]),
404
+ key: "2"
405
+ } : void 0,
406
+ a(p)("content") ? {
407
+ name: "content",
408
+ fn: i(() => [
409
+ c(t.$slots, "content", {}, void 0, !0)
410
+ ]),
411
+ key: "3"
412
+ } : void 0,
413
+ a(p)("actions") ? {
414
+ name: "actions",
415
+ fn: i(() => [
416
+ c(t.$slots, "actions", {}, void 0, !0)
417
+ ]),
418
+ key: "4"
419
+ } : void 0
420
+ ]), 1032, ["with-column-layout", "size", "custom-padding", "columns-size"]))
421
+ ]),
422
+ _: 3
423
+ }, 8, ["id"])), [
424
+ [a(Ee), te]
425
+ ]) : G("", !0)
426
+ ], 46, We)
427
+ ], 16));
428
+ }
429
+ }), ca = /* @__PURE__ */ x(je, [["__scopeId", "data-v-c004427f"]]);
430
+ export {
431
+ k as B,
432
+ we as a,
433
+ $e as b,
434
+ He as c,
435
+ W as d,
436
+ R as e,
437
+ Re as f,
438
+ Fe as g,
439
+ ca as h
440
+ };
441
+ //# sourceMappingURL=base-modal.Bn4ZXwv6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.Bn4ZXwv6.js","sources":["../../../vue2/src/composables/use-attribute-routing/use-attribute-routing.ts","../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/modal.keys.ts","../../../vue2/src/components/modal/components/modal-page/modal-page.vue","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["import { type SetupContext, useAttrs } from 'vue';\n\nexport type Attributes = SetupContext['attrs'];\n\nexport interface AttributeRouting {\n getAriaAttributes: (attrs?: Attributes) => Attributes;\n getRootAttributes: (attrs?: Attributes) => Attributes;\n}\n\n/**\n * Routes ARIA attributes away from a component root to its semantic element.\n *\n * @returns Functions that return ARIA and root attribute groups.\n */\nexport const useAttributeRouting = (): AttributeRouting => {\n const attrs = useAttrs();\n\n const filterAttrs = (attrsArg: Attributes, shouldInclude: (key: string) => boolean): Attributes =>\n Object.fromEntries(Object.entries(attrsArg).filter(([key]) => shouldInclude(key)));\n\n return {\n getAriaAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => key.startsWith('aria-')),\n getRootAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => !key.startsWith('aria-')),\n };\n};\n","/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","export const MODAL_CONFIG_INJECTION_KEY = Symbol('modal config data injection key');\n","<template>\n <dialog-page\n ref=\"page\"\n class=\"b-modal-page\"\n :class=\"modalPageConditionalClasses\"\n :page-id=\"pageId\"\n :always-show-border=\"hasColumnLayout\"\n :back-button-styling=\"customPaddingStyles?.backButton\"\n :previous-page=\"previousPage\"\n @animationend=\"isAnimationActive = false\"\n >\n <template v-if=\"hasSlot('default') || showCloseButton\" #header>\n <div class=\"b-modal-page__header-container\" :style=\"customPaddingStyles.header\">\n <div class=\"b-modal-page__header\">\n <bento-typography class=\"b-modal-page__title\" el=\"span\" variant=\"title\" stronger>\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n </div>\n </div>\n </template>\n\n <template #content>\n <div\n class=\"b-modal-page__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n el=\"div\"\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-page__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"hasSlot('actions')\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <div aria-label=\"modal actions\" class=\"b-modal-page__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </template>\n <template v-else-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, nextTick, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoTypography } from '@/components/typography';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n\n import { FooterActions } from '@/components/internal/footer-actions';\n\n import DialogPage from '@/internal/dialog-page/dialog-page.vue';\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import type { BentoModalPageProps } from './modal-page.types';\n\n const CLOSE_BUTTON_ICON_WIDTH = 26;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const page = ref<InstanceType<typeof DialogPage>>(null);\n\n const props = withDefaults(defineProps<BentoModalPageProps>(), {\n actions: null,\n actionsLabel: null,\n columnsSize: BentoModalColumnLayoutVariant.SMALLER,\n customPadding: null,\n destructiveActions: false,\n withColumnLayout: false,\n pageId: undefined,\n previousPage: undefined,\n });\n\n const modalPageConditionalClasses = computed(() => ({\n 'b-modal-page--custom-padding': props.customPadding,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-page__content--with-header': hasSlot('default'),\n 'b-modal-page__content--with-actions': hasSlot('actions') || props.actions?.length,\n }));\n\n // Setting custom padding styles\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: {\n ...xPadding,\n paddingTop: props.customPadding,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n flex: 1,\n },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n backButton: { top: props.customPadding, paddingLeft: props.customPadding },\n };\n });\n\n // Column layout styles\n const hasColumnLayout = computed(() => props.withColumnLayout && size.value === BentoModalSize.LARGE);\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n // Register page to parent component and inject data from parent component\n const { activePage, height, isAnimationActive, pageCustomPadding, showCloseButton, size } =\n inject<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY);\n\n const isCurrentPage = computed(() => activePage.value === props.pageId || !activePage.value);\n\n // Animation\n // Set resize observer on mount of update the height of the dialog on resize\n let pageElementObserver: ResizeObserver | null = null;\n\n // Watching activePage changes to set the height of the page and set isAnimationActive\n watch(\n () => activePage.value,\n async (value, oldValue) => {\n if (isCurrentPage.value) {\n await nextTick();\n height.value = `${page.value?.$el?.clientHeight}px`;\n pageCustomPadding.value = props.customPadding;\n // only set isAnimationActive to true if its going from two different pages and not from null to the first page\n isAnimationActive.value = oldValue !== undefined;\n\n pageElementObserver = observeSizeOfElement(page.value, () => {\n const pageHeight = `${page.value?.$el?.clientHeight}px`;\n if (pageHeight && pageHeight !== height.value) {\n height.value = pageHeight;\n }\n });\n }\n },\n { immediate: true }\n );\n\n // Disconnect observer on unmounting the page\n onUnmounted(() => {\n pageElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalPage is used to render different pages of the Modal component\n *\n * @example\n * import { BentoModal, BentoModalPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal, BentoModalPage },\n * template: `\n * <bento-modal active-page='page1' :is-open='true'>\n * <bento-modal-page\n * pageId='page1'\n * actions-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1\n * <template #content>\n * Page 1 content\n * </template>\n * </bento-modal-page>\n * <bento-modal-page\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2\n * <template #content>\n * Page 2 content\n * </template>\n * </bento-modal-page>\n * </bento-modal>\n * `\n * }\n */\n export default defineComponent({});\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-page.scss\" />\n","<template>\n <div v-bind=\"getRootAttributes($attrs)\" class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"$attrs?.['aria-label'] ?? t('ariaLabelFallback')\"\n :style=\"{ height: height }\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap\n v-if=\"isOpen || initiallyOpen\"\n :id=\"modalId\"\n v-bento-click-outside-directive=\"closeModalOnClickOutside\"\n >\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-page\n v-else\n :with-column-layout=\"withColumnLayout\"\n :size=\"size\"\n :custom-padding=\"customPadding\"\n :columns-size=\"columnsSize\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1\n ><slot name=\"content-col-1\"></slot\n ></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2\n ><slot name=\"content-col-2\"></slot\n ></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n <template v-if=\"hasSlot('actions')\" #actions><slot name=\"actions\"></slot></template>\n </bento-modal-page>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoButton, type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { useAttributeRouting, useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n import messages from './messages.json';\n\n import { BentoModalPage } from '@/components/modal/components/modal-page';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const { getRootAttributes } = useAttributeRouting();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const pageCustomPadding = ref(props.customPadding);\n\n const customPaddingStyles = computed(() => {\n if (!pageCustomPadding.value) {\n return {};\n }\n\n return { top: pageCustomPadding.value, right: pageCustomPadding.value };\n });\n\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit('close-modal');\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emitCloseEvent();\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n const closeModalOnClickOutside = () => {\n if (props.isDismissible) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n 'b-modal-base__container--animation': isAnimationActive.value,\n }));\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n // add the first page to the array when the modal opens\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n\n // Modal pagination\n const { activePage, isOpen, size } = toRefs(props);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n const height = ref('');\n const isAnimationActive = ref(false);\n\n provide<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY, {\n activePage,\n height,\n isAnimationActive,\n pageCustomPadding,\n showCloseButton,\n size,\n });\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["useAttributeRouting","attrs","useAttrs","filterAttrs","attrsArg","shouldInclude","key","overrideAttrs","BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","MODAL_CONFIG_INJECTION_KEY","__default__$1","defineComponent","slots","useSlots","hasSlot","useHasSlot","page","ref","props","__props","modalPageConditionalClasses","computed","modalContentConditionalClasses","customPaddingStyles","xPadding","content","hasColumnLayout","size","computedColumnWidth","activePage","height","isAnimationActive","pageCustomPadding","showCloseButton","inject","isCurrentPage","pageElementObserver","watch","value","oldValue","nextTick","observeSizeOfElement","pageHeight","onUnmounted","__default__","messages","t","useI18n","getRootAttributes","modal","isClosing","modalId","generateUid","emit","__emit","openModal","emitCloseEvent","closeModalAfterAnimation","previousPages","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","modalConditionalClasses","newIsOpen","newModalValue","oldModalValue","onMounted","__expose","provide","MODAL_DIALOG_ID_INJECTION_KEY","isOpen","toRefs","animation","BentoDialogPageAnimation","pages","updatePage","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,MAAA;AACH,QAAAC,IAAAC,GAAA,GAEAC,IAAA,CAAAC,GAAAC,MAAA,OAAA,YAAA,OAAA,QAAAD,CAAA,EAAA,OAAA,CAAA,CAAAE,CAAA,MAAAD,EAAAC,CAAA,CAAA,CAAA;AAGA,SAAA;AAAA,IAAO,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,IACmG,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAA,CAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,EACC;AAE/G;ACrBO,IAAAE,KAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA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"}
@@ -1,5 +1,5 @@
1
1
  import { ref as f, watch as _, nextTick as m, defineComponent as y, toRef as b, computed as p, provide as h, openBlock as A, createElementBlock as w, createElementVNode as B, normalizeClass as N, createVNode as k, unref as E, createBlock as T, createCommentVNode as C } from "vue";
2
- import { M as I, d as W, B as M, f as R } from "./button-actions.BjSTWgNC.js";
2
+ import { M as I, d as W, B as M, f as R } from "./button-actions.uIjzze43.js";
3
3
  import { b as g } from "./index.DCpihRYV.js";
4
4
  import { _ as O } from "./_plugin-vue_export-helper.CHgC5LLL.js";
5
5
  import "../assets/button-actions-with-menu.css";
@@ -82,4 +82,4 @@ const L = (v) => {
82
82
  export {
83
83
  J as B
84
84
  };
85
- //# sourceMappingURL=button-actions-with-menu.LF1NNScj.js.map
85
+ //# sourceMappingURL=button-actions-with-menu.CrbF2BSQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.LF1NNScj.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, ref, type Ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: Ref<number>;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref(defaultActionsCount.value);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount.value) {\n displayedActionsCount.value += 1;\n\n await showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n await hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n await showActions();\n } else {\n await hideActions();\n }\n });\n\n watch(defaultActionsCount, async count => {\n displayedActionsCount.value = count;\n\n if (breakpoint && windowWidth.value <= breakpoint && container.value) {\n await hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions } from '@/components/button';\n import { type BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { computed, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { type ButtonActionsWithMenuProps } from './button-actions-with-menu.types';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n const props = withDefaults(defineProps<ButtonActionsWithMenuProps>(), {\n actionsLayout: 'buttons-end',\n disableResponsiveBehavior: false,\n displayedActions: undefined,\n inverse: false,\n hideDisplayedActionsBreakpoint: 0,\n menuPosition: 'bottom-start',\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: toRef(props, 'displayedActions'),\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]: props.actionsLayout === 'buttons-end',\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]: props.actionsLayout === 'buttons-start',\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() => {\n if (displayedActionsCount.value === undefined || displayedActionsCount.value >= props.actions.length) {\n return [];\n }\n\n const actionsToProcess = props.actions.slice(displayedActionsCount.value, props.actions.length);\n\n return actionsToProcess.flatMap<BentoMenuItem>(action => {\n if (!action.data) {\n return {\n text: action.title,\n handler: () => action.event?.({} as Event),\n icon: action.icon,\n critical: action.critical,\n disabled: action.disabled,\n };\n }\n\n return action.data;\n });\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * {\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * },\n * {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\"\n * :displayedActions=\"2\"\n * />\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","__props","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","computedMenuActions","action"],"mappings":";;;;;AAUO,MAAAA,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,EAAA,KAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA,KAAAK;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,EAAA,UACII,EAAA,SAAA,GAEA,MAAAG,EAAA;AAAA,EACJ,GAGJI,IAAA,YAAA;AACI,UAAAH,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA;AAGA,IAAAQ,IAAAC,KAAAN,EAAA,QAA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AAA,kBAAA;AAAA,MACE,kEAAA0B,EAAA;AAAA,IACT,EAAA,GAGrFS,IAAAP,EAAA,MACIrB,EAAA,UAAA,UAAAA,EAAA,SAAAP,EAAA,QAAA,SACI,CAAA,IAGJA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAEA,QAAA,CAAAoC,MACIA,EAAA,OAUAA,EAAA,OATI;AAAA,MAAO,MAAAA,EAAA;AAAA,MACU,SAAA,MAAAA,EAAA,QAAA,CAAA,CAAA;AAAA,MAC4B,MAAAA,EAAA;AAAA,MAC5B,UAAAA,EAAA;AAAA,MACI,UAAAA,EAAA;AAAA,IACA,CAIX,CACjB;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-actions-with-menu.CrbF2BSQ.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, ref, type Ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: Ref<number>;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref(defaultActionsCount.value);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount.value) {\n displayedActionsCount.value += 1;\n\n await showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n await hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n await showActions();\n } else {\n await hideActions();\n }\n });\n\n watch(defaultActionsCount, async count => {\n displayedActionsCount.value = count;\n\n if (breakpoint && windowWidth.value <= breakpoint && container.value) {\n await hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions } from '@/components/button';\n import { type BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { computed, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { type ButtonActionsWithMenuProps } from './button-actions-with-menu.types';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n const props = withDefaults(defineProps<ButtonActionsWithMenuProps>(), {\n actionsLayout: 'buttons-end',\n disableResponsiveBehavior: false,\n displayedActions: undefined,\n inverse: false,\n hideDisplayedActionsBreakpoint: 0,\n menuPosition: 'bottom-start',\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: toRef(props, 'displayedActions'),\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]: props.actionsLayout === 'buttons-end',\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]: props.actionsLayout === 'buttons-start',\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() => {\n if (displayedActionsCount.value === undefined || displayedActionsCount.value >= props.actions.length) {\n return [];\n }\n\n const actionsToProcess = props.actions.slice(displayedActionsCount.value, props.actions.length);\n\n return actionsToProcess.flatMap<BentoMenuItem>(action => {\n if (!action.data) {\n return {\n text: action.title,\n handler: () => action.event?.({} as Event),\n icon: action.icon,\n critical: action.critical,\n disabled: action.disabled,\n };\n }\n\n return action.data;\n });\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * {\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * },\n * {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\"\n * :displayedActions=\"2\"\n * />\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","hideActions","watch","newWidth","containerEl","oldWidth","count","__default__","__props","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","computedMenuActions","action"],"mappings":";;;;;AAUO,MAAAA,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,EAAA,KAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA,KAAAK;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,EAAA,UACII,EAAA,SAAA,GAEA,MAAAG,EAAA;AAAA,EACJ,GAGJI,IAAA,YAAA;AACI,UAAAH,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,SAAAH,GAAA,OAAA,eAAA;AAGA,IAAAQ,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEA,MAAAO,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAV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ACIrB,EAAA,UAAA,UAAAA,EAAA,SAAAP,EAAA,QAAA,SACI,CAAA,IAGJA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAEA,QAAA,CAAAoC,MACIA,EAAA,OAUAA,EAAA,OATI;AAAA,MAAO,MAAAA,EAAA;AAAA,MACU,SAAA,MAAAA,EAAA,QAAA,CAAA,CAAA;AAAA,MAC4B,MAAAA,EAAA;AAAA,MAC5B,UAAAA,EAAA;AAAA,MACI,UAAAA,EAAA;AAAA,IACA,CAIX,CACjB;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as $, useSlots as Z, computed as h, openBlock as r, createBlock as y, withModifiers as J, normalizeClass as F, createSlots as K, withCtx as b, renderSlot as w, unref as g, createElementVNode as P, createCommentVNode as I, mergeProps as j, renderList as Q, normalizeProps as Me, guardReactiveProps as Te, resolveComponent as O, createVNode as B, createTextVNode as U, toDisplayString as V, onMounted as x, onUnmounted as fe, useAttrs as we, inject as N, Transition as me, createElementBlock as k, Teleport as Ne, getCurrentInstance as Re, resolveDynamicComponent as H, ref as v, toHandlers as oe, withKeys as E, Fragment as q, watch as pe, nextTick as ee, toRef as ve, normalizeStyle as be, provide as Ae } from "vue";
2
- import { B as S } from "./button.D6d4P8nC.js";
2
+ import { B as S } from "./button.Ciflfide.js";
3
3
  import { B as De } from "./loading-indicator.BPol9I84.js";
4
4
  import { _ as Pe } from "./cross-circle-fill.DJbpTaVE.js";
5
5
  import { _ as Fe } from "./checkmark-circle-fill.Caog04lx.js";
@@ -15,9 +15,9 @@ import { g as He } from "./generate-uid.DBWe4g6T.js";
15
15
  import { _ as Je } from "./chevron-down.DDkuHzKj.js";
16
16
  /* empty css */
17
17
  import { a as ze, _ as re } from "./chevron-left.COoYL-X9.js";
18
- import { a as ue, B as Xe } from "./base-button.C8hw-h9-.js";
18
+ import { a as ue, B as Xe } from "./base-button.Bi5JR_6k.js";
19
19
  import { t as qe } from "./truncate.DmCXQmeb.js";
20
- import { _ as Ze } from "./link.DHhC2vrX.js";
20
+ import { _ as Ze } from "./link.types.BGj7apK3.js";
21
21
  import { o as Qe } from "./resize.Bqks3WUm.js";
22
22
  import { g as xe } from "./es6.yPcTMnSH.js";
23
23
  import "../assets/button-actions.css";
@@ -1213,7 +1213,7 @@ const Ut = /* @__PURE__ */ L(Wt, [["render", Vt], ["__scopeId", "data-v-15efaaa1
1213
1213
  }, 8, ["disabled"])) : I("", !0)
1214
1214
  ], 34));
1215
1215
  }
1216
- }), Ht = /* @__PURE__ */ L(Yt, [["__scopeId", "data-v-bbe808f3"]]), Jt = /* @__PURE__ */ Symbol(
1216
+ }), Ht = /* @__PURE__ */ L(Yt, [["__scopeId", "data-v-e3f17ae3"]]), Jt = /* @__PURE__ */ Symbol(
1217
1217
  "button actions with menu container injection key"
1218
1218
  ), zt = 242, ce = parseInt(xe, 10), Xt = (e, i, o) => {
1219
1219
  const t = v(0);
@@ -1411,4 +1411,4 @@ export {
1411
1411
  Ce as l,
1412
1412
  ft as u
1413
1413
  };
1414
- //# sourceMappingURL=button-actions.BjSTWgNC.js.map
1414
+ //# sourceMappingURL=button-actions.uIjzze43.js.map