@adyen/bento-vue2 1.85.0 → 1.86.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 (309) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +358 -260
  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 +5 -0
  8. package/dist/anchor-scroller.js.map +1 -0
  9. package/dist/assets/accordion-item.css +1 -1
  10. package/dist/assets/action-bar.css +1 -1
  11. package/dist/assets/anchor-scroller.css +1 -0
  12. package/dist/assets/base-modal.css +1 -1
  13. package/dist/assets/button-actions.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/data-grid.css +1 -1
  16. package/dist/assets/date-picker.css +1 -1
  17. package/dist/assets/date-range-picker.css +1 -1
  18. package/dist/assets/dialog-page.css +1 -1
  19. package/dist/assets/dropdown-default-textbox.css +1 -1
  20. package/dist/assets/dropdown.css +1 -1
  21. package/dist/assets/error-message.css +1 -0
  22. package/dist/assets/file-uploader.css +1 -1
  23. package/dist/assets/fixed-scroller.css +1 -1
  24. package/dist/assets/inspector.css +1 -1
  25. package/dist/assets/modal-fullscreen.css +1 -1
  26. package/dist/assets/secondary-nav.css +1 -1
  27. package/dist/assets/sidepanel.css +1 -1
  28. package/dist/assets/use-cached-selected-values.css +1 -1
  29. package/dist/avatar.js +1 -1
  30. package/dist/button.js +3 -3
  31. package/dist/card.js +1 -1
  32. package/dist/checkbox.js +6 -6
  33. package/dist/chip.js +1 -1
  34. package/dist/chunks/{accordion-item.DeV8s0oW.js → accordion-item.Cv6kG2N3.js} +2 -2
  35. package/dist/chunks/{accordion-item.DeV8s0oW.js.map → accordion-item.Cv6kG2N3.js.map} +1 -1
  36. package/dist/chunks/{action-bar.rgLdy6Bu.js → action-bar.Dnkt4yn7.js} +9 -9
  37. package/dist/chunks/{action-bar.rgLdy6Bu.js.map → action-bar.Dnkt4yn7.js.map} +1 -1
  38. package/dist/chunks/{ai-button.ggEcDV08.js → ai-button.BTi18ipD.js} +3 -3
  39. package/dist/chunks/{ai-button.ggEcDV08.js.map → ai-button.BTi18ipD.js.map} +1 -1
  40. package/dist/chunks/{ai-tag.DKMGiQcJ.js → ai-tag.s8TECgn_.js} +27 -19
  41. package/dist/chunks/{ai-tag.DKMGiQcJ.js.map → ai-tag.s8TECgn_.js.map} +1 -1
  42. package/dist/chunks/{alert.B3Pdp02a.js → alert.BESCd8iS.js} +5 -5
  43. package/dist/chunks/{alert.B3Pdp02a.js.map → alert.BESCd8iS.js.map} +1 -1
  44. package/dist/chunks/anchor-scroller.3_idPubO.js +178 -0
  45. package/dist/chunks/anchor-scroller.3_idPubO.js.map +1 -0
  46. package/dist/chunks/{avatar.CUCH3CTc.js → avatar.rwWPYJnt.js} +2 -2
  47. package/dist/chunks/{avatar.CUCH3CTc.js.map → avatar.rwWPYJnt.js.map} +1 -1
  48. package/dist/chunks/{base-button.IN4bpcds.js → base-button.BPRPrO0p.js} +2 -2
  49. package/dist/chunks/{base-button.IN4bpcds.js.map → base-button.BPRPrO0p.js.map} +1 -1
  50. package/dist/chunks/{base-modal.QsjzGei_.js → base-modal.09nAcnF_.js} +41 -41
  51. package/dist/chunks/{base-modal.QsjzGei_.js.map → base-modal.09nAcnF_.js.map} +1 -1
  52. package/dist/chunks/{button-actions-with-menu.PL45aAcI.js → button-actions-with-menu.C8tSTxrm.js} +3 -3
  53. package/dist/chunks/{button-actions-with-menu.PL45aAcI.js.map → button-actions-with-menu.C8tSTxrm.js.map} +1 -1
  54. package/dist/chunks/{button-actions.JRDi9PFT.js → button-actions.VSc47LLH.js} +8 -8
  55. package/dist/chunks/{button-actions.JRDi9PFT.js.map → button-actions.VSc47LLH.js.map} +1 -1
  56. package/dist/chunks/{button.DIU6m9wD.js → button.Ctj3rkxw.js} +5 -5
  57. package/dist/chunks/{button.DIU6m9wD.js.map → button.Ctj3rkxw.js.map} +1 -1
  58. package/dist/chunks/{calendar.B0SmuooF.js → calendar.DiXkjQDP.js} +8 -8
  59. package/dist/chunks/{calendar.B0SmuooF.js.map → calendar.DiXkjQDP.js.map} +1 -1
  60. package/dist/chunks/{card.CVkEg8m1.js → card.BdjdBN36.js} +3 -3
  61. package/dist/chunks/{card.CVkEg8m1.js.map → card.BdjdBN36.js.map} +1 -1
  62. package/dist/chunks/{checkbox-group.DPZJjcdT.js → checkbox-group.d6VQvZL7.js} +5 -5
  63. package/dist/chunks/{checkbox-group.DPZJjcdT.js.map → checkbox-group.d6VQvZL7.js.map} +1 -1
  64. package/dist/chunks/{checkbox.D3D1I22O.js → checkbox.ClFNfhNh.js} +4 -4
  65. package/dist/chunks/{checkbox.D3D1I22O.js.map → checkbox.ClFNfhNh.js.map} +1 -1
  66. package/dist/chunks/{chip.C6DRfdJ8.js → chip.D_XQ8ReC.js} +3 -3
  67. package/dist/chunks/{chip.C6DRfdJ8.js.map → chip.D_XQ8ReC.js.map} +1 -1
  68. package/dist/chunks/{click-outside.C1Ud8AA2.js → click-outside.CDz_x8mN.js} +2 -2
  69. package/dist/chunks/{click-outside.C1Ud8AA2.js.map → click-outside.CDz_x8mN.js.map} +1 -1
  70. package/dist/chunks/{code-snippet.BN5P-KQo.js → code-snippet.DBNJgt1j.js} +11 -11
  71. package/dist/chunks/{code-snippet.BN5P-KQo.js.map → code-snippet.DBNJgt1j.js.map} +1 -1
  72. package/dist/chunks/{codemirror.Cy7iSLbd.js → codemirror.D2BAltnu.js} +3688 -3673
  73. package/dist/chunks/codemirror.D2BAltnu.js.map +1 -0
  74. package/dist/chunks/{controls-group.BwXz0UYr.js → controls-group.HUWlAOhG.js} +3 -3
  75. package/dist/chunks/{controls-group.BwXz0UYr.js.map → controls-group.HUWlAOhG.js.map} +1 -1
  76. package/dist/chunks/{copy.BIh04KTY.js → copy.BXykYfg0.js} +7 -7
  77. package/dist/chunks/{copy.BIh04KTY.js.map → copy.BXykYfg0.js.map} +1 -1
  78. package/dist/chunks/{country.DyrDj95W.js → country.BywHth0L.js} +3 -3
  79. package/dist/chunks/{country.DyrDj95W.js.map → country.BywHth0L.js.map} +1 -1
  80. package/dist/chunks/{country.types.DaVCMxk-.js → country.types.BBQbWkTY.js} +3 -3
  81. package/dist/chunks/{country.types.DaVCMxk-.js.map → country.types.BBQbWkTY.js.map} +1 -1
  82. package/dist/chunks/{currency.DYZr_RDk.js → currency.Ciyxfmg1.js} +2 -2
  83. package/dist/chunks/{currency.DYZr_RDk.js.map → currency.Ciyxfmg1.js.map} +1 -1
  84. package/dist/chunks/{dashboard-section.BvFMd9CQ.js → dashboard-section.Cw2Ima3U.js} +6 -6
  85. package/dist/chunks/{dashboard-section.BvFMd9CQ.js.map → dashboard-section.Cw2Ima3U.js.map} +1 -1
  86. package/dist/chunks/{dashed-underline.CXyMT-cF.js → dashed-underline.Dfw7cJ-9.js} +9 -9
  87. package/dist/chunks/{dashed-underline.CXyMT-cF.js.map → dashed-underline.Dfw7cJ-9.js.map} +1 -1
  88. package/dist/chunks/{data-grid-template.wWWI3FE3.js → data-grid-template.6LR2Jqka.js} +4 -4
  89. package/dist/chunks/{data-grid-template.wWWI3FE3.js.map → data-grid-template.6LR2Jqka.js.map} +1 -1
  90. package/dist/chunks/{data-grid.Dcj_tU8q.js → data-grid.B_uZEPDW.js} +177 -177
  91. package/dist/chunks/data-grid.B_uZEPDW.js.map +1 -0
  92. package/dist/chunks/date-input.etw_pFpA.js +20 -0
  93. package/dist/chunks/date-input.etw_pFpA.js.map +1 -0
  94. package/dist/chunks/{date-picker.Dh3-TgPT.js → date-picker.CITeN8WH.js} +56 -56
  95. package/dist/chunks/date-picker.CITeN8WH.js.map +1 -0
  96. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  97. package/dist/chunks/{date-range-picker.BOn_Xjkr.js → date-range-picker.DxVjXxap.js} +343 -343
  98. package/dist/chunks/{date-range-picker.BOn_Xjkr.js.map → date-range-picker.DxVjXxap.js.map} +1 -1
  99. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  100. package/dist/chunks/{date.DBWzp0So.js → date.B0m0sFP6.js} +2 -2
  101. package/dist/chunks/{date.DBWzp0So.js.map → date.B0m0sFP6.js.map} +1 -1
  102. package/dist/chunks/dialog-page.DA6E6qma.js +122 -0
  103. package/dist/chunks/dialog-page.DA6E6qma.js.map +1 -0
  104. package/dist/chunks/{directive.Cbdox5VL.js → directive.rXUeDb8p.js} +2 -2
  105. package/dist/chunks/{directive.Cbdox5VL.js.map → directive.rXUeDb8p.js.map} +1 -1
  106. package/dist/chunks/{dropdown-default-textbox.Cq68tN9F.js → dropdown-default-textbox.5WjhJWdh.js} +71 -80
  107. package/dist/chunks/dropdown-default-textbox.5WjhJWdh.js.map +1 -0
  108. package/dist/chunks/{dropdown-tag.C7Buz72U.js → dropdown-tag.BnMuMIDk.js} +8 -8
  109. package/dist/chunks/{dropdown-tag.C7Buz72U.js.map → dropdown-tag.BnMuMIDk.js.map} +1 -1
  110. package/dist/chunks/{dropdown.ByH2zHxF.js → dropdown.DDPfKc74.js} +227 -225
  111. package/dist/chunks/dropdown.DDPfKc74.js.map +1 -0
  112. package/dist/chunks/{empty-state.DpBnqAxu.js → empty-state.IiG1LXa2.js} +6 -6
  113. package/dist/chunks/{empty-state.DpBnqAxu.js.map → empty-state.IiG1LXa2.js.map} +1 -1
  114. package/dist/chunks/{field-label.BKxm8ehO.js → error-message.VenUl2OK.js} +54 -54
  115. package/dist/chunks/error-message.VenUl2OK.js.map +1 -0
  116. package/dist/chunks/{file-uploader.U7YUrGoM.js → file-uploader.BU1V40qK.js} +9 -9
  117. package/dist/chunks/{file-uploader.U7YUrGoM.js.map → file-uploader.BU1V40qK.js.map} +1 -1
  118. package/dist/chunks/{filter-bar.BRE0djRy.js → filter-bar.UdXQf_RN.js} +104 -96
  119. package/dist/chunks/{filter-bar.BRE0djRy.js.map → filter-bar.UdXQf_RN.js.map} +1 -1
  120. package/dist/chunks/fixed-scroller.BueAsyGk.js +120 -0
  121. package/dist/chunks/{fixed-scroller.Bp4-iO80.js.map → fixed-scroller.BueAsyGk.js.map} +1 -1
  122. package/dist/chunks/{focus-trap.Ed8RY9cJ.js → focus-trap.DMc1wL3A.js} +312 -295
  123. package/dist/chunks/focus-trap.DMc1wL3A.js.map +1 -0
  124. package/dist/chunks/{footer-actions.mS3IiJg7.js → footer-actions.z-api8J_.js} +4 -4
  125. package/dist/chunks/{footer-actions.mS3IiJg7.js.map → footer-actions.z-api8J_.js.map} +1 -1
  126. package/dist/chunks/{form-layout-title.C3uKS3GA.js → form-layout-title.Bbq05nMT.js} +5 -5
  127. package/dist/chunks/{form-layout-title.C3uKS3GA.js.map → form-layout-title.Bbq05nMT.js.map} +1 -1
  128. package/dist/chunks/{header-meta.CQTfyEJR.js → header-meta.CuMQSsOm.js} +9 -9
  129. package/dist/chunks/{header-meta.CQTfyEJR.js.map → header-meta.CuMQSsOm.js.map} +1 -1
  130. package/dist/chunks/{header-with-views.-PRI2W3p.js → header-with-views.DX8EXLMJ.js} +13 -13
  131. package/dist/chunks/{header-with-views.-PRI2W3p.js.map → header-with-views.DX8EXLMJ.js.map} +1 -1
  132. package/dist/chunks/{header.DDwoZ8fF.js → header.YECm2GAh.js} +4 -4
  133. package/dist/chunks/{header.DDwoZ8fF.js.map → header.YECm2GAh.js.map} +1 -1
  134. package/dist/chunks/index.BkJqgYF1.js +692 -0
  135. package/dist/chunks/{index.Zfd79j1_.js.map → index.BkJqgYF1.js.map} +1 -1
  136. package/dist/chunks/{info-icon.gUcRjEyG.js → info-icon.DS9ax8ZD.js} +3 -3
  137. package/dist/chunks/{info-icon.gUcRjEyG.js.map → info-icon.DS9ax8ZD.js.map} +1 -1
  138. package/dist/chunks/{input-field-password.BO3EMjVD.js → input-field-password.DrI6eF5u.js} +11 -11
  139. package/dist/chunks/{input-field-password.BO3EMjVD.js.map → input-field-password.DrI6eF5u.js.map} +1 -1
  140. package/dist/chunks/{input-field-phone-number.DDQIkRdm.js → input-field-phone-number.Buh4x3pJ.js} +4 -4
  141. package/dist/chunks/{input-field-phone-number.DDQIkRdm.js.map → input-field-phone-number.Buh4x3pJ.js.map} +1 -1
  142. package/dist/chunks/{input-field.BRIDLPBn.js → input-field.NEKXqT4R.js} +7 -7
  143. package/dist/chunks/{input-field.BRIDLPBn.js.map → input-field.NEKXqT4R.js.map} +1 -1
  144. package/dist/chunks/{inspector.DCda4tku.js → inspector.BomNgVb-.js} +5 -5
  145. package/dist/chunks/{inspector.DCda4tku.js.map → inspector.BomNgVb-.js.map} +1 -1
  146. package/dist/chunks/{isSameWeek.5sjhTHiU.js → isSameWeek.DjeUtLwI.js} +2 -2
  147. package/dist/chunks/{isSameWeek.5sjhTHiU.js.map → isSameWeek.DjeUtLwI.js.map} +1 -1
  148. package/dist/chunks/{it.DEniTaO2.js → it.DIafuXtH.js} +2 -2
  149. package/dist/chunks/{it.DEniTaO2.js.map → it.DIafuXtH.js.map} +1 -1
  150. package/dist/chunks/{layout-row.BtCzzLTz.js → layout-row.BxuMJU4E.js} +3 -3
  151. package/dist/chunks/{layout-row.BtCzzLTz.js.map → layout-row.BxuMJU4E.js.map} +1 -1
  152. package/dist/chunks/{link.PsTSQjK3.js → link.DKimL08z.js} +2 -2
  153. package/dist/chunks/{link.PsTSQjK3.js.map → link.DKimL08z.js.map} +1 -1
  154. package/dist/chunks/{listbox-option-tag.B63aT5Sq.js → listbox-option-tag.Cv3y0TvQ.js} +3 -3
  155. package/dist/chunks/{listbox-option-tag.B63aT5Sq.js.map → listbox-option-tag.Cv3y0TvQ.js.map} +1 -1
  156. package/dist/chunks/{modal-fullscreen.CRLZX72M.js → modal-fullscreen.6bAjPENL.js} +73 -69
  157. package/dist/chunks/modal-fullscreen.6bAjPENL.js.map +1 -0
  158. package/dist/chunks/{modal.BnAZ8Nj1.js → modal.DOR8c0gy.js} +6 -6
  159. package/dist/chunks/{modal.BnAZ8Nj1.js.map → modal.DOR8c0gy.js.map} +1 -1
  160. package/dist/chunks/on-click-outside.BW4rkhzG.js +91 -0
  161. package/dist/chunks/on-click-outside.BW4rkhzG.js.map +1 -0
  162. package/dist/chunks/{pagination.spAA5CX0.js → pagination.wuEIlDcq.js} +4 -4
  163. package/dist/chunks/{pagination.spAA5CX0.js.map → pagination.wuEIlDcq.js.map} +1 -1
  164. package/dist/chunks/{payment-method.BKXLPDC9.js → payment-method.B3CkgsAY.js} +2 -2
  165. package/dist/chunks/{payment-method.BKXLPDC9.js.map → payment-method.B3CkgsAY.js.map} +1 -1
  166. package/dist/chunks/popover.types.DkiRUQ4Z.js +6 -0
  167. package/dist/chunks/{popover.types.Zm8nugBw.js.map → popover.types.DkiRUQ4Z.js.map} +1 -1
  168. package/dist/chunks/popper-container.D4dworD4.js +1423 -0
  169. package/dist/chunks/popper-container.D4dworD4.js.map +1 -0
  170. package/dist/chunks/{promo-banner.BkLMZH66.js → promo-banner.bjMDm76T.js} +4 -4
  171. package/dist/chunks/{promo-banner.BkLMZH66.js.map → promo-banner.bjMDm76T.js.map} +1 -1
  172. package/dist/chunks/{radio-group.B6-Fd_kH.js → radio-group.DKRxfGtE.js} +8 -8
  173. package/dist/chunks/{radio-group.B6-Fd_kH.js.map → radio-group.DKRxfGtE.js.map} +1 -1
  174. package/dist/chunks/{rich-text-editor.DeywBxSb.js → rich-text-editor.DiuS9alD.js} +9 -13
  175. package/dist/chunks/rich-text-editor.DiuS9alD.js.map +1 -0
  176. package/dist/chunks/{search-bar.BKRppqyI.js → search-bar.UVSaoX0h.js} +5 -5
  177. package/dist/chunks/{search-bar.BKRppqyI.js.map → search-bar.UVSaoX0h.js.map} +1 -1
  178. package/dist/chunks/{secondary-nav.RQ5eRpPH.js → secondary-nav.C6ldQMZ2.js} +18 -18
  179. package/dist/chunks/secondary-nav.C6ldQMZ2.js.map +1 -0
  180. package/dist/chunks/{segmented-control.BomURsCq.js → segmented-control.BLnuxgnJ.js} +3 -3
  181. package/dist/chunks/{segmented-control.BomURsCq.js.map → segmented-control.BLnuxgnJ.js.map} +1 -1
  182. package/dist/chunks/{selection-card-group.gh-fMA9T.js → selection-card-group.CqGYskmS.js} +5 -5
  183. package/dist/chunks/{selection-card-group.gh-fMA9T.js.map → selection-card-group.CqGYskmS.js.map} +1 -1
  184. package/dist/chunks/{sidepanel.B80Mujpk.js → sidepanel.BKE87Uef.js} +71 -67
  185. package/dist/chunks/sidepanel.BKE87Uef.js.map +1 -0
  186. package/dist/chunks/{startOfWeek.CM1KIrNi.js → startOfWeek.D8Yh4c0G.js} +3 -3
  187. package/dist/chunks/{startOfWeek.CM1KIrNi.js.map → startOfWeek.D8Yh4c0G.js.map} +1 -1
  188. package/dist/chunks/{status.types.Cv5XN4zL.js → status.types.BTsaLHQ6.js} +2 -2
  189. package/dist/chunks/{status.types.Cv5XN4zL.js.map → status.types.BTsaLHQ6.js.map} +1 -1
  190. package/dist/chunks/{step.BLFXvHL6.js → step.BEbWkprZ.js} +5 -5
  191. package/dist/chunks/{step.BLFXvHL6.js.map → step.BEbWkprZ.js.map} +1 -1
  192. package/dist/chunks/{structured-list-item.DCEKBtbT.js → structured-list-item.DRFRap_S.js} +6 -6
  193. package/dist/chunks/{structured-list-item.DCEKBtbT.js.map → structured-list-item.DRFRap_S.js.map} +1 -1
  194. package/dist/chunks/{summary-grid.types.BV8FDXGv.js → summary-grid.types.OldkhD7S.js} +10 -10
  195. package/dist/chunks/{summary-grid.types.BV8FDXGv.js.map → summary-grid.types.OldkhD7S.js.map} +1 -1
  196. package/dist/chunks/{tab.FUMpPsBP.js → tab.BqSNoefU.js} +5 -5
  197. package/dist/chunks/{tab.FUMpPsBP.js.map → tab.BqSNoefU.js.map} +1 -1
  198. package/dist/chunks/{tag.CroNYKsL.js → tag.Cy3XkSDQ.js} +3 -3
  199. package/dist/chunks/{tag.CroNYKsL.js.map → tag.Cy3XkSDQ.js.map} +1 -1
  200. package/dist/chunks/{textarea.CtTdhV_G.js → textarea.Bm9MZb_W.js} +4 -4
  201. package/dist/chunks/{textarea.CtTdhV_G.js.map → textarea.Bm9MZb_W.js.map} +1 -1
  202. package/dist/chunks/{timeline-item.DCWllef8.js → timeline-item.Cpbm8IUw.js} +15 -15
  203. package/dist/chunks/{timeline-item.DCWllef8.js.map → timeline-item.Cpbm8IUw.js.map} +1 -1
  204. package/dist/chunks/{toast.Csv6tMyT.js → toast.Wuy6VuOT.js} +4 -4
  205. package/dist/chunks/{toast.Csv6tMyT.js.map → toast.Wuy6VuOT.js.map} +1 -1
  206. package/dist/chunks/{toggle.227XgEc7.js → toggle.B1z1YPe_.js} +4 -4
  207. package/dist/chunks/{toggle.227XgEc7.js.map → toggle.B1z1YPe_.js.map} +1 -1
  208. package/dist/chunks/{tooltip.DxJQHsuI.js → tooltip.DF11J3k3.js} +50 -50
  209. package/dist/chunks/{tooltip.DxJQHsuI.js.map → tooltip.DF11J3k3.js.map} +1 -1
  210. package/dist/chunks/{tutorial.O_vT6Q2b.js → tutorial.D5xtZ1Pt.js} +5 -5
  211. package/dist/chunks/{tutorial.O_vT6Q2b.js.map → tutorial.D5xtZ1Pt.js.map} +1 -1
  212. package/dist/chunks/{typography.Bq-EGj9y.js → typography.C8lPlsbD.js} +3 -3
  213. package/dist/chunks/{typography.Bq-EGj9y.js.map → typography.C8lPlsbD.js.map} +1 -1
  214. package/dist/chunks/{use-bento-toast-controller.MmyZXtME.js → use-bento-toast-controller.CB6Qbf3R.js} +2 -2
  215. package/dist/chunks/{use-bento-toast-controller.MmyZXtME.js.map → use-bento-toast-controller.CB6Qbf3R.js.map} +1 -1
  216. package/dist/chunks/{use-cached-selected-values.3YqO69wz.js → use-cached-selected-values.wn2xnwYG.js} +12 -12
  217. package/dist/chunks/use-cached-selected-values.wn2xnwYG.js.map +1 -0
  218. package/dist/chunks/{use-country-items.ClS_So5N.js → use-country-items.CQnldpqM.js} +11 -11
  219. package/dist/chunks/{use-country-items.ClS_So5N.js.map → use-country-items.CQnldpqM.js.map} +1 -1
  220. package/dist/chunks/utils.BzUwtTXc.js +21 -0
  221. package/dist/chunks/utils.BzUwtTXc.js.map +1 -0
  222. package/dist/chunks/{zh-CN.CgIooHto.js → zh-CN.Bw_6j9Cd.js} +2 -2
  223. package/dist/chunks/{zh-CN.CgIooHto.js.map → zh-CN.Bw_6j9Cd.js.map} +1 -1
  224. package/dist/click-outside.js +1 -1
  225. package/dist/code-snippet.js +1 -1
  226. package/dist/country.js +2 -2
  227. package/dist/currency.js +1 -1
  228. package/dist/dashboard-template.js +1 -1
  229. package/dist/dashed-underline.js +1 -1
  230. package/dist/data-grid-template.js +1 -1
  231. package/dist/data-grid.js +1 -1
  232. package/dist/date-picker.js +2 -2
  233. package/dist/date-range-picker.js +2 -2
  234. package/dist/date.js +1 -1
  235. package/dist/draggable-handle.js +47 -31
  236. package/dist/draggable-handle.js.map +1 -1
  237. package/dist/dropdown.js +11 -11
  238. package/dist/empty-state.js +1 -1
  239. package/dist/file-uploader.js +1 -1
  240. package/dist/filter-bar.js +1 -1
  241. package/dist/focus-trap.js +1 -1
  242. package/dist/form-layout.js +1 -1
  243. package/dist/header-with-views.js +1 -1
  244. package/dist/header.js +1 -1
  245. package/dist/index.js +281 -279
  246. package/dist/index.js.map +1 -1
  247. package/dist/info-icon.js +1 -1
  248. package/dist/input-field-password.js +1 -1
  249. package/dist/input-field-phone-number.js +1 -1
  250. package/dist/input-field.js +1 -1
  251. package/dist/inspector.js +1 -1
  252. package/dist/internal.js +42 -42
  253. package/dist/layout.js +1 -1
  254. package/dist/link.js +1 -1
  255. package/dist/menu.js +1 -1
  256. package/dist/modal-fullscreen.js +1 -1
  257. package/dist/modal.js +2 -2
  258. package/dist/pagination.js +1 -1
  259. package/dist/payment-method.js +1 -1
  260. package/dist/popover.js +2 -2
  261. package/dist/popper-container.js +1 -1
  262. package/dist/promo-banner.js +1 -1
  263. package/dist/radio-group.js +1 -1
  264. package/dist/rich-text-editor.js +1 -1
  265. package/dist/search-bar.js +2 -2
  266. package/dist/secondary-nav.js +1 -1
  267. package/dist/segmented-control.js +1 -1
  268. package/dist/selection-card.js +1 -1
  269. package/dist/sidepanel.js +1 -1
  270. package/dist/status.js +1 -1
  271. package/dist/stepper.js +1 -1
  272. package/dist/structured-list.js +1 -1
  273. package/dist/summary-grid.js +1 -1
  274. package/dist/tabs.js +1 -1
  275. package/dist/tag.js +1 -1
  276. package/dist/textarea.js +1 -1
  277. package/dist/timeline.js +1 -1
  278. package/dist/toast.js +1 -1
  279. package/dist/toggle.js +1 -1
  280. package/dist/tutorial.js +1 -1
  281. package/dist/typography.js +1 -1
  282. package/dist/use-form-v4.js +756 -7787
  283. package/dist/use-form-v4.js.map +1 -1
  284. package/dist/web-types.json +128 -30
  285. package/package.json +6 -6
  286. package/dist/assets/field-label.css +0 -1
  287. package/dist/chunks/codemirror.Cy7iSLbd.js.map +0 -1
  288. package/dist/chunks/data-grid.Dcj_tU8q.js.map +0 -1
  289. package/dist/chunks/date-input.BbZqj10S.js +0 -15
  290. package/dist/chunks/date-input.BbZqj10S.js.map +0 -1
  291. package/dist/chunks/date-picker.Dh3-TgPT.js.map +0 -1
  292. package/dist/chunks/dialog-page.BegXhP0L.js +0 -118
  293. package/dist/chunks/dialog-page.BegXhP0L.js.map +0 -1
  294. package/dist/chunks/dropdown-default-textbox.Cq68tN9F.js.map +0 -1
  295. package/dist/chunks/dropdown.ByH2zHxF.js.map +0 -1
  296. package/dist/chunks/field-label.BKxm8ehO.js.map +0 -1
  297. package/dist/chunks/fixed-scroller.Bp4-iO80.js +0 -114
  298. package/dist/chunks/focus-trap.Ed8RY9cJ.js.map +0 -1
  299. package/dist/chunks/index.Zfd79j1_.js +0 -593
  300. package/dist/chunks/modal-fullscreen.CRLZX72M.js.map +0 -1
  301. package/dist/chunks/on-click-outside.D9aY9g8G.js +0 -101
  302. package/dist/chunks/on-click-outside.D9aY9g8G.js.map +0 -1
  303. package/dist/chunks/popover.types.Zm8nugBw.js +0 -6
  304. package/dist/chunks/popper-container.CXUG6v_U.js +0 -1404
  305. package/dist/chunks/popper-container.CXUG6v_U.js.map +0 -1
  306. package/dist/chunks/rich-text-editor.DeywBxSb.js.map +0 -1
  307. package/dist/chunks/secondary-nav.RQ5eRpPH.js.map +0 -1
  308. package/dist/chunks/sidepanel.B80Mujpk.js.map +0 -1
  309. package/dist/chunks/use-cached-selected-values.3YqO69wz.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-item.DCWllef8.js","sources":["../../src/components/timeline/timeline.types.ts","../../src/components/timeline/timeline.keys.ts","../../src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { 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 \"variant\" prop was deprecated. Use \"status\" modifier 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}\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\n/**\n * @deprecated from version 2.0.0.\n */\nexport type BentoTimelineRegisterEntry = (props: {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; index: number; unregisterTimelineEntry: () => void };\n\n/**\n * @private\n */\nexport type BentoInternalTimelineRegisterEntry = (\n entry: BentoTimelineEntry\n) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; unregisterTimelineEntry: () => void };\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 * Variant for the timeline item\n * @values DEFAULT, SUCCESS, CRITICAL\n *\n * @deprecated Use \"status\" prop instead\n */\n variant?: BentoTimelineItemVariant | `${BentoTimelineItemVariant}`;\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 {\n type BentoInternalTimelineRegisterEntry,\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 = defineProps({\n addNote: { type: Boolean, default: false },\n showMore: { default: null },\n timegapLimit: { default: 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>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","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","<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 {{ timestamp.value }}\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 {{ additionalTimestamp.value }}\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 { 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 { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\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 BentoTimelineItemVariant,\n type BentoTimelineRegisterEntry,\n } from '../../timeline.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 = defineProps({\n additionalTimestamp: { default: null },\n dataList: { default: null },\n description: { default: null },\n status: { default: 'black' },\n tag: { default: undefined },\n timestamp: null,\n title: { default: null },\n type: { default: 'milestone' },\n variant: { default: null }\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 // Handle variant deprecation, by setting `critical` and `success` variants to their respective colors\n const computedStatus = computed(() => {\n if (props.variant === BentoTimelineItemVariant.CRITICAL) {\n return 'red';\n }\n\n if (props.variant === BentoTimelineItemVariant.SUCCESS) {\n return 'green';\n }\n\n return props.status;\n });\n\n if (props.variant) {\n deprecate(\n 'BentoTimelineItem \"variant\" property',\n `Use the BentoTimelineItem \"status\" modifier instead to modify the color of the timeline icon.\n <bento-timeline-item status=\"red\" />`,\n '2.0.0'\n );\n }\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${computedStatus.value}`]: computedStatus.value && !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":["BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","_a","_b","addNoteToTimeline","emit","timelineEntries","hiddenItems","props","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","uuid","_sfc_main$1","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","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","computedStatus","deprecate","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAKO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,cAAA,eACAA,EAAA,cAAA,eAHQA,IAAAD,KAAA,CAAA,CAAA,GAWLE,KAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,MAAA,OACAA,EAAA,QAAA,SACAA,EAAA,OAAA,QANQA,IAAAD,MAAA,CAAA,CAAA,GAiBLE,IAAA,kBAAAC,OACHA,EAAA,UAAA,mBACAA,EAAA,UAAA,qBACAA,EAAA,WAAA,mBAHQA,IAAAD,KAAA,CAAA,CAAA,GAMLE,KAAA,kBAAAC,OACHA,EA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AAA,MAAAC,EAAA,IAAA5E,EAAA,MAAAc,EAAA,KAAA,GACA+D,IAAA;AAAA,QAA8BvD,EAAAoD,GAAAE,GAAA,EAAA,MAAAxE,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAyE,IAAAvD,EAAAoD,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAA7F,EAAA,MAAAwF,EAAA,QAAA,EAAA,WAAA,EAAA,SAAAA,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAA9F,EAAA,MAAAgB,EAAA,SAAAO,EAAA,UAAAM,EAAA,KAAA,GACAkE,IAAA/F,EAAA,MAEI6B,EAAA,UAAA,MAAAA,EAAA,UAAAd,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]}
1
+ {"version":3,"file":"timeline-item.Cpbm8IUw.js","sources":["../../src/components/timeline/timeline.types.ts","../../src/components/timeline/timeline.keys.ts","../../src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { 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 \"variant\" prop was deprecated. Use \"status\" modifier 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}\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\n/**\n * @deprecated from version 2.0.0.\n */\nexport type BentoTimelineRegisterEntry = (props: {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; index: number; unregisterTimelineEntry: () => void };\n\n/**\n * @private\n */\nexport type BentoInternalTimelineRegisterEntry = (\n entry: BentoTimelineEntry\n) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; unregisterTimelineEntry: () => void };\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 * Variant for the timeline item\n * @values DEFAULT, SUCCESS, CRITICAL\n *\n * @deprecated Use \"status\" prop instead\n */\n variant?: BentoTimelineItemVariant | `${BentoTimelineItemVariant}`;\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 {\n type BentoInternalTimelineRegisterEntry,\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 = defineProps({\n addNote: { type: Boolean, default: false },\n showMore: { default: null },\n timegapLimit: { default: 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>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","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","<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 {{ timestamp.value }}\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 {{ additionalTimestamp.value }}\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 { 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 { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\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 BentoTimelineItemVariant,\n type BentoTimelineRegisterEntry,\n } from '../../timeline.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 = defineProps({\n additionalTimestamp: { default: null },\n dataList: { default: null },\n description: { default: null },\n status: { default: 'black' },\n tag: { default: undefined },\n timestamp: null,\n title: { default: null },\n type: { default: 'milestone' },\n variant: { default: null }\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 // Handle variant deprecation, by setting `critical` and `success` variants to their respective colors\n const computedStatus = computed(() => {\n if (props.variant === BentoTimelineItemVariant.CRITICAL) {\n return 'red';\n }\n\n if (props.variant === BentoTimelineItemVariant.SUCCESS) {\n return 'green';\n }\n\n return props.status;\n });\n\n if (props.variant) {\n deprecate(\n 'BentoTimelineItem \"variant\" property',\n `Use the BentoTimelineItem \"status\" modifier instead to modify the color of the timeline icon.\n <bento-timeline-item status=\"red\" />`,\n '2.0.0'\n );\n }\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${computedStatus.value}`]: computedStatus.value && !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":["BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","_a","_b","addNoteToTimeline","emit","timelineEntries","hiddenItems","props","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","uuid","_sfc_main$1","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","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","computedStatus","deprecate","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAKO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,cAAA,eACAA,EAAA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A,OAAAiB,EAAA,SAAA,QAAA,GACAsE,IAAAvF,EAAA,MAAAiB,EAAA,KAAA,GACAuE,IAAAxF,EAAA,MAAA;;AACI,UAAA,CAAAmB,EAAA;AACI,eAAA;AAEJ,YAAAsE,KAAA9E,IAAAI,EAAA,MAAAc,EAAA,QAAA,CAAA,MAAA,gBAAAlB,EAAA,MACA+E,IAAAN,EAAA,SAAA9D,EAAA,MAAA,SAAAO,EAAA,QAAA,CAAA;AACA,UAAA,CAAA4D,KAAA,CAAAC;AACI,eAAA;AAEJ,YAAA,EAAA,MAAAC,EAAA,IAAA5E,EAAA,MAAAc,EAAA,KAAA,GACA+D,IAAA;AAAA,QAA8BvD,EAAAoD,GAAAE,GAAA,EAAA,MAAAxE,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAyE,IAAAvD,EAAAoD,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAA7F,EAAA,MAAAwF,EAAA,QAAA,EAAA,WAAA,EAAA,SAAAA,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAA9F,EAAA,MAAAgB,EAAA,SAAAO,EAAA,UAAAM,EAAA,KAAA,GACAkE,IAAA/F,EAAA,MAEI6B,EAAA,UAAA,MAAAA,EAAA,UAAAd,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]}
@@ -2,10 +2,10 @@ import { defineComponent as S, ref as c, computed as d, watch as k, onMounted as
2
2
  import "./index.Cl4_42j5.js";
3
3
  import { C as q } from "./cross-small.CoQUe8SS.js";
4
4
  import { u as L } from "./index.B6WW_F-J.js";
5
- import { B as N } from "./button.DIU6m9wD.js";
6
- import { B as U } from "./typography.Bq-EGj9y.js";
5
+ import { B as N } from "./button.Ctj3rkxw.js";
6
+ import { B as U } from "./typography.C8lPlsbD.js";
7
7
  import { n as $ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
- import { u as O } from "./use-bento-toast-controller.MmyZXtME.js";
8
+ import { u as O } from "./use-bento-toast-controller.CB6Qbf3R.js";
9
9
  import "../assets/toast.css";
10
10
  const M = {
11
11
  "en-US": {
@@ -168,4 +168,4 @@ const mt = st.exports;
168
168
  export {
169
169
  mt as B
170
170
  };
171
- //# sourceMappingURL=toast.Csv6tMyT.js.map
171
+ //# sourceMappingURL=toast.Wuy6VuOT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.Csv6tMyT.js","sources":["../../src/components/toast/components/toast-item/toast-item.vue","../../src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../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 class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\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([\"update\"]);\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","t","useI18n","props","stack","useBentoToastController","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","emit","watch","onMounted","renderToast","toastStack","hovered","collapsedToastHeight","stackIndicatorHeight","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root"],"mappings":";;;;;;;;;;;;;;;;;;;GAsDIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;iBAbA,EAAA,GAAAC,EAAA,IAAAC,EAAA;kDAEA,MAAA;AACI,MAAA,OAAAC,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;ACxBxB,UAAA,EAAA,OAAAC,EAAA,IAAAC,EAAA,GAIAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,GACAE,IAAAF,EAAA,GACAG,IAAAH,EAAA,GACAI,IAAA,CAAAH,GAAAC,GAAAC,CAAA,GAGAE,IAAAC,EAAA,MAAAT,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,GAEAU,IAAA,YAAA;AAEI,YAAAC,EAAA;AAGA,YAAA,EAAA,KAAAC,EAAA,IAAAV,EAAA,MAAA,sBAAA,GAEAW,IAAAb,EAAA,MAAA,IAAA,CAAAc,GAAAC,MAAA;AACI,YAAAA,IAAA;AACI,iBAAA,EAAA,GAAAD,GAAA,Q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,MAAA,MAAAU,EAAA,MAAA,CAAA;AAAA,MACuB,CAAAe,GAAAC,MAAA;AAEf,SAAAD,KAAA,gBAAAA,EAAA,SAAAC,KAAA,gBAAAA,EAAA,OAGAF,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,IAAArB,EAAAI,GAAA,CAAAyB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA;kcAKA,MAAA,WAAA,MAAA;AAEQ,MAAAoB,EAAA,QAAAA,EAAA,QAAA0B,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"toast.Wuy6VuOT.js","sources":["../../src/components/toast/components/toast-item/toast-item.vue","../../src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../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 class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\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([\"update\"]);\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","t","useI18n","props","stack","useBentoToastController","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","emit","watch","onMounted","renderToast","toastStack","hovered","collapsedToastHeight","stackIndicatorHeight","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root"],"mappings":";;;;;;;;;;;;;;;;;;;GAsDIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;iBAbA,EAAA,GAAAC,EAAA,IAAAC,EAAA;kDAEA,MAAA;AACI,MAAA,OAAAC,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;ACxBxB,UAAA,EAAA,OAAAC,EAAA,IAAAC,EAAA,GAIAC,IAAAC,EAAA,G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AA,IAAgB,CAAA;AAGpB,QAAAsB,IAAA,MACAC,IAAA,MACAC,IAAA;AAEA,UAAAC,IAAA,CAAA3B,GAAA4B,MAAA;AACI,MAAAH,IAAA,KAAA,IAAA,GACAD,IAAA,WAAA,MAAAxB,EAAA,QAAA,GAAA4B,CAAA;AAAA,IAA0D,GAG9DC,IAAA,CAAA7B,MAAA;AAEI,mBAAAwB,CAAA,GACAxB,KACI0B,IAAA,KACAjB,EAAA,SACIkB,EAAA3B,GAAA0B,CAAA,KAGJA,IAAA;AAAA,IACJ;AAGJ,IAAArB;AAAA,MAAA,MAAAU,EAAA,MAAA,CAAA;AAAA,MACuB,CAAAe,GAAAC,MAAA;AAEf,SAAAD,KAAA,gBAAAA,EAAA,SAAAC,KAAA,gBAAAA,EAAA,OAGAF,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,IAAArB,EAAAI,GAAA,CAAAyB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA;kcAKA,MAAA,WAAA,MAAA;AAEQ,MAAAoB,EAAA,QAAAA,EAAA,QAAA0B,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as v, useSlots as C, useAttrs as S, ref as k, computed as p, toRefs as I, watch as B } from "vue";
2
2
  import { C as A } from "./checkmark-small.DVDtD4HQ.js";
3
- import { B as L } from "./typography.Bq-EGj9y.js";
3
+ import { B as L } from "./typography.C8lPlsbD.js";
4
4
  import { g as E } from "./generate-uid.NJ8tVoha.js";
5
5
  import { u as F } from "./use-default-slot-validator.BDn0wkYP.js";
6
6
  import { u as R } from "./use-has-slot.C9lQZ6nz.js";
@@ -102,7 +102,7 @@ var P = function() {
102
102
  const Q = z.exports;
103
103
  export {
104
104
  Q as B,
105
- f as a,
106
- u as b
105
+ u as a,
106
+ f as b
107
107
  };
108
- //# sourceMappingURL=toggle.227XgEc7.js.map
108
+ //# sourceMappingURL=toggle.B1z1YPe_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.227XgEc7.js","sources":["../../src/components/toggle/toggle.types.ts","../../src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the 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 '@/core/utils/ts';\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 from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\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([\"input\"]);\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","toggleInput","ref","props","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","emit","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;ACuJR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlHAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GA+CAM,IAAAC,EAAAC,EAAA,KAAA,GACAC,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAX,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAY,IAAAC,EAAA,MAAAT,EAAA,SAAA,IAAAU,EAAAd,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAe,IAAAF,EAAA,MAAAX,EAAA,YAAA,CAAA,GACA,EAAA,WAAAc,EAAA,IAAAC,EAAAT,CAAA,GACAU,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,aAAAlB,EAAA,WAAA,EAAA,GAAAa,EAAA,kBAAAX,EAAA;AAAA,MACiC,sBAAAW,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCc,IAAA,CAAAC,MAAA;AACI,MAAAC,EAAA,SAAAD,EAAA,OAAA,OAAA;AAAA,IAAwD,GAI5DE,IAAA,CAAAF,MAAA;AACI,MAAAf,EAAA,YACIe,EAAA,eAAA;AAAA,IACJ;AAGJ,WAAAG;AAAA,MAAA,MAAAlB,EAAA;AAAA,MACgB,CAAAmB,MAAA;AAER,QAAArB,EAAA,QAAAqB;AAAA,MAAoB;AAAA,IACxB;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"toggle.B1z1YPe_.js","sources":["../../src/components/toggle/toggle.types.ts","../../src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the 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 '@/core/utils/ts';\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 from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\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([\"input\"]);\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","toggleInput","ref","props","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","emit","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;ACuJR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlHAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GA+CAM,IAAAC,EAAAC,EAAA,KAAA,GACAC,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAX,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAY,IAAAC,EAAA,MAAAT,EAAA,SAAA,IAAAU,EAAAd,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAe,IAAAF,EAAA,MAAAX,EAAA,YAAA,CAAA,GACA,EAAA,WAAAc,EAAA,IAAAC,EAAAT,CAAA,GACAU,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,aAAAlB,EAAA,WAAA,EAAA,GAAAa,EAAA,kBAAAX,EAAA;AAAA,MACiC,sBAAAW,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCc,IAAA,CAAAC,MAAA;AACI,MAAAC,EAAA,SAAAD,EAAA,OAAA,OAAA;AAAA,IAAwD,GAI5DE,IAAA,CAAAF,MAAA;AACI,MAAAf,EAAA,YACIe,EAAA,eAAA;AAAA,IACJ;AAGJ,WAAAG;AAAA,MAAA,MAAAlB,EAAA;AAAA,MACgB,CAAAmB,MAAA;AAER,QAAArB,EAAA,QAAAqB;AAAA,MAAoB;AAAA,IACxB;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as O, computed as y, reactive as C, nextTick as D } from "vue";
2
2
  import { l as r } from "./events.BQOQSSb7.js";
3
3
  import { g as R } from "./generate-uid.NJ8tVoha.js";
4
- import { a as g, c as B, P as N } from "./popper-container.CXUG6v_U.js";
4
+ import { c as E, a as B, P as N } from "./popper-container.D4dworD4.js";
5
5
  import { V as $ } from "./index.Cl4_42j5.js";
6
- import { B as I } from "./typography.Bq-EGj9y.js";
6
+ import { B as I } from "./typography.C8lPlsbD.js";
7
7
  import { n as k } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
8
  import "../assets/tooltip.css";
9
- const h = { ...g };
10
- var x = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(x || {}), P = /* @__PURE__ */ ((t) => (t.ESCAPE = "Escape", t.ENTER = "Enter", t.ARROW_LEFT = "ArrowLeft", t.ARROW_UP = "ArrowUp", t.ARROW_RIGHT = "ArrowRight", t.ARROW_DOWN = "ArrowDown", t.PAGE_UP = "PageUp", t.PAGE_DOWN = "PageDown", t.END = "End", t.HOME = "Home", t.TAB = "Tab", t))(P || {});
11
- const T = { ...g };
12
- var b = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(b || {});
9
+ const _ = { ...E };
10
+ var x = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(x || {}), g = /* @__PURE__ */ ((t) => (t.ESCAPE = "Escape", t.ENTER = "Enter", t.ARROW_LEFT = "ArrowLeft", t.ARROW_UP = "ArrowUp", t.ARROW_RIGHT = "ArrowRight", t.ARROW_DOWN = "ArrowDown", t.PAGE_UP = "PageUp", t.PAGE_DOWN = "PageDown", t.END = "End", t.HOME = "Home", t.TAB = "Tab", t))(g || {});
11
+ const h = { ...E };
12
+ var P = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(P || {});
13
13
  const U = {
14
14
  name: "tooltip"
15
15
  }, H = /* @__PURE__ */ O({
@@ -30,8 +30,8 @@ const U = {
30
30
  */
31
31
  position: {
32
32
  type: String,
33
- default: T.TOP,
34
- validator: (t) => Object.values(T).includes(t)
33
+ default: h.TOP,
34
+ validator: (t) => Object.values(h).includes(t)
35
35
  },
36
36
  /**
37
37
  * Tooltip's offset.
@@ -64,7 +64,7 @@ const U = {
64
64
  },
65
65
  setup(t) {
66
66
  const o = t, e = y(() => ({
67
- [`b-tooltip--${b.HIDDEN}`]: !o.isShown
67
+ [`b-tooltip--${P.HIDDEN}`]: !o.isShown
68
68
  }));
69
69
  return { __sfc: !0, props: o, conditionalClasses: e, PopperContainer: N, PopperContainerAriaRole: B, BentoTypography: I };
70
70
  }
@@ -80,110 +80,110 @@ var W = function() {
80
80
  null,
81
81
  "6d4633ff"
82
82
  );
83
- const L = F.exports, i = [], v = "aria-describedby", d = R("tooltip");
84
- let n, f = !1;
83
+ const L = F.exports, i = [], b = "aria-describedby", u = R("tooltip");
84
+ let n, c = !1;
85
85
  const a = C({
86
86
  targetElement: null,
87
87
  content: "START_MESSAGE",
88
- id: d,
88
+ id: u,
89
89
  position: void 0,
90
90
  isShown: !1
91
91
  }), G = (t) => {
92
92
  t.setAttribute("tabindex", "0");
93
93
  {
94
94
  const o = $.extend(L);
95
- n = new o({ propsData: { targetElement: t, content: "", id: d } }).$mount(), document.body.appendChild(n.$el);
95
+ n = new o({ propsData: { targetElement: t, content: "", id: u } }).$mount(), document.body.appendChild(n.$el);
96
96
  }
97
97
  }, j = () => {
98
98
  document.contains(n.$el) && document.body.removeChild(n.$el), n.$destroy(), n = void 0;
99
- }, A = (t) => Object.values(h).includes(t.arg) ? t.arg : h.TOP, m = (t) => i.find(
99
+ }, v = (t) => Object.values(_).includes(t.arg) ? t.arg : _.TOP, d = (t) => i.find(
100
100
  (o) => (
101
101
  // isEqualNode doesn't work correct for svg element, hence the second check here
102
102
  o.target.isEqualNode(t) && o.target === t
103
103
  )
104
104
  ), M = (t) => {
105
- const o = m(t);
106
- if (!o.content || !t)
105
+ const o = d(t);
106
+ if (!o || !o.content || !t || !n)
107
107
  return;
108
- t && t.setAttribute(v, d);
108
+ t && t.setAttribute(b, u);
109
109
  let e = !1;
110
110
  document.querySelectorAll("dialog").forEach((s) => {
111
111
  e = (s == null ? void 0 : s.open) || e;
112
- }), e && (t.after(n.$el), e = !1), f = !0, n.content = o.content, n.position = o.position, a.content = o.content, a.position = o.position, D(() => {
113
- f && (n.targetElement = t, n.isShown = !0, a.targetElement = t, a.isShown = !0);
112
+ }), e && (t.after(n.$el), e = !1), c = !0, n.content = o.content, n.position = o.position, a.content = o.content, a.position = o.position, D(() => {
113
+ !c || !n || (n.targetElement = t, n.isShown = !0, a.targetElement = t, a.isShown = !0);
114
114
  });
115
- }, w = (t) => {
116
- var o, e, s, l;
117
- (e = (o = n.$el) == null ? void 0 : o.parentElement) != null && e.tagName && ((l = (s = n.$el) == null ? void 0 : s.parentElement) == null ? void 0 : l.tagName) !== "BODY" && document.body.appendChild(n.$el), f = !1, n.isShown = !1, a.isShown = !1, t && t.removeAttribute(v);
118
- }, u = (t, o) => {
115
+ }, A = (t) => {
116
+ var o, e;
117
+ (e = (o = n == null ? void 0 : n.$el) == null ? void 0 : o.parentElement) != null && e.tagName && n.$el.parentElement.tagName !== "BODY" && document.body.appendChild(n.$el), c = !1, n && (n.isShown = !1), a.isShown = !1, t && t.removeAttribute(b);
118
+ }, f = (t, o) => {
119
119
  if (!o.hasOwnProperty("value") || o.value) {
120
120
  i.length === 0 && G(t);
121
- const e = () => M(t), s = () => w(t), l = {
121
+ const e = () => M(t), s = () => A(t), w = {
122
122
  target: t,
123
123
  content: o.value,
124
- position: A(o),
124
+ position: v(o),
125
125
  removeListeners: [
126
126
  r(t, "mouseenter", e),
127
127
  r(t, "mouseleave", s),
128
128
  r(t, "focus", () => {
129
129
  t.matches(":focus-visible") && e();
130
130
  }),
131
- r(t, "blur", (p) => {
132
- var _;
133
- ((_ = p.relatedTarget) == null ? void 0 : _.getAttribute("role")) !== "tooltip" && s();
131
+ r(t, "blur", (l) => {
132
+ var m;
133
+ ((m = l.relatedTarget) == null ? void 0 : m.getAttribute("role")) !== "tooltip" && s();
134
134
  }),
135
- r(t, "keydown", (p) => {
136
- p.key === P.ESCAPE && s();
135
+ r(t, "keydown", (l) => {
136
+ l.key === g.ESCAPE && s();
137
137
  })
138
138
  ]
139
139
  };
140
- i.push(l);
140
+ i.push(w);
141
141
  }
142
- }, c = (t, o) => {
143
- const e = m(t);
142
+ }, p = (t, o) => {
143
+ const e = d(t);
144
144
  if (e) {
145
145
  if ((e == null ? void 0 : e.content) !== o.value && (e.content = o.value, n.isShown && n.targetElement.isEqualNode(t) && (e.content ? n.content = o.value : n.isShown = !1)), e.position !== o.arg) {
146
- const s = A(o);
146
+ const s = v(o);
147
147
  e.position = s, n.position = s;
148
148
  }
149
- } else !e && o.value && u(t, o);
150
- }, E = (t) => {
151
- const o = m(t);
149
+ } else !e && o.value && f(t, o);
150
+ }, T = (t) => {
151
+ const o = d(t);
152
152
  o && (o.removeListeners.forEach((e) => {
153
153
  e();
154
- }), w(), i.splice(i.indexOf(o), 1), i.length === 0 && j());
154
+ }), A(), i.splice(i.indexOf(o), 1), i.length === 0 && j());
155
155
  }, K = {
156
156
  // Vue 2 Directive hooks
157
157
  bind(t, o) {
158
- u(t, o);
158
+ f(t, o);
159
159
  },
160
160
  update(t, o) {
161
- c(t, o);
161
+ p(t, o);
162
162
  },
163
163
  unbind(t) {
164
- E(t);
164
+ T(t);
165
165
  },
166
166
  // Vue 3 Directive hooks
167
167
  beforeMount(t, o) {
168
- u(t, o);
168
+ f(t, o);
169
169
  },
170
170
  mounted(t, o) {
171
- c(t, o);
171
+ p(t, o);
172
172
  },
173
173
  updated(t, o) {
174
- c(t, o);
174
+ p(t, o);
175
175
  },
176
176
  unmounted(t) {
177
- E(t);
177
+ T(t);
178
178
  }
179
179
  };
180
180
  export {
181
- T as B,
182
- P as E,
181
+ h as B,
182
+ g as E,
183
183
  L as T,
184
- b as a,
184
+ P as a,
185
185
  K as b,
186
- h as c,
186
+ _ as c,
187
187
  x as d
188
188
  };
189
- //# sourceMappingURL=tooltip.DxJQHsuI.js.map
189
+ //# sourceMappingURL=tooltip.DF11J3k3.js.map