@adyen/bento-vue2 1.90.0 → 1.92.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 (271) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +372 -236
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/assets/accordion-item.css +1 -1
  7. package/dist/assets/action-bar.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions.css +1 -1
  10. package/dist/assets/card.css +1 -1
  11. package/dist/assets/checkbox-group.css +1 -1
  12. package/dist/assets/checkbox.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/date-picker.css +1 -1
  15. package/dist/assets/date-range-picker.css +1 -1
  16. package/dist/assets/dialog-page.css +1 -1
  17. package/dist/assets/draggable-handle.css +1 -1
  18. package/dist/assets/dropdown.css +1 -1
  19. package/dist/assets/error-message.css +1 -1
  20. package/dist/assets/field-label.css +1 -0
  21. package/dist/assets/file-uploader.css +1 -1
  22. package/dist/assets/filter-bar.css +1 -1
  23. package/dist/assets/form-layout-title.css +1 -1
  24. package/dist/assets/input-field.css +1 -1
  25. package/dist/assets/input-time.css +1 -1
  26. package/dist/assets/inspector.css +1 -1
  27. package/dist/assets/modal-fullscreen.css +1 -1
  28. package/dist/assets/secondary-nav.css +1 -1
  29. package/dist/assets/sidepanel.css +1 -1
  30. package/dist/assets/toggle.css +1 -1
  31. package/dist/assets/use-cached-selected-values.css +1 -1
  32. package/dist/button.js +1 -1
  33. package/dist/card.js +1 -1
  34. package/dist/checkbox.js +2 -2
  35. package/dist/chunks/{action-bar.B63qIiiH.js → action-bar.ChuPTyQG.js} +3 -3
  36. package/dist/chunks/{action-bar.B63qIiiH.js.map → action-bar.ChuPTyQG.js.map} +1 -1
  37. package/dist/chunks/{ai-tag.CCJCOdXu.js → ai-tag.Dt8nijLW.js} +2 -2
  38. package/dist/chunks/{ai-tag.CCJCOdXu.js.map → ai-tag.Dt8nijLW.js.map} +1 -1
  39. package/dist/chunks/{alert.CXRb-Smf.js → alert.CLqcPN0Q.js} +73 -55
  40. package/dist/chunks/alert.CLqcPN0Q.js.map +1 -0
  41. package/dist/chunks/{base-modal.DpmeDmq-.js → base-modal.DMdzcBrq.js} +4 -4
  42. package/dist/chunks/base-modal.DMdzcBrq.js.map +1 -0
  43. package/dist/chunks/{button-actions-with-menu.ChTUOsZl.js → button-actions-with-menu.CXFziNUr.js} +2 -2
  44. package/dist/chunks/{button-actions-with-menu.ChTUOsZl.js.map → button-actions-with-menu.CXFziNUr.js.map} +1 -1
  45. package/dist/chunks/{button-actions.BmU1DngD.js → button-actions.CXD6_9qN.js} +5 -5
  46. package/dist/chunks/button-actions.CXD6_9qN.js.map +1 -0
  47. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
  48. package/dist/chunks/button.C9b2AC9w.js.map +1 -1
  49. package/dist/chunks/calendar.rZsIZPxm.js +1232 -0
  50. package/dist/chunks/calendar.rZsIZPxm.js.map +1 -0
  51. package/dist/chunks/{card.WWUfBkqf.js → card.Brma5kdb.js} +2 -2
  52. package/dist/chunks/card.Brma5kdb.js.map +1 -0
  53. package/dist/chunks/{checkbox-group.CI0xDnql.js → checkbox-group.DWZvFkjz.js} +6 -6
  54. package/dist/chunks/checkbox-group.DWZvFkjz.js.map +1 -0
  55. package/dist/chunks/{checkbox.TsWA6O3Z.js → checkbox.BZP0wtnE.js} +20 -22
  56. package/dist/chunks/checkbox.BZP0wtnE.js.map +1 -0
  57. package/dist/chunks/{click-outside.CDz_x8mN.js → click-outside.BG01Sm0A.js} +2 -2
  58. package/dist/chunks/{click-outside.CDz_x8mN.js.map → click-outside.BG01Sm0A.js.map} +1 -1
  59. package/dist/chunks/{code-snippet.4DX9iUV8.js → code-snippet.DHAymIXp.js} +3 -3
  60. package/dist/chunks/code-snippet.DHAymIXp.js.map +1 -0
  61. package/dist/chunks/constructNow.CK0ryPil.js +8 -0
  62. package/dist/chunks/{constructNow.CIc7d13I.js.map → constructNow.CK0ryPil.js.map} +1 -1
  63. package/dist/chunks/{controls-group.D_KE99mg.js → controls-group.DSm2Ujwt.js} +2 -2
  64. package/dist/chunks/{controls-group.D_KE99mg.js.map → controls-group.DSm2Ujwt.js.map} +1 -1
  65. package/dist/chunks/country.types.jjXwaoMl.js.map +1 -1
  66. package/dist/chunks/{dashboard-section.TWlLdQHG.js → dashboard-section.D9rS8myE.js} +2 -2
  67. package/dist/chunks/{dashboard-section.TWlLdQHG.js.map → dashboard-section.D9rS8myE.js.map} +1 -1
  68. package/dist/chunks/{dashed-underline.CpDuQ3Fo.js → dashed-underline.D_FhFRXM.js} +2 -2
  69. package/dist/chunks/{dashed-underline.CpDuQ3Fo.js.map → dashed-underline.D_FhFRXM.js.map} +1 -1
  70. package/dist/chunks/{data-grid-template.DZaE-kOS.js → data-grid-template.CRijG20n.js} +2 -2
  71. package/dist/chunks/{data-grid-template.DZaE-kOS.js.map → data-grid-template.CRijG20n.js.map} +1 -1
  72. package/dist/chunks/{data-grid.x6cEW0az.js → data-grid.hMM9F36T.js} +540 -538
  73. package/dist/chunks/data-grid.hMM9F36T.js.map +1 -0
  74. package/dist/chunks/date-picker.BSo6Cvum.js +237 -0
  75. package/dist/chunks/date-picker.BSo6Cvum.js.map +1 -0
  76. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  77. package/dist/chunks/date-range-picker.D90k5b8p.js +1097 -0
  78. package/dist/chunks/date-range-picker.D90k5b8p.js.map +1 -0
  79. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  80. package/dist/chunks/{de.BJvo6njq.js → de.pvjpUJ1o.js} +2 -2
  81. package/dist/chunks/{de.BJvo6njq.js.map → de.pvjpUJ1o.js.map} +1 -1
  82. package/dist/chunks/{differenceInMonths.CIYECBxK.js → differenceInMonths.CpwVtHZX.js} +3 -2
  83. package/dist/chunks/{differenceInMonths.CIYECBxK.js.map → differenceInMonths.CpwVtHZX.js.map} +1 -1
  84. package/dist/chunks/{directive.rXUeDb8p.js → directive.Bfr4fuOy.js} +2 -2
  85. package/dist/chunks/{directive.rXUeDb8p.js.map → directive.Bfr4fuOy.js.map} +1 -1
  86. package/dist/{draggable-handle.js → chunks/draggable-handle.BR_aQH5N.js} +49 -40
  87. package/dist/chunks/draggable-handle.BR_aQH5N.js.map +1 -0
  88. package/dist/chunks/{dropdown-tag.t3FlJUSy.js → dropdown-tag.z3rsxbpW.js} +4 -4
  89. package/dist/chunks/dropdown-tag.z3rsxbpW.js.map +1 -0
  90. package/dist/chunks/dropdown.BYJwx-JD.js +1148 -0
  91. package/dist/chunks/dropdown.BYJwx-JD.js.map +1 -0
  92. package/dist/chunks/{en-GB.C3-QUpva.js → en-GB.-Q7Oq-nY.js} +2 -2
  93. package/dist/chunks/{en-GB.C3-QUpva.js.map → en-GB.-Q7Oq-nY.js.map} +1 -1
  94. package/dist/chunks/{en-US.YeSsZuOc.js → en-US.BK5uiAND.js} +5 -5
  95. package/dist/chunks/{en-US.YeSsZuOc.js.map → en-US.BK5uiAND.js.map} +1 -1
  96. package/dist/chunks/error-message.CyERcfdt.js +72 -0
  97. package/dist/chunks/error-message.CyERcfdt.js.map +1 -0
  98. package/dist/chunks/{es.DyUjjSL8.js → es.2H4LvTyV.js} +2 -2
  99. package/dist/chunks/{es.DyUjjSL8.js.map → es.2H4LvTyV.js.map} +1 -1
  100. package/dist/chunks/field-label.DjjjkcO6.js +97 -0
  101. package/dist/chunks/field-label.DjjjkcO6.js.map +1 -0
  102. package/dist/chunks/{file-uploader.Cig5gDXT.js → file-uploader.Djl0xaDN.js} +4 -4
  103. package/dist/chunks/{file-uploader.Cig5gDXT.js.map → file-uploader.Djl0xaDN.js.map} +1 -1
  104. package/dist/chunks/{filter-bar.x445KK3y.js → filter-bar.C9rWMIWO.js} +899 -882
  105. package/dist/chunks/filter-bar.C9rWMIWO.js.map +1 -0
  106. package/dist/chunks/{footer-actions.CIkul1OD.js → footer-actions.D9mHwk5l.js} +2 -2
  107. package/dist/chunks/{footer-actions.CIkul1OD.js.map → footer-actions.D9mHwk5l.js.map} +1 -1
  108. package/dist/chunks/{form-layout-title.DR5M7GP3.js → form-layout-title.zZVLCyqe.js} +71 -62
  109. package/dist/chunks/form-layout-title.zZVLCyqe.js.map +1 -0
  110. package/dist/chunks/{fr.JD_4GwS8.js → fr.Cu0IIfBP.js} +2 -2
  111. package/dist/chunks/{fr.JD_4GwS8.js.map → fr.Cu0IIfBP.js.map} +1 -1
  112. package/dist/chunks/{header-meta.BC5fdpD1.js → header-meta.BSPnWWmi.js} +14 -14
  113. package/dist/chunks/{header-meta.BC5fdpD1.js.map → header-meta.BSPnWWmi.js.map} +1 -1
  114. package/dist/chunks/{header-with-views.-cvdi9-L.js → header-with-views.g6J7x6l2.js} +10 -10
  115. package/dist/chunks/{header-with-views.-cvdi9-L.js.map → header-with-views.g6J7x6l2.js.map} +1 -1
  116. package/dist/chunks/{header.DtmZjxiU.js → header.DyZG7qWe.js} +3 -3
  117. package/dist/chunks/header.DyZG7qWe.js.map +1 -0
  118. package/dist/chunks/{input-field-password.Bdlw4dzr.js → input-field-password.CiDdI6A_.js} +4 -4
  119. package/dist/chunks/input-field-password.CiDdI6A_.js.map +1 -0
  120. package/dist/chunks/{input-field-phone-number.DPuWxBBz.js → input-field-phone-number.DFS58acU.js} +3 -3
  121. package/dist/chunks/{input-field-phone-number.DPuWxBBz.js.map → input-field-phone-number.DFS58acU.js.map} +1 -1
  122. package/dist/chunks/input-field.CGLjYab8.js +222 -0
  123. package/dist/chunks/input-field.CGLjYab8.js.map +1 -0
  124. package/dist/chunks/input-time.BhAUyKZM.js +135 -0
  125. package/dist/chunks/input-time.BhAUyKZM.js.map +1 -0
  126. package/dist/chunks/isSameWeek.TrpUOIn5.js +14 -0
  127. package/dist/chunks/{isSameWeek.CzBCmu7d.js.map → isSameWeek.TrpUOIn5.js.map} +1 -1
  128. package/dist/chunks/{it.BlUnV-yA.js → it.B65snrJA.js} +3 -3
  129. package/dist/chunks/{it.BlUnV-yA.js.map → it.B65snrJA.js.map} +1 -1
  130. package/dist/chunks/{ja.nUwDmVf2.js → ja.xGVfFSzL.js} +2 -2
  131. package/dist/chunks/{ja.nUwDmVf2.js.map → ja.xGVfFSzL.js.map} +1 -1
  132. package/dist/chunks/link.DB5g6d48.js.map +1 -1
  133. package/dist/chunks/{modal-fullscreen.CaxuXW-H.js → modal-fullscreen.De6mevyD.js} +2 -2
  134. package/dist/chunks/{modal-fullscreen.CaxuXW-H.js.map → modal-fullscreen.De6mevyD.js.map} +1 -1
  135. package/dist/chunks/{modal.Brif0vAy.js → modal.BXxwn9H4.js} +93 -91
  136. package/dist/chunks/{modal.Brif0vAy.js.map → modal.BXxwn9H4.js.map} +1 -1
  137. package/dist/chunks/on-click-outside.Cy1eFULD.js +109 -0
  138. package/dist/chunks/on-click-outside.Cy1eFULD.js.map +1 -0
  139. package/dist/chunks/{pagination.BmrU_sn_.js → pagination.BzsKZFnw.js} +37 -37
  140. package/dist/chunks/{pagination.BmrU_sn_.js.map → pagination.BzsKZFnw.js.map} +1 -1
  141. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  142. package/dist/chunks/popover.types.hA13DZPg.js.map +1 -1
  143. package/dist/chunks/popper-container.C_n9Ds1W.js.map +1 -1
  144. package/dist/chunks/promo-banner.Dc_kK1x9.js.map +1 -1
  145. package/dist/chunks/{pt-BR.BCU2Hj36.js → pt-BR.D9FuAQZm.js} +2 -2
  146. package/dist/chunks/{pt-BR.BCU2Hj36.js.map → pt-BR.D9FuAQZm.js.map} +1 -1
  147. package/dist/chunks/{radio-group.5oS-AeYN.js → radio-group.Bb-L-0io.js} +3 -3
  148. package/dist/chunks/radio-group.Bb-L-0io.js.map +1 -0
  149. package/dist/chunks/{rich-text-editor.DSGTe8Zt.js → rich-text-editor.DPpIzYid.js} +7 -6
  150. package/dist/chunks/{rich-text-editor.DSGTe8Zt.js.map → rich-text-editor.DPpIzYid.js.map} +1 -1
  151. package/dist/chunks/{search-bar.CNfoeLLt.js → search-bar.BEOieKeA.js} +4 -4
  152. package/dist/chunks/{search-bar.CNfoeLLt.js.map → search-bar.BEOieKeA.js.map} +1 -1
  153. package/dist/chunks/{secondary-nav.IF5CgeIP.js → secondary-nav.BBL5zZPK.js} +2 -2
  154. package/dist/chunks/{secondary-nav.IF5CgeIP.js.map → secondary-nav.BBL5zZPK.js.map} +1 -1
  155. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
  156. package/dist/chunks/{selection-card-group.DZjFeQKR.js → selection-card-group.CLJPaknG.js} +10 -10
  157. package/dist/chunks/{selection-card-group.DZjFeQKR.js.map → selection-card-group.CLJPaknG.js.map} +1 -1
  158. package/dist/chunks/{sidepanel.DZDXuyzg.js → sidepanel.nW0Bhk_u.js} +4 -4
  159. package/dist/chunks/{sidepanel.DZDXuyzg.js.map → sidepanel.nW0Bhk_u.js.map} +1 -1
  160. package/dist/chunks/{startOfWeek.CXhhX-R7.js → startOfWeek.Br5KM4z_.js} +2 -2
  161. package/dist/chunks/{startOfWeek.CXhhX-R7.js.map → startOfWeek.Br5KM4z_.js.map} +1 -1
  162. package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
  163. package/dist/chunks/{summary-grid.types.CrPNQbX0.js → summary-grid.types.Dp_efYVN.js} +2 -2
  164. package/dist/chunks/{summary-grid.types.CrPNQbX0.js.map → summary-grid.types.Dp_efYVN.js.map} +1 -1
  165. package/dist/chunks/tag.D2xagTJv.js.map +1 -1
  166. package/dist/chunks/{textarea.Bi53QF5Q.js → textarea.CJS-1I41.js} +5 -4
  167. package/dist/chunks/textarea.CJS-1I41.js.map +1 -0
  168. package/dist/chunks/{timeline-item.C6Bi0eam.js → timeline-item.CF9jbIRr.js} +5 -5
  169. package/dist/chunks/timeline-item.CF9jbIRr.js.map +1 -0
  170. package/dist/chunks/{toggle.B1z1YPe_.js → toggle.Ca-MM3dt.js} +3 -5
  171. package/dist/chunks/toggle.Ca-MM3dt.js.map +1 -0
  172. package/dist/chunks/tooltip.BxtnF3is.js.map +1 -1
  173. package/dist/chunks/{tutorial.BCiZMLJE.js → tutorial.CoWDVs7_.js} +2 -2
  174. package/dist/chunks/{tutorial.BCiZMLJE.js.map → tutorial.CoWDVs7_.js.map} +1 -1
  175. package/dist/chunks/typography.C8lPlsbD.js.map +1 -1
  176. package/dist/chunks/use-cached-selected-values.Du8-wWR2.js +1520 -0
  177. package/dist/chunks/use-cached-selected-values.Du8-wWR2.js.map +1 -0
  178. package/dist/chunks/{use-date-input-formatter.DRMt9yR2.js → use-date-input-formatter.ibZeLD_V.js} +4 -4
  179. package/dist/chunks/{use-date-input-formatter.DRMt9yR2.js.map → use-date-input-formatter.ibZeLD_V.js.map} +1 -1
  180. package/dist/chunks/use-touch-device.DTqFAbXh.js +11 -0
  181. package/dist/chunks/use-touch-device.DTqFAbXh.js.map +1 -0
  182. package/dist/chunks/{zh-CN.ChYkuQAR.js → zh-CN.Be4pa3-g.js} +3 -3
  183. package/dist/chunks/{zh-CN.ChYkuQAR.js.map → zh-CN.Be4pa3-g.js.map} +1 -1
  184. package/dist/click-outside.js +1 -1
  185. package/dist/code-snippet.js +1 -1
  186. package/dist/dashboard-template.js +1 -1
  187. package/dist/dashed-underline.js +1 -1
  188. package/dist/data-grid-template.js +1 -1
  189. package/dist/data-grid.js +1 -1
  190. package/dist/date-picker.js +2 -2
  191. package/dist/date-range-picker.js +2 -2
  192. package/dist/draggable.js +1396 -0
  193. package/dist/draggable.js.map +1 -0
  194. package/dist/dropdown.js +11 -12
  195. package/dist/dropdown.js.map +1 -1
  196. package/dist/file-uploader.js +1 -1
  197. package/dist/filter-bar.js +1 -1
  198. package/dist/form-layout.js +1 -1
  199. package/dist/header-with-views.js +1 -1
  200. package/dist/header.js +1 -1
  201. package/dist/index.js +274 -271
  202. package/dist/index.js.map +1 -1
  203. package/dist/input-field-password.js +1 -1
  204. package/dist/input-field-phone-number.js +1 -1
  205. package/dist/input-field.js +1 -1
  206. package/dist/input-time.js +1 -1
  207. package/dist/internal.js +24 -23
  208. package/dist/internal.js.map +1 -1
  209. package/dist/menu.js +1 -1
  210. package/dist/modal-fullscreen.js +1 -1
  211. package/dist/modal.js +2 -2
  212. package/dist/pagination.js +1 -1
  213. package/dist/popover.js +1 -1
  214. package/dist/radio-group.js +1 -1
  215. package/dist/rich-text-editor.js +1 -1
  216. package/dist/search-bar.js +2 -2
  217. package/dist/secondary-nav.js +1 -1
  218. package/dist/selection-card.js +1 -1
  219. package/dist/sidepanel.js +1 -1
  220. package/dist/summary-grid.js +1 -1
  221. package/dist/textarea.js +1 -1
  222. package/dist/timeline.js +1 -1
  223. package/dist/toggle.js +1 -1
  224. package/dist/tutorial.js +1 -1
  225. package/dist/web-types.json +144 -7
  226. package/package.json +8 -13
  227. package/dist/assets/dropdown-default-textbox.css +0 -1
  228. package/dist/chunks/alert.CXRb-Smf.js.map +0 -1
  229. package/dist/chunks/base-modal.DpmeDmq-.js.map +0 -1
  230. package/dist/chunks/button-actions.BmU1DngD.js.map +0 -1
  231. package/dist/chunks/calendar.uvIGF_jU.js +0 -1154
  232. package/dist/chunks/calendar.uvIGF_jU.js.map +0 -1
  233. package/dist/chunks/card.WWUfBkqf.js.map +0 -1
  234. package/dist/chunks/checkbox-group.CI0xDnql.js.map +0 -1
  235. package/dist/chunks/checkbox.TsWA6O3Z.js.map +0 -1
  236. package/dist/chunks/code-snippet.4DX9iUV8.js.map +0 -1
  237. package/dist/chunks/constructNow.CIc7d13I.js +0 -8
  238. package/dist/chunks/data-grid.x6cEW0az.js.map +0 -1
  239. package/dist/chunks/date-picker.Dln8ocL4.js +0 -222
  240. package/dist/chunks/date-picker.Dln8ocL4.js.map +0 -1
  241. package/dist/chunks/date-range-picker.DPGy2h-9.js +0 -1068
  242. package/dist/chunks/date-range-picker.DPGy2h-9.js.map +0 -1
  243. package/dist/chunks/debounce.DUTu11PS.js +0 -10
  244. package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
  245. package/dist/chunks/dropdown-default-textbox.CjhLIxVq.js +0 -364
  246. package/dist/chunks/dropdown-default-textbox.CjhLIxVq.js.map +0 -1
  247. package/dist/chunks/dropdown-tag.t3FlJUSy.js.map +0 -1
  248. package/dist/chunks/dropdown.CvNI2V33.js +0 -790
  249. package/dist/chunks/dropdown.CvNI2V33.js.map +0 -1
  250. package/dist/chunks/error-message.BUNKRa_w.js +0 -160
  251. package/dist/chunks/error-message.BUNKRa_w.js.map +0 -1
  252. package/dist/chunks/filter-bar.x445KK3y.js.map +0 -1
  253. package/dist/chunks/form-layout-title.DR5M7GP3.js.map +0 -1
  254. package/dist/chunks/header.DtmZjxiU.js.map +0 -1
  255. package/dist/chunks/input-field-password.Bdlw4dzr.js.map +0 -1
  256. package/dist/chunks/input-field.DH25CU_G.js +0 -207
  257. package/dist/chunks/input-field.DH25CU_G.js.map +0 -1
  258. package/dist/chunks/input-time.6eJ4-QdU.js +0 -92
  259. package/dist/chunks/input-time.6eJ4-QdU.js.map +0 -1
  260. package/dist/chunks/isSameWeek.CzBCmu7d.js +0 -14
  261. package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
  262. package/dist/chunks/on-click-outside.BW4rkhzG.js.map +0 -1
  263. package/dist/chunks/radio-group.5oS-AeYN.js.map +0 -1
  264. package/dist/chunks/textarea.Bi53QF5Q.js.map +0 -1
  265. package/dist/chunks/timeline-item.C6Bi0eam.js.map +0 -1
  266. package/dist/chunks/toggle.B1z1YPe_.js.map +0 -1
  267. package/dist/chunks/use-cached-selected-values.Bn3Y8Iuq.js +0 -1450
  268. package/dist/chunks/use-cached-selected-values.Bn3Y8Iuq.js.map +0 -1
  269. package/dist/chunks/warning-filled.CbJ1pcB2.js +0 -24
  270. package/dist/chunks/warning-filled.CbJ1pcB2.js.map +0 -1
  271. package/dist/draggable-handle.js.map +0 -1
@@ -1,91 +0,0 @@
1
- import { watch as P } from "vue";
2
- import { n as A, u as a, r as k, d as w, i as v } from "./utils.BzUwtTXc.js";
3
- const I = (o) => typeof o == "string";
4
- function h(...o) {
5
- let c, n, r, l;
6
- if (I(o[0]) || Array.isArray(o[0]) ? ([n, r, l] = o, c = w) : [c, n, r, l] = o, !c)
7
- return A;
8
- Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
9
- const f = [], m = () => {
10
- f.forEach((s) => s()), f.length = 0;
11
- }, i = (s, p, t, e) => (s.addEventListener(p, t, e), () => s.removeEventListener(p, t, e)), d = P(
12
- () => [a(c), k(l)],
13
- ([s, p]) => {
14
- m(), s && f.push(
15
- ...n.flatMap(
16
- (t) => r.map(
17
- (e) => i(
18
- s,
19
- t,
20
- e,
21
- p
22
- )
23
- )
24
- )
25
- );
26
- },
27
- { immediate: !0, flush: "post" }
28
- );
29
- return () => {
30
- d(), m();
31
- };
32
- }
33
- let E = !1;
34
- function W(o, c, n = {}) {
35
- const { window: r = w, ignore: l = [], capture: f = !0, detectIframe: m = !1 } = n;
36
- if (!r)
37
- return;
38
- v && !E && (E = !0, Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", A)));
39
- let i = !0;
40
- const d = (t) => (
41
- // eslint-disable-next-line @typescript-eslint/no-shadow
42
- l.some((e) => {
43
- if (typeof e == "string")
44
- return Array.from(r.document.querySelectorAll(e)).some(
45
- (y) => y === t.target || t.composedPath().includes(y)
46
- );
47
- const u = a(e);
48
- return u && (t.target === u || t.composedPath().includes(u));
49
- })
50
- ), s = [
51
- h(r, "click", (t) => {
52
- const e = a(o);
53
- if (!(!e || e === t.target || t.composedPath().includes(e))) {
54
- if (t.detail === 0 && (i = !d(t)), !i) {
55
- i = !0;
56
- return;
57
- }
58
- c(t);
59
- }
60
- }, { passive: !0, capture: f }),
61
- h(
62
- r,
63
- "pointerdown",
64
- (t) => {
65
- const e = a(o);
66
- e && (i = !t.composedPath().includes(e) && !d(t));
67
- },
68
- { passive: !0 }
69
- ),
70
- h(
71
- r,
72
- "pointerup",
73
- (t) => {
74
- const e = a(o);
75
- e && (i = i && !t.composedPath().includes(e) && !d(t));
76
- },
77
- { passive: !0 }
78
- ),
79
- m && h(r, "blur", (t) => {
80
- var u;
81
- const e = a(o);
82
- ((u = r.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(e != null && e.contains(r.document.activeElement)) && c(t);
83
- })
84
- ].filter(Boolean);
85
- return () => s.forEach((t) => t());
86
- }
87
- export {
88
- W as o,
89
- h as u
90
- };
91
- //# sourceMappingURL=on-click-outside.BW4rkhzG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"on-click-outside.BW4rkhzG.js","sources":["../../src/directives/click-outside/useEventListener/index.ts","../../src/directives/click-outside/on-click-outside.ts"],"sourcesContent":["import type { Fn } from '@/types/functions';\nimport type { MaybeComputedRef } from '@/types/refs';\nimport type { Arrayable, GeneralEventListener } from './types';\nimport { watch } from 'vue';\nimport { defaultWindow, noop, resolveUnref, unrefElement } from '../utils';\n\n/**\n * Verify type of input value\n * @param val Value to be evaluated as string\n * @returns {boolean} true if the value is a \"string\", false if it's something else\n */\nconst isString = (val: unknown): val is string => typeof val === 'string';\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 1: Omitted Window target\n *\n * @see https://vueuse.org/useEventListener\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof WindowEventMap>(\n event: Arrayable<E>,\n listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 2: Explicitly Window target\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof WindowEventMap>(\n target: Window,\n event: Arrayable<E>,\n listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 3: Explicitly Document target\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof DocumentEventMap>(\n target: DocumentOrShadowRoot,\n event: Arrayable<E>,\n listener: Arrayable<(this: Document, ev: DocumentEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 4: Custom event target with event type infer\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<Names extends string, EventType = Event>(\n target: EventTarget,\n event: Arrayable<Names>,\n listener: Arrayable<GeneralEventListener<EventType>>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 5: Custom event target fallback\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<EventType = Event>(\n target: MaybeComputedRef<EventTarget | null | undefined>,\n event: Arrayable<string>,\n listener: Arrayable<GeneralEventListener<EventType>>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\nexport function useEventListener(...args) {\n let target: MaybeComputedRef<EventTarget> | undefined;\n let events: Arrayable<string>;\n let listeners: Arrayable<EventListenerOrEventListenerObject>;\n let options: MaybeComputedRef<boolean | AddEventListenerOptions> | undefined;\n\n if (isString(args[0]) || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n\n if (!target) {\n return noop;\n }\n\n if (!Array.isArray(events)) {\n events = [events];\n }\n\n if (!Array.isArray(listeners)) {\n listeners = [listeners];\n }\n\n const cleanups: Array<() => void> = [];\n const cleanup = () => {\n cleanups.forEach(fn => fn());\n cleanups.length = 0;\n };\n\n const register = (\n el: EventTarget,\n event: string,\n listener: EventListenerOrEventListenerObject,\n registerOptions: boolean | AddEventListenerOptions\n ) => {\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n el.addEventListener(event, listener, registerOptions);\n return () => el.removeEventListener(event, listener, registerOptions);\n };\n\n const stopWatch = watch(\n () => [unrefElement(target as any), resolveUnref(options)],\n ([el, stopWatchOptions]) => {\n cleanup();\n\n if (!el) {\n return;\n }\n\n cleanups.push(\n ...(events as Array<string>).flatMap(event =>\n (listeners as Array<EventListenerOrEventListenerObject>).map(listener =>\n register(\n el as EventTarget,\n event,\n listener as EventListenerOrEventListenerObject,\n stopWatchOptions as boolean | AddEventListenerOptions\n )\n )\n )\n );\n },\n { immediate: true, flush: 'post' }\n );\n\n const stop = () => {\n stopWatch();\n cleanup();\n };\n\n return stop;\n}\n","import type { Fn } from '@/types/functions';\nimport type { MaybeElementRef } from '@/types/elements';\nimport type { OnClickOutsideHandler, OnClickOutsideOptions } from './types';\nimport { useEventListener } from './useEventListener';\nimport { defaultWindow, isIOS, noop, unrefElement } from './utils';\n\n// eslint-disable-next-line no-underscore-dangle\nlet _iOSWorkaround = false;\n\n/**\n * Listen for clicks outside of an element.\n *\n * @see https://vueuse.org/onClickOutside\n * @param target\n * @param handler\n * @param options\n */\nexport function onClickOutside<T extends OnClickOutsideOptions>(\n target: MaybeElementRef,\n handler: OnClickOutsideHandler,\n options: T = {} as T\n) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n\n if (!window) {\n return;\n }\n\n // Fixes \"onClickOutside not working on Safari iOS\": https://github.com/vueuse/vueuse/issues/1520\n // How it works: https://stackoverflow.com/a/39712411\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n Array.from(window.document.body.children).forEach((el: Element) => el.addEventListener('click', noop));\n }\n\n let shouldListen = true;\n\n const shouldIgnore = (event: PointerEvent) =>\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ignore.some(target => {\n if (typeof target === 'string') {\n return Array.from(window.document.querySelectorAll(target)).some(\n (el: Element) => el === event.target || event.composedPath().includes(el)\n );\n }\n\n const el = unrefElement(target as any) as EventTarget;\n return el && (event.target === el || event.composedPath().includes(el));\n });\n\n const listener = (event: PointerEvent) => {\n const el = unrefElement(target as any) as EventTarget;\n\n if (!el || el === event.target || event.composedPath().includes(el)) {\n return;\n }\n\n if (event.detail === 0) {\n shouldListen = !shouldIgnore(event);\n }\n\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n\n handler(event);\n };\n\n const cleanup = [\n useEventListener(window, 'click', listener, { passive: true, capture }),\n useEventListener(\n window,\n 'pointerdown',\n e => {\n const el = unrefElement(target as any) as EventTarget;\n if (el) {\n shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);\n }\n },\n { passive: true }\n ),\n useEventListener(\n window,\n 'pointerup',\n e => {\n const el = unrefElement(target as any) as EventTarget;\n if (el) {\n shouldListen = shouldListen && !e.composedPath().includes(el) && !shouldIgnore(e);\n }\n },\n { passive: true }\n ),\n detectIframe &&\n useEventListener(window, 'blur', event => {\n const el: Element = unrefElement(target as any);\n if (\n window.document.activeElement?.tagName === 'IFRAME' &&\n !el?.contains(window.document.activeElement)\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handler(event as any);\n }\n }),\n ].filter(Boolean) as Array<Fn>;\n\n const stop = () => cleanup.forEach(fn => fn());\n\n // eslint-disable-next-line consistent-return\n return stop;\n}\n"],"names":["isString","val","useEventListener","args","target","events","listeners","options","defaultWindow","noop","cleanups","cleanup","fn","register","el","event","listener","registerOptions","stopWatch","watch","unrefElement","resolveUnref","stopWatchOptions","_iOSWorkaround","onClickOutside","handler","window","ignore","capture","detectIframe","isIOS","shouldListen","shouldIgnore","e","_a"],"mappings":";;AAWA,MAAMA,IAAW,CAACC,MAAgC,OAAOA,KAAQ;AA0F1D,SAASC,KAAoBC,GAA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AAA,IAEpB/B;AAAA,MACIwB;AAAA,MACA;AAAA,MACA,CAAAO,MAAK;AACD,cAAMnB,IAAKM,EAAahB,CAAa;AACrC,QAAIU,MACAiB,IAAeA,KAAgB,CAACE,EAAE,aAAA,EAAe,SAASnB,CAAE,KAAK,CAACkB,EAAaC,CAAC;AAAA,MAExF;AAAA,MACA,EAAE,SAAS,GAAA;AAAA,IAAK;AAAA,IAEpBJ,KACI3B,EAAiBwB,GAAQ,QAAQ,CAAAX,MAAS;;AACtC,YAAMD,IAAcM,EAAahB,CAAa;AAC9C,QACI8B,IAAAR,EAAO,SAAS,kBAAhB,gBAAAQ,EAA+B,aAAY,YAC3C,EAACpB,KAAA,QAAAA,EAAI,SAASY,EAAO,SAAS,mBAG9BD,EAAQV,CAAY;AAAA,IAE5B,CAAC;AAAA,EAAA,EACP,OAAO,OAAO;AAKhB,SAHa,MAAMJ,EAAQ,QAAQ,CAAAC,MAAMA,GAAI;AAIjD;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio-group.5oS-AeYN.js","sources":["../../src/components/radio-group/components/radio-button/radio-button.vue","../../src/components/radio-group/radio-group.types.ts","../../src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n ref=\"radioInputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, type PropType, ref, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, type BentoRadioButtonTag, type BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n const radioInputRef = ref(null);\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n\n const focus = () => {\n radioInputRef.value.focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { FormField, FormFieldEmits } from '../../types/form-field';\nimport type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport type BentoRadioGroupEmits = FormFieldEmits<BentoRadioGroupValue>;\n\nexport interface BentoRadioGroupProps extends FormField {\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n * @default null\n */\n formId?: string | null;\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n * @deprecated Use \"errorMessage\" prop instead\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Shows/hides the group label.\n * @default null\n */\n hideLabel?: boolean | null;\n\n /**\n * The radio group's items.\n * Required.\n */\n items: BentoRadioGroupItems;\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * Required.\n */\n label: string;\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n * @default null\n */\n modelValue?: BentoRadioGroupValue | null;\n\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @default BentoRadioGroupVariant.VERTICAL\n */\n variant?: BentoRadioGroupVariant | `${BentoRadioGroupVariant}`;\n}\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :aria-required=\"required\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n role=\"radiogroup\"\n :aria-readonly=\"isReadOnly\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n ref=\"radioButton\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onUpdateModelValue\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n <template v-if=\"hasSlot('description')\" #description>\n <slot name=\"description\" />\n </template>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { type BentoRadioGroupEmits, type BentoRadioGroupProps, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"update:model-value\", \"input\"]);\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: null,\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hasError: { type: Boolean, default: false },\n hideLabel: { type: Boolean, default: null },\n items: null,\n modelValue: { default: null },\n variant: { default: BentoRadioGroupVariant.VERTICAL }\n});\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits(emit);\n const radioButton = ref(null);\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onUpdateModelValue = value => {\n emitValue(value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n\n const focus = () => {\n radioButton.value[0].focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","value","toRefs","props","radioButtonId","generateUid","descriptionId","radioInputRef","ref","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","onChange","emit","focus","expose","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","emitValue","useFormFieldEmits","radioButton","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onUpdateModelValue","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;;AA4KI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7HAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAoDA,EAAA,OAAAI,EAAA,IAAAC,EAAAC,CAAA,GACAC,IAAAC,EAAA,oBAAA,GACAC,IAAAD,EAAA,aAAA,GACAE,IAAAC,EAAA,IAAA;AAEA,IAAAC,EAAA,sBAAAZ,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAa,IAAAC,EAAA,OAAA;AAAA,MAAkD,CAAA,mBAAAC,EAAA,QAAA,EAAA,GAAAT,EAAA;AAAA,MACoB,CAAA,mBAAAS,EAAA,QAAA,EAAA,GAAAT,EAAA;AAAA,IACA,EAAA,GAGtEU,IAAAC,EAAA;AAAA,MAA+B,WAAAC,EAAAlB,CAAA,EAAA,SAAA;AAAA,MACY,OAAAI,EAAA;AAAA,IAC1B,CAAA,GAGjBe,IAAAL,EAAA,MAAAR,EAAA,UAAAA,EAAA,UAAA,GAEAc,IAAA,MAAA;AACI,MAAA,CAAAd,EAAA,YAAA,CAAAA,EAAA,aACIe,EAAA,sBAAAf,EAAA,KAAA,GACAe,EAAA,SAAAf,EAAA,KAAA;AAAA,IACJ,GAGJgB,IAAA,MAAA;AACI,MAAAZ,EAAA,MAAA,MAAA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AAAA,MACJ;AAAA,MACJ;AAAA,QACA,WAAA;AAAA,MACe;AAAA,IACf;AAGJ,UAAAtB,IAAA,MAAA;AACI,MAAAa,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,IAA2B;AAG/B,WAAAZ,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"textarea.Bi53QF5Q.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\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 UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: string;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\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 :required=\"required\"\n :aria-required=\"required\"\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 @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\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, 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 import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BBorderWidthAttention } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, 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 description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: '' },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n ariaLabel: { default: undefined },\n characterLimit: { default: undefined },\n clearable: { type: Boolean, default: false },\n height: { default: null },\n resizable: { default: 'both' },\n value: { default: '' },\n modelValue: { 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.modelValue || props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => [props.value, props.modelValue],\n () => {\n textareaValue.value = props.modelValue || props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\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`]: isDynamicHeight.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 emitValue('');\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 emitValue(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 const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\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 if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\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 (isDynamicHeight.value) {\n calculateHeight();\n }\n\n if (props.value) {\n deprecate(\n 'BentoTextarea \"value\" property',\n `The use of \"value\" prop in \"BentoTextarea\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BBorderWidthAttention);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BBorderWidthAttention","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","counter","computed","_a","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","focus","expose","onMounted","observeSizeOfElement","deprecate","onUnmounted"],"mappings":";;;;;;;;;;;;;;AAYO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,SAAA,U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;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeline-item.C6Bi0eam.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../src/components/timeline/timeline.types.ts","../../src/components/timeline/timeline.keys.ts","../../src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { type BentoDashedUnderlineProps } from '@/components/dashed-underline/dashed-underline.types';\nimport { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated \"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 description?: BentoDashedUnderlineProps;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\n/**\n * @deprecated from version 2.0.0.\n */\nexport type BentoTimelineRegisterEntry = (props: {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; index: number; unregisterTimelineEntry: () => void };\n\n/**\n * @private\n */\nexport type BentoInternalTimelineRegisterEntry = (\n entry: BentoTimelineEntry\n) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; unregisterTimelineEntry: () => void };\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n\nexport interface BentoTimelineProps {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote?: boolean;\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore?: BentoTimelineShowMoreObject;\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit?: BentoTimelineGapObject;\n}\n\nexport interface BentoTimelineItemProps {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp?: BentoTimelineTimestamp;\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList?: BentoTimelineDataList;\n /**\n * Description of the event\n */\n description?: string;\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status?: string;\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag?: BentoTimelineTagProps;\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: BentoTimelineTimestamp;\n /**\n * Title of the event\n */\n title?: BentoTimelineItemTitle | string;\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type?: string;\n /**\n * Variant for the timeline item\n * @values DEFAULT, SUCCESS, CRITICAL\n *\n * @deprecated Use \"status\" prop instead\n */\n variant?: BentoTimelineItemVariant | `${BentoTimelineItemVariant}`;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @update:model-value=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import {\n type BentoInternalTimelineRegisterEntry,\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineProps,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n addNote: { type: Boolean, default: false },\n showMore: { default: null },\n timegapLimit: { default: null }\n});\n\n const emit = defineEmits(['add-timeline-note']);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n</script>\n<script lang=\"ts\">\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n\n <bento-dashed-underline v-if=\"timestamp.description\" v-bind=\"timestamp.description\">\n {{ timestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>{{ timestamp.value }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n\n <bento-dashed-underline\n v-if=\"additionalTimestamp.description\"\n v-bind=\"additionalTimestamp.description\"\n >\n {{ additionalTimestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>\n {{ additionalTimestamp.value }}\n </span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"listEntry in dataList\"\n :key=\"generateUid(listEntry.label)\"\n :label=\"listEntry.label\"\n >\n <bento-typography variant=\"caption\">{{ listEntry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, useSlots } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineItemProps,\n type BentoTimelineItemTitle,\n BentoTimelineItemVariant,\n type BentoTimelineRegisterEntry,\n } from '../../timeline.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n additionalTimestamp: { default: null },\n dataList: { default: null },\n description: { default: null },\n status: { default: 'black' },\n tag: { default: undefined },\n timestamp: null,\n title: { default: null },\n type: { default: 'milestone' },\n variant: { default: null }\n});\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const isNoteType = computed(() => props.type === 'note');\n\n // Handle variant deprecation, by setting `critical` and `success` variants to their respective colors\n const computedStatus = computed(() => {\n if (props.variant === BentoTimelineItemVariant.CRITICAL) {\n return 'red';\n }\n\n if (props.variant === BentoTimelineItemVariant.SUCCESS) {\n return 'green';\n }\n\n return props.status;\n });\n\n if (props.variant) {\n deprecate(\n 'BentoTimelineItem \"variant\" property',\n `Use the BentoTimelineItem \"status\" modifier instead to modify the color of the timeline icon.\n <bento-timeline-item status=\"red\" />`,\n '2.0.0'\n );\n }\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${computedStatus.value}`]: computedStatus.value && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)));\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n i18n: { messages },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","_a","_b","addNoteToTimeline","emit","timelineEntries","hiddenItems","props","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","uuid","_sfc_main$1","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","computedStatus","deprecate","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAmGO,SAAAA,EAAAC,GAAAC,GAAAC,GAAA;AACP,QAAAC,IAAAC,GAAA,GACAC,KAAAH,KAAA,gBAAAA,EAAA,WAAAC,EAAA,UAAAG,IAEAC,IAAAC,GAAAR,GAAAC,CAAA;AAEA,MAAA,MAAAM,CAAA;AACA,UAAA,IAAA,WAAA,oBAAA;AAGA,QAAAE,IAAA,OAAA,OAAA,CAAA,GAAAP,GAAA;AAAA,IACA,WAAAA,KAAA,gBAAAA,EAAA;AAAA,IACA,YAA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AAI,EAAA,MAAAc,EAAA,QAAA,CAAA,MAAA,gBAAAlB,EAAA,MACA8C,IAAAN,EAAA,SAAA7B,EAAA,MAAA,SAAAO,EAAA,QAAA,CAAA;AACA,UAAA,CAAA2B,KAAA,CAAAC;AACI,eAAA;AAEJ,YAAA,EAAA,MAAAC,EAAA,IAAA3C,EAAA,MAAAc,EAAA,KAAA,GACA8B,IAAA;AAAA,QAA8B5G,EAAAyG,GAAAE,GAAA,EAAA,MAAAvC,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAwC,IAAA5G,EAAAyG,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAA5D,EAAA,MAAAuD,EAAA,QAAA,EAAA,WAAA,EAAA,SAAAA,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAA7D,EAAA,MAAAgB,EAAA,SAAAO,EAAA,UAAAM,EAAA,KAAA,GACAiC,IAAA9D,EAAA,MAEI6B,EAAA,UAAA,MAAAA,EAAA,UAAAd,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle.B1z1YPe_.js","sources":["../../src/components/toggle/toggle.types.ts","../../src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type PropType, ref, toRefs, useAttrs, useSlots, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/core/utils/ts';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string | null => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = computed(() => attrs['aria-label'] as string);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]: props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default {\n name: 'bento-toggle',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","__default__","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","toggleInput","ref","props","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","emit","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;ACuJR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlHAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GA+CAM,IAAAC,EAAAC,EAAA,KAAA,GACAC,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAX,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAY,IAAAC,EAAA,MAAAT,EAAA,SAAA,IAAAU,EAAAd,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAe,IAAAF,EAAA,MAAAX,EAAA,YAAA,CAAA,GACA,EAAA,WAAAc,EAAA,IAAAC,EAAAT,CAAA,GACAU,IAAAC,EAAA;AAAA,MAAuC,WAAAJ,EAAA;AAAA;AAAA,MACL,OAAAC;AAAA,MAEvB,iBAAAJ;AAAA,IACU,CAAA,GAGrBQ,IAAAP,EAAA,MAAAJ,KAAA,IAAA,GAEAY,IAAAR,EAAA,OAAA;AAAA,MAAuE,CAAA,aAAAlB,EAAA,WAAA,EAAA,GAAAa,EAAA,kBAAAX,EAAA;AAAA,MACiC,sBAAAW,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCc,IAAA,CAAAC,MAAA;AACI,MAAAC,EAAA,SAAAD,EAAA,OAAA,OAAA;AAAA,IAA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