@adyen/bento-vue3 2.1.0 → 2.2.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 (258) hide show
  1. package/dist/@types/bento-translation-keys.generated.d.ts +10 -0
  2. package/dist/@types/index.d.ts +67 -10
  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/alert.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/button.css +1 -1
  13. package/dist/assets/card.css +1 -1
  14. package/dist/assets/checkbox-input.css +1 -1
  15. package/dist/assets/dashboard-section.css +1 -1
  16. package/dist/assets/data-grid.css +1 -1
  17. package/dist/assets/date-filter.css +1 -0
  18. package/dist/assets/date-range-filter.css +1 -0
  19. package/dist/assets/dialog-page.css +1 -1
  20. package/dist/assets/draggable-handle.css +1 -1
  21. package/dist/assets/dropdown.css +1 -1
  22. package/dist/assets/file-uploader.css +1 -1
  23. package/dist/assets/filter-bar.css +1 -1
  24. package/dist/assets/fixed-scroller.css +1 -1
  25. package/dist/assets/form-layout-title.css +1 -1
  26. package/dist/assets/grid-layout.css +1 -1
  27. package/dist/assets/input-field.css +1 -1
  28. package/dist/assets/input-with-dropdown-filter.css +1 -0
  29. package/dist/assets/inspector.css +1 -1
  30. package/dist/assets/modal-fullscreen.css +1 -1
  31. package/dist/assets/navigation-menu-group.css +1 -1
  32. package/dist/assets/pagination.css +1 -1
  33. package/dist/assets/secondary-nav.css +1 -1
  34. package/dist/assets/sidepanel.css +1 -1
  35. package/dist/assets/table-of-contents.css +1 -1
  36. package/dist/assets/textarea.css +1 -1
  37. package/dist/assets/timeline-item.css +1 -1
  38. package/dist/assets/toggle.css +1 -1
  39. package/dist/button.js +1 -1
  40. package/dist/card.js +1 -1
  41. package/dist/checkbox.js +2 -2
  42. package/dist/chunks/{action-bar.C6XFuiE0.js → action-bar.BIidNGlt.js} +3 -3
  43. package/dist/chunks/{action-bar.C6XFuiE0.js.map → action-bar.BIidNGlt.js.map} +1 -1
  44. package/dist/chunks/{ai-tag.BLDTP7fs.js → ai-tag.B1YHMfAh.js} +2 -2
  45. package/dist/chunks/{ai-tag.BLDTP7fs.js.map → ai-tag.B1YHMfAh.js.map} +1 -1
  46. package/dist/chunks/{alert.BYmn1ewo.js → alert.PGzfyHZI.js} +80 -98
  47. package/dist/chunks/alert.PGzfyHZI.js.map +1 -0
  48. package/dist/chunks/{anchor-scroller.B35-JMuH.js → anchor-scroller.CSOg3htL.js} +2 -2
  49. package/dist/chunks/{anchor-scroller.B35-JMuH.js.map → anchor-scroller.CSOg3htL.js.map} +1 -1
  50. package/dist/chunks/{base-modal.CulokESn.js → base-modal.A52tojyk.js} +5 -5
  51. package/dist/chunks/{base-modal.CulokESn.js.map → base-modal.A52tojyk.js.map} +1 -1
  52. package/dist/chunks/{button-actions-with-menu.BsCmJeKU.js → button-actions-with-menu.DkPSfKO9.js} +2 -2
  53. package/dist/chunks/{button-actions-with-menu.BsCmJeKU.js.map → button-actions-with-menu.DkPSfKO9.js.map} +1 -1
  54. package/dist/chunks/{button-actions.DvuGEQxM.js → button-actions.BYoctIth.js} +2 -2
  55. package/dist/chunks/button-actions.BYoctIth.js.map +1 -0
  56. package/dist/chunks/{calendar.EuBZ9HoM.js → calendar.BhoyTBN1.js} +18 -18
  57. package/dist/chunks/{calendar.EuBZ9HoM.js.map → calendar.BhoyTBN1.js.map} +1 -1
  58. package/dist/chunks/{card.OErI_R47.js → card.DL3-xIH9.js} +3 -3
  59. package/dist/chunks/{card.OErI_R47.js.map → card.DL3-xIH9.js.map} +1 -1
  60. package/dist/chunks/{checkbox-group.Deb5pHjj.js → checkbox-group.993HE54c.js} +3 -3
  61. package/dist/chunks/{checkbox-group.Deb5pHjj.js.map → checkbox-group.993HE54c.js.map} +1 -1
  62. package/dist/chunks/{checkbox.YBhv3GCJ.js → checkbox.DpT4DfSl.js} +2 -2
  63. package/dist/chunks/{checkbox.YBhv3GCJ.js.map → checkbox.DpT4DfSl.js.map} +1 -1
  64. package/dist/chunks/{code-snippet.DNDXr7t6.js → code-snippet.8XinCILe.js} +4 -4
  65. package/dist/chunks/{code-snippet.DNDXr7t6.js.map → code-snippet.8XinCILe.js.map} +1 -1
  66. package/dist/chunks/{controls-group.CC3yZiTT.js → controls-group.BcbFbqr-.js} +2 -2
  67. package/dist/chunks/{controls-group.CC3yZiTT.js.map → controls-group.BcbFbqr-.js.map} +1 -1
  68. package/dist/chunks/{copy.YBeE8V9S.js → copy.DrHbwkFX.js} +3 -3
  69. package/dist/chunks/{copy.YBeE8V9S.js.map → copy.DrHbwkFX.js.map} +1 -1
  70. package/dist/chunks/{dashboard-section.CjC3fVU6.js → dashboard-section.CVDLs9xL.js} +4 -4
  71. package/dist/chunks/dashboard-section.CVDLs9xL.js.map +1 -0
  72. package/dist/chunks/{dashed-underline.DAtZOaad.js → dashed-underline.BH4vfrBh.js} +3 -3
  73. package/dist/chunks/{dashed-underline.DAtZOaad.js.map → dashed-underline.BH4vfrBh.js.map} +1 -1
  74. package/dist/chunks/{data-grid-template.bPjGSga2.js → data-grid-template.5keqokzt.js} +4 -4
  75. package/dist/chunks/{data-grid-template.bPjGSga2.js.map → data-grid-template.5keqokzt.js.map} +1 -1
  76. package/dist/chunks/{data-grid.o5MQdWnJ.js → data-grid.DP4VPyjR.js} +20 -20
  77. package/dist/chunks/{data-grid.o5MQdWnJ.js.map → data-grid.DP4VPyjR.js.map} +1 -1
  78. package/dist/chunks/date-filter.EysjbedJ.js +156 -0
  79. package/dist/chunks/date-filter.EysjbedJ.js.map +1 -0
  80. package/dist/chunks/{date-picker.DyB8XkiY.js → date-picker.CQ3eoDIo.js} +10 -10
  81. package/dist/chunks/{date-picker.DyB8XkiY.js.map → date-picker.CQ3eoDIo.js.map} +1 -1
  82. package/dist/chunks/date-range-filter.DwNzkqTo.js +949 -0
  83. package/dist/chunks/date-range-filter.DwNzkqTo.js.map +1 -0
  84. package/dist/chunks/{date-range-picker.BcQUUVcW.js → date-range-picker.BYGk8uh-.js} +60 -60
  85. package/dist/chunks/{date-range-picker.BcQUUVcW.js.map → date-range-picker.BYGk8uh-.js.map} +1 -1
  86. package/dist/chunks/{draggable-handle.CKkSJP0K.js → draggable-handle.D6rFbf1V.js} +2 -2
  87. package/dist/chunks/{draggable-handle.CKkSJP0K.js.map → draggable-handle.D6rFbf1V.js.map} +1 -1
  88. package/dist/chunks/{draggable.jzTSFcM7.js → draggable.DH-Wc8GI.js} +2 -2
  89. package/dist/chunks/{draggable.jzTSFcM7.js.map → draggable.DH-Wc8GI.js.map} +1 -1
  90. package/dist/chunks/{dropdown-tag.BvXqllkv.js → dropdown-tag.DQ_BcUK7.js} +3 -3
  91. package/dist/chunks/{dropdown-tag.BvXqllkv.js.map → dropdown-tag.DQ_BcUK7.js.map} +1 -1
  92. package/dist/chunks/{dropdown.BoSI-Rre.js → dropdown.BJ0cJ9Ea.js} +1471 -1384
  93. package/dist/chunks/dropdown.BJ0cJ9Ea.js.map +1 -0
  94. package/dist/chunks/{empty-state.BuK12EGe.js → empty-state.CECdMida.js} +2 -2
  95. package/dist/chunks/{empty-state.BuK12EGe.js.map → empty-state.CECdMida.js.map} +1 -1
  96. package/dist/chunks/{field-label.vrUwhoOg.js → field-label.Dm9I8IDI.js} +2 -2
  97. package/dist/chunks/{field-label.vrUwhoOg.js.map → field-label.Dm9I8IDI.js.map} +1 -1
  98. package/dist/chunks/{file-uploader.Cv8sm0Jd.js → file-uploader.B8c3MlBD.js} +7 -6
  99. package/dist/chunks/{file-uploader.Cv8sm0Jd.js.map → file-uploader.B8c3MlBD.js.map} +1 -1
  100. package/dist/chunks/filter-bar.BPPxuT_w.js +2552 -0
  101. package/dist/chunks/filter-bar.BPPxuT_w.js.map +1 -0
  102. package/dist/chunks/{fixed-scroller.C0nVzRBU.js → fixed-scroller.nECGGyOp.js} +15 -15
  103. package/dist/chunks/{fixed-scroller.C0nVzRBU.js.map → fixed-scroller.nECGGyOp.js.map} +1 -1
  104. package/dist/chunks/{focus-trap.Co-S6goa.js → focus-trap.BgyHTR_3.js} +1 -2
  105. package/dist/chunks/{focus-trap.Co-S6goa.js.map → focus-trap.BgyHTR_3.js.map} +1 -1
  106. package/dist/chunks/{footer-actions.BJif4sIk.js → footer-actions.B2dxp-b_.js} +2 -2
  107. package/dist/chunks/{footer-actions.BJif4sIk.js.map → footer-actions.B2dxp-b_.js.map} +1 -1
  108. package/dist/chunks/{form-layout-title.C7f1ByNh.js → form-layout-title.h-7dMAq7.js} +2 -2
  109. package/dist/chunks/{form-layout-title.C7f1ByNh.js.map → form-layout-title.h-7dMAq7.js.map} +1 -1
  110. package/dist/chunks/grid-layout.BuhsC4WZ.js +115 -0
  111. package/dist/chunks/grid-layout.BuhsC4WZ.js.map +1 -0
  112. package/dist/chunks/{header-with-views.Dl6bfk_7.js → header-with-views.Bux_-bM4.js} +308 -308
  113. package/dist/chunks/{header-with-views.Dl6bfk_7.js.map → header-with-views.Bux_-bM4.js.map} +1 -1
  114. package/dist/chunks/{header.E-KFjIG7.js → header.BEnZbxIA.js} +4 -4
  115. package/dist/chunks/{header.E-KFjIG7.js.map → header.BEnZbxIA.js.map} +1 -1
  116. package/dist/chunks/{info-icon-with-popover.DqnQnwMI.js → info-icon-with-popover.BRl6sC0B.js} +3 -3
  117. package/dist/chunks/{info-icon-with-popover.DqnQnwMI.js.map → info-icon-with-popover.BRl6sC0B.js.map} +1 -1
  118. package/dist/chunks/{info-icon.D_zu5SYT.js → info-icon.CcM7z-CY.js} +3 -3
  119. package/dist/chunks/{info-icon.D_zu5SYT.js.map → info-icon.CcM7z-CY.js.map} +1 -1
  120. package/dist/chunks/{input-field-password.BXptrVTT.js → input-field-password.0W7vePC4.js} +4 -4
  121. package/dist/chunks/{input-field-password.BXptrVTT.js.map → input-field-password.0W7vePC4.js.map} +1 -1
  122. package/dist/chunks/{input-field-phone-number.Crxi8Wm7.js → input-field-phone-number.RblgK9OP.js} +2 -2
  123. package/dist/chunks/{input-field-phone-number.Crxi8Wm7.js.map → input-field-phone-number.RblgK9OP.js.map} +1 -1
  124. package/dist/chunks/{input-field._keU91LW.js → input-field.B-Nta-en.js} +3 -3
  125. package/dist/chunks/{input-field._keU91LW.js.map → input-field.B-Nta-en.js.map} +1 -1
  126. package/dist/chunks/{input-time.D7UW_ww_.js → input-time.CMKTGRcV.js} +3 -3
  127. package/dist/chunks/{input-time.D7UW_ww_.js.map → input-time.CMKTGRcV.js.map} +1 -1
  128. package/dist/chunks/input-with-dropdown-filter.DXnJOBf6.js +100 -0
  129. package/dist/chunks/input-with-dropdown-filter.DXnJOBf6.js.map +1 -0
  130. package/dist/chunks/{inspector-page.DNsc0lK1.js → inspector-page.Bd39LxR2.js} +2 -2
  131. package/dist/chunks/{inspector-page.DNsc0lK1.js.map → inspector-page.Bd39LxR2.js.map} +1 -1
  132. package/dist/chunks/{inspector.BLAqbhmV.js → inspector.SmoWfjqp.js} +2 -2
  133. package/dist/chunks/{inspector.BLAqbhmV.js.map → inspector.SmoWfjqp.js.map} +1 -1
  134. package/dist/chunks/{list-item.RuGQ8Y4T.js → list-item.CoDag_QY.js} +3 -3
  135. package/dist/chunks/{list-item.RuGQ8Y4T.js.map → list-item.CoDag_QY.js.map} +1 -1
  136. package/dist/chunks/{listbox-option-tag.71rmQvG8.js → listbox-option-tag.Bhyu9LpW.js} +2 -2
  137. package/dist/chunks/{listbox-option-tag.71rmQvG8.js.map → listbox-option-tag.Bhyu9LpW.js.map} +1 -1
  138. package/dist/chunks/{modal-fullscreen.jXJnaueu.js → modal-fullscreen.D-ws4648.js} +3 -3
  139. package/dist/chunks/{modal-fullscreen.jXJnaueu.js.map → modal-fullscreen.D-ws4648.js.map} +1 -1
  140. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js → modal.vue_vue_type_script_setup_true_lang.DkjMGIP8.js} +4 -4
  141. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js.map → modal.vue_vue_type_script_setup_true_lang.DkjMGIP8.js.map} +1 -1
  142. package/dist/chunks/{navigation-menu-group.BnS0isK8.js → navigation-menu-group.BlkhBGX3.js} +2 -2
  143. package/dist/chunks/{navigation-menu-group.BnS0isK8.js.map → navigation-menu-group.BlkhBGX3.js.map} +1 -1
  144. package/dist/chunks/{pagination.C-kvJ-XK.js → pagination.CyqfmV_-.js} +4 -4
  145. package/dist/chunks/{pagination.C-kvJ-XK.js.map → pagination.CyqfmV_-.js.map} +1 -1
  146. package/dist/chunks/popover.types.CXIAfp1m.js +6 -0
  147. package/dist/chunks/{popover.types.dhllh3NP.js.map → popover.types.CXIAfp1m.js.map} +1 -1
  148. package/dist/chunks/{popper-container.Rfj8UdMD.js → popper-container.lfk_dyZi.js} +2 -2
  149. package/dist/chunks/{popper-container.Rfj8UdMD.js.map → popper-container.lfk_dyZi.js.map} +1 -1
  150. package/dist/chunks/promo-banner.3d1DHWas.js.map +1 -1
  151. package/dist/chunks/{radio-group.BTI_2U11.js → radio-group.DGwM-ijw.js} +3 -3
  152. package/dist/chunks/{radio-group.BTI_2U11.js.map → radio-group.DGwM-ijw.js.map} +1 -1
  153. package/dist/chunks/{rich-text-editor.ClUU1zPM.js → rich-text-editor.7qlWY3xz.js} +5 -5
  154. package/dist/chunks/{rich-text-editor.ClUU1zPM.js.map → rich-text-editor.7qlWY3xz.js.map} +1 -1
  155. package/dist/chunks/{search-bar.D1Jz7hdd.js → search-bar.BRMyMzkF.js} +3 -3
  156. package/dist/chunks/{search-bar.D1Jz7hdd.js.map → search-bar.BRMyMzkF.js.map} +1 -1
  157. package/dist/chunks/{secondary-nav.D32VFDTi.js → secondary-nav.BbBhe7QI.js} +3 -3
  158. package/dist/chunks/{secondary-nav.D32VFDTi.js.map → secondary-nav.BbBhe7QI.js.map} +1 -1
  159. package/dist/chunks/{segmented-control.CarI0i3p.js → segmented-control.BTILFbBW.js} +2 -2
  160. package/dist/chunks/{segmented-control.CarI0i3p.js.map → segmented-control.BTILFbBW.js.map} +1 -1
  161. package/dist/chunks/select-avatar-filter.DdOdBb0C.js +55 -0
  162. package/dist/chunks/select-avatar-filter.DdOdBb0C.js.map +1 -0
  163. package/dist/chunks/select-country-filter.D-zpTtKe.js +56 -0
  164. package/dist/chunks/select-country-filter.D-zpTtKe.js.map +1 -0
  165. package/dist/chunks/select-currency-filter.BitX4BCE.js +91 -0
  166. package/dist/chunks/select-currency-filter.BitX4BCE.js.map +1 -0
  167. package/dist/chunks/select-payment-method-filter.BiZuCZOa.js +55 -0
  168. package/dist/chunks/select-payment-method-filter.BiZuCZOa.js.map +1 -0
  169. package/dist/chunks/select-tag-filter.BUIIqK0l.js +63 -0
  170. package/dist/chunks/select-tag-filter.BUIIqK0l.js.map +1 -0
  171. package/dist/chunks/{selection-card-group.CQsS8-H9.js → selection-card-group.mCAfzxrB.js} +3 -3
  172. package/dist/chunks/{selection-card-group.CQsS8-H9.js.map → selection-card-group.mCAfzxrB.js.map} +1 -1
  173. package/dist/chunks/{sidepanel.CYWPV9dE.js → sidepanel.amz6_quV.js} +12 -12
  174. package/dist/chunks/sidepanel.amz6_quV.js.map +1 -0
  175. package/dist/chunks/{structured-list-item.C6SAUS9a.js → structured-list-item.Br6cAwZk.js} +4 -4
  176. package/dist/chunks/{structured-list-item.C6SAUS9a.js.map → structured-list-item.Br6cAwZk.js.map} +1 -1
  177. package/dist/chunks/{summary-grid.types.FTWeUNFh.js → summary-grid.types.DUEiCht4.js} +6 -6
  178. package/dist/chunks/{summary-grid.types.FTWeUNFh.js.map → summary-grid.types.DUEiCht4.js.map} +1 -1
  179. package/dist/chunks/{tab.CwXAsp9E.js → tab.Df1c3HPX.js} +3 -3
  180. package/dist/chunks/{tab.CwXAsp9E.js.map → tab.Df1c3HPX.js.map} +1 -1
  181. package/dist/chunks/{tag.BYxa556o.js → tag.Cg3joxK_.js} +2 -2
  182. package/dist/chunks/{tag.BYxa556o.js.map → tag.Cg3joxK_.js.map} +1 -1
  183. package/dist/chunks/{textarea.D4aMdmDx.js → textarea.ClWTwdJT.js} +2 -2
  184. package/dist/chunks/{textarea.D4aMdmDx.js.map → textarea.ClWTwdJT.js.map} +1 -1
  185. package/dist/chunks/{timeline-item.De8HCoYw.js → timeline-item.CdOFw-Jn.js} +144 -132
  186. package/dist/chunks/timeline-item.CdOFw-Jn.js.map +1 -0
  187. package/dist/chunks/{title-details.8cyCeaLf.js → title-details.Ccs_ltkI.js} +2 -2
  188. package/dist/chunks/{title-details.8cyCeaLf.js.map → title-details.Ccs_ltkI.js.map} +1 -1
  189. package/dist/chunks/{tooltip.0QqJo2sa.js → tooltip.B8LTTssT.js} +3 -3
  190. package/dist/chunks/{tooltip.0QqJo2sa.js.map → tooltip.B8LTTssT.js.map} +1 -1
  191. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js → tutorial.vue_vue_type_script_setup_true_lang.CpzGxsmy.js} +4 -4
  192. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js.map → tutorial.vue_vue_type_script_setup_true_lang.CpzGxsmy.js.map} +1 -1
  193. package/dist/chunks/typography.B6elnWpr.js.map +1 -1
  194. package/dist/chunks/{use-date-input-formatter.BIVkaB1k.js → use-date-input-formatter.COZBxMaZ.js} +2 -2
  195. package/dist/chunks/{use-date-input-formatter.BIVkaB1k.js.map → use-date-input-formatter.COZBxMaZ.js.map} +1 -1
  196. package/dist/chunks/warning-filled.Bzh3ib0x.js +25 -0
  197. package/dist/chunks/warning-filled.Bzh3ib0x.js.map +1 -0
  198. package/dist/code-snippet.js +1 -1
  199. package/dist/dashboard-template.js +1 -1
  200. package/dist/dashed-underline.js +1 -1
  201. package/dist/data-grid-template.js +1 -1
  202. package/dist/data-grid.js +1 -1
  203. package/dist/date-picker.js +2 -2
  204. package/dist/date-range-picker.js +2 -2
  205. package/dist/date-time-picker.js +4 -4
  206. package/dist/draggable.js +2 -2
  207. package/dist/dropdown.js +2 -2
  208. package/dist/empty-state.js +1 -1
  209. package/dist/file-uploader.js +1 -1
  210. package/dist/filter-bar.js +1 -1
  211. package/dist/focus-trap.js +1 -1
  212. package/dist/form-layout.js +1 -1
  213. package/dist/header-with-views.js +1 -1
  214. package/dist/header.js +1 -1
  215. package/dist/index.js +257 -257
  216. package/dist/info-icon.js +1 -1
  217. package/dist/input-field-password.js +1 -1
  218. package/dist/input-field-phone-number.js +1 -1
  219. package/dist/input-field.js +1 -1
  220. package/dist/input-time.js +1 -1
  221. package/dist/inspector.js +2 -2
  222. package/dist/internal.js +13 -13
  223. package/dist/list.js +1 -1
  224. package/dist/menu.js +1 -1
  225. package/dist/modal-fullscreen.js +1 -1
  226. package/dist/modal.js +2 -2
  227. package/dist/navigation-menu.js +1 -1
  228. package/dist/pagination.js +1 -1
  229. package/dist/popover.js +2 -2
  230. package/dist/popper-container.js +1 -1
  231. package/dist/progress-bar.js +1 -1
  232. package/dist/radio-group.js +1 -1
  233. package/dist/rich-text-editor.js +1 -1
  234. package/dist/search-bar.js +2 -2
  235. package/dist/secondary-nav.js +1 -1
  236. package/dist/segmented-control.js +1 -1
  237. package/dist/selection-card.js +1 -1
  238. package/dist/sidepanel.js +1 -1
  239. package/dist/structured-list.js +1 -1
  240. package/dist/summary-grid.js +1 -1
  241. package/dist/tabs.js +1 -1
  242. package/dist/tag.js +1 -1
  243. package/dist/textarea.js +1 -1
  244. package/dist/timeline.js +1 -1
  245. package/dist/tutorial.js +1 -1
  246. package/dist/web-types.json +1 -1
  247. package/package.json +4 -4
  248. package/dist/chunks/alert.BYmn1ewo.js.map +0 -1
  249. package/dist/chunks/button-actions.DvuGEQxM.js.map +0 -1
  250. package/dist/chunks/dashboard-section.CjC3fVU6.js.map +0 -1
  251. package/dist/chunks/dropdown.BoSI-Rre.js.map +0 -1
  252. package/dist/chunks/filter-bar.6ElVHgFA.js +0 -3974
  253. package/dist/chunks/filter-bar.6ElVHgFA.js.map +0 -1
  254. package/dist/chunks/grid-layout.CCWNscU_.js +0 -113
  255. package/dist/chunks/grid-layout.CCWNscU_.js.map +0 -1
  256. package/dist/chunks/popover.types.dhllh3NP.js +0 -6
  257. package/dist/chunks/sidepanel.CYWPV9dE.js.map +0 -1
  258. package/dist/chunks/timeline-item.De8HCoYw.js.map +0 -1
@@ -0,0 +1,63 @@
1
+ import { defineComponent as d, computed as a, resolveComponent as c, openBlock as u, createBlock as b, mergeProps as _, withCtx as U, createVNode as $ } from "vue";
2
+ import { c as n, S as g, _ as v } from "./filter-bar.BPPxuT_w.js";
3
+ import { L as I } from "./listbox-option-tag.Bhyu9LpW.js";
4
+ import { _ as P } from "./_plugin-vue_export-helper.CHgC5LLL.js";
5
+ const T = d({
6
+ name: "bento-select-country-filter",
7
+ components: {
8
+ BentoSelectFilter: v,
9
+ ListboxOptionTag: I
10
+ },
11
+ props: {
12
+ ...g,
13
+ /**
14
+ * List of options that are needed to setup the tag filter
15
+ * Available options:
16
+ * - multiple: If "true", the user will be able to select multiple items.
17
+ * - listboxItems: The option elements to populate the filter with {@see BentoSelectTagFilterOptions}
18
+ */
19
+ options: {
20
+ type: Object,
21
+ default: void 0
22
+ }
23
+ },
24
+ emits: [n.INPUT, n.UPDATE],
25
+ setup(t, { emit: o }) {
26
+ const l = (e) => o(n.UPDATE, e), r = a(
27
+ () => t?.options?.listboxItems?.map(({ label: e, value: s, variant: i }) => ({ label: e, value: s, data: i }))
28
+ );
29
+ return {
30
+ // Values
31
+ countryOptions: a(() => ({
32
+ ...t.options,
33
+ listboxItems: r.value
34
+ })),
35
+ // Methods
36
+ onUpdate: l,
37
+ // Enums
38
+ BentoFilterEvent: n
39
+ };
40
+ }
41
+ });
42
+ function y(t, o, l, r, m, e) {
43
+ const s = c("listbox-option-tag"), i = c("bento-select-filter");
44
+ return u(), b(i, _(t.$props, {
45
+ field: t.field,
46
+ label: t.label,
47
+ options: t.countryOptions,
48
+ onUpdate: t.onUpdate,
49
+ onInput: o[0] || (o[0] = (p) => t.$emit(t.BentoFilterEvent.INPUT, p))
50
+ }), {
51
+ default: U(({ label: p, data: f }) => [
52
+ $(s, {
53
+ option: { value: p, data: f, label: "" }
54
+ }, null, 8, ["option"])
55
+ ]),
56
+ _: 1
57
+ }, 16, ["field", "label", "options", "onUpdate"]);
58
+ }
59
+ const C = /* @__PURE__ */ P(T, [["render", y]]);
60
+ export {
61
+ C as default
62
+ };
63
+ //# sourceMappingURL=select-tag-filter.BUIIqK0l.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-tag-filter.BUIIqK0l.js","sources":["../../../vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue"],"sourcesContent":["<template>\n <bento-select-filter\n v-slot=\"{ label: slotLabel, data }\"\n v-bind=\"$props\"\n :field=\"field\"\n :label=\"label\"\n :options=\"countryOptions\"\n @update=\"onUpdate\"\n @input=\"e => $emit(BentoFilterEvent.INPUT, e)\"\n >\n <listbox-option-tag :option=\"{ value: slotLabel, data, label: '' }\" />\n </bento-select-filter>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n import { BentoSelectFilter } from '../../index';\n import { BentoFilterEvent, type BentoSelectTagFilterOptions } from '@/components/filter-bar/filter-bar.types';\n import { ListboxOptionTag } from '@/internal';\n import SelectFilterProps from '@/components/filter-bar/components/select-filter/select-filter.props';\n\n /**\n * The Select Tag filter displays a listbox of tag items\n * passed in the \"options.listboxItems\" property.\n *\n * @example\n * import { BentoSelectTagFilter } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectTagFilter },\n * template: `\n * <bento-select-tag-filter\n * :field=\"tag\"\n * :label=\"Tag\"\n * :options=\"{\n * listboxItems: [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * { label: 'Standby', value: 'unique-id-3', variant: 'orange' },\n * { label: 'Busy with things', value: 'unique-id-4', variant: 'blue' },\n * ]\n * }\"\n * :value=\"'unique-id-4'\"\n * @update=\"updateFilterHandler\"\n * >\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-select-country-filter',\n components: {\n BentoSelectFilter,\n ListboxOptionTag,\n },\n props: {\n ...SelectFilterProps,\n\n /**\n * List of options that are needed to setup the tag filter\n * Available options:\n * - multiple: If \"true\", the user will be able to select multiple items.\n * - listboxItems: The option elements to populate the filter with {@see BentoSelectTagFilterOptions}\n */\n options: {\n type: Object as PropType<BentoSelectTagFilterOptions>,\n default: undefined,\n },\n },\n emits: [BentoFilterEvent.INPUT, BentoFilterEvent.UPDATE],\n setup(props, { emit }) {\n const onUpdate = (selectedValue: BentoListboxSelectedValue) => emit(BentoFilterEvent.UPDATE, selectedValue);\n\n const tagItems = computed(() =>\n props?.options?.listboxItems?.map(({ label, value, variant }) => ({ label, value, data: variant }))\n );\n const countryOptions = computed(() => ({\n ...props.options,\n listboxItems: tagItems.value,\n }));\n\n return {\n // Values\n countryOptions,\n\n // Methods\n onUpdate,\n\n // Enums\n BentoFilterEvent,\n };\n },\n });\n</script>\n"],"names":["_sfc_main","defineComponent","BentoSelectFilter","ListboxOptionTag","SelectFilterProps","BentoFilterEvent","props","emit","onUpdate","selectedValue","tagItems","computed","label","value","variant","_resolveComponent","_openBlock","_createBlock","_component_bento_select_filter","_mergeProps","_ctx","countryOptions","_cache","e","_withCtx","slotLabel","data","_createVNode","_component_listbox_option_tag"],"mappings":";;;;AAiDI,MAAAA,IAAeC,EAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,IAAA,mBACRC;AAAAA,IACA,kBAAAC;AAAA,EAAA;AAAA,EAEJ,OAAO;AAAA,IACH,GAAGC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQH,SAAS;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACb;AAAA,EAEJ,OAAO,CAACC,EAAiB,OAAOA,EAAiB,MAAM;AAAA,EACvD,MAAMC,GAAO,EAAE,MAAAC,KAAQ;AACnB,UAAMC,IAAW,CAACC,MAA6CF,EAAKF,EAAiB,QAAQI,CAAa,GAEpGC,IAAWC;AAAA,MAAS,MACtBL,GAAO,SAAS,cAAc,IAAI,CAAC,EAAE,OAAAM,GAAO,OAAAC,GAAO,SAAAC,EAAA,OAAe,EAAE,OAAAF,GAAO,OAAAC,GAAO,MAAMC,IAAU;AAAA,IAAA;AAOtG,WAAO;AAAA;AAAA,MAEH,gBAPmBH,EAAS,OAAO;AAAA,QACnC,GAAGL,EAAM;AAAA,QACT,cAAcI,EAAS;AAAA,MAAA,EACzB;AAAA;AAAA,MAOE,UAAAF;AAAA;AAAA,MAGA,kBAAAH;AAAA,IAAA;AAAA,EAER;AACJ,CAAC;;yCAjFqBU,EAAA,qBAVtB;SAIUC,EAAA,GAAOC,EAAAC,GAAAC,EAAAC,EAAA,QAAA;AAAA,IACZ,OAAOA,EAAEC;AAAAA,IACT,OAAAD,EAAQZ;AAAAA,IACR,SAAKY,EAAA;AAAA,IAAA,UAAAA,EAAA;AAAA,IARd,SAAAE,EAAA,CAAA,MAU8EA,EARrD,YAAWF,EAAI,MAAAA,EAAA,iBAAA,OAAAG,CAAA;AAAA,EAAA,CAAA,GAQhC;AAAA,IAAA,SAAqBC,EAAM,GAAW,OAAAC,GAAe,MAAAC,EAAA,MAAA;AAAA,MAAAC,EAAAC,GAAA;AAAA;MAV7D,GAAA,MAAA,GAAA,CAAA,QAAA,CAAA;AAAA,IAAA,CAAA;AAAA;;;;"}
@@ -9,8 +9,8 @@ import { u as ce } from "./use-has-slot.CyMiImRQ.js";
9
9
  import { a as me } from "./radio-input.FC4PVCHr.js";
10
10
  import { _ as X } from "./_plugin-vue_export-helper.CHgC5LLL.js";
11
11
  import { u as fe } from "./form-field.B60VsF8d.js";
12
- import { C as ve } from "./controls-group.CC3yZiTT.js";
13
- import { G as be } from "./grid-layout.CCWNscU_.js";
12
+ import { C as ve } from "./controls-group.BcbFbqr-.js";
13
+ import { G as be } from "./grid-layout.BuhsC4WZ.js";
14
14
  import { E as pe } from "./error-message.DJ5l0EUH.js";
15
15
  import "../assets/selection-card-group.css";
16
16
  var G = /* @__PURE__ */ ((o) => (o.DISABLED = "disabled", o.READONLY = "readonly", o.ERROR = "error", o))(G || {});
@@ -410,4 +410,4 @@ export {
410
410
  G as a,
411
411
  qe as s
412
412
  };
413
- //# sourceMappingURL=selection-card-group.CQsS8-H9.js.map
413
+ //# sourceMappingURL=selection-card-group.mCAfzxrB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection-card-group.CQsS8-H9.js","sources":["../../../vue2/src/components/selection-card/selection-card.types.ts","../../../vue2/src/components/selection-card/selection-card.keys.ts","../../../vue2/src/components/selection-card/selection-card.vue","../../../vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the selection card is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoSelectionCardValue);\n /**\n * Emitted when the selection card is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoSelectionCardValue);\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = withDefaults(defineProps<BentoSelectionCardGroupProps>(), {\n description: null,\n disabled: false,\n errorMessage: null,\n formId: null,\n hideLabel: null,\n label: null,\n layout: 'vertical',\n itemsPerRow: undefined,\n modelValue: null,\n optional: false,\n required: false,\n tooltipText: null,\n readonly: false,\n variant: 'checkbox',\n });\n\n const emit = defineEmits<BentoSelectionCardGroupEmits>();\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(value => {\n const numericValue = Number(value);\n if (!Number.isInteger(numericValue) || numericValue < 1 || numericValue > 6) {\n throw new Error(\n 'itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","numericValue"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJL,MAAAE,IAAA,uBAAA,0CAAA;;;;;iBC6THC,KAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApOA,UAAAC,IAAAC,GAoEAC,IAAAC,GAWAC,IAAAC,EAAA,GACAC,IAAAC,GAAAH,CAAA,GAEAI,IAAAC,EAAA,yBAAA,GACAC,IAAAD,EAAA,4BAAA,GAEAE,IAAAC;AAAA,MAAmE,MAAAZ,EAAA;AAAA,IACnD,GAEhBa,IAAAD;AAAA,MAAwE,MAAAZ,EAAA;AAAA,IACxD,GAGhBc,IAAAF,EAAA,OAAA;AAAA,MAA2C,6BAAAG,EAAA;AAAA,MACA,qCAAAf,EAAA;AAAA,IACI,EAAA,GAG/CgB,IAAAJ,EAAA,OAAA;AAAA,MAAoD,CAAA,qBAAAhB,EAAA,QAAA,EAAA,GAAAI,EAAA;AAAA,MACiB,CAAA,qBAAAJ,EAAA,KAAA,EAAA,GAAAI,EAAA;AAAA,MACH,CAAA,qBAAAJ,EAAA,QAAA,EAAA,GAAAI,EAAA;AAAA,MACG,oCAAAiB,EAAA;AAAA,IACjB,EAAA,GAGpDC,IAAAN,EAAA,OAAA;AAAA,MAA4D,wDAAAK,EAAA;AAAA,IACY,EAAA,GAGxEE,IAAAP,EAAA,OAAA;AAAA,MAAgE,6DAAAK,EAAA;AAAA,IACa,EAAA,GAG7EG,IAAAR,EAAA,OAAA;AAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"selection-card-group.mCAfzxrB.js","sources":["../../../vue2/src/components/selection-card/selection-card.types.ts","../../../vue2/src/components/selection-card/selection-card.keys.ts","../../../vue2/src/components/selection-card/selection-card.vue","../../../vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the selection card is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoSelectionCardValue);\n /**\n * Emitted when the selection card is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoSelectionCardValue);\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = withDefaults(defineProps<BentoSelectionCardGroupProps>(), {\n description: null,\n disabled: false,\n errorMessage: null,\n formId: null,\n hideLabel: null,\n label: null,\n layout: 'vertical',\n itemsPerRow: undefined,\n modelValue: null,\n optional: false,\n required: false,\n tooltipText: null,\n readonly: false,\n variant: 'checkbox',\n });\n\n const emit = defineEmits<BentoSelectionCardGroupEmits>();\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(value => {\n const numericValue = Number(value);\n if (!Number.isInteger(numericValue) || numericValue < 1 || numericValue > 6) {\n throw new Error(\n 'itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","numericValue"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJL,MAAAE,IAAA,uBAAA,0CAAA;;;;;iBC6THC,KAAA;AAAA,EAAe,MAA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A,MAAA4D,GAAAA,IAAAH,GAAA,KAAA,CAAA;AAEJ,aAAAE;AAAA,IAAO,CAAA,GAIXE,IAAAjD,EAAA,MAAA,KAAA6C,GAAA,KAAA,GAOAK,IAAAlD,EAAA,MACI6C,GAAA,QAAA,IAAA,MAAAA,GAAA,KAAA,EAAA,KAAA;AAAA;AAAA,MACiD,OAAAI,EAAA;AAAA,MAEhB,QAAAA,EAAA;AAAA,MACC,OAAAA,EAAA;AAAA,IACD,CAAA,IAAA,CAAA,CAE1B,GAGXE,IAAA,CAAAC,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAAuB,CAAA;AAAA,IAAe,GAGnBC,IAAArD,EAAA,MAAAZ,EAAA,YAAA,OAAA;AAEA,WAAAkE,GAAApE,GAAAmE,CAAA,GAEAE,GAAA,MAAA;AACI,MAAAnE,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAAgE,MAAA;AACI,cAAAI,IAAA,OAAAJ,CAAA;AACA,YAAA,CAAA,OAAA,UAAAI,CAAA,KAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as y, openBlock as f, createBlock as S, unref as s, createSlots as V, withCtx as n, createElementVNode as h, createVNode as c, renderSlot as T, createTextVNode as x, toDisplayString as J, toRefs as Y, ref as o, computed as I, onMounted as z, onUnmounted as j, watch as H, provide as A, createElementBlock as D, withKeys as X, withModifiers as q, normalizeClass as Q, withDirectives as W, createCommentVNode as Z } from "vue";
2
- import { B as b, d as ee } from "./typography.B6elnWpr.js";
3
- import { F as te } from "./footer-actions.BJif4sIk.js";
1
+ import { defineComponent as y, openBlock as f, createBlock as S, unref as s, createSlots as V, withCtx as n, createElementVNode as h, createVNode as c, renderSlot as T, createTextVNode as x, toDisplayString as J, toRefs as Y, ref as o, computed as I, onMounted as z, onUnmounted as j, watch as H, provide as A, createElementBlock as b, withKeys as X, withModifiers as q, normalizeClass as Q, withDirectives as W, createCommentVNode as Z } from "vue";
2
+ import { B as D, d as ee } from "./typography.B6elnWpr.js";
3
+ import { F as te } from "./footer-actions.B2dxp-b_.js";
4
4
  import { D as se } from "./dialog-page.CHpFuDd9.js";
5
5
  import { _ as N } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
6
  import { B as ae } from "./button.DAcwNdtP.js";
7
- import { B as ie } from "./focus-trap.Co-S6goa.js";
7
+ import { B as ie } from "./focus-trap.BgyHTR_3.js";
8
8
  import { _ as oe } from "./cross.Daa8LxjC.js";
9
- import { S as ne } from "./button-actions.DvuGEQxM.js";
9
+ import { S as ne } from "./button-actions.BYoctIth.js";
10
10
  import { B as le } from "./directive.D1-d-C2K.js";
11
11
  import { u as re } from "./index.CGBfMQdv.js";
12
12
  import { g as ce } from "./generate-uid.DBWe4g6T.js";
@@ -82,7 +82,7 @@ const fe = { class: "b-sidepanel-page__header" }, me = { class: "b-sidepanel-pag
82
82
  }, V({
83
83
  header: n(() => [
84
84
  h("div", fe, [
85
- c(s(b), {
85
+ c(s(D), {
86
86
  class: "b-sidepanel-page__title",
87
87
  el: "h2",
88
88
  variant: "title"
@@ -96,7 +96,7 @@ const fe = { class: "b-sidepanel-page__header" }, me = { class: "b-sidepanel-pag
96
96
  ]),
97
97
  content: n(() => [
98
98
  h("div", me, [
99
- c(s(b), {
99
+ c(s(D), {
100
100
  el: "div",
101
101
  variant: "body"
102
102
  }, {
@@ -175,7 +175,7 @@ const O = {
175
175
  },
176
176
  /**
177
177
  * Controls the visibility of close button on the sidepanel.
178
- * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.
178
+ * Defaults to `true` when `isDismissible=false`, and `false` when `isDismissible=true`.
179
179
  *
180
180
  * _Note: This property will be set to `false` by default, independent of `isDismissible` in v3.0.0_
181
181
  */
@@ -221,7 +221,7 @@ const O = {
221
221
  'BentoSidepanel "isDismissible" property’s behavior',
222
222
  'BentoSidepanel "isDismissible" will no longer hide the close button. Use "hideCloseButton=true" instead.',
223
223
  "3.0.0"
224
- ), (t, a) => (f(), D("dialog", {
224
+ ), (t, a) => (f(), b("dialog", {
225
225
  ref_key: "sidepanel",
226
226
  ref: l,
227
227
  class: Q(["b-sidepanel", L.value]),
@@ -230,7 +230,7 @@ const O = {
230
230
  }, [
231
231
  W((f(), S(s(ie), { id: s(B) }, {
232
232
  default: n(() => [
233
- $.value ? Z("", !0) : (f(), D("div", Ee, [
233
+ $.value ? Z("", !0) : (f(), b("div", Ee, [
234
234
  c(s(ae), {
235
235
  variant: "tertiary",
236
236
  onClick: p
@@ -251,10 +251,10 @@ const O = {
251
251
  ])
252
252
  ], 34));
253
253
  }
254
- }), Fe = /* @__PURE__ */ N(Ae, [["__scopeId", "data-v-3ed068a6"]]);
254
+ }), Fe = /* @__PURE__ */ N(Ae, [["__scopeId", "data-v-5f4b2906"]]);
255
255
  export {
256
256
  m as B,
257
257
  Le as a,
258
258
  Fe as s
259
259
  };
260
- //# sourceMappingURL=sidepanel.CYWPV9dE.js.map
260
+ //# sourceMappingURL=sidepanel.amz6_quV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidepanel.amz6_quV.js","sources":["../../../vue2/src/components/sidepanel/components/sidepanel-page.vue","../../../vue2/src/components/sidepanel/sidepanel.types.ts","../../../vue2/src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__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 { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n 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 * ```\n * [{\n * title: 'Primary',\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: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\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 sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\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 import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v3.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `false` when `isDismissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v3.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\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, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.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 pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-sidepanel',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","props","__props","emit","__emit","activePage","isOpen","toRefs","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRem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AAAC;AAAA,MACA,YAAAoB;AAAA,IACA,CAAA,GAEJM,EAAAE,IAAAH,CAAA,GAGAC,EAAAG,IAAAzB,CAAA,GAEA,CAAAhB,EAAA,iBAAAA,EAAA,oBAAA,QACI0C;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as b, inject as p, computed as o, provide as $, openBlock as r, createElementBlock as B, renderSlot as S, ref as R, normalizeClass as _, createElementVNode as h, normalizeStyle as U, createVNode as f, unref as e, withCtx as y, createTextVNode as g, toDisplayString as A, createBlock as u, createCommentVNode as d, withDirectives as V } from "vue";
2
2
  import { _ as v } from "./_plugin-vue_export-helper.CHgC5LLL.js";
3
3
  import { B as j } from "./button.DAcwNdtP.js";
4
- import { B as F } from "./info-icon.D_zu5SYT.js";
4
+ import { B as F } from "./info-icon.CcM7z-CY.js";
5
5
  import { B as O } from "./typography.B6elnWpr.js";
6
- import { C as w } from "./copy.YBeE8V9S.js";
6
+ import { C as w } from "./copy.DrHbwkFX.js";
7
7
  import { _ as z } from "./search.mr5Q3y2z.js";
8
8
  import { u as H } from "./index.CGBfMQdv.js";
9
- import { b as J } from "./tooltip.0QqJo2sa.js";
9
+ import { b as J } from "./tooltip.B8LTTssT.js";
10
10
  import "../assets/structured-list-item.css";
11
11
  const C = /* @__PURE__ */ Symbol("structured list condensed style injection key"), T = /* @__PURE__ */ Symbol("structured list labels width injection key"), x = ["25-75", "33-66", "42-58", "50-50", "75-25", "66-33", "58-42"], K = { class: "b-structured-list" }, Y = {
12
12
  name: "bento-structured-list"
@@ -111,4 +111,4 @@ export {
111
111
  C as S,
112
112
  lt as a
113
113
  };
114
- //# sourceMappingURL=structured-list-item.C6SAUS9a.js.map
114
+ //# sourceMappingURL=structured-list-item.Br6cAwZk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structured-list-item.C6SAUS9a.js","sources":["../../../vue2/src/components/structured-list/structured-list.keys.ts","../../../vue2/src/components/structured-list/structured-list.types.ts","../../../vue2/src/components/structured-list/structured-list.vue","../../../vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50' | '75-25' | '66-33' | '58-42';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50', '75-25', '66-33', '58-42'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth?: number;\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n * '75-25'\n * '66-33'\n * '58-42'\n */\n layout?: BentoStructuredListLayoutOptions;\n }>(),\n {\n labelsWidth: null,\n layout: '33-66',\n }\n );\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n name: 'bento-structured-list',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" @click=\"emitCopy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, type Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps<{\n /**\n * Label to display for the value\n */\n label: string;\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo?: string;\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy?: string;\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search?: (event: Event) => void;\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip?: string;\n /**\n * Truncates the value of the item\n */\n truncate?: boolean;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emits copy event and value when copy button is clicked\n */\n (e: 'copy', value: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const emitCopy = () => {\n emit('copy', props.copy);\n };\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","props","__props","isCondensed","inject","computedLayout","computed","computedLabelsWidth","provide","__default__","messages","emit","__emit","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","emitCopy","labelTypographyVariant"],"mappings":";;;;;;;;;;AAAO,MAAAA,IAAA,uBAAA,+CAAA,GACAC,IAAA,uBAAA,4CAAA,GCAAC,IAAA,CAAA,SAAA,SAAA,SAAA,SAAA,SAAA,SAAA,OAAA,uCCqFHC,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;AA1EA,UAAAC,IAAAC,GA6BAC,IAAAC,EAAAP,GAAA,EAAA,GAEAQ,IAAAC;AAAA,MAAuB,MAAAP,EAAA,SAAAE,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EM,IAAAD,EAAA,MACIH,IACI,UAGJF,EAAA,cACI,GAAAA,EAAA,WAAA,OAGJ,GAAAI,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA,CAAA,GAA4C;AAGhD,WAAAG,EAAAV,GAAAS,CAAA;;;;;;;;;;;;;;;;GCoEAE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;AA/EA,UAAAT,IAAAC,GA2BAS,IAAAC,GAOA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAJ,EAAA,CAAA,GACAP,IAAAC,EAAAP,GAAA,EAAA,GACAkB,IAAAX,EAAAN,GAAAkB,EAAA,KAAA,CAAA,GACAC,IAAAX,EAAA,MAAA,cAAAS,EAAA,KAAA,EAAA,GACAG,IAAAZ,EAAA,OAAA;AAAA,MAA2C,qCAAAH;AAAA,IACF,EAAA,GAGzCgB,IAAAb,EAAA,OAAA;AAAA,MAAgD,2CAAAL,EAAA;AAAA,IACK,EAAA,GAGrDmB,IAAA,MAAA;AACI,MAAAT,EAAA,QAAAV,EAAA,IAAA;AAAA,IAAuB,GAG3BoB,IAAAf,EAAA,MAAAH,IAAA,YAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"structured-list-item.Br6cAwZk.js","sources":["../../../vue2/src/components/structured-list/structured-list.keys.ts","../../../vue2/src/components/structured-list/structured-list.types.ts","../../../vue2/src/components/structured-list/structured-list.vue","../../../vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50' | '75-25' | '66-33' | '58-42';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50', '75-25', '66-33', '58-42'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth?: number;\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n * '75-25'\n * '66-33'\n * '58-42'\n */\n layout?: BentoStructuredListLayoutOptions;\n }>(),\n {\n labelsWidth: null,\n layout: '33-66',\n }\n );\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n name: 'bento-structured-list',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" @click=\"emitCopy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, type Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps<{\n /**\n * Label to display for the value\n */\n label: string;\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo?: string;\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy?: string;\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search?: (event: Event) => void;\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip?: string;\n /**\n * Truncates the value of the item\n */\n truncate?: boolean;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emits copy event and value when copy button is clicked\n */\n (e: 'copy', value: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const emitCopy = () => {\n emit('copy', props.copy);\n };\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","props","__props","isCondensed","inject","computedLayout","computed","computedLabelsWidth","provide","__default__","messages","emit","__emit","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","emitCopy","labelTypograph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createElementBlock as P, Fragment as G, renderList as j, unref as t, createBlock as f, createSlots as k, withCtx as i, renderSlot as p, toRefs as H, inject as W, ref as J, computed as T, normalizeStyle as K, normalizeClass as q, createElementVNode as _, createVNode as R, createTextVNode as $, toDisplayString as v, createCommentVNode as h, mergeProps as Q } from "vue";
2
2
  import { u as I } from "./use-has-slot.CyMiImRQ.js";
3
3
  import { S as X, a as V } from "./summary-grid.keys.Xx-W5a2w.js";
4
- import { G as x } from "./grid-layout.CCWNscU_.js";
4
+ import { G as x } from "./grid-layout.BuhsC4WZ.js";
5
5
  import { _ as E } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
6
  import { B as D } from "./typography.B6elnWpr.js";
7
7
  import { u as ee } from "./index.CGBfMQdv.js";
8
- import { B as te } from "./dashed-underline.DAtZOaad.js";
9
- import { B as oe } from "./info-icon.D_zu5SYT.js";
10
- import { B as A } from "./tag.BYxa556o.js";
11
- import { C as ne } from "./copy.YBeE8V9S.js";
8
+ import { B as te } from "./dashed-underline.BH4vfrBh.js";
9
+ import { B as oe } from "./info-icon.CcM7z-CY.js";
10
+ import { B as A } from "./tag.Cg3joxK_.js";
11
+ import { C as ne } from "./copy.DrHbwkFX.js";
12
12
  import "../assets/summary-grid.css";
13
13
  const ie = { class: "b-summary-grid" }, re = {}, le = /* @__PURE__ */ g({
14
14
  ...re,
@@ -486,4 +486,4 @@ export {
486
486
  ge as e,
487
487
  we as s
488
488
  };
489
- //# sourceMappingURL=summary-grid.types.FTWeUNFh.js.map
489
+ //# sourceMappingURL=summary-grid.types.DUEiCht4.js.map