@adyen/bento-vue3 2.0.1 → 2.1.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 (325) hide show
  1. package/dist/@types/bento-translation-keys.generated.d.ts +908 -0
  2. package/dist/@types/index.d.ts +136 -82
  3. package/dist/accordion.js +1 -1
  4. package/dist/action-bar.js +1 -1
  5. package/dist/ai-tag.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/anchor-scroller.js +1 -1
  8. package/dist/assets/accordion-item.css +1 -1
  9. package/dist/assets/action-bar.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/button.css +1 -1
  13. package/dist/assets/calendar.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/checkbox.css +1 -1
  16. package/dist/assets/chip.css +1 -1
  17. package/dist/assets/currency.css +1 -1
  18. package/dist/assets/data-grid.css +1 -1
  19. package/dist/assets/date-range-picker.css +1 -1
  20. package/dist/assets/dialog-page.css +1 -1
  21. package/dist/assets/draggable.css +1 -1
  22. package/dist/assets/dropdown.css +1 -1
  23. package/dist/assets/file-uploader.css +1 -1
  24. package/dist/assets/filter-bar.css +1 -1
  25. package/dist/assets/header-with-views.css +1 -1
  26. package/dist/assets/input-field.css +1 -1
  27. package/dist/assets/input-time.css +1 -1
  28. package/dist/assets/inspector.css +1 -1
  29. package/dist/assets/modal-fullscreen.css +1 -1
  30. package/dist/assets/navigation-menu-group.css +1 -1
  31. package/dist/assets/pagination.css +1 -1
  32. package/dist/assets/rich-text-editor.css +1 -1
  33. package/dist/assets/search-bar.css +1 -1
  34. package/dist/assets/secondary-nav.css +1 -1
  35. package/dist/assets/selection-card-group.css +1 -1
  36. package/dist/assets/sidepanel.css +1 -1
  37. package/dist/assets/step.css +1 -1
  38. package/dist/assets/structured-list-item.css +1 -1
  39. package/dist/assets/tab.css +1 -1
  40. package/dist/assets/textarea.css +1 -1
  41. package/dist/assets/toggle.css +1 -1
  42. package/dist/assets/typography.css +1 -1
  43. package/dist/avatar.js +1 -1
  44. package/dist/button.js +3 -3
  45. package/dist/card.js +1 -1
  46. package/dist/checkbox.js +2 -2
  47. package/dist/chip.js +1 -1
  48. package/dist/chunks/{accordion-item.BMxeTYDy.js → accordion-item.BbMoC7Rn.js} +6 -6
  49. package/dist/chunks/{accordion-item.BMxeTYDy.js.map → accordion-item.BbMoC7Rn.js.map} +1 -1
  50. package/dist/chunks/{action-bar.CWjLoeOU.js → action-bar.C6XFuiE0.js} +20 -20
  51. package/dist/chunks/{action-bar.CWjLoeOU.js.map → action-bar.C6XFuiE0.js.map} +1 -1
  52. package/dist/chunks/{ai-button.CYaCMWFk.js → ai-button.M2xaszNl.js} +3 -3
  53. package/dist/chunks/{ai-button.CYaCMWFk.js.map → ai-button.M2xaszNl.js.map} +1 -1
  54. package/dist/chunks/{ai-tag.CjrOE5yl.js → ai-tag.BLDTP7fs.js} +4 -4
  55. package/dist/chunks/{ai-tag.CjrOE5yl.js.map → ai-tag.BLDTP7fs.js.map} +1 -1
  56. package/dist/chunks/{alert.C8Pe1-OO.js → alert.BYmn1ewo.js} +4 -4
  57. package/dist/chunks/{alert.C8Pe1-OO.js.map → alert.BYmn1ewo.js.map} +1 -1
  58. package/dist/chunks/{anchor-scroller.C3zkcfPH.js → anchor-scroller.B35-JMuH.js} +6 -6
  59. package/dist/chunks/{anchor-scroller.C3zkcfPH.js.map → anchor-scroller.B35-JMuH.js.map} +1 -1
  60. package/dist/chunks/{avatar.DcXyOCS4.js → avatar.Bes5Qw12.js} +2 -2
  61. package/dist/chunks/{avatar.DcXyOCS4.js.map → avatar.Bes5Qw12.js.map} +1 -1
  62. package/dist/chunks/{base-button.Bi5JR_6k.js → base-button.Dg_u0f2_.js} +3 -3
  63. package/dist/chunks/{base-button.Bi5JR_6k.js.map → base-button.Dg_u0f2_.js.map} +1 -1
  64. package/dist/chunks/{base-modal.Bn4ZXwv6.js → base-modal.CulokESn.js} +7 -7
  65. package/dist/chunks/{base-modal.Bn4ZXwv6.js.map → base-modal.CulokESn.js.map} +1 -1
  66. package/dist/chunks/{button-actions-with-menu.CrbF2BSQ.js → button-actions-with-menu.BsCmJeKU.js} +2 -2
  67. package/dist/chunks/{button-actions-with-menu.CrbF2BSQ.js.map → button-actions-with-menu.BsCmJeKU.js.map} +1 -1
  68. package/dist/chunks/{button-actions.uIjzze43.js → button-actions.DvuGEQxM.js} +9 -9
  69. package/dist/chunks/button-actions.DvuGEQxM.js.map +1 -0
  70. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
  71. package/dist/chunks/{button.Ciflfide.js → button.DAcwNdtP.js} +3 -3
  72. package/dist/chunks/{button.Ciflfide.js.map → button.DAcwNdtP.js.map} +1 -1
  73. package/dist/chunks/{calendar.Dtba7fcs.js → calendar.EuBZ9HoM.js} +325 -322
  74. package/dist/chunks/calendar.EuBZ9HoM.js.map +1 -0
  75. package/dist/chunks/{card.a8QL14dy.js → card.OErI_R47.js} +8 -8
  76. package/dist/chunks/{card.a8QL14dy.js.map → card.OErI_R47.js.map} +1 -1
  77. package/dist/chunks/{checkbox-group.BCzNXT1-.js → checkbox-group.Deb5pHjj.js} +4 -4
  78. package/dist/chunks/{checkbox-group.BCzNXT1-.js.map → checkbox-group.Deb5pHjj.js.map} +1 -1
  79. package/dist/chunks/{checkbox.0RmIkniU.js → checkbox.YBhv3GCJ.js} +17 -17
  80. package/dist/chunks/{checkbox.0RmIkniU.js.map → checkbox.YBhv3GCJ.js.map} +1 -1
  81. package/dist/chunks/{chip.Bv6IGch0.js → chip.D4OozULC.js} +13 -11
  82. package/dist/chunks/{chip.Bv6IGch0.js.map → chip.D4OozULC.js.map} +1 -1
  83. package/dist/chunks/{code-snippet.BbswO6TU.js → code-snippet.DNDXr7t6.js} +7 -7
  84. package/dist/chunks/{code-snippet.BbswO6TU.js.map → code-snippet.DNDXr7t6.js.map} +1 -1
  85. package/dist/chunks/{controls-group.KarFHKUT.js → controls-group.CC3yZiTT.js} +3 -3
  86. package/dist/chunks/{controls-group.KarFHKUT.js.map → controls-group.CC3yZiTT.js.map} +1 -1
  87. package/dist/chunks/{copy.C92qFRaR.js → copy.YBeE8V9S.js} +4 -4
  88. package/dist/chunks/{copy.C92qFRaR.js.map → copy.YBeE8V9S.js.map} +1 -1
  89. package/dist/chunks/{country.BN34hLpN.js → country.PHJgPzKU.js} +7 -7
  90. package/dist/chunks/{country.BN34hLpN.js.map → country.PHJgPzKU.js.map} +1 -1
  91. package/dist/chunks/country.types.BCOrkmVK.js.map +1 -1
  92. package/dist/chunks/{currency.DS4-apvT.js → currency.Y6BqUzYE.js} +5 -5
  93. package/dist/chunks/{currency.DS4-apvT.js.map → currency.Y6BqUzYE.js.map} +1 -1
  94. package/dist/chunks/{dashboard-section.Bv-SveGN.js → dashboard-section.CjC3fVU6.js} +3 -3
  95. package/dist/chunks/{dashboard-section.Bv-SveGN.js.map → dashboard-section.CjC3fVU6.js.map} +1 -1
  96. package/dist/chunks/{dashed-underline.C3lSC1_R.js → dashed-underline.DAtZOaad.js} +4 -4
  97. package/dist/chunks/{dashed-underline.C3lSC1_R.js.map → dashed-underline.DAtZOaad.js.map} +1 -1
  98. package/dist/chunks/{data-grid-template.DqZmPeze.js → data-grid-template.bPjGSga2.js} +4 -4
  99. package/dist/chunks/{data-grid-template.DqZmPeze.js.map → data-grid-template.bPjGSga2.js.map} +1 -1
  100. package/dist/chunks/{data-grid.vBDlLHOW.js → data-grid.o5MQdWnJ.js} +26 -26
  101. package/dist/chunks/{data-grid.vBDlLHOW.js.map → data-grid.o5MQdWnJ.js.map} +1 -1
  102. package/dist/chunks/{date-picker.Dnr2HuxA.js → date-picker.DyB8XkiY.js} +10 -10
  103. package/dist/chunks/{date-picker.Dnr2HuxA.js.map → date-picker.DyB8XkiY.js.map} +1 -1
  104. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  105. package/dist/chunks/{date-range-picker.CuBygd3O.js → date-range-picker.BcQUUVcW.js} +567 -525
  106. package/dist/chunks/date-range-picker.BcQUUVcW.js.map +1 -0
  107. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  108. package/dist/chunks/{date.ojGAujAt.js → date.SUOSxkTe.js} +4 -4
  109. package/dist/chunks/{date.ojGAujAt.js.map → date.SUOSxkTe.js.map} +1 -1
  110. package/dist/chunks/{dialog-page.D60pjDsQ.js → dialog-page.CHpFuDd9.js} +4 -4
  111. package/dist/chunks/{dialog-page.D60pjDsQ.js.map → dialog-page.CHpFuDd9.js.map} +1 -1
  112. package/dist/chunks/{draggable-handle.Cvc8gHzx.js → draggable-handle.CKkSJP0K.js} +3 -3
  113. package/dist/chunks/{draggable-handle.Cvc8gHzx.js.map → draggable-handle.CKkSJP0K.js.map} +1 -1
  114. package/dist/chunks/{draggable.BZsgR26I.js → draggable.jzTSFcM7.js} +38 -35
  115. package/dist/chunks/draggable.jzTSFcM7.js.map +1 -0
  116. package/dist/chunks/{drawer.D3j-d3q5.js → drawer.De-jDVb2.js} +2 -2
  117. package/dist/chunks/{drawer.D3j-d3q5.js.map → drawer.De-jDVb2.js.map} +1 -1
  118. package/dist/chunks/{dropdown-tag.Bn5FPeEL.js → dropdown-tag.BvXqllkv.js} +8 -8
  119. package/dist/chunks/{dropdown-tag.Bn5FPeEL.js.map → dropdown-tag.BvXqllkv.js.map} +1 -1
  120. package/dist/chunks/{dropdown.D_jkFrMd.js → dropdown.BoSI-Rre.js} +20 -20
  121. package/dist/chunks/{dropdown.D_jkFrMd.js.map → dropdown.BoSI-Rre.js.map} +1 -1
  122. package/dist/chunks/{empty-state.DpUC-3wv.js → empty-state.BuK12EGe.js} +4 -4
  123. package/dist/chunks/{empty-state.DpUC-3wv.js.map → empty-state.BuK12EGe.js.map} +1 -1
  124. package/dist/chunks/{error-message.Bt0CznQM.js → error-message.DJ5l0EUH.js} +3 -3
  125. package/dist/chunks/{error-message.Bt0CznQM.js.map → error-message.DJ5l0EUH.js.map} +1 -1
  126. package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
  127. package/dist/chunks/{field-label.Cz11fn_F.js → field-label.vrUwhoOg.js} +4 -4
  128. package/dist/chunks/{field-label.Cz11fn_F.js.map → field-label.vrUwhoOg.js.map} +1 -1
  129. package/dist/chunks/{file-uploader.BglImnqw.js → file-uploader.Cv8sm0Jd.js} +12 -12
  130. package/dist/chunks/{file-uploader.BglImnqw.js.map → file-uploader.Cv8sm0Jd.js.map} +1 -1
  131. package/dist/chunks/{filter-bar.DG4GTi8L.js → filter-bar.6ElVHgFA.js} +34 -31
  132. package/dist/chunks/filter-bar.6ElVHgFA.js.map +1 -0
  133. package/dist/chunks/{fixed-scroller.DoOR83iH.js → fixed-scroller.C0nVzRBU.js} +3 -3
  134. package/dist/chunks/{fixed-scroller.DoOR83iH.js.map → fixed-scroller.C0nVzRBU.js.map} +1 -1
  135. package/dist/chunks/{footer-actions.Dl20Q1WX.js → footer-actions.BJif4sIk.js} +4 -4
  136. package/dist/chunks/{footer-actions.Dl20Q1WX.js.map → footer-actions.BJif4sIk.js.map} +1 -1
  137. package/dist/chunks/{form-layout-group.iAwbiI_S.js → form-layout-group.B9Kzae5F.js} +2 -2
  138. package/dist/chunks/{form-layout-group.iAwbiI_S.js.map → form-layout-group.B9Kzae5F.js.map} +1 -1
  139. package/dist/chunks/{form-layout-title.BZFh_nGD.js → form-layout-title.C7f1ByNh.js} +4 -4
  140. package/dist/chunks/{form-layout-title.BZFh_nGD.js.map → form-layout-title.C7f1ByNh.js.map} +1 -1
  141. package/dist/chunks/{header-with-views.WJlXgGI5.js → header-with-views.Dl6bfk_7.js} +17 -17
  142. package/dist/chunks/{header-with-views.WJlXgGI5.js.map → header-with-views.Dl6bfk_7.js.map} +1 -1
  143. package/dist/chunks/{header.Bi3MPZKE.js → header.E-KFjIG7.js} +5 -5
  144. package/dist/chunks/{header.Bi3MPZKE.js.map → header.E-KFjIG7.js.map} +1 -1
  145. package/dist/chunks/index.CGBfMQdv.js +38 -0
  146. package/dist/chunks/index.CGBfMQdv.js.map +1 -0
  147. package/dist/chunks/{info-icon-with-popover.uSr6-jzR.js → info-icon-with-popover.DqnQnwMI.js} +4 -4
  148. package/dist/chunks/{info-icon-with-popover.uSr6-jzR.js.map → info-icon-with-popover.DqnQnwMI.js.map} +1 -1
  149. package/dist/chunks/{info-icon.Zlg6Sgz0.js → info-icon.D_zu5SYT.js} +2 -2
  150. package/dist/chunks/{info-icon.Zlg6Sgz0.js.map → info-icon.D_zu5SYT.js.map} +1 -1
  151. package/dist/chunks/{input-field-password.CJZxudne.js → input-field-password.BXptrVTT.js} +7 -7
  152. package/dist/chunks/{input-field-password.CJZxudne.js.map → input-field-password.BXptrVTT.js.map} +1 -1
  153. package/dist/chunks/{input-field-phone-number.OJ4MG9Gf.js → input-field-phone-number.Crxi8Wm7.js} +4 -4
  154. package/dist/chunks/{input-field-phone-number.OJ4MG9Gf.js.map → input-field-phone-number.Crxi8Wm7.js.map} +1 -1
  155. package/dist/chunks/{input-field.IyNujUZt.js → input-field._keU91LW.js} +24 -24
  156. package/dist/chunks/{input-field.IyNujUZt.js.map → input-field._keU91LW.js.map} +1 -1
  157. package/dist/chunks/input-time.D7UW_ww_.js +193 -0
  158. package/dist/chunks/input-time.D7UW_ww_.js.map +1 -0
  159. package/dist/chunks/{inspector-page.D42_PXHM.js → inspector-page.DNsc0lK1.js} +4 -4
  160. package/dist/chunks/{inspector-page.D42_PXHM.js.map → inspector-page.DNsc0lK1.js.map} +1 -1
  161. package/dist/chunks/{inspector.BBgrupfO.js → inspector.BLAqbhmV.js} +6 -6
  162. package/dist/chunks/{inspector.BBgrupfO.js.map → inspector.BLAqbhmV.js.map} +1 -1
  163. package/dist/chunks/{layout-row.DijjweVX.js → layout-row.X6mPrUu8.js} +2 -2
  164. package/dist/chunks/{layout-row.DijjweVX.js.map → layout-row.X6mPrUu8.js.map} +1 -1
  165. package/dist/chunks/{link.types.BGj7apK3.js → link.types.BZ1u_6CS.js} +2 -2
  166. package/dist/chunks/{link.types.BGj7apK3.js.map → link.types.BZ1u_6CS.js.map} +1 -1
  167. package/dist/chunks/{list-item.CT7dyMQH.js → list-item.RuGQ8Y4T.js} +6 -6
  168. package/dist/chunks/{list-item.CT7dyMQH.js.map → list-item.RuGQ8Y4T.js.map} +1 -1
  169. package/dist/chunks/{listbox-option-tag.CwrFdsY1.js → listbox-option-tag.71rmQvG8.js} +3 -3
  170. package/dist/chunks/{listbox-option-tag.CwrFdsY1.js.map → listbox-option-tag.71rmQvG8.js.map} +1 -1
  171. package/dist/chunks/{modal-fullscreen.I5bjqzfd.js → modal-fullscreen.jXJnaueu.js} +10 -10
  172. package/dist/chunks/modal-fullscreen.jXJnaueu.js.map +1 -0
  173. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js → modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js} +8 -8
  174. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js.map → modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js.map} +1 -1
  175. package/dist/chunks/{navigation-menu-group.BJ9ZsXEn.js → navigation-menu-group.BnS0isK8.js} +32 -32
  176. package/dist/chunks/navigation-menu-group.BnS0isK8.js.map +1 -0
  177. package/dist/chunks/{pagination.C5gZxtZY.js → pagination.C-kvJ-XK.js} +9 -8
  178. package/dist/chunks/{pagination.C5gZxtZY.js.map → pagination.C-kvJ-XK.js.map} +1 -1
  179. package/dist/chunks/{payment-method.q2yow5VR.js → payment-method.B69Mu88z.js} +2 -2
  180. package/dist/chunks/{payment-method.q2yow5VR.js.map → payment-method.B69Mu88z.js.map} +1 -1
  181. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  182. package/dist/chunks/popover.types.dhllh3NP.js.map +1 -1
  183. package/dist/chunks/popper-container.Rfj8UdMD.js.map +1 -1
  184. package/dist/chunks/{promo-banner.kE1-WkzI.js → promo-banner.3d1DHWas.js} +4 -4
  185. package/dist/chunks/{promo-banner.kE1-WkzI.js.map → promo-banner.3d1DHWas.js.map} +1 -1
  186. package/dist/chunks/{radio-group.XmRPh03c.js → radio-group.BTI_2U11.js} +5 -5
  187. package/dist/chunks/{radio-group.XmRPh03c.js.map → radio-group.BTI_2U11.js.map} +1 -1
  188. package/dist/chunks/{rich-text-editor.Cv_Vwt-6.js → rich-text-editor.ClUU1zPM.js} +12 -12
  189. package/dist/chunks/{rich-text-editor.Cv_Vwt-6.js.map → rich-text-editor.ClUU1zPM.js.map} +1 -1
  190. package/dist/chunks/{scroll-to-section.CJorrxQT.js → scroll-to-section.BRr4Vwi7.js} +2 -2
  191. package/dist/chunks/{scroll-to-section.CJorrxQT.js.map → scroll-to-section.BRr4Vwi7.js.map} +1 -1
  192. package/dist/chunks/{search-bar.5tObtLfW.js → search-bar.D1Jz7hdd.js} +13 -13
  193. package/dist/chunks/{search-bar.5tObtLfW.js.map → search-bar.D1Jz7hdd.js.map} +1 -1
  194. package/dist/chunks/{secondary-nav.DApIImQ0.js → secondary-nav.D32VFDTi.js} +26 -26
  195. package/dist/chunks/{secondary-nav.DApIImQ0.js.map → secondary-nav.D32VFDTi.js.map} +1 -1
  196. package/dist/chunks/{segmented-control.CEt2dz4n.js → segmented-control.CarI0i3p.js} +3 -3
  197. package/dist/chunks/{segmented-control.CEt2dz4n.js.map → segmented-control.CarI0i3p.js.map} +1 -1
  198. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
  199. package/dist/chunks/{selection-card-group.DHXtJpoB.js → selection-card-group.CQsS8-H9.js} +109 -108
  200. package/dist/chunks/{selection-card-group.DHXtJpoB.js.map → selection-card-group.CQsS8-H9.js.map} +1 -1
  201. package/dist/chunks/{sidepanel._30g8POM.js → sidepanel.CYWPV9dE.js} +13 -13
  202. package/dist/chunks/{sidepanel._30g8POM.js.map → sidepanel.CYWPV9dE.js.map} +1 -1
  203. package/dist/chunks/{status.Nss4P5OU.js → status.BJ48Isyh.js} +2 -2
  204. package/dist/chunks/{status.Nss4P5OU.js.map → status.BJ48Isyh.js.map} +1 -1
  205. package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
  206. package/dist/chunks/{step.5_ZukVqJ.js → step.CRVu8HPR.js} +6 -6
  207. package/dist/chunks/step.CRVu8HPR.js.map +1 -0
  208. package/dist/chunks/{structured-list-item.CBzznwcF.js → structured-list-item.C6SAUS9a.js} +11 -10
  209. package/dist/chunks/structured-list-item.C6SAUS9a.js.map +1 -0
  210. package/dist/chunks/{summary-grid.types.BR_EGvRg.js → summary-grid.types.FTWeUNFh.js} +7 -7
  211. package/dist/chunks/{summary-grid.types.BR_EGvRg.js.map → summary-grid.types.FTWeUNFh.js.map} +1 -1
  212. package/dist/chunks/{tab.D_k5AVHk.js → tab.CwXAsp9E.js} +44 -43
  213. package/dist/chunks/tab.CwXAsp9E.js.map +1 -0
  214. package/dist/chunks/{table-of-contents.CJ2yMbAG.js → table-of-contents.Bnyua5hb.js} +4 -4
  215. package/dist/chunks/{table-of-contents.CJ2yMbAG.js.map → table-of-contents.Bnyua5hb.js.map} +1 -1
  216. package/dist/chunks/{tag.BE1j0Oid.js → tag.BYxa556o.js} +3 -3
  217. package/dist/chunks/{tag.BE1j0Oid.js.map → tag.BYxa556o.js.map} +1 -1
  218. package/dist/chunks/{textarea.BYshPd98.js → textarea.D4aMdmDx.js} +8 -8
  219. package/dist/chunks/textarea.D4aMdmDx.js.map +1 -0
  220. package/dist/chunks/{timeline-item.Sy_DSw6p.js → timeline-item.De8HCoYw.js} +11 -11
  221. package/dist/chunks/{timeline-item.Sy_DSw6p.js.map → timeline-item.De8HCoYw.js.map} +1 -1
  222. package/dist/chunks/{title-details.C4ZvxPMu.js → title-details.8cyCeaLf.js} +5 -5
  223. package/dist/chunks/{title-details.C4ZvxPMu.js.map → title-details.8cyCeaLf.js.map} +1 -1
  224. package/dist/chunks/{toast.u5Y_CGe_.js → toast.BI2PD8Oj.js} +5 -5
  225. package/dist/chunks/{toast.u5Y_CGe_.js.map → toast.BI2PD8Oj.js.map} +1 -1
  226. package/dist/chunks/{toggle.BW8ww0Ih.js → toggle.BbCqV953.js} +4 -4
  227. package/dist/chunks/{toggle.BW8ww0Ih.js.map → toggle.BbCqV953.js.map} +1 -1
  228. package/dist/chunks/{tooltip.TFOGHOO0.js → tooltip.0QqJo2sa.js} +2 -2
  229. package/dist/chunks/{tooltip.TFOGHOO0.js.map → tooltip.0QqJo2sa.js.map} +1 -1
  230. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js → tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js} +4 -4
  231. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js.map → tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js.map} +1 -1
  232. package/dist/chunks/{typography.wIM07Hbl.js → typography.B6elnWpr.js} +35 -35
  233. package/dist/chunks/{typography.wIM07Hbl.js.map → typography.B6elnWpr.js.map} +1 -1
  234. package/dist/chunks/{use-bento-toast-controller.BAoPbtq7.js → use-bento-toast-controller.CkpBtweL.js} +2 -2
  235. package/dist/chunks/{use-bento-toast-controller.BAoPbtq7.js.map → use-bento-toast-controller.CkpBtweL.js.map} +1 -1
  236. package/dist/chunks/{use-country-items.CYnYzs7x.js → use-country-items.CAYJt6XS.js} +3 -3
  237. package/dist/chunks/{use-country-items.CYnYzs7x.js.map → use-country-items.CAYJt6XS.js.map} +1 -1
  238. package/dist/chunks/{use-date-input-formatter._ik1DYYV.js → use-date-input-formatter.BIVkaB1k.js} +2 -2
  239. package/dist/chunks/{use-date-input-formatter._ik1DYYV.js.map → use-date-input-formatter.BIVkaB1k.js.map} +1 -1
  240. package/dist/chunks/{use-dynamic-date-fns-locale.BMO9rsEh.js → use-dynamic-date-fns-locale._EtEeU3i.js} +2 -2
  241. package/dist/chunks/{use-dynamic-date-fns-locale.BMO9rsEh.js.map → use-dynamic-date-fns-locale._EtEeU3i.js.map} +1 -1
  242. package/dist/code-snippet.js +1 -1
  243. package/dist/country.js +1 -1
  244. package/dist/currency.js +1 -1
  245. package/dist/dashboard-template.js +1 -1
  246. package/dist/dashed-underline.js +1 -1
  247. package/dist/data-grid-template.js +1 -1
  248. package/dist/data-grid.js +1 -1
  249. package/dist/date-picker.js +2 -2
  250. package/dist/date-range-picker.js +2 -2
  251. package/dist/date-time-picker.js +6 -6
  252. package/dist/date.js +1 -1
  253. package/dist/draggable.js +2 -2
  254. package/dist/drawer.js +1 -1
  255. package/dist/dropdown.js +2 -2
  256. package/dist/empty-state.js +1 -1
  257. package/dist/file-uploader.js +1 -1
  258. package/dist/filter-bar.js +1 -1
  259. package/dist/form-layout.js +2 -2
  260. package/dist/header-with-views.js +1 -1
  261. package/dist/header.js +1 -1
  262. package/dist/index.js +382 -353
  263. package/dist/index.js.map +1 -1
  264. package/dist/info-icon.js +1 -1
  265. package/dist/input-field-password.js +1 -1
  266. package/dist/input-field-phone-number.js +1 -1
  267. package/dist/input-field.js +1 -1
  268. package/dist/input-time.js +1 -1
  269. package/dist/inspector.js +2 -2
  270. package/dist/internal.js +14 -14
  271. package/dist/layout.js +1 -1
  272. package/dist/link.js +1 -1
  273. package/dist/list.js +1 -1
  274. package/dist/menu.js +1 -1
  275. package/dist/modal-fullscreen.js +1 -1
  276. package/dist/modal.js +2 -2
  277. package/dist/navigation-menu.js +1 -1
  278. package/dist/pagination.js +1 -1
  279. package/dist/payment-method.js +1 -1
  280. package/dist/popover.js +1 -1
  281. package/dist/progress-bar.js +4 -4
  282. package/dist/promo-banner.js +1 -1
  283. package/dist/radio-group.js +1 -1
  284. package/dist/rich-text-editor.js +1 -1
  285. package/dist/search-bar.js +2 -2
  286. package/dist/secondary-nav.js +1 -1
  287. package/dist/segmented-control.js +1 -1
  288. package/dist/selection-card.js +1 -1
  289. package/dist/sidepanel.js +1 -1
  290. package/dist/status.js +1 -1
  291. package/dist/stepper.js +1 -1
  292. package/dist/structured-list.js +1 -1
  293. package/dist/styles/bento-dark.css +3 -0
  294. package/dist/styles/bento-light.css +3 -0
  295. package/dist/styles/bento.css +3 -0
  296. package/dist/styles/legacy.css +3 -0
  297. package/dist/styles/styleguide.css +3 -0
  298. package/dist/styles/utility.css +9 -0
  299. package/dist/summary-grid.js +1 -1
  300. package/dist/table-of-contents.js +1 -1
  301. package/dist/tabs.js +1 -1
  302. package/dist/tag.js +1 -1
  303. package/dist/textarea.js +1 -1
  304. package/dist/timeline.js +1 -1
  305. package/dist/toast.js +1 -1
  306. package/dist/toggle.js +1 -1
  307. package/dist/tutorial.js +1 -1
  308. package/dist/typography.js +1 -1
  309. package/dist/web-types.json +1 -1
  310. package/package.json +9 -5
  311. package/dist/chunks/button-actions.uIjzze43.js.map +0 -1
  312. package/dist/chunks/calendar.Dtba7fcs.js.map +0 -1
  313. package/dist/chunks/date-range-picker.CuBygd3O.js.map +0 -1
  314. package/dist/chunks/draggable.BZsgR26I.js.map +0 -1
  315. package/dist/chunks/filter-bar.DG4GTi8L.js.map +0 -1
  316. package/dist/chunks/index.B875RXHM.js +0 -15
  317. package/dist/chunks/index.B875RXHM.js.map +0 -1
  318. package/dist/chunks/input-time.BJ6YqkFi.js +0 -122
  319. package/dist/chunks/input-time.BJ6YqkFi.js.map +0 -1
  320. package/dist/chunks/modal-fullscreen.I5bjqzfd.js.map +0 -1
  321. package/dist/chunks/navigation-menu-group.BJ9ZsXEn.js.map +0 -1
  322. package/dist/chunks/step.5_ZukVqJ.js.map +0 -1
  323. package/dist/chunks/structured-list-item.CBzznwcF.js.map +0 -1
  324. package/dist/chunks/tab.D_k5AVHk.js.map +0 -1
  325. package/dist/chunks/textarea.BYshPd98.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-item.Sy_DSw6p.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../../vue2/src/components/timeline/timeline.types.ts","../../../vue2/src/components/timeline/timeline.keys.ts","../../../vue2/src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../vue2/src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { type BentoDashedUnderlineProps } from '@/components/dashed-underline/dashed-underline.types';\nimport { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated Since v3.0.0. Do not use. Use the `status` prop instead.\n */\nexport enum BentoTimelineItemVariant {\n DEFAULT = 'SquareSmallIcon',\n SUCCESS = 'CheckedCircleIcon',\n CRITICAL = 'CrossCircleIcon',\n}\n\nexport enum BentoTimelineStatus {\n BLACK = 'black',\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoTimelineItemTitle extends RouterLinkProps {\n /**\n * Link label.\n */\n title: string;\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n // This has been added to allow users to add HTML and Aria attribute\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [name: string]: any;\n}\n\nexport interface BentoTimelineTimestamp {\n date: Date | number;\n format?: BentoDateFormat;\n value?: string;\n description?: BentoDashedUnderlineProps;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n\nexport interface BentoTimelineProps {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote?: boolean;\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore?: BentoTimelineShowMoreObject;\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit?: BentoTimelineGapObject;\n}\n\nexport interface BentoTimelineItemProps {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp?: BentoTimelineTimestamp;\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList?: BentoTimelineDataList;\n /**\n * Description of the event\n */\n description?: string;\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status?: string;\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag?: BentoTimelineTagProps;\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: BentoTimelineTimestamp;\n /**\n * Title of the event\n */\n title?: BentoTimelineItemTitle | string;\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type?: string;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @update:model-value=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import { type BentoInternalTimelineRegisterEntry } from './timeline.internal.types';\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineProps,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineProps>(), {\n addNote: false,\n showMore: null,\n timegapLimit: null,\n });\n\n const emit = defineEmits(['add-timeline-note']);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n</script>\n<script lang=\"ts\">\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n\n <bento-dashed-underline v-if=\"timestamp.description\" v-bind=\"timestamp.description\">\n {{ timestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>{{ timestamp.value }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n\n <bento-dashed-underline\n v-if=\"additionalTimestamp.description\"\n v-bind=\"additionalTimestamp.description\"\n >\n {{ additionalTimestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>\n {{ additionalTimestamp.value }}\n </span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"listEntry in dataList\"\n :key=\"generateUid(listEntry.label)\"\n :label=\"listEntry.label\"\n >\n <bento-typography variant=\"caption\">{{ listEntry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, useSlots } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineItemProps,\n type BentoTimelineItemTitle,\n } from '../../timeline.types';\n import { type BentoTimelineRegisterEntry } from '../../timeline.internal.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineItemProps>(), {\n additionalTimestamp: null,\n dataList: null,\n description: null,\n status: 'black',\n tag: undefined,\n title: null,\n type: 'milestone',\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const isNoteType = computed(() => props.type === 'note');\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${props.status}`]: props.status && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)));\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n i18n: { messages },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","props","__props","emit","__emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","instance","getCurrentInstance","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAmGO,SAAAA,GAAAC,GAAAC,GAAAC,GAAA;AACP,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AA,MAAAa,EAAA,QAAA,CAAA,GAAA,MACA0B,IAAAN,EAAA,SAAA3B,EAAA,MAAA,SAAAO,EAAA,QAAA,CAAA;AACA,UAAA,CAAAyB,KAAA,CAAAC;AACI,eAAA;AAEJ,YAAA,EAAA,MAAAC,EAAA,IAAAxC,EAAA,MAAAa,EAAA,KAAA,GACA4B,KAAA;AAAA,QAA8B1G,GAAAuG,GAAAE,GAAA,EAAA,MAAArC,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAsC,KAAA1G,GAAAuG,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAAtD,EAAA,MAAAiD,EAAA,QAAApD,EAAA,WAAA,EAAA,SAAAoD,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAAvD,EAAA,MAAAa,EAAA,SAAAM,EAAA,UAAAM,EAAA,KAAA,GACA+B,IAAAxD,EAAA,MAEIyB,EAAA,UAAA,MAAAA,EAAA,UAAAb,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"timeline-item.De8HCoYw.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../../vue2/src/components/timeline/timeline.types.ts","../../../vue2/src/components/timeline/timeline.keys.ts","../../../vue2/src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../vue2/src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { type BentoDashedUnderlineProps } from '@/components/dashed-underline/dashed-underline.types';\nimport { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated Since v3.0.0. Do not use. Use the `status` prop instead.\n */\nexport enum BentoTimelineItemVariant {\n DEFAULT = 'SquareSmallIcon',\n SUCCESS = 'CheckedCircleIcon',\n CRITICAL = 'CrossCircleIcon',\n}\n\nexport enum BentoTimelineStatus {\n BLACK = 'black',\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoTimelineItemTitle extends RouterLinkProps {\n /**\n * Link label.\n */\n title: string;\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n // This has been added to allow users to add HTML and Aria attribute\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [name: string]: any;\n}\n\nexport interface BentoTimelineTimestamp {\n date: Date | number;\n format?: BentoDateFormat;\n value?: string;\n description?: BentoDashedUnderlineProps;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n\nexport interface BentoTimelineProps {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote?: boolean;\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore?: BentoTimelineShowMoreObject;\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit?: BentoTimelineGapObject;\n}\n\nexport interface BentoTimelineItemProps {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp?: BentoTimelineTimestamp;\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList?: BentoTimelineDataList;\n /**\n * Description of the event\n */\n description?: string;\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status?: string;\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag?: BentoTimelineTagProps;\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: BentoTimelineTimestamp;\n /**\n * Title of the event\n */\n title?: BentoTimelineItemTitle | string;\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type?: string;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @update:model-value=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import { type BentoInternalTimelineRegisterEntry } from './timeline.internal.types';\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineProps,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineProps>(), {\n addNote: false,\n showMore: null,\n timegapLimit: null,\n });\n\n const emit = defineEmits(['add-timeline-note']);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n</script>\n<script lang=\"ts\">\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n\n <bento-dashed-underline v-if=\"timestamp.description\" v-bind=\"timestamp.description\">\n {{ timestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>{{ timestamp.value }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n\n <bento-dashed-underline\n v-if=\"additionalTimestamp.description\"\n v-bind=\"additionalTimestamp.description\"\n >\n {{ additionalTimestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>\n {{ additionalTimestamp.value }}\n </span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"listEntry in dataList\"\n :key=\"generateUid(listEntry.label)\"\n :label=\"listEntry.label\"\n >\n <bento-typography variant=\"caption\">{{ listEntry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, useSlots } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineItemProps,\n type BentoTimelineItemTitle,\n } from '../../timeline.types';\n import { type BentoTimelineRegisterEntry } from '../../timeline.internal.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineItemProps>(), {\n additionalTimestamp: null,\n dataList: null,\n description: null,\n status: 'black',\n tag: undefined,\n title: null,\n type: 'milestone',\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const isNoteType = computed(() => props.type === 'note');\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${props.status}`]: props.status && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)));\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n i18n: { messages },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","props","__props","emit","__emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","instance","getCurrentInstance","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAmGO,SAAAA,GAAAC,GAAAC,GAAAC,GAAA;AACP,QAAAC,IAAAC,GAAA,GACAC,IAAAH,GAAA,UAAAC,EAAA,UAAAG,IAEAC,IAAAC,GAAAR,GAAAC,CAAA;AAEA,MAAA,MAAAM,C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AyB,KAAA,CAAAC;AACI,eAAA;AAEJ,YAAA,EAAA,MAAAC,EAAA,IAAAxC,EAAA,MAAAa,EAAA,KAAA,GACA4B,KAAA;AAAA,QAA8B1G,GAAAuG,GAAAE,GAAA,EAAA,MAAArC,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAsC,KAAA1G,GAAAuG,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAAtD,EAAA,MAAAiD,EAAA,QAAApD,EAAA,WAAA,EAAA,SAAAoD,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAAvD,EAAA,MAAAa,EAAA,SAAAM,EAAA,UAAAM,EAAA,KAAA,GACA+B,IAAAxD,EAAA,MAEIyB,EAAA,UAAA,MAAAA,EAAA,UAAAb,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -4,11 +4,11 @@ import { c as E } from "./constructNow.Dl44Mvpp.js";
4
4
  import { t as N, d as j, n as A, j as X, k as R, o as b, p as M, g as V } from "./en-US.C412g-7U.js";
5
5
  import { d as Y } from "./differenceInMonths.CPDkGea3.js";
6
6
  import { g as H } from "./getRoundingMethod.C3eaeGLR.js";
7
- import { B as k } from "./typography.wIM07Hbl.js";
7
+ import { B as k } from "./typography.B6elnWpr.js";
8
8
  import { _ as F } from "./refresh.DjN1EulV.js";
9
- import { u as $ } from "./index.B875RXHM.js";
10
- import { u as G } from "./use-dynamic-date-fns-locale.BMO9rsEh.js";
11
- import { a as J } from "./button-actions.uIjzze43.js";
9
+ import { u as $ } from "./index.CGBfMQdv.js";
10
+ import { u as G } from "./use-dynamic-date-fns-locale._EtEeU3i.js";
11
+ import { a as J } from "./button-actions.DvuGEQxM.js";
12
12
  import { _ as P } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
13
  import "../assets/title-details.css";
14
14
  function q(s, o) {
@@ -141,4 +141,4 @@ const z = {
141
141
  export {
142
142
  ht as T
143
143
  };
144
- //# sourceMappingURL=title-details.C4ZvxPMu.js.map
144
+ //# sourceMappingURL=title-details.8cyCeaLf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"title-details.C4ZvxPMu.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js","../../../vue2/src/components/internal/title-details/title-details.vue"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { minutesInDay, minutesInMonth } from \"./constants.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistance(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) throw new RangeError(\"Invalid time value\");\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const seconds = differenceInSeconds(earlierDate_, laterDate_);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(earlierDate_, laterDate_);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistance } from \"./formatDistance.js\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","<template>\n <div class=\"b-title-details__container\">\n <bento-typography v-if=\"description || hasSlot('description')\" class=\"b-title-details__description\" el=\"div\">\n <slot name=\"description\">{{ description }}</slot>\n </bento-typography>\n <div v-if=\"lastUpdatedDate\" class=\"b-title-details__timestamp-section\">\n <bento-typography class=\"b-title-details__timestamp\" el=\"div\">\n <time :datetime=\"lastUpdatedDateTime\">{{ timestamp }}</time>\n </bento-typography>\n <bento-loading-button\n v-if=\"reloadButton\"\n variant=\"tertiary\"\n :state=\"reloadButton.state\"\n @click=\"reloadButton.event\"\n ><template #iconLeft><reload-icon aria-hidden=\"true\" /></template\n >{{ reloadButton.title }}</bento-loading-button\n >\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { useDynamicDateFnsLocale, useHasSlot } from '@/composables';\n import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingButton } from '@/components/button';\n import ReloadIcon from '@adyen/ui-assets-icons-16/vue/refresh';\n import { useI18n } from '@/utils/ts/i18n';\n import type { TitleDetailsProps } from './title-details.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, locale } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<TitleDetailsProps>(), {\n description: null,\n lastUpdated: null,\n reloadButton: null,\n });\n\n const lastUpdatedDate = computed(() => {\n if (!props.lastUpdated) {\n return null;\n }\n\n const date = props.lastUpdated instanceof Date ? props.lastUpdated : new Date(props.lastUpdated);\n return Number.isNaN(date.getTime()) ? null : date;\n });\n\n const activeLocale = computed(() => (lastUpdatedDate.value ? locale.value : ''));\n const dateLocale = useDynamicDateFnsLocale(activeLocale);\n const lastUpdatedDateTime = computed(() => lastUpdatedDate.value?.toISOString());\n\n const timestamp = computed(() =>\n lastUpdatedDate.value\n ? t('lastUpdated', {\n date: formatDistanceToNow(lastUpdatedDate.value, {\n locale: dateLocale.value,\n addSuffix: true,\n }),\n })\n : null\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal component for descriptions and last-updated metadata.\n *\n * @example\n * import { TitleDetails } from '@/internal';\n *\n * export default {\n * components: { TitleDetails },\n * template: `\n * <title-details description=\"content description\" :last-updated=\"new Date()\" />\n * `\n * }\n * @slot description - The description content. Overrides the `description` prop.\n * @property description - Text showed under the title.\n * @property lastUpdated - JavaScript \"Date\" object for when the content was last updated.\n * @property reloadButton - Reload button which shows next to the header's timestamp.\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./title-details.scss\" />\n"],"names":["differenceInMilliseconds","laterDate","earlierDate","toDate","differenceInSeconds","options","diff","getRoundingMethod","formatDistance","defaultOptions","getDefaultOptions","locale","enUS","minutesInAlmostTwoDays","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","seconds","offsetInSeconds","getTimezoneOffsetInMilliseconds","minutes","months","minutesInDay","hours","minutesInMonth","days","differenceInMonths","nearestMonth","monthsSinceStartOfYear","years","formatDistanceToNow","date","constructNow","__default__","messages","t","useI18n","props","__props","lastUpdatedDate","computed","activeLocale","dateLocale","useDynamicDateFnsLocale","lastUpdatedDateTime","timestamp","slots","useSlots","hasSlot","useHasSlot"],"mappings":";;;;;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GAAA,QAAA3B,EAAA,IAAA4B,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GAMAC,IAAAC,EAAA,MAAA;AACI,UAAA,CAAAH,EAAA;AACI,eAAA;AAGJ,YAAAN,IAAAM,EAAA,uBAAA,OAAAA,EAAA,cAAA,IAAA,KAAAA,EAAA,WAAA;AACA,aAAA,OAAA,MAAAN,EAAA,QAAA,CAAA,IAAA,OAAAA;AAAA,IAA6C,CAAA,GAGjDU,IAAAD,EAAA,MAAAD,EAAA,QAAA/B,EAAA,QAAA,EAAA,GACAkC,IAAAC,EAAAF,CAAA,GACAG,IAAAJ,EAAA,MAAAD,EAAA,OAAA,YAAA,CAAA,GAEAM,IAAAL;AAAA,MAAkB,MAAAD,EAAA,QAAAJ,EAAA,eAAA;AAAA,QAES,MAAAL,EAAAS,EAAA,OAAA;AAAA,UACoC,QAAAG,EAAA;AAAA,UAC1B,WAAA;AAAA,QACR,CAAA;AAAA,MACd,CAAA,IAAA;AAAA,IAEL,GAGVI,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"title-details.8cyCeaLf.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js","../../../vue2/src/components/internal/title-details/title-details.vue"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { minutesInDay, minutesInMonth } from \"./constants.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistance(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) throw new RangeError(\"Invalid time value\");\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const seconds = differenceInSeconds(earlierDate_, laterDate_);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(earlierDate_, laterDate_);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistance } from \"./formatDistance.js\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","<template>\n <div class=\"b-title-details__container\">\n <bento-typography v-if=\"description || hasSlot('description')\" class=\"b-title-details__description\" el=\"div\">\n <slot name=\"description\">{{ description }}</slot>\n </bento-typography>\n <div v-if=\"lastUpdatedDate\" class=\"b-title-details__timestamp-section\">\n <bento-typography class=\"b-title-details__timestamp\" el=\"div\">\n <time :datetime=\"lastUpdatedDateTime\">{{ timestamp }}</time>\n </bento-typography>\n <bento-loading-button\n v-if=\"reloadButton\"\n variant=\"tertiary\"\n :state=\"reloadButton.state\"\n @click=\"reloadButton.event\"\n ><template #iconLeft><reload-icon aria-hidden=\"true\" /></template\n >{{ reloadButton.title }}</bento-loading-button\n >\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { useDynamicDateFnsLocale, useHasSlot } from '@/composables';\n import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingButton } from '@/components/button';\n import ReloadIcon from '@adyen/ui-assets-icons-16/vue/refresh';\n import { useI18n } from '@/utils/ts/i18n';\n import type { TitleDetailsProps } from './title-details.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, locale } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<TitleDetailsProps>(), {\n description: null,\n lastUpdated: null,\n reloadButton: null,\n });\n\n const lastUpdatedDate = computed(() => {\n if (!props.lastUpdated) {\n return null;\n }\n\n const date = props.lastUpdated instanceof Date ? props.lastUpdated : new Date(props.lastUpdated);\n return Number.isNaN(date.getTime()) ? null : date;\n });\n\n const activeLocale = computed(() => (lastUpdatedDate.value ? locale.value : ''));\n const dateLocale = useDynamicDateFnsLocale(activeLocale);\n const lastUpdatedDateTime = computed(() => lastUpdatedDate.value?.toISOString());\n\n const timestamp = computed(() =>\n lastUpdatedDate.value\n ? t('lastUpdated', {\n date: formatDistanceToNow(lastUpdatedDate.value, {\n locale: dateLocale.value,\n addSuffix: true,\n }),\n })\n : null\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal component for descriptions and last-updated metadata.\n *\n * @example\n * import { TitleDetails } from '@/internal';\n *\n * export default {\n * components: { TitleDetails },\n * template: `\n * <title-details description=\"content description\" :last-updated=\"new Date()\" />\n * `\n * }\n * @slot description - The description content. Overrides the `description` prop.\n * @property description - Text showed under the title.\n * @property lastUpdated - JavaScript \"Date\" object for when the content was last updated.\n * @property reloadButton - Reload button which shows next to the header's timestamp.\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./title-details.scss\" />\n"],"names":["differenceInMilliseconds","laterDate","earlierDate","toDate","differenceInSeconds","options","diff","getRoundingMethod","formatDistance","defaultOptions","getDefaultOptions","locale","enUS","minutesInAlmostTwoDays","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","seconds","offsetInSeconds","getTimezoneOffsetInMilliseconds","minutes","months","minutesInDay","hours","minutesInMonth","days","differenceInMonths","nearestMonth","monthsSinceStartOfYear","years","formatDistanceToNow","date","constructNow","__default__","messages","t","useI18n","props","__props","lastUpdatedDate","computed","activeLocale","dateLocale","useDynamicDateFnsLocale","lastUpdatedDateTime","timestamp","slots","useSlots","hasSlot","useHasSlot"],"mappings":";;;;;;;;;;;;;AAwBO,SAAAA,EAAAC,GAAAC,GAAA;AACP,SAAA,CAAAC,EAAAF,CAAA,IAAA,CAAAE,EAAAD,CAAA;AACA;ACIO,SAAAE,EAAAH,GAAAC,GAAAG,GAAA;AACP,QAAAC,IAAAN,EAAAC,GAAAC,CAAA,IAAA;AACA,SAAAK,EAAAF,GAAA,cAAA,EAAAC,CAAA;AACA;AC0DO,SAAAE,EAAAP,GAAAC,GAAAG,GAAA;AACP,QAAAI,IAAAC,EAAA,GACAC,IAAAN,GAAA,UAAAI,EAAA,UAAAG,GACAC,IAAA,MAEAC,IAAAC,EAAAd,GAAAC,CAAA;AAEA,MAAA,MAAAY,CAAA,EAAA,OAAA,IAAA,WAAA,oBAAA;AAEA,QAAAE,IAAA,OAAA,OAAA,CAAA,GAAAX,GAAA;AAAA,IACA,WAAAA,GAAA;AAAA,IACA,YAAAS;AAAA,EACA,CAAA,GAEA,CAAAG,GAAAC,CAAA,IAAAC;AAAA,IACAd,GAAA;AAAA,IACA,GAAAS,IAAA,IAAA,CAAAZ,GAAAD,CAAA,IAAA,CAAAA,GAAAC,CAAA;AAAA,EACA,GAEAkB,IAAAhB,EAAAc,GAAAD,CAAA,GACAI,KACAC,EAAAJ,CAAA,IACAI,EAAAL,CAAA,KACA,KACAM,IAAA,KAAA,OAAA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, createVNode as y, unref as k, withCtx as I, createTextVNode as A, toDisplayString as E, createBlock as b, createCommentVNode as B, ref as v, computed as _, watch as S, onMounted as G, nextTick as X, normalizeStyle as J, TransitionGroup as K, Fragment as Q, renderList as Z, mergeProps as tt } from "vue";
2
- import { u as j } from "./use-bento-toast-controller.BAoPbtq7.js";
2
+ import { u as j } from "./use-bento-toast-controller.CkpBtweL.js";
3
3
  import { _ as et } from "./cross-small.B6P0qFHF.js";
4
- import { u as st } from "./index.B875RXHM.js";
5
- import { B as H } from "./button.Ciflfide.js";
6
- import { B as at } from "./typography.wIM07Hbl.js";
4
+ import { u as st } from "./index.CGBfMQdv.js";
5
+ import { B as H } from "./button.DAcwNdtP.js";
6
+ import { B as at } from "./typography.B6elnWpr.js";
7
7
  import { _ as R } from "./_plugin-vue_export-helper.CHgC5LLL.js";
8
8
  import "../assets/toast.css";
9
9
  const O = {
@@ -220,4 +220,4 @@ const O = {
220
220
  export {
221
221
  Tt as B
222
222
  };
223
- //# sourceMappingURL=toast.u5Y_CGe_.js.map
223
+ //# sourceMappingURL=toast.BI2PD8Oj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.u5Y_CGe_.js","sources":["../../../vue2/src/components/toast/components/toast-item/toast-item.vue","../../../vue2/src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../../vue2/src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n variant=\"tertiary\"\n inverse\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button variant=\"tertiary\" inverse data-testid=\"toast-item-close-btn\" @click=\"toast.dismiss()\">\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\n /**\n *\n */\n (e: 'update', toasts: Array<BentoToastItemWithDimensions>): void;\n }>();\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import ToastItem from './components/toast-item/toast-item.vue';\n import { useBentoToastController } from '@/composables/use-bento-toast-controller';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","onAction","stack","useBentoToastController","emit","__emit","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","watch","onMounted","TOAST_DISPLAY_DURATION","collapsedToastHeight","stackIndicatorHeight","renderToast","toastStack","hovered","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root","checkHover"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAiDIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;AAlBA,UAAAC,IAAAC,GAKA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAJ,EAAA,CAAA,GAEAK,IAAA,MAAA;AACI,MAAA,OAAAJ,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MA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;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"toast.BI2PD8Oj.js","sources":["../../../vue2/src/components/toast/components/toast-item/toast-item.vue","../../../vue2/src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../../vue2/src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n variant=\"tertiary\"\n inverse\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button variant=\"tertiary\" inverse data-testid=\"toast-item-close-btn\" @click=\"toast.dismiss()\">\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\n /**\n *\n */\n (e: 'update', toasts: Array<BentoToastItemWithDimensions>): void;\n }>();\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import ToastItem from './components/toast-item/toast-item.vue';\n import { useBentoToastController } from '@/composables/use-bento-toast-controller';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","onAction","stack","useBentoToastController","emit","__emit","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","watch","onMounted","TOAST_DISPLAY_DURATION","collapsedToastHeight","stackIndicatorHeight","renderToast","toastStack","hovered","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root","checkHover"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAiDIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;AAlBA,UAAAC,IAAAC,GAKA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAJ,EAAA,CAAA,GAEAK,IAAA,MAAA;AACI,MAAA,OAAAJ,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnBxB,UAAA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,GACAE,IAAAF,EAAA,GACAG,IAAAH,EAAA,GACAI,IAAA,CAAAH,GAAAC,GAAAC,CAAA,GAGAE,IAAAC,EAAA,MAAAX,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,GAEAY,IAAA,YAAA;AAEI,YAAAC,EAAA;AAGA,YAAA,EAAA,KAAAC,EAAA,IAAAV,EAAA,MAAA,sBAAA,GAEAW,IAAAf,EAAA,MAAA,IAAA,CAAAgB,GAAAC,MAAA;AACI,YAAAA,IAAA;AACI,iBAAA,EAAA,GAAAD,GAAA,QAAA,GAAA,QAAA,EAAA;AAEJ,cAAA,EAAA,QAAAE,GAAA,KAAAC,EAAA,IAAAV,EAAAQ,CAAA,EAAA,MAAA,IAAA,sBAAA;AACA,eAAA,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GAF,EAAAC,CAAA;AAAA,MAA+B;AAAA,MACnC,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAE,IAAA,MAAA;AACI,MAAAN,IAAAA,IAAA,KAAA,IAAA,IAAAD,GACA,aAAAD,CAAA;AAAA,IAA0B,GAG9BS,IAAA,MAAA;AACI,MAAAP,IAAA,KACIC,EAAAZ,EAAA,MAAA,CAAA,GAAAW,CAAA;AAAA,IACJ;AAGJ,IAAAtB,EAAAO,GAAA,CAAAuB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA,GAKA+C,IAAA,MAAA,WAAA,MAAA;AAEQ,MAAAzB,EAAA,QAAAA,EAAA,QAAAwB,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as T, useSlots as w, useAttrs as D, ref as O, computed as d, toRefs as V, watch as $, openBlock as s, createElementBlock as m, normalizeClass as N, withDirectives as U, createElementVNode as p, unref as t, vModelCheckbox as j, createBlock as f, createCommentVNode as u, withCtx as _, renderSlot as v } from "vue";
2
2
  import { _ as z } from "./checkmark-small.DJcd8Sd7.js";
3
- import { B as y } from "./typography.wIM07Hbl.js";
3
+ import { B as y } from "./typography.B6elnWpr.js";
4
4
  import { g as H } from "./generate-uid.DBWe4g6T.js";
5
5
  import { u as M } from "./use-default-slot-validator.BzHcrgmy.js";
6
6
  import { u as P } from "./use-has-slot.CyMiImRQ.js";
@@ -21,7 +21,7 @@ const K = ["aria-label", "aria-describedby", "disabled", "aria-readonly"], Q = {
21
21
  ...Y,
22
22
  props: {
23
23
  /**
24
- * @deprecated Since v2.0.0. Use `aria-label` instead.
24
+ * @deprecated Since v3.0.0. Use `aria-label` instead.
25
25
  * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label
26
26
  */
27
27
  ariaLabel: {
@@ -132,10 +132,10 @@ const K = ["aria-label", "aria-describedby", "disabled", "aria-readonly"], Q = {
132
132
  ])) : u("", !0)
133
133
  ], 2));
134
134
  }
135
- }), de = /* @__PURE__ */ J(Z, [["__scopeId", "data-v-2dce6863"]]);
135
+ }), de = /* @__PURE__ */ J(Z, [["__scopeId", "data-v-1171b39e"]]);
136
136
  export {
137
137
  de as B,
138
138
  c as a,
139
139
  h as b
140
140
  };
141
- //# sourceMappingURL=toggle.BW8ww0Ih.js.map
141
+ //# sourceMappingURL=toggle.BbCqV953.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.BW8ww0Ih.js","sources":["../../../vue2/src/components/toggle/toggle.types.ts","../../../vue2/src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type PropType, ref, toRefs, useAttrs, useSlots, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * @deprecated Since v2.0.0. Use `aria-label` instead.\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n (e: 'input', value: boolean): void;\n }>();\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string | null => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = computed(() => attrs['aria-label'] as string);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]: props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default {\n name: 'bento-toggle',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","__default__","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","props","__props","emit","__emit","toggleInput","ref","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCuJRE,IAAA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le/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type PropType, ref, toRefs, useAttrs, useSlots, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * @deprecated Since v3.0.0. Use `aria-label` instead.\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n (e: 'input', value: boolean): void;\n }>();\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string | null => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = computed(() => attrs['aria-label'] as string);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]: props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default {\n name: 'bento-toggle',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","__default__","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","props","__props","emit","__emit","toggleInput","ref","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCuJRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAlHA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GAyCAC,IAAAC,GAIAC,IAAAC,EAAAL,EAAA,KAAA,GACAM,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAd,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAe,IAAAC,EAAA,MAAAZ,EAAA,SAAA,IAAAa,EAAAjB,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAkB,IAAAF,EAAA,MAAAd,EAAA,YAAA,CAAA,GACA,EAAA,WAAAiB,EAAA,IAAAC,EAAAd,CAAA,GACAe,IAAAC,EAAA;AAAA,MAAuC,WAAAJ,EAAA;AAAA;AAAA,MACL,OAAAC;AAAA,MAEvB,iBAAAJ;AAAA,IACU,CAAA,GAGrBQ,IAAAP,EAAA,MAAAJ,KAAA,IAAA,GAEAY,IAAAR,EAAA,OAAA;AAAA,MAAuE,CAAA,aAAArB,EAAA,WAAA,EAAA,GAAAW,EAAA,kBAAAT,EAAA;AAAA,MACiC,sBAAAS,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCmB,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAA,SAAAkB,EAAA,OAAA,OAAA;AAAA,IAAwD,GAI5DC,IAAA,CAAAD,MAAA;AACI,MAAApB,EAAA,YACIoB,EAAA,eAAA;AAAA,IACJ;AAGJ,WAAAE;AAAA,MAAA,MAAAtB,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAAnB,EAAA,QAAAmB;AAAA,MAAoB;AAAA,IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { defineComponent as y, computed as C, openBlock as R, createBlock as _,
2
2
  import { l as r } from "./events.BQOQSSb7.js";
3
3
  import { g as L } from "./generate-uid.DBWe4g6T.js";
4
4
  import { c as P, P as G, a as j } from "./popper-container.Rfj8UdMD.js";
5
- import { B as M } from "./typography.wIM07Hbl.js";
5
+ import { B as M } from "./typography.B6elnWpr.js";
6
6
  import { _ as V } from "./_plugin-vue_export-helper.CHgC5LLL.js";
7
7
  import { a as z } from "./focus-trap.Co-S6goa.js";
8
8
  import "../assets/tooltip.css";
@@ -198,4 +198,4 @@ export {
198
198
  T as c,
199
199
  Y as d
200
200
  };
201
- //# sourceMappingURL=tooltip.TFOGHOO0.js.map
201
+ //# sourceMappingURL=tooltip.0QqJo2sa.js.map