@adyen/bento-vue2 1.43.0 → 1.45.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 (297) hide show
  1. package/dist/@types/index.d.ts +118 -143
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-button.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions-with-menu.css +1 -1
  10. package/dist/assets/button-actions.css +1 -1
  11. package/dist/assets/button.css +1 -1
  12. package/dist/assets/card.css +1 -1
  13. package/dist/assets/checkbox.css +1 -1
  14. package/dist/assets/data-grid.css +1 -1
  15. package/dist/assets/dialog-page.css +1 -1
  16. package/dist/assets/dropdown-default-textbox.css +1 -1
  17. package/dist/assets/dropdown.css +1 -1
  18. package/dist/assets/file-uploader.css +1 -1
  19. package/dist/assets/focus-trap.css +1 -1
  20. package/dist/assets/header.css +1 -1
  21. package/dist/assets/info-icon-with-popover.css +1 -0
  22. package/dist/assets/input-field.css +1 -1
  23. package/dist/assets/inspector.css +1 -1
  24. package/dist/assets/layout-row.css +1 -1
  25. package/dist/assets/link.css +1 -1
  26. package/dist/assets/menu.css +1 -1
  27. package/dist/assets/modal-fullscreen.css +1 -1
  28. package/dist/assets/popover.css +1 -1
  29. package/dist/assets/popper-container.css +1 -1
  30. package/dist/assets/radio-input.css +1 -1
  31. package/dist/assets/selection-card-group.css +1 -1
  32. package/dist/assets/sidepanel.css +1 -1
  33. package/dist/assets/tabs.css +1 -1
  34. package/dist/assets/textarea.css +1 -1
  35. package/dist/assets/use-cached-selected-values.css +1 -1
  36. package/dist/avatar.js +1 -1
  37. package/dist/button.js +8 -9
  38. package/dist/button.js.map +1 -1
  39. package/dist/card.js +1 -1
  40. package/dist/checkbox.js +2 -2
  41. package/dist/chunks/{accordion-item.BjXzREaK.js → accordion-item.CzKttO4w.js} +5 -5
  42. package/dist/chunks/{accordion-item.BjXzREaK.js.map → accordion-item.CzKttO4w.js.map} +1 -1
  43. package/dist/chunks/{action-bar.kPPYSgQK.js → action-bar.BXemSuq4.js} +18 -18
  44. package/dist/chunks/action-bar.BXemSuq4.js.map +1 -0
  45. package/dist/chunks/{alert.D2Z_aiFC.js → alert.CAIp-87f.js} +3 -3
  46. package/dist/chunks/{alert.D2Z_aiFC.js.map → alert.CAIp-87f.js.map} +1 -1
  47. package/dist/chunks/{avatar.DXzyWKsI.js → avatar.BgwjpLQO.js} +2 -2
  48. package/dist/chunks/{avatar.DXzyWKsI.js.map → avatar.BgwjpLQO.js.map} +1 -1
  49. package/dist/chunks/{base-button.4UYC3kp2.js → base-button.-gx_u8Bd.js} +3 -3
  50. package/dist/chunks/base-button.-gx_u8Bd.js.map +1 -0
  51. package/dist/chunks/{base-modal.DroVbSCn.js → base-modal.4JSNBM4T.js} +12 -12
  52. package/dist/chunks/{base-modal.DroVbSCn.js.map → base-modal.4JSNBM4T.js.map} +1 -1
  53. package/dist/chunks/{button-actions-with-menu.dp6C-PKX.js → button-actions-with-menu.ieopdfI7.js} +38 -29
  54. package/dist/chunks/button-actions-with-menu.ieopdfI7.js.map +1 -0
  55. package/dist/chunks/button-actions.CtFB6iRj.js +252 -0
  56. package/dist/chunks/button-actions.CtFB6iRj.js.map +1 -0
  57. package/dist/chunks/{button.CufUNBkv.js → button.BX6ZJxF7.js} +13 -13
  58. package/dist/chunks/button.BX6ZJxF7.js.map +1 -0
  59. package/dist/chunks/{calendar.B9WZ8ub3.js → calendar.BouORZfb.js} +9 -9
  60. package/dist/chunks/{calendar.B9WZ8ub3.js.map → calendar.BouORZfb.js.map} +1 -1
  61. package/dist/chunks/{card.BcjxzwZV.js → card.BabmUkTG.js} +6 -6
  62. package/dist/chunks/{card.BcjxzwZV.js.map → card.BabmUkTG.js.map} +1 -1
  63. package/dist/chunks/{checkbox-group.Bcqac3y8.js → checkbox-group.DbLznnsa.js} +7 -7
  64. package/dist/chunks/{checkbox-group.Bcqac3y8.js.map → checkbox-group.DbLznnsa.js.map} +1 -1
  65. package/dist/chunks/{checkbox.B1qjI4R_.js → checkbox.fhQLs-NN.js} +6 -6
  66. package/dist/chunks/checkbox.fhQLs-NN.js.map +1 -0
  67. package/dist/chunks/{chevron-left.CtnrsqUy.js → chevron-left.PIu6yPqe.js} +3 -3
  68. package/dist/chunks/{chevron-left.CtnrsqUy.js.map → chevron-left.PIu6yPqe.js.map} +1 -1
  69. package/dist/chunks/{chevron-up.B2uWhZf7.js → chevron-up.DVfo78kV.js} +3 -3
  70. package/dist/chunks/{chevron-up.B2uWhZf7.js.map → chevron-up.DVfo78kV.js.map} +1 -1
  71. package/dist/chunks/{code-snippet.DuZDA7gH.js → code-snippet.5iJcUZSo.js} +20 -20
  72. package/dist/chunks/{code-snippet.DuZDA7gH.js.map → code-snippet.5iJcUZSo.js.map} +1 -1
  73. package/dist/chunks/{codemirror.BlV6WO5w.js → codemirror.CXFEqvAi.js} +2047 -2053
  74. package/dist/chunks/{codemirror.BlV6WO5w.js.map → codemirror.CXFEqvAi.js.map} +1 -1
  75. package/dist/chunks/{controls-group.J8shO_JL.js → controls-group.CnXzOQkX.js} +3 -3
  76. package/dist/chunks/{controls-group.J8shO_JL.js.map → controls-group.CnXzOQkX.js.map} +1 -1
  77. package/dist/chunks/{copy.DgzxvExj.js → copy.DN0tClPm.js} +4 -4
  78. package/dist/chunks/{copy.DgzxvExj.js.map → copy.DN0tClPm.js.map} +1 -1
  79. package/dist/chunks/{country.CM5oZOyZ.js → country.Bft91V1L.js} +3 -3
  80. package/dist/chunks/{country.CM5oZOyZ.js.map → country.Bft91V1L.js.map} +1 -1
  81. package/dist/chunks/{country.types.Br0AjxGy.js → country.types.pilf5B3F.js} +483 -480
  82. package/dist/chunks/{country.types.Br0AjxGy.js.map → country.types.pilf5B3F.js.map} +1 -1
  83. package/dist/chunks/{currency.P7Psn_SK.js → currency.BmI4Sqy5.js} +2 -2
  84. package/dist/chunks/{currency.P7Psn_SK.js.map → currency.BmI4Sqy5.js.map} +1 -1
  85. package/dist/chunks/{dashboard-section.CExqPbQb.js → dashboard-section.DYXZhtop.js} +5 -5
  86. package/dist/chunks/{dashboard-section.CExqPbQb.js.map → dashboard-section.DYXZhtop.js.map} +1 -1
  87. package/dist/chunks/{dashed-underline.dGO33Q_E.js → dashed-underline.BvSZS1-m.js} +4 -4
  88. package/dist/chunks/{dashed-underline.dGO33Q_E.js.map → dashed-underline.BvSZS1-m.js.map} +1 -1
  89. package/dist/chunks/{data-grid-template.BF7JMfoJ.js → data-grid-template.Du92TEFY.js} +4 -4
  90. package/dist/chunks/{data-grid-template.BF7JMfoJ.js.map → data-grid-template.Du92TEFY.js.map} +1 -1
  91. package/dist/chunks/{data-grid.BXB98JQr.js → data-grid.Kwtf1DMq.js} +46 -46
  92. package/dist/chunks/{data-grid.BXB98JQr.js.map → data-grid.Kwtf1DMq.js.map} +1 -1
  93. package/dist/chunks/{date-picker.Dfg1_eo6.js → date-picker.B7mTNghB.js} +11 -11
  94. package/dist/chunks/{date-picker.Dfg1_eo6.js.map → date-picker.B7mTNghB.js.map} +1 -1
  95. package/dist/chunks/{date-range-picker.xYGf0SRg.js → date-range-picker.DPLri9D-.js} +241 -241
  96. package/dist/chunks/{date-range-picker.xYGf0SRg.js.map → date-range-picker.DPLri9D-.js.map} +1 -1
  97. package/dist/chunks/{date.BQ29-2L1.js → date.1zs9CRhw.js} +2 -4
  98. package/dist/chunks/{date.BQ29-2L1.js.map → date.1zs9CRhw.js.map} +1 -1
  99. package/dist/chunks/{dialog-page.CplkzZGZ.js → dialog-page.DcJ7LaOE.js} +33 -32
  100. package/dist/chunks/dialog-page.DcJ7LaOE.js.map +1 -0
  101. package/dist/chunks/{dropdown-default-textbox.DPZmj7xJ.js → dropdown-default-textbox.DBoSso4J.js} +124 -104
  102. package/dist/chunks/dropdown-default-textbox.DBoSso4J.js.map +1 -0
  103. package/dist/chunks/{dropdown-tag.B4RMse5R.js → dropdown-tag.XIlES6IT.js} +8 -8
  104. package/dist/chunks/{dropdown-tag.B4RMse5R.js.map → dropdown-tag.XIlES6IT.js.map} +1 -1
  105. package/dist/chunks/{dropdown.BfzsI2Th.js → dropdown.BqsoncJr.js} +228 -222
  106. package/dist/chunks/dropdown.BqsoncJr.js.map +1 -0
  107. package/dist/chunks/{empty-state.B8ZeRgDi.js → empty-state.1TyzB5ju.js} +5 -5
  108. package/dist/chunks/{empty-state.B8ZeRgDi.js.map → empty-state.1TyzB5ju.js.map} +1 -1
  109. package/dist/chunks/{error-message.B7uoqQpq.js → error-message.Ccc1sTTp.js} +3 -3
  110. package/dist/chunks/{error-message.B7uoqQpq.js.map → error-message.Ccc1sTTp.js.map} +1 -1
  111. package/dist/chunks/es6.jIyAPBgt.js +11 -0
  112. package/dist/chunks/{es6.b4enG1py.js.map → es6.jIyAPBgt.js.map} +1 -1
  113. package/dist/chunks/{file-uploader.CK-Frs_q.js → file-uploader.C6kcnhqp.js} +228 -227
  114. package/dist/chunks/file-uploader.C6kcnhqp.js.map +1 -0
  115. package/dist/chunks/{filter-bar.hBPWastb.js → filter-bar.DT_-lVmf.js} +54 -55
  116. package/dist/chunks/{filter-bar.hBPWastb.js.map → filter-bar.DT_-lVmf.js.map} +1 -1
  117. package/dist/chunks/{fixed-scroller.B880PL1J.js → fixed-scroller.IPM3AzHS.js} +4 -4
  118. package/dist/chunks/{fixed-scroller.B880PL1J.js.map → fixed-scroller.IPM3AzHS.js.map} +1 -1
  119. package/dist/chunks/focus-trap.CGypVwG6.js +495 -0
  120. package/dist/chunks/focus-trap.CGypVwG6.js.map +1 -0
  121. package/dist/chunks/{footer-actions.DwnLB4NW.js → footer-actions.D0uH9JWq.js} +4 -4
  122. package/dist/chunks/{footer-actions.DwnLB4NW.js.map → footer-actions.D0uH9JWq.js.map} +1 -1
  123. package/dist/chunks/{form-layout-title.BarHgyjC.js → form-layout-title.DN0jonFa.js} +3 -3
  124. package/dist/chunks/{form-layout-title.BarHgyjC.js.map → form-layout-title.DN0jonFa.js.map} +1 -1
  125. package/dist/chunks/{generate-uid.D-HFI38h.js → generate-uid.NJ8tVoha.js} +2 -2
  126. package/dist/chunks/{generate-uid.D-HFI38h.js.map → generate-uid.NJ8tVoha.js.map} +1 -1
  127. package/dist/chunks/header.BvZxtIOD.js +205 -0
  128. package/dist/chunks/header.BvZxtIOD.js.map +1 -0
  129. package/dist/chunks/{index.Gcw_BUVh.js → index.D8ivUe7P.js} +6 -5
  130. package/dist/chunks/{index.Gcw_BUVh.js.map → index.D8ivUe7P.js.map} +1 -1
  131. package/dist/chunks/info-icon-with-popover.DEjsASNU.js +71 -0
  132. package/dist/chunks/info-icon-with-popover.DEjsASNU.js.map +1 -0
  133. package/dist/chunks/{info-icon.p-28zHUJ.js → info-icon.0d0GzDe2.js} +3 -3
  134. package/dist/chunks/{info-icon.p-28zHUJ.js.map → info-icon.0d0GzDe2.js.map} +1 -1
  135. package/dist/chunks/{input-field-password.BmfOGkrH.js → input-field-password.HRDEb0jL.js} +10 -10
  136. package/dist/chunks/{input-field-password.BmfOGkrH.js.map → input-field-password.HRDEb0jL.js.map} +1 -1
  137. package/dist/chunks/{input-field.CHD3Fzzg.js → input-field.D6N2kt7s.js} +6 -6
  138. package/dist/chunks/input-field.D6N2kt7s.js.map +1 -0
  139. package/dist/chunks/{inspector.types.DaY6OOzz.js → inspector.types.2YEArjPi.js} +5 -5
  140. package/dist/chunks/{inspector.types.DaY6OOzz.js.map → inspector.types.2YEArjPi.js.map} +1 -1
  141. package/dist/chunks/{layout-row.DzS_XyyF.js → layout-row.BfS-cPky.js} +5 -5
  142. package/dist/chunks/layout-row.BfS-cPky.js.map +1 -0
  143. package/dist/chunks/{link.v-y0fKjn.js → link.UOEUR35A.js} +7 -7
  144. package/dist/chunks/{link.v-y0fKjn.js.map → link.UOEUR35A.js.map} +1 -1
  145. package/dist/chunks/{listbox-option-tag.BnX0H4HE.js → listbox-option-tag.Co0ycEdQ.js} +3 -3
  146. package/dist/chunks/{listbox-option-tag.BnX0H4HE.js.map → listbox-option-tag.Co0ycEdQ.js.map} +1 -1
  147. package/dist/chunks/{menu.N41WnXc8.js → menu.CLaN9Eys.js} +83 -56
  148. package/dist/chunks/menu.CLaN9Eys.js.map +1 -0
  149. package/dist/chunks/{modal-fullscreen.BbNe6M9T.js → modal-fullscreen.B-qr1Szh.js} +7 -7
  150. package/dist/chunks/{modal-fullscreen.BbNe6M9T.js.map → modal-fullscreen.B-qr1Szh.js.map} +1 -1
  151. package/dist/chunks/{modal.Cb4zg5fN.js → modal.wU3uUJKq.js} +6 -6
  152. package/dist/chunks/{modal.Cb4zg5fN.js.map → modal.wU3uUJKq.js.map} +1 -1
  153. package/dist/chunks/{pagination.DORr-ox0.js → pagination.BM3FhtxJ.js} +5 -5
  154. package/dist/chunks/{pagination.DORr-ox0.js.map → pagination.BM3FhtxJ.js.map} +1 -1
  155. package/dist/chunks/{payment-method.CoXB0ZAW.js → payment-method.UaERFtej.js} +2 -2
  156. package/dist/chunks/{payment-method.CoXB0ZAW.js.map → payment-method.UaERFtej.js.map} +1 -1
  157. package/dist/chunks/{popover.Uy-vuQq5.js → popover.DsUymZWJ.js} +5 -5
  158. package/dist/chunks/{popover.Uy-vuQq5.js.map → popover.DsUymZWJ.js.map} +1 -1
  159. package/dist/chunks/{popper-container.CnWphJTN.js → popper-container.B1iB2ovW.js} +5 -5
  160. package/dist/chunks/popper-container.B1iB2ovW.js.map +1 -0
  161. package/dist/chunks/{promo-banner.cTUF9seG.js → promo-banner.BXtIM4C9.js} +7 -7
  162. package/dist/chunks/{promo-banner.cTUF9seG.js.map → promo-banner.BXtIM4C9.js.map} +1 -1
  163. package/dist/chunks/{radio-group.EnMXbuly.js → radio-group.DMob8x2J.js} +15 -15
  164. package/dist/chunks/{radio-group.EnMXbuly.js.map → radio-group.DMob8x2J.js.map} +1 -1
  165. package/dist/chunks/{radio-input.q980f8Uf.js → radio-input.C1DZbkcT.js} +5 -5
  166. package/dist/chunks/radio-input.C1DZbkcT.js.map +1 -0
  167. package/dist/chunks/{search-bar.BtFX4039.js → search-bar.rubkdbcD.js} +3 -3
  168. package/dist/chunks/{search-bar.BtFX4039.js.map → search-bar.rubkdbcD.js.map} +1 -1
  169. package/dist/chunks/{secondary-nav.DtnWRhFW.js → secondary-nav.DKSjc5bn.js} +5 -5
  170. package/dist/chunks/{secondary-nav.DtnWRhFW.js.map → secondary-nav.DKSjc5bn.js.map} +1 -1
  171. package/dist/chunks/{segmented-control.CVeUROYR.js → segmented-control.DL0W7lJ_.js} +4 -4
  172. package/dist/chunks/{segmented-control.CVeUROYR.js.map → segmented-control.DL0W7lJ_.js.map} +1 -1
  173. package/dist/chunks/{selection-card-group.B6XXbJsv.js → selection-card-group.iYyZ9yX4.js} +12 -12
  174. package/dist/chunks/{selection-card-group.B6XXbJsv.js.map → selection-card-group.iYyZ9yX4.js.map} +1 -1
  175. package/dist/chunks/{sidepanel.CRJN9Acz.js → sidepanel.CQnLpV8A.js} +7 -7
  176. package/dist/chunks/{sidepanel.CRJN9Acz.js.map → sidepanel.CQnLpV8A.js.map} +1 -1
  177. package/dist/chunks/{status.types.B0jtv0c7.js → status.types.Cv6hHRMu.js} +2 -2
  178. package/dist/chunks/{status.types.B0jtv0c7.js.map → status.types.Cv6hHRMu.js.map} +1 -1
  179. package/dist/chunks/{step.5g9BIi15.js → step.BsIdWhaZ.js} +3 -3
  180. package/dist/chunks/{step.5g9BIi15.js.map → step.BsIdWhaZ.js.map} +1 -1
  181. package/dist/chunks/{structured-list-item.BEhWyaVP.js → structured-list-item.BhBbmkbw.js} +6 -6
  182. package/dist/chunks/{structured-list-item.BEhWyaVP.js.map → structured-list-item.BhBbmkbw.js.map} +1 -1
  183. package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js → summary-grid-item-custom.CicAOBVQ.js} +5 -5
  184. package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js.map → summary-grid-item-custom.CicAOBVQ.js.map} +1 -1
  185. package/dist/chunks/{tabs.Casntai-.js → tabs.9kObZry9.js} +5 -5
  186. package/dist/chunks/{tabs.Casntai-.js.map → tabs.9kObZry9.js.map} +1 -1
  187. package/dist/chunks/{tag.wTXg-O7i.js → tag.-YNhsBv7.js} +3 -3
  188. package/dist/chunks/{tag.wTXg-O7i.js.map → tag.-YNhsBv7.js.map} +1 -1
  189. package/dist/chunks/{teleport.CQKBJZU5.js → teleport.B5fwsT5y.js} +26 -17
  190. package/dist/chunks/teleport.B5fwsT5y.js.map +1 -0
  191. package/dist/chunks/textarea.Cf21WMwL.js +196 -0
  192. package/dist/chunks/{textarea.Y3yd_3ll.js.map → textarea.Cf21WMwL.js.map} +1 -1
  193. package/dist/chunks/{timeline-item.CCV4U3Zx.js → timeline-item.Cu5b-Mqj.js} +12 -12
  194. package/dist/chunks/timeline-item.Cu5b-Mqj.js.map +1 -0
  195. package/dist/chunks/{toast.BEipTIrz.js → toast.DgJbW9CL.js} +4 -4
  196. package/dist/chunks/{toast.BEipTIrz.js.map → toast.DgJbW9CL.js.map} +1 -1
  197. package/dist/chunks/{toggle-button.CYplDIO-.js → toggle-button.Cf8C7p6e.js} +2 -2
  198. package/dist/chunks/{toggle-button.CYplDIO-.js.map → toggle-button.Cf8C7p6e.js.map} +1 -1
  199. package/dist/chunks/{toggle.INRYdQzz.js → toggle.CnS7qszG.js} +3 -3
  200. package/dist/chunks/{toggle.INRYdQzz.js.map → toggle.CnS7qszG.js.map} +1 -1
  201. package/dist/chunks/{tooltip.DH8TqpYV.js → tooltip.R2sqydIE.js} +4 -4
  202. package/dist/chunks/{tooltip.DH8TqpYV.js.map → tooltip.R2sqydIE.js.map} +1 -1
  203. package/dist/chunks/{tutorial.4r7MKNEU.js → tutorial.w2ZqeOh1.js} +9 -9
  204. package/dist/chunks/{tutorial.4r7MKNEU.js.map → tutorial.w2ZqeOh1.js.map} +1 -1
  205. package/dist/chunks/{typography.Bu_WAKdf.js → typography.J1v_SPG3.js} +2 -1
  206. package/dist/chunks/{typography.Bu_WAKdf.js.map → typography.J1v_SPG3.js.map} +1 -1
  207. package/dist/chunks/{use-bento-toast-controller.BVVMh0wc.js → use-bento-toast-controller.Cn_2Eogn.js} +3 -3
  208. package/dist/chunks/{use-bento-toast-controller.BVVMh0wc.js.map → use-bento-toast-controller.Cn_2Eogn.js.map} +1 -1
  209. package/dist/chunks/{use-cached-selected-values.CAlfyb_L.js → use-cached-selected-values.impKjAIS.js} +46 -46
  210. package/dist/chunks/use-cached-selected-values.impKjAIS.js.map +1 -0
  211. package/dist/chunks/{use-country-items.C25TI6tp.js → use-country-items.DPBbl1KK.js} +2 -2
  212. package/dist/chunks/{use-country-items.C25TI6tp.js.map → use-country-items.DPBbl1KK.js.map} +1 -1
  213. package/dist/code-snippet.js +1 -1
  214. package/dist/country.js +2 -2
  215. package/dist/currency.js +1 -1
  216. package/dist/dashboard-template.js +1 -1
  217. package/dist/dashed-underline.js +1 -1
  218. package/dist/data-grid-template.js +1 -1
  219. package/dist/data-grid.js +1 -1
  220. package/dist/date-picker.js +2 -2
  221. package/dist/date-range-picker.js +2 -2
  222. package/dist/date.js +1 -1
  223. package/dist/dropdown.js +4 -4
  224. package/dist/empty-state.js +1 -1
  225. package/dist/file-uploader.js +1 -1
  226. package/dist/filter-bar.js +1 -1
  227. package/dist/focus-trap.js +1 -1
  228. package/dist/form-layout.js +1 -1
  229. package/dist/header.js +1 -1
  230. package/dist/index.js +115 -116
  231. package/dist/index.js.map +1 -1
  232. package/dist/info-icon.js +1 -1
  233. package/dist/input-field-password.js +1 -1
  234. package/dist/input-field.js +1 -1
  235. package/dist/inspector.js +1 -1
  236. package/dist/internal.js +33 -27
  237. package/dist/internal.js.map +1 -1
  238. package/dist/layout.js +1 -1
  239. package/dist/link.js +1 -1
  240. package/dist/menu.js +1 -1
  241. package/dist/modal-fullscreen.js +1 -1
  242. package/dist/modal.js +2 -2
  243. package/dist/pagination.js +1 -1
  244. package/dist/payment-method.js +1 -1
  245. package/dist/popover.js +1 -1
  246. package/dist/popper-container.js +1 -1
  247. package/dist/promo-banner.js +1 -1
  248. package/dist/radio-group.js +2 -2
  249. package/dist/search-bar.js +2 -2
  250. package/dist/secondary-nav.js +1 -1
  251. package/dist/segmented-control.js +1 -1
  252. package/dist/selection-card.js +1 -1
  253. package/dist/sidepanel.js +1 -1
  254. package/dist/status.js +1 -1
  255. package/dist/stepper.js +1 -1
  256. package/dist/structured-list.js +1 -1
  257. package/dist/summary-grid.js +1 -1
  258. package/dist/tabs.js +1 -1
  259. package/dist/tag.js +1 -1
  260. package/dist/textarea.js +1 -1
  261. package/dist/timeline.js +1 -1
  262. package/dist/toast.js +1 -1
  263. package/dist/toggle.js +1 -1
  264. package/dist/tutorial.js +1 -1
  265. package/dist/typography.js +1 -1
  266. package/dist/web-types.json +49 -3
  267. package/package.json +7 -6
  268. package/dist/assets/loading-button.css +0 -1
  269. package/dist/chunks/action-bar.kPPYSgQK.js.map +0 -1
  270. package/dist/chunks/base-button.4UYC3kp2.js.map +0 -1
  271. package/dist/chunks/button-actions-with-menu.dp6C-PKX.js.map +0 -1
  272. package/dist/chunks/button-actions.Cpx4PQp0.js +0 -111
  273. package/dist/chunks/button-actions.Cpx4PQp0.js.map +0 -1
  274. package/dist/chunks/button.CufUNBkv.js.map +0 -1
  275. package/dist/chunks/checkbox.B1qjI4R_.js.map +0 -1
  276. package/dist/chunks/dialog-page.CplkzZGZ.js.map +0 -1
  277. package/dist/chunks/dropdown-default-textbox.DPZmj7xJ.js.map +0 -1
  278. package/dist/chunks/dropdown.BfzsI2Th.js.map +0 -1
  279. package/dist/chunks/es6.b4enG1py.js +0 -10
  280. package/dist/chunks/file-uploader.CK-Frs_q.js.map +0 -1
  281. package/dist/chunks/focus-trap.DSkLNO_i.js +0 -443
  282. package/dist/chunks/focus-trap.DSkLNO_i.js.map +0 -1
  283. package/dist/chunks/header.CAJtHW1k.js +0 -266
  284. package/dist/chunks/header.CAJtHW1k.js.map +0 -1
  285. package/dist/chunks/input-field.CHD3Fzzg.js.map +0 -1
  286. package/dist/chunks/layout-row.DzS_XyyF.js.map +0 -1
  287. package/dist/chunks/loading-button.CiPmvU7F.js +0 -113
  288. package/dist/chunks/loading-button.CiPmvU7F.js.map +0 -1
  289. package/dist/chunks/menu.N41WnXc8.js.map +0 -1
  290. package/dist/chunks/popper-container.CnWphJTN.js.map +0 -1
  291. package/dist/chunks/radio-input.q980f8Uf.js.map +0 -1
  292. package/dist/chunks/teleport.CQKBJZU5.js.map +0 -1
  293. package/dist/chunks/textarea.Y3yd_3ll.js +0 -192
  294. package/dist/chunks/timeline-item.CCV4U3Zx.js.map +0 -1
  295. package/dist/chunks/use-cached-selected-values.CAlfyb_L.js.map +0 -1
  296. package/dist/chunks/use-click-outside.D6aIgS15.js +0 -14
  297. package/dist/chunks/use-click-outside.D6aIgS15.js.map +0 -1
@@ -0,0 +1,196 @@
1
+ import { defineComponent as K, useAttrs as Q, toRefs as H, ref as p, toRef as X, computed as n, watch as E, nextTick as ee, onMounted as ae, onUnmounted as te } from "vue";
2
+ import { B as le } from "./button.BX6ZJxF7.js";
3
+ import { B as re } from "./typography.J1v_SPG3.js";
4
+ import { C as se } from "./cross-circle-fill-small.Oj6lPaDy.js";
5
+ import { g as oe } from "./generate-uid.NJ8tVoha.js";
6
+ import { o as T } from "./resize.Bqks3WUm.js";
7
+ import { u as ne } from "./aria-label.CaUURpnB.js";
8
+ import { u as ie } from "./i18n.BQkEbtPM.js";
9
+ import { u as ue } from "./use-form-layout-loading.D3lALhtC.js";
10
+ import { F as ce, E as de } from "./error-message.Ccc1sTTp.js";
11
+ import { n as pe } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
12
+ import "../assets/textarea.css";
13
+ var A = /* @__PURE__ */ ((t) => (t.HORIZONTAL = "horizontal", t.VERTICAL = "vertical", t.BOTH = "both", t.NONE = "none", t))(A || {}), f = /* @__PURE__ */ ((t) => (t.CLEARABLE = "clearable", t.DISABLED = "disabled", t.ERROR = "error", t.READONLY = "readonly", t))(f || {}), u = /* @__PURE__ */ ((t) => (t.BLUR = "blur", t.CHANGE = "change", t.CLEAR = "clear", t.ESCAPE_PRESSED = "escape-pressed", t.FOCUS = "focus", t.INPUT = "input", t))(u || {});
14
+ const fe = {
15
+ "en-US": {
16
+ clearText: "Clear text",
17
+ textarea: "textarea",
18
+ yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
19
+ }
20
+ }, be = {
21
+ i18n: { messages: fe },
22
+ name: "bento-textarea"
23
+ }, me = /* @__PURE__ */ K({
24
+ ...be,
25
+ props: {
26
+ /**
27
+ * Text that labels an the input element
28
+ */
29
+ ariaLabel: { type: String, default: void 0 },
30
+ /**
31
+ * Text that shows number of characters in textarea
32
+ */
33
+ characterLimit: { type: Number, default: void 0 },
34
+ /**
35
+ * Text displayed as the help text of the textarea
36
+ */
37
+ description: { type: String, default: "" },
38
+ /**
39
+ * Disables the possibility of changing value in the textarea
40
+ */
41
+ disabled: { type: Boolean, default: !1 },
42
+ /**
43
+ * If set to true, shows a button to clear all the text
44
+ */
45
+ clearable: { type: Boolean, default: !1 },
46
+ /**
47
+ * Adds error text
48
+ */
49
+ errorMessage: { type: String, default: "" },
50
+ /**
51
+ * Sets the height of the textarea, e.g 200px OR 20vh
52
+ */
53
+ height: { type: String, default: null },
54
+ /**
55
+ * Text displayed as the label of the textarea
56
+ */
57
+ label: { type: String, default: "" },
58
+ /**
59
+ * Highlights the textarea is optional.
60
+ */
61
+ optional: { type: Boolean, default: !1 },
62
+ /**
63
+ * Text displayed as the placeholder of the textarea
64
+ */
65
+ placeholder: { type: String, default: "" },
66
+ /**
67
+ * Set the textarea to read only state.
68
+ */
69
+ readonly: { type: Boolean, default: !1 },
70
+ /**
71
+ * Indicates the possibility of resize the textarea
72
+ */
73
+ resizable: {
74
+ type: String,
75
+ default: A.BOTH,
76
+ validator: (t) => Object.values(A).includes(t)
77
+ },
78
+ /**
79
+ * Highlights the textarea is required.
80
+ */
81
+ required: { type: Boolean, default: !1 },
82
+ /**
83
+ * Adds a info icon next to the label to display the passed tooltip message.
84
+ */
85
+ tooltipText: { type: String, default: null },
86
+ /**
87
+ * Text displayed as the value of the textarea
88
+ */
89
+ value: { type: String, default: "" }
90
+ },
91
+ emits: [],
92
+ setup(t, { expose: a, emit: l }) {
93
+ const e = t, r = Q(), { height: c } = H(e), P = oe("textarea"), s = p(null), b = p(null), o = p(e.value), y = 44, m = p(e.height || `${y}px`), x = p("100%");
94
+ let _ = null, v = null;
95
+ const { t: I } = ie(), { isReadOnly: h } = ue(X(e, "readonly")), N = n(() => `${o.value.length} / ${e.characterLimit}`), C = n(
96
+ () => e.characterLimit && o.value.length > e.characterLimit
97
+ ), g = () => {
98
+ s.value && s.value.scrollHeight > y && (m.value = `${s.value.scrollHeight + 3}px`);
99
+ };
100
+ E(c, () => {
101
+ c.value ? m.value = c.value : g();
102
+ }), E(
103
+ () => e.value,
104
+ () => {
105
+ o.value = e.value;
106
+ },
107
+ { immediate: !0 }
108
+ ), E(
109
+ () => o.value,
110
+ async () => {
111
+ var i, d;
112
+ if (!c.value && (!s.value || ((i = s.value) == null ? void 0 : i.scrollHeight) > ((d = s.value) == null ? void 0 : d.clientHeight))) {
113
+ if (m.value = `${y}px`, !o.value)
114
+ return;
115
+ await ee(), g();
116
+ }
117
+ },
118
+ { immediate: !0 }
119
+ );
120
+ const R = n(() => !!e.errorMessage || C.value), M = n(() => ({
121
+ [`b-textarea--${f.DISABLED}`]: e.disabled
122
+ })), U = n(() => ({
123
+ [`b-textarea__input--${f.CLEARABLE}`]: e.clearable,
124
+ [`b-textarea__input--${f.READONLY}`]: h.value,
125
+ [`b-textarea__input--${f.ERROR}`]: R.value,
126
+ "b-textarea__input--dynamic-height": !c.value
127
+ })), W = n(() => ({
128
+ "b-textarea__label-box--no-label": !e.label
129
+ })), D = n(() => ({
130
+ [`b-textarea__label-item--${f.ERROR}`]: C.value
131
+ })), w = n(() => I("yourTextCanBenAtMost", { characterLimit: e.characterLimit })), S = p(r["aria-label"]), { ariaLabel: B, label: k } = H(e), z = ne({
132
+ ariaLabel: S.value,
133
+ // TODO: take this line away when the aria-label props is removed
134
+ label: B,
135
+ defaultFallback: k
136
+ }), $ = n(
137
+ () => e.clearable && o.value && !e.disabled && !h.value
138
+ ), q = () => {
139
+ o.value = "", l(u.CLEAR), l(u.INPUT, "");
140
+ }, V = (i) => {
141
+ i.stopImmediatePropagation(), !e.disabled && !h.value && (o.value = i.target.value, l(u.INPUT, o.value));
142
+ }, Y = () => {
143
+ s.value.scrollTop = 0, l(u.BLUR);
144
+ }, G = () => {
145
+ s.value.focus(), l(u.FOCUS);
146
+ }, j = () => {
147
+ l(u.CHANGE);
148
+ }, Z = () => {
149
+ l(u.ESCAPE_PRESSED);
150
+ }, L = (i = !1) => {
151
+ var F;
152
+ const d = s.value.style.width;
153
+ if (s.value.style.height && (m.value = s.value.style.height), i && !d)
154
+ return;
155
+ const J = (F = b == null ? void 0 : b.value) == null ? void 0 : F.offsetWidth;
156
+ !d || parseInt(d, 10) > J ? x.value = "100%" : x.value = d;
157
+ }, O = () => {
158
+ s.value.focus();
159
+ };
160
+ return a({
161
+ focus: O
162
+ }), ae(() => {
163
+ _ = T(s.value, () => {
164
+ L(!0);
165
+ }), v = T(b.value, () => {
166
+ L();
167
+ }), c.value || g();
168
+ }), te(() => {
169
+ _ == null || _.disconnect(), v == null || v.disconnect();
170
+ }), { __sfc: !0, attrs: r, props: e, emit: l, height: c, textareaId: P, textareaElement: s, textareaComponent: b, textareaValue: o, defaultTextareaHeight: y, textareaHeight: m, textareaWrapperWidth: x, textareaElementObserver: _, textareaComponentObserver: v, t: I, isReadOnly: h, counter: N, isOverCharacterLimit: C, calculateHeight: g, invalidInput: R, conditionalClasses: M, conditionalClassesInput: U, conditionalClassesLabelBox: W, conditionalClassesLabelItem: D, counterErrorText: w, ariaLabelAttribute: S, ariaLabel: B, label: k, computedAriaLabel: z, showClearButton: $, onClear: q, onInput: V, onBlur: Y, onFocus: G, onChange: j, onPressEscape: Z, resizeTextareaWrapper: L, focus: O, BentoButton: le, BentoTypography: re, ErrorMessage: de, FieldLabel: ce, CrossCircleFillSmallIcon: se };
171
+ }
172
+ });
173
+ var _e = function() {
174
+ var a = this, l = a._self._c, e = a._self._setupProxy;
175
+ return l("div", { ref: "textareaComponent", staticClass: "b-textarea", class: e.conditionalClasses }, [l("div", { style: { width: e.textareaWrapperWidth } }, [l("div", { staticClass: "b-textarea__label-box", class: e.conditionalClassesLabelBox }, [e.label ? l(e.FieldLabel, { attrs: { for: e.textareaId, label: e.label, "tooltip-text": a.tooltipText, optional: a.optional, required: a.required } }) : a._e(), a.characterLimit ? l(e.BentoTypography, { staticClass: "b-textarea__label-item", class: e.conditionalClassesLabelItem, attrs: { el: "span" } }, [a._v(" " + a._s(e.counter) + " ")]) : a._e()], 1), l(e.BentoTypography, { staticClass: "b-textarea__input-box", attrs: { el: "div", "aria-disabled": a.disabled } }, [l("textarea", { ref: "textareaElement", staticClass: "b-textarea__input", class: e.conditionalClassesInput, style: { resize: a.resizable, height: e.textareaHeight }, attrs: { id: e.textareaId, "aria-label": e.computedAriaLabel, "aria-invalid": e.invalidInput, readonly: e.isReadOnly, disabled: a.disabled, placeholder: a.placeholder }, domProps: { value: e.textareaValue }, on: { blur: e.onBlur, change: e.onChange, focus: e.onFocus, input: e.onInput, keydown: function(r) {
176
+ return !r.type.indexOf("key") && a._k(r.keyCode, "esc", 27, r.key, ["Esc", "Escape"]) ? null : e.onPressEscape.apply(null, arguments);
177
+ } } }), e.showClearButton ? l("div", { staticClass: "b-textarea__clear-button" }, [l(e.BentoButton, { attrs: { variant: "tertiary", disabled: a.disabled }, on: { click: e.onClear, keypress: function(r) {
178
+ return !r.type.indexOf("key") && a._k(r.keyCode, "enter", 13, r.key, "Enter") ? null : e.onClear.apply(null, arguments);
179
+ }, keyup: function(r) {
180
+ return !r.type.indexOf("key") && a._k(r.keyCode, "space", 32, r.key, [" ", "Spacebar"]) ? null : e.onClear.apply(null, arguments);
181
+ } }, scopedSlots: a._u([{ key: "iconLeft", fn: function() {
182
+ return [l(e.CrossCircleFillSmallIcon, { attrs: { "svg-title": e.t("clearText") } })];
183
+ }, proxy: !0 }], null, !1, 3119266621) })], 1) : a._e()]), e.isOverCharacterLimit ? l(e.ErrorMessage, { attrs: { "error-message": e.counterErrorText } }) : a._e(), a.errorMessage ? l(e.ErrorMessage, { attrs: { "error-message": a.errorMessage } }) : a._e(), a.description ? l(e.BentoTypography, { staticClass: "b-textarea__description", attrs: { el: "span" } }, [a._v(" " + a._s(a.description) + " ")]) : a._e()], 1)]);
184
+ }, ve = [], ye = /* @__PURE__ */ pe(
185
+ me,
186
+ _e,
187
+ ve,
188
+ !1,
189
+ null,
190
+ "972261d9"
191
+ );
192
+ const ke = ye.exports;
193
+ export {
194
+ ke as B
195
+ };
196
+ //# sourceMappingURL=textarea.Cf21WMwL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.Y3yd_3ll.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits([]);\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n // Auto-adjust height if the text area is overflowing\n if (\n !height.value &&\n (!textareaElement.value || textareaElement.value?.scrollHeight > textareaElement.value?.clientHeight)\n ) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","textareaWrapperWidth","textareaElementObserver","textareaComponentObserver","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","_a","_b","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","onMounted","observeSizeOfElement","onUnmounted"],"mappings":";;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCkWRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzRAC,IAAAC,EAAA,GAqFA,EAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAJ,EAAA,KAAA,GACAO,IAAA,IACAC,IAAAJ,EAAAJ,EAAA,UAAA,GAAAO,CAAA,IAAA,GACAE,IAAAL,EAAA,MAAA;AACA,QAAAM,IAAA,MACAC,IAAA;AAEA,UAAA,EAAA,GAAAC,EAAA,IAAAC,GAAA,GAEA,EAAA,YAAAC,EAAA,IAAAC,GAAAC,EAAAhB,GAAA,UAAA,CAAA,GAEAiB,IAAAC,EAAA,MAAA,GAAAZ,EAAA,MAAA,MAAA,MAAAN,EAAA,cAAA,EAA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cAAA;AAAA,IAAsC,GAO1CqD,IAAA,CAAAC,IAAA,OAAA;;AAEI,YAAAC,IAAA5C,EAAA,MAAA,MAAA;AASA,UANAA,EAAA,MAAA,MAAA,WACIK,EAAA,QAAAL,EAAA,MAAA,MAAA,SAKJ2C,KAAA,CAAAC;AACI;AAIJ,YAAAC,KAAA1B,IAAAjB,KAAA,gBAAAA,EAAA,UAAA,gBAAAiB,EAAA;AAGA,MAAA,CAAAyB,KAAA,SAAAA,GAAA,EAAA,IAAAC,IACIvC,EAAA,QAAA,SAGAA,EAAA,QAAAsC;AAAA,IACJ;AAGJ,WAAAE,EAAA,MAAA;AACI,MAAAvC,IAAAwC,EAAA/C,EAAA,OAAA,MAAA;AACI,QAAA0C,EAAA,EAAA;AAAA,MAA0B,CAAA,GAG9BlC,IAAAuC,EAAA7C,EAAA,OAAA,MAAA;AACI,QAAAwC,EAAA;AAAA,MAAsB,CAAA,GAG1B/C,EAAA,SACIsB,EAAA;AAAA,IACJ,CAAA,GAGJ+B,GAAA,MAAA;AACI,MAAAzC,KAAA,QAAAA,EAAA,cACAC,KAAA,QAAAA,EAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"textarea.Cf21WMwL.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits([]);\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n // Auto-adjust height if the text area is overflowing\n if (\n !height.value &&\n (!textareaElement.value || textareaElement.value?.scrollHeight > textareaElement.value?.clientHeight)\n ) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","textareaWrapperWidth","textareaElementObserver","textareaComponentObserver","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","_a","_b","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","focus","expose","onMounted","observeSizeOfElement","onUnmounted"],"mappings":";;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GC0WRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAjSAC,IAAAC,EAAA,GAqFA,EAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAJ,EAAA,KAAA,GACAO,IAAA,IACAC,IAAAJ,EAAAJ,EAAA,UAAA,GAAAO,CAAA,IAAA,GACAE,IAAA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AA,IAAA;AAAA,IAA4B,GAGhCkD,IAAA,MAAA;AACI,MAAAvC,EAAA,MAAA,MAAA,GACAmC,EAAA9C,EAAA,KAAA;AAAA,IAA6B,GAGjCmD,IAAA,MAAA;AACI,MAAAL,EAAA9C,EAAA,MAAA;AAAA,IAA8B,GAGlCoD,IAAA,MAAA;AACI,MAAAN,EAAA9C,EAAA,cAAA;AAAA,IAAsC,GAO1CqD,IAAA,CAAAC,IAAA,OAAA;;AAEI,YAAAC,IAAA5C,EAAA,MAAA,MAAA;AASA,UANAA,EAAA,MAAA,MAAA,WACIK,EAAA,QAAAL,EAAA,MAAA,MAAA,SAKJ2C,KAAA,CAAAC;AACI;AAIJ,YAAAC,KAAA1B,IAAAjB,KAAA,gBAAAA,EAAA,UAAA,gBAAAiB,EAAA;AAGA,MAAA,CAAAyB,KAAA,SAAAA,GAAA,EAAA,IAAAC,IACIvC,EAAA,QAAA,SAGAA,EAAA,QAAAsC;AAAA,IACJ,GAGJE,IAAA,MAAA;AACI,MAAA9C,EAAA,MAAA,MAAA;AAAA,IAA4B;AAGhC,WAAA+C,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA,GAGJE,GAAA,MAAA;AACI,MAAAzC,IAAA0C,EAAAjD,EAAA,OAAA,MAAA;AACI,QAAA0C,EAAA,EAAA;AAAA,MAA0B,CAAA,GAG9BlC,IAAAyC,EAAA/C,EAAA,OAAA,MAAA;AACI,QAAAwC,EAAA;AAAA,MAAsB,CAAA,GAG1B/C,EAAA,SACIsB,EAAA;AAAA,IACJ,CAAA,GAGJiC,GAAA,MAAA;AACI,MAAA3C,KAAA,QAAAA,EAAA,cACAC,KAAA,QAAAA,EAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Y, computed as r, ref as T, toRefs as Z, provide as A, inject as D, onUnmounted as G } from "vue";
2
- import { B as P } from "./button.CufUNBkv.js";
3
- import { B as Q } from "./textarea.Y3yd_3ll.js";
2
+ import { B as P } from "./button.BX6ZJxF7.js";
3
+ import { B as Q } from "./textarea.Cf21WMwL.js";
4
4
  import { u as z } from "./i18n.BQkEbtPM.js";
5
- import { B as X } from "./button-actions.Cpx4PQp0.js";
5
+ import { B as X } from "./button-actions.CtFB6iRj.js";
6
6
  import { n as R } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
7
- import { B as tt } from "./date.BQ29-2L1.js";
8
- import { B as et } from "./link.v-y0fKjn.js";
9
- import { B as it } from "./tag.wTXg-O7i.js";
10
- import { B as at, d as st } from "./typography.Bu_WAKdf.js";
11
- import { B as nt, a as ot, S as rt } from "./structured-list-item.BEhWyaVP.js";
12
- import { g as lt } from "./generate-uid.D-HFI38h.js";
7
+ import { B as tt } from "./date.1zs9CRhw.js";
8
+ import { B as et } from "./link.UOEUR35A.js";
9
+ import { B as it } from "./tag.-YNhsBv7.js";
10
+ import { B as at, d as st } from "./typography.J1v_SPG3.js";
11
+ import { a as nt, B as ot, S as rt } from "./structured-list-item.BhBbmkbw.js";
12
+ import { g as lt } from "./generate-uid.NJ8tVoha.js";
13
13
  import { u as mt } from "./use-has-slot.C9lQZ6nz.js";
14
14
  import { r as ct, l as dt, t as I, a as k } from "./get-date-locale.BN8xEjY0.js";
15
15
  import { c as ut, a as _t } from "./index.DDnf1O9p.js";
@@ -212,8 +212,8 @@ const Et = wt.exports, Tt = {
212
212
  BentoLink: et,
213
213
  BentoTag: it,
214
214
  BentoTypography: at,
215
- BentoStructuredList: nt,
216
- BentoStructuredListItem: ot,
215
+ BentoStructuredList: ot,
216
+ BentoStructuredListItem: nt,
217
217
  SquareSmallIcon: Et
218
218
  },
219
219
  i18n: { messages: Tt },
@@ -377,4 +377,4 @@ export {
377
377
  H as d,
378
378
  qt as t
379
379
  };
380
- //# sourceMappingURL=timeline-item.CCV4U3Zx.js.map
380
+ //# sourceMappingURL=timeline-item.Cu5b-Mqj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-item.Cu5b-Mqj.js","sources":["../../../../node_modules/.pnpm/date-fns@2.28.0/node_modules/date-fns/esm/formatDistanceStrict/index.js","../../src/components/timeline/timeline.types.ts","../../src/components/timeline/timeline.keys.ts","../../src/components/timeline/timeline.vue","../../../../node_modules/.pnpm/@adyen+ui-assets-icons-16@4.1.0_vue@2.7.16/node_modules/@adyen/ui-assets-icons-16/dist/vue/square-small-fill.vue","../../src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 1000 * 60;\nvar MINUTES_IN_DAY = 60 * 24;\nvar MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;\nvar MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;\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 * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(2015, 0, 2),\n * new Date(2014, 6, 2)\n * ) //=> '6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 2)\n * ) //=> '6 months'\n * ```\n *\n * - `partialMethod` option is renamed to `roundingMethod`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { partialMethod: 'ceil' }\n * ) //=> '2 minutes'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { roundingMethod: 'ceil' }\n * ) //=> '2 minutes'\n * ```\n *\n * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`.\n *\n * - `unit` option now accepts one of the strings:\n * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { unit: 'm' }\n * )\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { unit: 'minute' }\n * )\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'\n * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws {RangeError} `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 default function formatDistanceStrict(dirtyDate, dirtyBaseDate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n requiredArgs(2, arguments);\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain localize.formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod);\n var roundingMethodFn;\n\n if (roundingMethod === 'floor') {\n roundingMethodFn = Math.floor;\n } else if (roundingMethod === 'ceil') {\n roundingMethodFn = Math.ceil;\n } else if (roundingMethod === 'round') {\n roundingMethodFn = Math.round;\n } else {\n throw new RangeError(\"roundingMethod must be 'floor', 'ceil' or 'round'\");\n }\n\n var milliseconds = dateRight.getTime() - dateLeft.getTime();\n var minutes = milliseconds / MILLISECONDS_IN_MINUTE;\n var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n\n var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;\n var unit;\n\n if (options.unit == null) {\n if (minutes < 1) {\n unit = 'second';\n } else if (minutes < 60) {\n unit = 'minute';\n } else if (minutes < MINUTES_IN_DAY) {\n unit = 'hour';\n } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {\n unit = 'day';\n } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {\n unit = 'month';\n } else {\n unit = 'year';\n }\n } else {\n unit = String(options.unit);\n } // 0 up to 60 seconds\n\n\n if (unit === 'second') {\n var seconds = roundingMethodFn(milliseconds / 1000);\n return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins\n } else if (unit === 'minute') {\n var roundedMinutes = roundingMethodFn(minutes);\n return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours\n } else if (unit === 'hour') {\n var hours = roundingMethodFn(minutes / 60);\n return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days\n } else if (unit === 'day') {\n var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months\n } else if (unit === 'month') {\n var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);\n return months === 12 && options.unit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date\n } else if (unit === 'year') {\n var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);\n return locale.formatDistance('xYears', years, localizeOptions);\n }\n\n throw new RangeError(\"unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\");\n}","import { BentoDateFormat } from '@/components/date/date.types';\nimport { BentoTag } from '@/components/tag';\nimport { 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\nexport type BentoTimelineRegisterEntry = (props: {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}) => { timelineEntries: Ref<BentoTimelineEntry[]>; index: number; unregisterTimelineEntry: () => void };\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<number[]>;\n timegapLimit: Ref<BentoTimelineGapObject>;\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 v-if=\"!showAddNoteTextArea\" variant=\"tertiary\" @click=\"toggleAddNote\">{{\n addNoteLabel\n }}</bento-button>\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @input=\"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 lang=\"ts\">\n import { computed, defineComponent, PropType, provide, Ref, ref, toRefs } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import {\n BentoTimelineConfigData,\n BentoTimelineEntry,\n BentoTimelineGapObject,\n BentoTimelineRegisterEntry,\n BentoTimelineShowMoreObject,\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 /**\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 components: { BentoButton, BentoButtonActions, BentoTextarea },\n props: {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote: {\n type: Boolean,\n default: false,\n },\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: {\n type: Object as PropType<BentoTimelineShowMoreObject>,\n default: null,\n },\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: {\n type: Object as PropType<BentoTimelineGapObject>,\n default: null,\n },\n },\n\n emits: ['add-timeline-note'],\n\n setup(props, { emit }) {\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 const showAddNoteTextArea = ref(false);\n const toggleAddNote = () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\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<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 visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n const timelineIndexes = Array.from(timelineEntries.value.keys());\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.slice(0, props.showMore.limit - 1),\n timelineIndexes[timelineIndexes.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes[0], ...timelineIndexes.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.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 // unregister timeline item if removed / destroyed\n const unregisterTimelineEntry = (tabIndexToRemove: number) => () => {\n timelineEntries.value = timelineEntries.value?.filter((_item, index) => index !== tabIndexToRemove);\n };\n\n const registerTimelineEntry: BentoTimelineRegisterEntry = ({ title, description, date }) => {\n // item index is the same as the length of the array BEFORE the item gets added\n // e.g. if the array is empty, length is 0 and the index of the item will also be 0\n const index = timelineEntries.value.length;\n\n // add entry to timeline entries\n timelineEntries.value.push({ title, description, date });\n\n // return values to the Timeline-Item component\n return { timelineEntries, index, unregisterTimelineEntry: unregisterTimelineEntry(index) };\n };\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\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\n return {\n addNoteLabel,\n cancelLabel,\n toggleAddNote,\n updateNoteContent,\n addNoteToTimeline,\n showAddNoteTextArea,\n };\n },\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=\"#00112C\" d=\"M5.5 3.25C4.25736 3.25 3.25 4.25736 3.25 5.5V10.5C3.25 11.7426 4.25736 12.75 5.5 12.75H10.5C11.7426 12.75 12.75 11.7426 12.75 10.5V5.5C12.75 4.25736 11.7426 3.25 10.5 3.25H5.5Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\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 >\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=\"entry in dataList\"\n :key=\"generateUid(entry.label)\"\n :label=\"entry.label\"\n >\n <bento-typography variant=\"caption\">{{ entry.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 lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, PropType, provide } 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 BentoTimelineConfigData,\n BentoTimelineDataList,\n BentoTimelineItemTitle,\n BentoTimelineItemVariant,\n BentoTimelineRegisterEntry,\n BentoTimelineStatus,\n BentoTimelineTagProps,\n BentoTimelineTimestamp,\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 * TimelineItem 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 components: {\n BentoButton,\n BentoDate,\n BentoLink,\n BentoTag,\n BentoTypography,\n BentoStructuredList,\n BentoStructuredListItem,\n SquareSmallIcon,\n },\n i18n: { messages },\n props: {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp: {\n type: Object as PropType<BentoTimelineTimestamp>,\n default: null,\n },\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList: {\n type: Array as PropType<BentoTimelineDataList>,\n default: null,\n },\n /**\n * Description of the event\n */\n description: {\n type: String,\n default: null,\n },\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status: {\n type: String as PropType<`${BentoTimelineStatus}`>,\n default: 'black',\n validator: (value: BentoTimelineStatus) => Object.values(BentoTimelineStatus).includes(value),\n },\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag: {\n type: Object as PropType<BentoTimelineTagProps>,\n default: undefined,\n },\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: {\n type: Object as PropType<BentoTimelineTimestamp>,\n required: true,\n },\n /**\n * Title of the event\n */\n title: {\n type: [Object, String] as PropType<BentoTimelineItemTitle | string>,\n default: null,\n },\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: {\n type: String,\n default: 'milestone',\n validator: (value: string) => ['milestone', 'note'].includes(value),\n },\n /**\n * Variant for the timeline item\n * @values DEFAULT, SUCCESS, CRITICAL\n *\n * @deprecated Use \"status\" prop instead\n */\n variant: {\n type: String as PropType<BentoTimelineItemVariant | `${BentoTimelineItemVariant}`>,\n default: null,\n validator: (value: BentoTimelineItemVariant) => Object.values(BentoTimelineItemVariant).includes(value),\n },\n },\n setup(props, { slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\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 // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, index, unregisterTimelineEntry } = registerTimelineEntry({\n title: props.title,\n date: props.timestamp.date,\n });\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 const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index)));\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 - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index];\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);\n const isLastItem = computed(() => index === timelineEntries.value.length - 1);\n\n return {\n // Values\n isNoteType,\n iconConditionalClasses,\n conditionalClasses,\n displayShowMoreButton,\n showAll,\n hiddenItems,\n isVisible,\n isLinkTitle,\n linkTitleProps,\n timegap,\n timegapAriaLabel,\n isLastItem,\n // Methods\n generateUid,\n hasSlot: useHasSlot(slots),\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["MILLISECONDS_IN_MINUTE","MINUTES_IN_DAY","MINUTES_IN_MONTH","MINUTES_IN_YEAR","formatDistanceStrict","dirtyDate","dirtyBaseDate","options","requiredArgs","locale$1","locale","comparison","compareAsc","localizeOptions","cloneObject","dateLeft","dateRight","toDate","roundingMethod","roundingMethodFn","milliseconds","minutes","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","unit","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","_sfc_main$2","defineComponent","messages$1","BentoButton","BentoButtonActions","BentoTextarea","props","emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","showAddNoteTextArea","toggleAddNote","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","visibleIndexes","timelineIndexes","showMoreIndex","unregisterTimelineEntry","tabIndexToRemove","_a","_item","index","registerTimelineEntry","title","description","date","configData","provide","uuid","_sfc_main$1","_sfc_main","BentoDate","BentoLink","BentoTag","BentoTypography","BentoStructuredList","BentoStructuredListItem","SquareSmallIcon","messages","value","slots","isNoteType","computedStatus","deprecate","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem","generateUid","useHasSlot"],"mappings":";;;;;;;;;;;;;;;;AAMA,IAAAA,IAAA,MAAA,IACAC,IAAA,KAAA,IACAC,IAAAD,IAAA,IACAE,IAAAF,IAAA;AAw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A,MAAAqB,MAAAZ,EAAA,MAAA,SAAA,CAAA;AAEA,WAAA;AAAA;AAAA,MAAA,YAAAgC;AAAA,MAEA,wBAAAG;AAAA,MACA,oBAAAC;AAAA,MACA,uBAAAa;AAAA,MACA,SAAA/C;AAAA,MACA,aAAAD;AAAA,MACA,WAAAwC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,SAAAC;AAAA,MACA,kBAAAI;AAAA,MACA,YAAAE;AAAA;AAAA,MACA,aAAAC;AAAA,MAEA,SAAAC,GAAArB,CAAA;AAAA,MACA,GAAA3C;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,4]}
@@ -2,10 +2,10 @@ import { defineComponent as B, 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.BLUwtRB-.js";
4
4
  import { u as L } from "./i18n.BQkEbtPM.js";
5
- import { B as N } from "./button.CufUNBkv.js";
6
- import { B as U } from "./typography.Bu_WAKdf.js";
5
+ import { B as N } from "./button.BX6ZJxF7.js";
6
+ import { B as U } from "./typography.J1v_SPG3.js";
7
7
  import { n as $ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
- import { u as O } from "./use-bento-toast-controller.BVVMh0wc.js";
8
+ import { u as O } from "./use-bento-toast-controller.Cn_2Eogn.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 t
170
170
  };
171
- //# sourceMappingURL=toast.BEipTIrz.js.map
171
+ //# sourceMappingURL=toast.DgJbW9CL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.BEipTIrz.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 { 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 { useBentoToastController } from '@/composables';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n import ToastItem from './components/toast-item/toast-item.vue';\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","pauseDismiss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AA;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.DgJbW9CL.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 { 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 { useBentoToastController } from '@/composables';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n import ToastItem from './components/toast-item/toast-item.vue';\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,QAAA,GAAA,QAAA,EAAA;AAEJ,cAAA,EAAA,QAAAE,GAAA,KAAAC,EAAA,IAAAV,EAAAQ,CAAA,EAAA,MAAA,IAAA,sBAAA;AACA,eAAA,EAAA,GAAAD,GAAA,QAAA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A,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,5 +1,5 @@
1
1
  import { defineComponent as u, computed as d, useSlots as c } from "vue";
2
- import { B as a } from "./button.CufUNBkv.js";
2
+ import { B as a } from "./button.BX6ZJxF7.js";
3
3
  import "./index.Cl4_42j5.js";
4
4
  import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
5
5
  import "../assets/toggle-button.css";
@@ -80,4 +80,4 @@ const x = v.exports;
80
80
  export {
81
81
  x as B
82
82
  };
83
- //# sourceMappingURL=toggle-button.CYplDIO-.js.map
83
+ //# sourceMappingURL=toggle-button.Cf8C7p6e.js.map