@adyen/bento-vue2 2.0.1 → 2.1.1

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 (320) hide show
  1. package/README.md +2 -2
  2. package/dist/@types/index.d.ts +114 -82
  3. package/dist/accordion.js +1 -1
  4. package/dist/action-bar.js +1 -1
  5. package/dist/ai-tag.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/anchor-scroller.js +1 -1
  8. package/dist/assets/accordion-item.css +1 -1
  9. package/dist/assets/action-bar.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/button.css +1 -1
  13. package/dist/assets/calendar.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/checkbox.css +1 -1
  16. package/dist/assets/chip.css +1 -1
  17. package/dist/assets/currency.css +1 -1
  18. package/dist/assets/data-grid.css +1 -1
  19. package/dist/assets/date-range-picker.css +1 -1
  20. package/dist/assets/dialog-page.css +1 -1
  21. package/dist/assets/draggable.css +1 -1
  22. package/dist/assets/dropdown.css +1 -1
  23. package/dist/assets/file-uploader.css +1 -1
  24. package/dist/assets/filter-bar.css +1 -1
  25. package/dist/assets/header-with-views.css +1 -1
  26. package/dist/assets/input-field.css +1 -1
  27. package/dist/assets/input-time.css +1 -1
  28. package/dist/assets/inspector.css +1 -1
  29. package/dist/assets/modal-fullscreen.css +1 -1
  30. package/dist/assets/navigation-menu-group.css +1 -1
  31. package/dist/assets/pagination.css +1 -1
  32. package/dist/assets/rich-text-editor.css +1 -1
  33. package/dist/assets/search-bar.css +1 -1
  34. package/dist/assets/secondary-nav.css +1 -1
  35. package/dist/assets/selection-card-group.css +1 -1
  36. package/dist/assets/sidepanel.css +1 -1
  37. package/dist/assets/step.css +1 -1
  38. package/dist/assets/structured-list-item.css +1 -1
  39. package/dist/assets/tab.css +1 -1
  40. package/dist/assets/textarea.css +1 -1
  41. package/dist/assets/toggle.css +1 -1
  42. package/dist/assets/typography.css +1 -1
  43. package/dist/avatar.js +1 -1
  44. package/dist/button.js +3 -3
  45. package/dist/card.js +1 -1
  46. package/dist/checkbox.js +2 -2
  47. package/dist/chip.js +1 -1
  48. package/dist/chunks/{accordion-item.B7lteJBu.js → accordion-item.C158YxId.js} +5 -5
  49. package/dist/chunks/{accordion-item.B7lteJBu.js.map → accordion-item.C158YxId.js.map} +1 -1
  50. package/dist/chunks/{action-bar.BsXW7BI2.js → action-bar.D29UQHoA.js} +15 -15
  51. package/dist/chunks/{action-bar.BsXW7BI2.js.map → action-bar.D29UQHoA.js.map} +1 -1
  52. package/dist/chunks/{ai-button.BnFk5CzK.js → ai-button.qEaHYybv.js} +3 -3
  53. package/dist/chunks/{ai-button.BnFk5CzK.js.map → ai-button.qEaHYybv.js.map} +1 -1
  54. package/dist/chunks/{ai-tag.D2Q0xhFK.js → ai-tag.BLi-Xoh_.js} +3 -3
  55. package/dist/chunks/{ai-tag.D2Q0xhFK.js.map → ai-tag.BLi-Xoh_.js.map} +1 -1
  56. package/dist/chunks/{alert.DJDHwVeR.js → alert.BddJPWMN.js} +3 -3
  57. package/dist/chunks/{alert.DJDHwVeR.js.map → alert.BddJPWMN.js.map} +1 -1
  58. package/dist/chunks/{anchor-scroller.BbvghQxZ.js → anchor-scroller.Clb_9RNz.js} +5 -5
  59. package/dist/chunks/{anchor-scroller.BbvghQxZ.js.map → anchor-scroller.Clb_9RNz.js.map} +1 -1
  60. package/dist/chunks/{avatar.CxPKc8Gy.js → avatar.BN4MI-42.js} +2 -2
  61. package/dist/chunks/{avatar.CxPKc8Gy.js.map → avatar.BN4MI-42.js.map} +1 -1
  62. package/dist/chunks/{base-button.DOhHyU7x.js → base-button.DYroENBg.js} +3 -3
  63. package/dist/chunks/{base-button.DOhHyU7x.js.map → base-button.DYroENBg.js.map} +1 -1
  64. package/dist/chunks/{base-modal.CcmoTJdc.js → base-modal._-Cc6jfi.js} +6 -6
  65. package/dist/chunks/{base-modal.CcmoTJdc.js.map → base-modal._-Cc6jfi.js.map} +1 -1
  66. package/dist/chunks/{button-actions-with-menu.BY394ars.js → button-actions-with-menu.1vZJWN1K.js} +2 -2
  67. package/dist/chunks/{button-actions-with-menu.BY394ars.js.map → button-actions-with-menu.1vZJWN1K.js.map} +1 -1
  68. package/dist/chunks/{button-actions.bkcLUE1G.js → button-actions.CdetBz3J.js} +8 -8
  69. package/dist/chunks/button-actions.CdetBz3J.js.map +1 -0
  70. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
  71. package/dist/chunks/{button.DII5Ifwa.js → button.tsTeQRcP.js} +3 -3
  72. package/dist/chunks/{button.DII5Ifwa.js.map → button.tsTeQRcP.js.map} +1 -1
  73. package/dist/chunks/{calendar.CXdLEeN4.js → calendar.BalfhApP.js} +293 -290
  74. package/dist/chunks/calendar.BalfhApP.js.map +1 -0
  75. package/dist/chunks/{card.BmpB0VbL.js → card.BhhC01dV.js} +7 -7
  76. package/dist/chunks/{card.BmpB0VbL.js.map → card.BhhC01dV.js.map} +1 -1
  77. package/dist/chunks/{checkbox-group.D1uyc3z3.js → checkbox-group.C-1v4X3c.js} +4 -4
  78. package/dist/chunks/{checkbox-group.D1uyc3z3.js.map → checkbox-group.C-1v4X3c.js.map} +1 -1
  79. package/dist/chunks/{checkbox.D5xZ5Nnh.js → checkbox.CnuIUi4-.js} +6 -6
  80. package/dist/chunks/{checkbox.D5xZ5Nnh.js.map → checkbox.CnuIUi4-.js.map} +1 -1
  81. package/dist/chunks/{chip.DRsJylWl.js → chip.Cc4f2vws.js} +14 -12
  82. package/dist/chunks/{chip.DRsJylWl.js.map → chip.Cc4f2vws.js.map} +1 -1
  83. package/dist/chunks/{code-snippet.CnThWqVb.js → code-snippet.Bkd8R0vf.js} +6 -6
  84. package/dist/chunks/{code-snippet.CnThWqVb.js.map → code-snippet.Bkd8R0vf.js.map} +1 -1
  85. package/dist/chunks/{controls-group.fdGc6epa.js → controls-group.Bku83Fm_.js} +3 -3
  86. package/dist/chunks/{controls-group.fdGc6epa.js.map → controls-group.Bku83Fm_.js.map} +1 -1
  87. package/dist/chunks/{copy.CSk1rCRo.js → copy.B12-P_8A.js} +3 -3
  88. package/dist/chunks/{copy.CSk1rCRo.js.map → copy.B12-P_8A.js.map} +1 -1
  89. package/dist/chunks/{country.UZbwr635.js → country._NpkT-91.js} +2 -2
  90. package/dist/chunks/{country.UZbwr635.js.map → country._NpkT-91.js.map} +1 -1
  91. package/dist/chunks/country.types.BCOrkmVK.js.map +1 -1
  92. package/dist/chunks/{currency.POwX-Trj.js → currency.BXsSGoWa.js} +4 -4
  93. package/dist/chunks/{currency.POwX-Trj.js.map → currency.BXsSGoWa.js.map} +1 -1
  94. package/dist/chunks/{dashboard-section.CYEoNH9Q.js → dashboard-section.yS2FNoIV.js} +3 -3
  95. package/dist/chunks/{dashboard-section.CYEoNH9Q.js.map → dashboard-section.yS2FNoIV.js.map} +1 -1
  96. package/dist/chunks/{dashed-underline.CzKc-fJW.js → dashed-underline.RcRbre03.js} +4 -4
  97. package/dist/chunks/{dashed-underline.CzKc-fJW.js.map → dashed-underline.RcRbre03.js.map} +1 -1
  98. package/dist/chunks/{data-grid-template.DCwzh2G7.js → data-grid-template.B5A9whlD.js} +4 -4
  99. package/dist/chunks/{data-grid-template.DCwzh2G7.js.map → data-grid-template.B5A9whlD.js.map} +1 -1
  100. package/dist/chunks/{data-grid.CMxQpfrY.js → data-grid.Pg5iM8CJ.js} +25 -25
  101. package/dist/chunks/{data-grid.CMxQpfrY.js.map → data-grid.Pg5iM8CJ.js.map} +1 -1
  102. package/dist/chunks/{date-picker.gDsw8bn1.js → date-picker.RFus1MVJ.js} +9 -9
  103. package/dist/chunks/{date-picker.gDsw8bn1.js.map → date-picker.RFus1MVJ.js.map} +1 -1
  104. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  105. package/dist/chunks/{date-range-picker.CqixIJxG.js → date-range-picker.B2B4hO6R.js} +411 -370
  106. package/dist/chunks/date-range-picker.B2B4hO6R.js.map +1 -0
  107. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  108. package/dist/chunks/{date-time-picker.Bktntun4.js → date-time-picker.DJxDa81N.js} +6 -6
  109. package/dist/chunks/{date-time-picker.Bktntun4.js.map → date-time-picker.DJxDa81N.js.map} +1 -1
  110. package/dist/chunks/{date.CPo8t1n9.js → date.P3Xx7JdV.js} +2 -2
  111. package/dist/chunks/{date.CPo8t1n9.js.map → date.P3Xx7JdV.js.map} +1 -1
  112. package/dist/chunks/{dialog-page.Bct3zOQO.js → dialog-page.DORdXmEm.js} +3 -3
  113. package/dist/chunks/{dialog-page.Bct3zOQO.js.map → dialog-page.DORdXmEm.js.map} +1 -1
  114. package/dist/chunks/{draggable-handle.DgVdGC1V.js → draggable-handle.BM07OVdH.js} +2 -2
  115. package/dist/chunks/{draggable-handle.DgVdGC1V.js.map → draggable-handle.BM07OVdH.js.map} +1 -1
  116. package/dist/chunks/{draggable.DYKdXdbj.js → draggable.BczXedk7.js} +59 -56
  117. package/dist/chunks/draggable.BczXedk7.js.map +1 -0
  118. package/dist/chunks/{dropdown-tag.Dk7SooVv.js → dropdown-tag.BmUNKoNw.js} +7 -7
  119. package/dist/chunks/{dropdown-tag.Dk7SooVv.js.map → dropdown-tag.BmUNKoNw.js.map} +1 -1
  120. package/dist/chunks/{dropdown.Bnq4kP7k.js → dropdown.CpZQYisR.js} +9 -9
  121. package/dist/chunks/{dropdown.Bnq4kP7k.js.map → dropdown.CpZQYisR.js.map} +1 -1
  122. package/dist/chunks/{empty-state.C2wjdE3y.js → empty-state.L3DTfiY7.js} +4 -4
  123. package/dist/chunks/{empty-state.C2wjdE3y.js.map → empty-state.L3DTfiY7.js.map} +1 -1
  124. package/dist/chunks/{error-message.DKnoUezI.js → error-message.B-n8wzFo.js} +2 -2
  125. package/dist/chunks/{error-message.DKnoUezI.js.map → error-message.B-n8wzFo.js.map} +1 -1
  126. package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
  127. package/dist/chunks/{field-label.C7BCsofY.js → field-label.BQaDr37D.js} +3 -3
  128. package/dist/chunks/{field-label.C7BCsofY.js.map → field-label.BQaDr37D.js.map} +1 -1
  129. package/dist/chunks/{file-uploader.DllKBmP8.js → file-uploader.Bo17jWtf.js} +11 -11
  130. package/dist/chunks/{file-uploader.DllKBmP8.js.map → file-uploader.Bo17jWtf.js.map} +1 -1
  131. package/dist/chunks/{filter-bar.D7Lk7wlq.js → filter-bar.Bio9nf9V.js} +28 -27
  132. package/dist/chunks/filter-bar.Bio9nf9V.js.map +1 -0
  133. package/dist/chunks/{fixed-scroller.YC4bZifw.js → fixed-scroller.CHmrgoTQ.js} +2 -2
  134. package/dist/chunks/{fixed-scroller.YC4bZifw.js.map → fixed-scroller.CHmrgoTQ.js.map} +1 -1
  135. package/dist/chunks/{footer-actions.C9STwwcv.js → footer-actions.B8f-gEQV.js} +4 -4
  136. package/dist/chunks/{footer-actions.C9STwwcv.js.map → footer-actions.B8f-gEQV.js.map} +1 -1
  137. package/dist/chunks/{form-layout-group.D4T0Z5xk.js → form-layout-group.BSC2esG8.js} +2 -2
  138. package/dist/chunks/{form-layout-group.D4T0Z5xk.js.map → form-layout-group.BSC2esG8.js.map} +1 -1
  139. package/dist/chunks/{form-layout-title.C0lwzPZz.js → form-layout-title.b2BMYjnl.js} +3 -3
  140. package/dist/chunks/{form-layout-title.C0lwzPZz.js.map → form-layout-title.b2BMYjnl.js.map} +1 -1
  141. package/dist/chunks/{header-with-views.BqobE7IF.js → header-with-views.BJCjvhem.js} +16 -16
  142. package/dist/chunks/{header-with-views.BqobE7IF.js.map → header-with-views.BJCjvhem.js.map} +1 -1
  143. package/dist/chunks/{header.CmyqVXuG.js → header.CDiold9n.js} +5 -5
  144. package/dist/chunks/{header.CmyqVXuG.js.map → header.CDiold9n.js.map} +1 -1
  145. package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js → info-icon-with-popover.BzGVcMqy.js} +3 -3
  146. package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js.map → info-icon-with-popover.BzGVcMqy.js.map} +1 -1
  147. package/dist/chunks/{info-icon.B-FAeceD.js → info-icon.D11usblr.js} +2 -2
  148. package/dist/chunks/{info-icon.B-FAeceD.js.map → info-icon.D11usblr.js.map} +1 -1
  149. package/dist/chunks/{input-field-password.9bWhLud0.js → input-field-password.D4Jn2yCi.js} +6 -6
  150. package/dist/chunks/{input-field-password.9bWhLud0.js.map → input-field-password.D4Jn2yCi.js.map} +1 -1
  151. package/dist/chunks/{input-field-phone-number.CCn1N9St.js → input-field-phone-number.lV7yePoJ.js} +3 -3
  152. package/dist/chunks/{input-field-phone-number.CCn1N9St.js.map → input-field-phone-number.lV7yePoJ.js.map} +1 -1
  153. package/dist/chunks/{input-field.D912rZS_.js → input-field.90DWNO1a.js} +7 -7
  154. package/dist/chunks/{input-field.D912rZS_.js.map → input-field.90DWNO1a.js.map} +1 -1
  155. package/dist/chunks/input-time.D7IsprlH.js +157 -0
  156. package/dist/chunks/input-time.D7IsprlH.js.map +1 -0
  157. package/dist/chunks/{inspector-page.BRC_7uro.js → inspector-page.IoC9naSV.js} +4 -4
  158. package/dist/chunks/{inspector-page.BRC_7uro.js.map → inspector-page.IoC9naSV.js.map} +1 -1
  159. package/dist/chunks/{inspector.IOtNex1r.js → inspector.BwtV4rE9.js} +5 -5
  160. package/dist/chunks/{inspector.IOtNex1r.js.map → inspector.BwtV4rE9.js.map} +1 -1
  161. package/dist/chunks/{layout-row.LBn6aJv4.js → layout-row.DYx7F4cb.js} +2 -2
  162. package/dist/chunks/{layout-row.LBn6aJv4.js.map → layout-row.DYx7F4cb.js.map} +1 -1
  163. package/dist/chunks/{link.Cls8XShm.js → link.iNnolG9W.js} +2 -2
  164. package/dist/chunks/{link.Cls8XShm.js.map → link.iNnolG9W.js.map} +1 -1
  165. package/dist/chunks/{list-item.HjabBEb8.js → list-item.ByyA5h1d.js} +5 -5
  166. package/dist/chunks/{list-item.HjabBEb8.js.map → list-item.ByyA5h1d.js.map} +1 -1
  167. package/dist/chunks/{listbox-option-tag.DhNxvqRO.js → listbox-option-tag.Cp_W_p4z.js} +3 -3
  168. package/dist/chunks/{listbox-option-tag.DhNxvqRO.js.map → listbox-option-tag.Cp_W_p4z.js.map} +1 -1
  169. package/dist/chunks/{modal-fullscreen.Bi1bQs4Z.js → modal-fullscreen.DG8Q-jHL.js} +9 -9
  170. package/dist/chunks/modal-fullscreen.DG8Q-jHL.js.map +1 -0
  171. package/dist/chunks/{modal.B3-pmL5s.js → modal.UkzON4bz.js} +7 -7
  172. package/dist/chunks/{modal.B3-pmL5s.js.map → modal.UkzON4bz.js.map} +1 -1
  173. package/dist/chunks/{navigation-menu-group.BnHdXODQ.js → navigation-menu-group.BzKRuhrd.js} +8 -8
  174. package/dist/chunks/navigation-menu-group.BzKRuhrd.js.map +1 -0
  175. package/dist/chunks/{pagination.cI_pc6oE.js → pagination.DZEVT-CA.js} +8 -7
  176. package/dist/chunks/{pagination.cI_pc6oE.js.map → pagination.DZEVT-CA.js.map} +1 -1
  177. package/dist/chunks/{payment-method.DcAITDcK.js → payment-method.meF6XN_X.js} +2 -2
  178. package/dist/chunks/{payment-method.DcAITDcK.js.map → payment-method.meF6XN_X.js.map} +1 -1
  179. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  180. package/dist/chunks/popover.types.DvIwSAAp.js.map +1 -1
  181. package/dist/chunks/popper-container.Cj3AWXSd.js.map +1 -1
  182. package/dist/chunks/{progress-bar.RlF3a0Gb.js → progress-bar.CaurNYsc.js} +4 -4
  183. package/dist/chunks/{progress-bar.RlF3a0Gb.js.map → progress-bar.CaurNYsc.js.map} +1 -1
  184. package/dist/chunks/{promo-banner.B5szTysj.js → promo-banner.CcYpFY9b.js} +3 -3
  185. package/dist/chunks/{promo-banner.B5szTysj.js.map → promo-banner.CcYpFY9b.js.map} +1 -1
  186. package/dist/chunks/{radio-group.CvsQDlHi.js → radio-group.CLbYlzD7.js} +5 -5
  187. package/dist/chunks/{radio-group.CvsQDlHi.js.map → radio-group.CLbYlzD7.js.map} +1 -1
  188. package/dist/chunks/{rich-text-editor.rXoS7KGY.js → rich-text-editor.5SMm2BbC.js} +11 -11
  189. package/dist/chunks/{rich-text-editor.rXoS7KGY.js.map → rich-text-editor.5SMm2BbC.js.map} +1 -1
  190. package/dist/chunks/{scroll-to-section.DhW8SFy0.js → scroll-to-section.CzeBpNj4.js} +2 -2
  191. package/dist/chunks/{scroll-to-section.DhW8SFy0.js.map → scroll-to-section.CzeBpNj4.js.map} +1 -1
  192. package/dist/chunks/{search-bar.--4KVNkf.js → search-bar.DrIwlAQj.js} +8 -8
  193. package/dist/chunks/{search-bar.--4KVNkf.js.map → search-bar.DrIwlAQj.js.map} +1 -1
  194. package/dist/chunks/{secondary-nav.CgdV0QwZ.js → secondary-nav.DRs5yAve.js} +16 -16
  195. package/dist/chunks/{secondary-nav.CgdV0QwZ.js.map → secondary-nav.DRs5yAve.js.map} +1 -1
  196. package/dist/chunks/{segmented-control.nYpRQTGc.js → segmented-control.CcQoBTfT.js} +3 -3
  197. package/dist/chunks/{segmented-control.nYpRQTGc.js.map → segmented-control.CcQoBTfT.js.map} +1 -1
  198. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
  199. package/dist/chunks/{selection-card-group.CmDuj1c7.js → selection-card-group.BYBAG8ig.js} +49 -48
  200. package/dist/chunks/{selection-card-group.CmDuj1c7.js.map → selection-card-group.BYBAG8ig.js.map} +1 -1
  201. package/dist/chunks/{sidepanel.CntIcmx-.js → sidepanel.CLbVkH7v.js} +14 -14
  202. package/dist/chunks/{sidepanel.CntIcmx-.js.map → sidepanel.CLbVkH7v.js.map} +1 -1
  203. package/dist/chunks/{status.DJ1Dfh5s.js → status.BdWYs5MK.js} +2 -2
  204. package/dist/chunks/{status.DJ1Dfh5s.js.map → status.BdWYs5MK.js.map} +1 -1
  205. package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
  206. package/dist/chunks/{step.BCa9IOWB.js → step.SkRHgSxN.js} +5 -5
  207. package/dist/chunks/step.SkRHgSxN.js.map +1 -0
  208. package/dist/chunks/{structured-list-item.Bhe0CH1M.js → structured-list-item.BgcR0XlO.js} +10 -9
  209. package/dist/chunks/structured-list-item.BgcR0XlO.js.map +1 -0
  210. package/dist/chunks/{summary-grid.types.C70ED6WD.js → summary-grid.types.Do2PZQGm.js} +6 -6
  211. package/dist/chunks/{summary-grid.types.C70ED6WD.js.map → summary-grid.types.Do2PZQGm.js.map} +1 -1
  212. package/dist/chunks/{tab.BK1sIJAJ.js → tab.zeRxc-3T.js} +49 -48
  213. package/dist/chunks/tab.zeRxc-3T.js.map +1 -0
  214. package/dist/chunks/{table-of-contents.BTy95Rrs.js → table-of-contents.D4sF13f8.js} +3 -3
  215. package/dist/chunks/{table-of-contents.BTy95Rrs.js.map → table-of-contents.D4sF13f8.js.map} +1 -1
  216. package/dist/chunks/{tag.Dz1FQSZb.js → tag.CgsX8v2m.js} +3 -3
  217. package/dist/chunks/{tag.Dz1FQSZb.js.map → tag.CgsX8v2m.js.map} +1 -1
  218. package/dist/chunks/{textarea.CcV9U3I7.js → textarea.DMBnJaB1.js} +7 -7
  219. package/dist/chunks/textarea.DMBnJaB1.js.map +1 -0
  220. package/dist/chunks/{timeline-item.BG2by0xf.js → timeline-item.CS7TCdoU.js} +10 -10
  221. package/dist/chunks/{timeline-item.BG2by0xf.js.map → timeline-item.CS7TCdoU.js.map} +1 -1
  222. package/dist/chunks/{title-details.ChwPP7C5.js → title-details.BhR2nis-.js} +4 -4
  223. package/dist/chunks/{title-details.ChwPP7C5.js.map → title-details.BhR2nis-.js.map} +1 -1
  224. package/dist/chunks/{toast.CO6ByH3n.js → toast.CjDkuh2x.js} +4 -4
  225. package/dist/chunks/{toast.CO6ByH3n.js.map → toast.CjDkuh2x.js.map} +1 -1
  226. package/dist/chunks/{toggle.Dgh7aw1D.js → toggle.BL_w2xUm.js} +4 -4
  227. package/dist/chunks/{toggle.Dgh7aw1D.js.map → toggle.BL_w2xUm.js.map} +1 -1
  228. package/dist/chunks/{tooltip.DFYc5NKM.js → tooltip.BOe7LOfD.js} +2 -2
  229. package/dist/chunks/{tooltip.DFYc5NKM.js.map → tooltip.BOe7LOfD.js.map} +1 -1
  230. package/dist/chunks/{tutorial.K0aOQWIg.js → tutorial.DSbBx_2h.js} +3 -3
  231. package/dist/chunks/{tutorial.K0aOQWIg.js.map → tutorial.DSbBx_2h.js.map} +1 -1
  232. package/dist/chunks/{typography.D1OZJbEa.js → typography.Cd386LC_.js} +5 -5
  233. package/dist/chunks/{typography.D1OZJbEa.js.map → typography.Cd386LC_.js.map} +1 -1
  234. package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js → use-bento-toast-controller.DMA9d_oD.js} +2 -2
  235. package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js.map → use-bento-toast-controller.DMA9d_oD.js.map} +1 -1
  236. package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js → use-date-input-formatter.CouOE5tF.js} +2 -2
  237. package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js.map → use-date-input-formatter.CouOE5tF.js.map} +1 -1
  238. package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js → use-dynamic-date-fns-locale.DGqfz_nF.js} +2 -2
  239. package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js.map → use-dynamic-date-fns-locale.DGqfz_nF.js.map} +1 -1
  240. package/dist/code-snippet.js +1 -1
  241. package/dist/country.js +1 -1
  242. package/dist/currency.js +1 -1
  243. package/dist/dashboard-template.js +1 -1
  244. package/dist/dashed-underline.js +1 -1
  245. package/dist/data-grid-template.js +1 -1
  246. package/dist/data-grid.js +1 -1
  247. package/dist/date-picker.js +2 -2
  248. package/dist/date-range-picker.js +2 -2
  249. package/dist/date-time-picker.js +1 -1
  250. package/dist/date.js +1 -1
  251. package/dist/draggable.js +2 -2
  252. package/dist/dropdown.js +2 -2
  253. package/dist/empty-state.js +1 -1
  254. package/dist/file-uploader.js +1 -1
  255. package/dist/filter-bar.js +1 -1
  256. package/dist/form-layout.js +2 -2
  257. package/dist/header-with-views.js +1 -1
  258. package/dist/header.js +1 -1
  259. package/dist/index.js +177 -152
  260. package/dist/index.js.map +1 -1
  261. package/dist/info-icon.js +1 -1
  262. package/dist/input-field-password.js +1 -1
  263. package/dist/input-field-phone-number.js +1 -1
  264. package/dist/input-field.js +1 -1
  265. package/dist/input-time.js +1 -1
  266. package/dist/inspector.js +2 -2
  267. package/dist/internal.js +14 -14
  268. package/dist/layout.js +1 -1
  269. package/dist/link.js +1 -1
  270. package/dist/list.js +1 -1
  271. package/dist/menu.js +1 -1
  272. package/dist/modal-fullscreen.js +1 -1
  273. package/dist/modal.js +2 -2
  274. package/dist/navigation-menu.js +1 -1
  275. package/dist/pagination.js +1 -1
  276. package/dist/payment-method.js +1 -1
  277. package/dist/popover.js +1 -1
  278. package/dist/progress-bar.js +1 -1
  279. package/dist/promo-banner.js +1 -1
  280. package/dist/radio-group.js +1 -1
  281. package/dist/rich-text-editor.js +1 -1
  282. package/dist/search-bar.js +2 -2
  283. package/dist/secondary-nav.js +1 -1
  284. package/dist/segmented-control.js +1 -1
  285. package/dist/selection-card.js +1 -1
  286. package/dist/sidepanel.js +1 -1
  287. package/dist/status.js +1 -1
  288. package/dist/stepper.js +1 -1
  289. package/dist/structured-list.js +1 -1
  290. package/dist/styles/bento-dark.css +3 -0
  291. package/dist/styles/bento-light.css +3 -0
  292. package/dist/styles/bento.css +3 -0
  293. package/dist/styles/legacy.css +3 -0
  294. package/dist/styles/styleguide.css +3 -0
  295. package/dist/styles/utility.css +9 -0
  296. package/dist/summary-grid.js +1 -1
  297. package/dist/table-of-contents.js +1 -1
  298. package/dist/tabs.js +1 -1
  299. package/dist/tag.js +1 -1
  300. package/dist/textarea.js +1 -1
  301. package/dist/timeline.js +1 -1
  302. package/dist/toast.js +1 -1
  303. package/dist/toggle.js +1 -1
  304. package/dist/tutorial.js +1 -1
  305. package/dist/typography.js +1 -1
  306. package/dist/web-types.json +1278 -46
  307. package/package.json +9 -9
  308. package/dist/chunks/button-actions.bkcLUE1G.js.map +0 -1
  309. package/dist/chunks/calendar.CXdLEeN4.js.map +0 -1
  310. package/dist/chunks/date-range-picker.CqixIJxG.js.map +0 -1
  311. package/dist/chunks/draggable.DYKdXdbj.js.map +0 -1
  312. package/dist/chunks/filter-bar.D7Lk7wlq.js.map +0 -1
  313. package/dist/chunks/input-time.CXMuvF9N.js +0 -105
  314. package/dist/chunks/input-time.CXMuvF9N.js.map +0 -1
  315. package/dist/chunks/modal-fullscreen.Bi1bQs4Z.js.map +0 -1
  316. package/dist/chunks/navigation-menu-group.BnHdXODQ.js.map +0 -1
  317. package/dist/chunks/step.BCa9IOWB.js.map +0 -1
  318. package/dist/chunks/structured-list-item.Bhe0CH1M.js.map +0 -1
  319. package/dist/chunks/tab.BK1sIJAJ.js.map +0 -1
  320. package/dist/chunks/textarea.CcV9U3I7.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as oe, useSlots as ne, ref as _, provide as ie, inject as B, toRef as re, computed as i } from "vue";
2
- import { h as le, B as de } from "./dropdown.Bnq4kP7k.js";
3
- import { p as L, d as se, B as pe } from "./typography.D1OZJbEa.js";
2
+ import { h as le, B as de } from "./dropdown.CpZQYisR.js";
3
+ import { p as L, d as se, B as pe } from "./typography.Cd386LC_.js";
4
4
  import { u as ue } from "./form-field.B60VsF8d.js";
5
5
  import { g as c } from "./generate-uid.DBWe4g6T.js";
6
6
  import { g as M } from "./get-slot-text.DM_NdrUC.js";
7
7
  import { u as ce } from "./index.CPOlyau9.js";
8
8
  import { u as fe } from "./use-form-layout-loading.CWbjZiwP.js";
9
9
  import { u as be } from "./use-has-slot.C9lQZ6nz.js";
10
- import { F as _e } from "./field-label.C7BCsofY.js";
11
- import { E as me } from "./error-message.DKnoUezI.js";
10
+ import { F as _e } from "./field-label.BQaDr37D.js";
11
+ import { E as me } from "./error-message.B-n8wzFo.js";
12
12
  import { n as De } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
13
13
  import "../assets/input-field.css";
14
14
  const we = /* @__PURE__ */ Symbol("input field hint injection key"), ye = /* @__PURE__ */ Symbol("input field parent component injection key");
@@ -129,7 +129,7 @@ const ve = {
129
129
  <my-icon-goes-here />
130
130
  </template>
131
131
  </bento-input-field>`,
132
- "2.0.0"
132
+ "3.0.0"
133
133
  ), { __sfc: !0, slots: n, props: e, emit: o, emitValue: T, t: m, hasSlot: g, inputFieldElement: D, inputDropdownElement: k, inputFieldId: V, dropdownId: w, staticValueId: y, descriptionId: A, errorId: I, isFocused: h, getDataTestId: $, getRootAttributes: U, hint: x, onFocus: H, onBlur: W, isReadOnly: s, isDropdownReadOnly: Y, shouldShowStaticValue: p, isDefaultVariant: j, isPaymentMethodVariant: q, shouldDisplayStaticValueAtStart: J, shouldDisplayStaticValueAtEnd: K, shouldShowDropdown: u, shouldDisplayDropdownAtStart: z, shouldDisplayDropdownAtEnd: X, shouldShowError: v, computedLabel: F, computedDescription: C, computedAriaOwns: Z, computedAriaLabelFallbackMessage: O, getAriaLabel: N, computedAriaDescribedBy: G, inputFieldConditionalClasses: Q, getInputFieldDropdownProps: ee, onInput: ae, onDropdownInput: te, focusInput: E, focus: R, inputFieldParentComponent: P, BentoDropdown: de, BentoTypography: pe, ErrorMessage: me, FieldLabel: _e };
134
134
  }
135
135
  });
@@ -158,7 +158,7 @@ var Se = function() {
158
158
  Te,
159
159
  !1,
160
160
  null,
161
- "f2528707"
161
+ "1a9459a8"
162
162
  );
163
163
  const $e = ge.exports;
164
164
  export {
@@ -171,4 +171,4 @@ export {
171
171
  d as e,
172
172
  ye as f
173
173
  };
174
- //# sourceMappingURL=input-field.D912rZS_.js.map
174
+ //# sourceMappingURL=input-field.90DWNO1a.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-field.D912rZS_.js","sources":["../../src/components/input-field/input-field.keys.ts","../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["export const INPUT_FIELD_HINT_INJECTION_KEY = Symbol('input field hint injection key');\nexport const INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY = Symbol('input field parent component injection key');\n","import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Indicates that dropdown items are loading (shows a loading skeleton)\n */\n componentLoading?: BentoDropdownProps['componentLoading'];\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: BentoDropdownProps['dynamicFiltering'];\n /**\n * Empty state displayed when no search results are found\n */\n emptyState?: BentoDropdownProps['emptyState'];\n /**\n * Enables value/label pair handling for selected values\n */\n enableValueLabelPair?: BentoDropdownProps['enableValueLabelPair'];\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems?: BentoDropdownProps['hasMoreItems'];\n /**\n * Function that determines which options are disabled from interaction\n */\n isOptionDisabled?: BentoDropdownProps['isOptionDisabled'];\n /**\n * List of available items\n */\n items: BentoDropdownProps['items'];\n /**\n * The type of lazy load: \"automatic\" for infinite scrolling, \"button\" for a show-more button\n */\n lazyLoadType?: BentoDropdownProps['lazyLoadType'];\n /**\n * Indicates if new options are lazy loading\n */\n loading?: BentoDropdownProps['loading'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: BentoDropdownProps['modelValue'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: BentoDropdownProps['readonly'];\n /**\n * Dropdown search options including debounce time and placeholder\n */\n search?: BentoDropdownProps['search'];\n /**\n * Displays non-selectable, static categories in the dropdown\n */\n staticCategories?: BentoDropdownProps['staticCategories'];\n /**\n * Enables virtual scrolling for large lists of items\n */\n virtualScroll?: BentoDropdownProps['virtualScroll'];\n}\n\n/**\n * @deprecated Since v2.0.0. Use `@<emit name>` instead.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the single-select dropdown menu embedded in the input field.\n * Only a subset of `BentoDropdownProps` is supported (multi-select is not available).\n *\n * @see {@link BentoInputDropdownProps}\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldValue;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n v-bind=\"getRootAttributes($attrs)\"\n :data-testid=\"getDataTestId($attrs)\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"$attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"getAriaLabel($attrs)\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :aria-required=\"required\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n @click=\"emit('click', $event)\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && modelValue\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <div\n v-if=\"(shouldShowError && !!errorMessage) || hasSlot('description') || description\"\n class=\"b-input-field__footer\"\n >\n <error-message v-if=\"shouldShowError && !!errorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <span\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { DROPDOWN_SMALL_SIZE_INJECTION_KEY } from '@/components/dropdown/dropdown.keys';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_HINT_INJECTION_KEY,\n INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n type BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n\n const props = defineProps({\n description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\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 ariaHidden: { type: Boolean, default: true },\n condensed: { type: Boolean, default: false },\n dropdown: { default: undefined },\n dropdownPosition: { default: BentoInputFieldElementPosition.START },\n modelValue: { default: undefined },\n slashedZero: { type: Boolean, default: false },\n staticValue: { default: '' },\n staticValuePosition: { default: BentoInputFieldElementPosition.START },\n type: { default: BentoInputFieldType.TEXT },\n variant: { default: BentoInputFieldVariant.DEFAULT }\n});\n\n const emit = defineEmits([\"blur\", \"click\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"update:dropdown\", \"update:model-value\"]);\n\n const { emitValue } = useFormFieldEmits<BentoInputFieldValue>(emit);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref<HTMLInputElement>(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n /**\n * Gets the overriden or the default data-testid attribute\n * @param attributes - the live attributes object\n */\n function getDataTestId(attributes: Record<string, unknown>) {\n return (attributes['data-testid'] as string) ?? 'input-text-container';\n }\n /**\n * Filters out all aria attributes for the root element.\n * @param attributes - the live attributes object\n */\n function getRootAttributes(attributes: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(attributes).filter(([key]) => !key.startsWith('aria-') && key !== 'data-testid')\n );\n }\n\n // Provide DROPDOWN_SMALL_SIZE_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(DROPDOWN_SMALL_SIZE_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const getAriaLabel = (attributes: Record<string, unknown>) =>\n (attributes['aria-label'] as string | undefined) ??\n (attributes['aria-labelledby'] ? undefined : computedLabel.value || computedAriaLabelFallbackMessage.value);\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const getInputFieldDropdownProps = (attributes: Record<string, unknown>) => ({\n 'aria-label': t('ariaLabelDropdownFallback', { inputLabel: getAriaLabel(attributes) }),\n ...props.dropdown,\n });\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emitValue(inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, modelValue: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose focus methods for parent components in Vue 3.\n defineExpose({\n /**\n * Focuses the input field.\n */\n focusInput,\n\n /**\n * Focuses the dropdown when using the dropdown variant; otherwise focuses the input field.\n */\n focus,\n\n /**\n * Reference to the native input element.\n */\n inputFieldElement,\n });\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\n }\n\n /**\n * Deprecations\n */\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :model-value=\"inputValue\"\n * :@update:model-value=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n name: 'bento-input-field',\n inheritAttrs: false,\n model: { prop: 'modelValue', event: 'update:model-value' },\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["INPUT_FIELD_HINT_INJECTION_KEY","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","slots","useSlots","emitValue","useFormFieldEmits","emit","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","getDataTestId","attributes","getRootAttributes","key","provide","DROPDOWN_SMALL_SIZE_INJECTION_KEY","hint","inject","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","getAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","getInputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","focus","expose","inputFieldParentComponent","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAAO,MAAAA,KAAA,uBAAA,gCAAA,GACAC,KAAA,uBAAA,4CAAA;ACKA,IAAAC,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GA0ELE,KAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACA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AAAsC,EAAA,IAAA,KAAA,CAAA6B,MACI7B,EAAA,SAAA,QACI8B;AAAA,MAAA,2DAAA9B,EAAA,IAAA;AAAA,IACyE,IACzEA,EAAA,SAAA,aAEA8B;AAAA,MAAA,2DAAA9B,EAAA,IAAA;AAAA,IACyE,IAGzE8B,EAAA,2DAAA9B,EAAA,IAAA,GAAA,IAORzB,EAAA,mBAAA,KACIwD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-field.90DWNO1a.js","sources":["../../src/components/input-field/input-field.keys.ts","../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["export const INPUT_FIELD_HINT_INJECTION_KEY = Symbol('input field hint injection key');\nexport const INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY = Symbol('input field parent component injection key');\n","import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Indicates that dropdown items are loading (shows a loading skeleton)\n */\n componentLoading?: BentoDropdownProps['componentLoading'];\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: BentoDropdownProps['dynamicFiltering'];\n /**\n * Empty state displayed when no search results are found\n */\n emptyState?: BentoDropdownProps['emptyState'];\n /**\n * Enables value/label pair handling for selected values\n */\n enableValueLabelPair?: BentoDropdownProps['enableValueLabelPair'];\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems?: BentoDropdownProps['hasMoreItems'];\n /**\n * Function that determines which options are disabled from interaction\n */\n isOptionDisabled?: BentoDropdownProps['isOptionDisabled'];\n /**\n * List of available items\n */\n items: BentoDropdownProps['items'];\n /**\n * The type of lazy load: \"automatic\" for infinite scrolling, \"button\" for a show-more button\n */\n lazyLoadType?: BentoDropdownProps['lazyLoadType'];\n /**\n * Indicates if new options are lazy loading\n */\n loading?: BentoDropdownProps['loading'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: BentoDropdownProps['modelValue'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: BentoDropdownProps['readonly'];\n /**\n * Dropdown search options including debounce time and placeholder\n */\n search?: BentoDropdownProps['search'];\n /**\n * Displays non-selectable, static categories in the dropdown\n */\n staticCategories?: BentoDropdownProps['staticCategories'];\n /**\n * Enables virtual scrolling for large lists of items\n */\n virtualScroll?: BentoDropdownProps['virtualScroll'];\n}\n\n/**\n * @deprecated Since v3.0.0. Use `@<emit name>` instead.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the single-select dropdown menu embedded in the input field.\n * Only a subset of `BentoDropdownProps` is supported (multi-select is not available).\n *\n * @see {@link BentoInputDropdownProps}\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldValue;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n v-bind=\"getRootAttributes($attrs)\"\n :data-testid=\"getDataTestId($attrs)\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"$attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"getAriaLabel($attrs)\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :aria-required=\"required\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n @click=\"emit('click', $event)\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && modelValue\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <div\n v-if=\"(shouldShowError && !!errorMessage) || hasSlot('description') || description\"\n class=\"b-input-field__footer\"\n >\n <error-message v-if=\"shouldShowError && !!errorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <span\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { DROPDOWN_SMALL_SIZE_INJECTION_KEY } from '@/components/dropdown/dropdown.keys';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_HINT_INJECTION_KEY,\n INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n type BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n\n const props = defineProps({\n description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\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 ariaHidden: { type: Boolean, default: true },\n condensed: { type: Boolean, default: false },\n dropdown: { default: undefined },\n dropdownPosition: { default: BentoInputFieldElementPosition.START },\n modelValue: { default: undefined },\n slashedZero: { type: Boolean, default: false },\n staticValue: { default: '' },\n staticValuePosition: { default: BentoInputFieldElementPosition.START },\n type: { default: BentoInputFieldType.TEXT },\n variant: { default: BentoInputFieldVariant.DEFAULT }\n});\n\n const emit = defineEmits([\"blur\", \"click\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"update:dropdown\", \"update:model-value\"]);\n\n const { emitValue } = useFormFieldEmits<BentoInputFieldValue>(emit);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref<HTMLInputElement>(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n /**\n * Gets the overriden or the default data-testid attribute\n * @param attributes - the live attributes object\n */\n function getDataTestId(attributes: Record<string, unknown>) {\n return (attributes['data-testid'] as string) ?? 'input-text-container';\n }\n /**\n * Filters out all aria attributes for the root element.\n * @param attributes - the live attributes object\n */\n function getRootAttributes(attributes: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(attributes).filter(([key]) => !key.startsWith('aria-') && key !== 'data-testid')\n );\n }\n\n // Provide DROPDOWN_SMALL_SIZE_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(DROPDOWN_SMALL_SIZE_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const getAriaLabel = (attributes: Record<string, unknown>) =>\n (attributes['aria-label'] as string | undefined) ??\n (attributes['aria-labelledby'] ? undefined : computedLabel.value || computedAriaLabelFallbackMessage.value);\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const getInputFieldDropdownProps = (attributes: Record<string, unknown>) => ({\n 'aria-label': t('ariaLabelDropdownFallback', { inputLabel: getAriaLabel(attributes) }),\n ...props.dropdown,\n });\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emitValue(inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, modelValue: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose focus methods for parent components in Vue 3.\n defineExpose({\n /**\n * Focuses the input field.\n */\n focusInput,\n\n /**\n * Focuses the dropdown when using the dropdown variant; otherwise focuses the input field.\n */\n focus,\n\n /**\n * Reference to the native input element.\n */\n inputFieldElement,\n });\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\n }\n\n /**\n * Deprecations\n */\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :model-value=\"inputValue\"\n * :@update:model-value=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n name: 'bento-input-field',\n inheritAttrs: false,\n model: { prop: 'modelValue', event: 'update:model-value' },\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["INPUT_FIELD_HINT_INJECTION_KEY","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","slots","useSlots","emitValue","useFormFieldEmits","emit","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","getDataTestId","attributes","getRootAttributes","key","provide","DROPDOWN_SMALL_SIZE_INJECTION_KEY","hint","inject","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","getAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","getInputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","focus","expose","inputFieldParentComponent","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAAO,MAAAA,KAAA,uBAAA,gCAAA,GACAC,KAAA,uBAAA,4CAAA;ACKA,IAAAC,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAA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A,EAAA,GAAA4B,GAAA,UAAA,YAAAyB,EAAA,CAAA;AAAA,IAAyE,GAG7EC,IAAA,MAAA;AACI,MAAAjD,EAAA,MAAA,MAAA;AAAA,IAA8B,GAGlCkD,IAAA,MAAA;AACI,MAAA3B,EAAA,YAAA,aACIrB,EAAA,MAAA,MAAA,IAEA+C,EAAA;AAAA,IACJ;AAIJ,IAAAE,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,YAAAF;AAAA;AAAA;AAAA;AAAA,MAIT,OAAAC;AAAA;AAAA;AAAA;AAAA,MAKA,mBAAAlD;AAAA,IAKA,CAAA;AAEJ,UAAAoD,IAAAnC,EAAAvC,IAAA,EAAA;AAEA,WAAA,CAAA,OAAA,OAAAO,CAAA,EAAA,SAAAsC,EAAA,IAAA,KAAA,CAAA6B,MACI7B,EAAA,SAAA,QACI8B;AAAA,MAAA,2DAAA9B,EAAA,IAAA;AAAA,IACyE,IACzEA,EAAA,SAAA,aAEA8B;AAAA,MAAA,2DAAA9B,EAAA,IAAA;AAAA,IACyE,IAGzE8B,EAAA,2DAAA9B,EAAA,IAAA,GAAA,IAORzB,EAAA,mBAAA,KACIwD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,157 @@
1
+ import { defineComponent as B, provide as V, useSlots as k, ref as N, computed as l, watch as M } from "vue";
2
+ import { B as $, g as A } from "./dropdown.CpZQYisR.js";
3
+ import { f as x, B as R } from "./input-field.90DWNO1a.js";
4
+ import { u as C } from "./index.CPOlyau9.js";
5
+ import { p as K } from "./typography.Cd386LC_.js";
6
+ import { u as P } from "./use-has-slot.C9lQZ6nz.js";
7
+ import { u as L } from "./use-touch-device.DTqFAbXh.js";
8
+ import { n as O } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
9
+ import "../assets/input-time.css";
10
+ const U = /[\d]/, q = /^\d{2}$/, z = /^\d{2}:\d{2}$/, G = 8, m = 1440, J = 5, g = (o) => {
11
+ const t = Math.floor(o / 60), n = o % 60;
12
+ return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}:00`;
13
+ }, W = (o) => {
14
+ const [t, n, e] = o.split(":");
15
+ return parseInt(t, 10) * 3600 + parseInt(n, 10) * 60 + parseInt(e, 10);
16
+ }, v = (o) => /^(?:[01]\d|2[0-4]):(?:[0-5]\d):(?:[0-5]\d)$/.test(o), f = (o) => Number.isInteger(o) && o >= J && o <= m && m % o === 0, X = (o) => {
17
+ if (!f(o))
18
+ return [];
19
+ const t = [];
20
+ for (let n = 0; n < m; n += o)
21
+ t.push(g(n));
22
+ return t;
23
+ }, ve = (o, t, n) => {
24
+ if (!o || !v(o) || !f(t))
25
+ return o;
26
+ const e = t * 60, r = m * 60 - e, d = W(o);
27
+ if (d <= r && d % e === 0)
28
+ return o;
29
+ const s = n === "down" ? Math.floor(d / e) * e : Math.ceil(d / e) * e;
30
+ return g(Math.min(s, r) / 60);
31
+ }, Y = (o) => {
32
+ const { selectionStart: t, value: n = "" } = o.target, r = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"].includes(o.key), d = U.test(o.key) || r, s = [1, 2, 4, 5].includes(t) && o.key === ":", p = n.length >= G;
33
+ (!d && !s || p && !r) && o.preventDefault();
34
+ }, j = (o) => {
35
+ if (!o)
36
+ return o;
37
+ let t = o;
38
+ if (t.length === 1 && parseInt(o, 10) > 2)
39
+ return `0${t}:`;
40
+ const [n, e] = t.slice(-2);
41
+ return [2, 5].includes(t.length) && e === ":" && (t = `${t.slice(0, t.length - 2)}0${n}`), (q.test(t) || z.test(t)) && (t += ":"), t;
42
+ }, Z = {
43
+ "de-DE": { invalidTimeFormat: "Ungültiges Zeitformat", timeFormatDescription: "HH:MM:SS" },
44
+ "en-GB": { invalidTimeFormat: "Invalid time format", timeFormatDescription: "HH:MM:SS" },
45
+ "en-US": { invalidTimeFormat: "Invalid time format", timeFormatDescription: "HH:MM:SS" },
46
+ "es-419": { invalidTimeFormat: "Formato de tiempo no válido", timeFormatDescription: "HH:MM:SS" },
47
+ "es-ES": { invalidTimeFormat: "Formato de hora no válido", timeFormatDescription: "HH:MM:SS" },
48
+ "es-MX": { invalidTimeFormat: "Formato de hora no válido", timeFormatDescription: "HH:MM:SS" },
49
+ "fr-FR": { invalidTimeFormat: "Format d’heure non valide", timeFormatDescription: "HH:MM:SS" },
50
+ "it-IT": { invalidTimeFormat: "Formato orario non valido", timeFormatDescription: "HH:MM:SS" },
51
+ "ja-JP": { invalidTimeFormat: "無効な時刻形式", timeFormatDescription: "HH時MM分SS秒" },
52
+ "pt-BR": { invalidTimeFormat: "Formato de tempo inválido", timeFormatDescription: "HH:MM:SS" },
53
+ "zh-CN": { invalidTimeFormat: "时间格式无效", timeFormatDescription: "HH:MM:SS" }
54
+ }, Q = {
55
+ i18n: { messages: Z },
56
+ name: "bento-input-time",
57
+ inheritAttrs: !1,
58
+ model: { prop: "modelValue" }
59
+ }, ee = /* @__PURE__ */ B({
60
+ ...Q,
61
+ props: {
62
+ description: { default: void 0 },
63
+ disabled: { type: Boolean, default: !1 },
64
+ errorMessage: { default: null },
65
+ label: { default: "" },
66
+ optional: { type: Boolean, default: !1 },
67
+ placeholder: { default: "" },
68
+ readonly: { type: Boolean, default: !1 },
69
+ required: { type: Boolean, default: !1 },
70
+ tooltipText: { default: null },
71
+ condensed: { type: Boolean, default: !1 },
72
+ interval: { default: void 0 },
73
+ modelValue: { default: void 0 }
74
+ },
75
+ emits: ["click", "update:model-value", "keydown", "input:valid", "input:error"],
76
+ setup(o, { emit: t }) {
77
+ const n = o, e = 300;
78
+ V(x, "bento-input-time");
79
+ const r = k(), d = P(r), { isTouchDevice: s } = L(), { t: p } = C(), u = N(!1), S = l(() => n.errorMessage ? n.errorMessage : u.value ? p("invalidTimeFormat") : null), h = l(() => s.value ? n.errorMessage : S.value), I = l(() => s.value ? "time" : void 0), y = l(() => n.modelValue), D = l(() => s ? void 0 : n.placeholder), F = l(
80
+ () => n.description ? `${n.description} ${p("timeFormatDescription")}` : p("timeFormatDescription")
81
+ ), c = l(() => f(n.interval)), b = l(() => c.value && !s.value), H = l(
82
+ () => X(n.interval).map((i) => ({ label: i, value: i }))
83
+ ), E = l(() => {
84
+ if (s.value)
85
+ return c.value ? n.interval * 60 : 1;
86
+ });
87
+ M(
88
+ () => n.interval,
89
+ (i) => {
90
+ i != null && !f(i) && K(
91
+ `[bento-input-time] The "interval" prop must be a whole number of minutes of at least 5 that divides a full day, e.g. 5, 15, 30 or 60. Received "${i}", falling back to a free text time input.`
92
+ );
93
+ },
94
+ { immediate: !0 }
95
+ );
96
+ const T = (i) => {
97
+ if (!i) {
98
+ u.value = !1;
99
+ return;
100
+ }
101
+ const a = v(i);
102
+ u.value = !a, t(a ? "input:valid" : "input:error");
103
+ }, _ = A(T, e);
104
+ return M(
105
+ () => n.modelValue,
106
+ (i) => {
107
+ const a = String(i ?? "");
108
+ a.length === 8 && v(a) && (u.value = !1);
109
+ }
110
+ ), { __sfc: !0, VALIDATION_DEBOUNCE_TIME: e, slots: r, hasSlot: d, isTouchDevice: s, t: p, props: n, emit: t, internalError: u, computedErrorMessage: S, inputErrorMessage: h, inputType: I, inputModelValue: y, computedPlaceholder: D, timeDescription: F, hasTimeInterval: c, isTimeDropdown: b, timeItems: H, nativeStep: E, validateTime: T, validateTimeWithDebounce: _, onInput: (i) => {
111
+ if (!(n.disabled || n.readonly))
112
+ if (s.value) {
113
+ const a = String(i ?? ""), w = c.value && a.length === 5;
114
+ t("update:model-value", w ? `${a}:00` : a), t("input:valid");
115
+ } else {
116
+ const a = j(String(i ?? ""));
117
+ t("update:model-value", a), _(a);
118
+ }
119
+ }, onKeyDown: (i) => {
120
+ s.value || Y(i), t("keydown", i);
121
+ }, onTimeSelected: (i) => {
122
+ n.disabled || n.readonly || (u.value = !1, t("update:model-value", String(i ?? "")), t("input:valid"));
123
+ }, BentoDropdown: $, BentoInputField: R };
124
+ }
125
+ });
126
+ var te = function() {
127
+ var t = this, n = t._self._c, e = t._self._setupProxy;
128
+ return e.isTimeDropdown ? n(e.BentoDropdown, t._b({ staticClass: "b-input-time", attrs: { "dynamic-filtering": "", condensed: e.props.condensed, disabled: e.props.disabled, "error-message": e.computedErrorMessage, items: e.timeItems, label: e.props.label, "model-value": e.props.modelValue ?? "", optional: e.props.optional, placeholder: e.props.placeholder, readonly: e.props.readonly, required: e.props.required, "tooltip-text": e.props.tooltipText }, on: { "update:model-value": e.onTimeSelected }, nativeOn: { click: function(r) {
129
+ return e.emit("click", r);
130
+ } }, scopedSlots: t._u([{ key: "description", fn: function() {
131
+ return [t._t("description", function() {
132
+ return [t._v(t._s(e.timeDescription))];
133
+ })];
134
+ }, proxy: !0 }], null, !0) }, "bento-dropdown", t.$attrs, !1)) : n(e.BentoInputField, t._b({ staticClass: "b-input-time", attrs: { type: e.inputType, step: e.nativeStep, condensed: e.props.condensed, disabled: e.props.disabled, "error-message": e.inputErrorMessage, label: e.props.label, "model-value": e.inputModelValue, optional: e.props.optional, placeholder: e.computedPlaceholder, readonly: e.props.readonly, required: e.props.required, "tooltip-text": e.props.tooltipText }, on: { click: function(r) {
135
+ return e.emit("click", r);
136
+ }, "update:model-value": e.onInput, keydown: e.onKeyDown }, scopedSlots: t._u([e.hasSlot("default") ? { key: "default", fn: function() {
137
+ return [t._t("default")];
138
+ }, proxy: !0 } : null, e.isTouchDevice ? null : { key: "description", fn: function() {
139
+ return [t._t("description", function() {
140
+ return [t._v(t._s(e.timeDescription))];
141
+ })];
142
+ }, proxy: !0 }], null, !0) }, "bento-input-field", t.$attrs, !1));
143
+ }, oe = [], ne = /* @__PURE__ */ O(
144
+ ee,
145
+ te,
146
+ oe,
147
+ !1,
148
+ null,
149
+ "db9b6cd5"
150
+ );
151
+ const Se = ne.exports;
152
+ export {
153
+ Se as B,
154
+ v as i,
155
+ ve as s
156
+ };
157
+ //# sourceMappingURL=input-time.D7IsprlH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-time.D7IsprlH.js","sources":["../../src/utils/ts/time-input.ts","../../src/components/input-time/input-time.vue"],"sourcesContent":["const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\nconst MAX_TIME_INPUT_LENGTH = 8;\n\nconst MINUTES_IN_A_DAY = 24 * 60;\nconst MIN_TIME_INTERVAL = 5;\n\nconst minutesToTimeString = (minutes: number): string => {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${String(hours).padStart(2, '0')}:${String(remainingMinutes).padStart(2, '0')}:00`;\n};\n\nconst timeStringToSeconds = (timeText: string): number => {\n const [hours, minutes, seconds] = timeText.split(':');\n return parseInt(hours, 10) * 3600 + parseInt(minutes, 10) * 60 + parseInt(seconds, 10);\n};\n\n/**\n * Validates a complete time string in HH:MM:SS format.\n * Hours: 00-24, Minutes: 00-59, Seconds: 00-59\n * @param timeText The time string to validate\n * @returns True if the time string is valid, false otherwise\n */\nexport const isValidTimeString = (timeText: string): boolean =>\n /^(?:[01]\\d|2[0-4]):(?:[0-5]\\d):(?:[0-5]\\d)$/.test(timeText);\n\n/**\n * Validates a time interval expressed in minutes.\n * An interval must be a whole number of at least 5 minutes that divides a full day,\n * so the generated options are evenly spread from midnight onwards.\n * @param interval The interval in minutes\n * @returns True if the interval can be used to generate time options, false otherwise\n */\nexport const isValidTimeInterval = (interval: number): boolean =>\n Number.isInteger(interval) &&\n interval >= MIN_TIME_INTERVAL &&\n interval <= MINUTES_IN_A_DAY &&\n MINUTES_IN_A_DAY % interval === 0;\n\n/**\n * Generates the list of selectable times for a given interval, starting at midnight.\n * Seconds are always `00`, e.g. an interval of 60 generates `00:00:00` up to `23:00:00`.\n * @param interval The interval in minutes\n * @returns A list of time strings in HH:MM:SS format, or an empty list for an invalid interval\n */\nexport const generateTimeOptions = (interval: number): Array<string> => {\n if (!isValidTimeInterval(interval)) {\n return [];\n }\n\n const options: Array<string> = [];\n for (let minutes = 0; minutes < MINUTES_IN_A_DAY; minutes += interval) {\n options.push(minutesToTimeString(minutes));\n }\n\n return options;\n};\n\n/**\n * Snaps a time to the closest selectable time of the given interval.\n * Rounding `up` is clamped to the last selectable time, so `23:59:59` with an\n * interval of 60 resolves to `23:00:00` instead of overflowing into the next day.\n * @param timeText The time string in HH:MM:SS format\n * @param interval The interval in minutes\n * @param direction Whether to round the time down or up\n * @returns The snapped time string, or the given time when it cannot be snapped\n */\nexport const snapTimeToInterval = (timeText: string, interval: number, direction: 'down' | 'up'): string => {\n if (!timeText || !isValidTimeString(timeText) || !isValidTimeInterval(interval)) {\n return timeText;\n }\n\n const intervalInSeconds = interval * 60;\n const lastOptionInSeconds = MINUTES_IN_A_DAY * 60 - intervalInSeconds;\n const totalSeconds = timeStringToSeconds(timeText);\n\n if (totalSeconds <= lastOptionInSeconds && totalSeconds % intervalInSeconds === 0) {\n return timeText;\n }\n\n const roundedSeconds =\n direction === 'down'\n ? Math.floor(totalSeconds / intervalInSeconds) * intervalInSeconds\n : Math.ceil(totalSeconds / intervalInSeconds) * intervalInSeconds;\n\n return minutesToTimeString(Math.min(roundedSeconds, lastOptionInSeconds) / 60);\n};\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart, value = '' } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isAllowedKey = allowedKeys.includes(event.key);\n const isValidKey = validDigitRegex.test(event.key) || isAllowedKey;\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n const isAtMaxLength = value.length >= MAX_TIME_INPUT_LENGTH;\n\n if ((!isValidKey && !isValidColon) || (isAtMaxLength && !isAllowedKey)) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","<template>\n <bento-dropdown\n v-if=\"isTimeDropdown\"\n class=\"b-input-time\"\n dynamic-filtering\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"computedErrorMessage\"\n :items=\"timeItems\"\n :label=\"props.label\"\n :model-value=\"props.modelValue ?? ''\"\n :optional=\"props.optional\"\n :placeholder=\"props.placeholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @click.native=\"emit('click', $event)\"\n @update:model-value=\"onTimeSelected\"\n >\n <template #description>\n <slot name=\"description\">{{ timeDescription }}</slot>\n </template>\n </bento-dropdown>\n <bento-input-field\n v-else\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"nativeStep\"\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"inputErrorMessage\"\n :label=\"props.label\"\n :model-value=\"inputModelValue\"\n :optional=\"props.optional\"\n :placeholder=\"computedPlaceholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @click=\"emit('click', $event)\"\n @update:model-value=\"onInput\"\n @keydown=\"onKeyDown\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"!isTouchDevice\" #description>\n <slot name=\"description\">{{ timeDescription }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoInputField } from '@/components/input-field';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n formatTimeInputValue,\n generateTimeOptions,\n isValidTimeInterval,\n isValidTimeString,\n validateTimeInput,\n } from '@/utils/ts/time-input';\n\n // Types\n import type { BentoInputFieldValue } from '@/components/input-field/input-field.types';\n import { type BentoInputTimeProps } from './input-time.types';\n\n // Localization\n import messages from './messages.json';\n\n import { computed, provide, ref, useSlots, watch } from 'vue';\n import { useHasSlot, useTouchDevice } from '@/composables';\n\n const VALIDATION_DEBOUNCE_TIME = 300;\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-time');\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { isTouchDevice } = useTouchDevice();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\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 condensed: { type: Boolean, default: false },\n interval: { default: undefined },\n modelValue: { default: undefined }\n});\n\n const emit = defineEmits([\"click\", \"update:model-value\", \"keydown\", \"input:valid\", \"input:error\"]);\n\n const internalError = ref(false);\n const computedErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return internalError.value ? t('invalidTimeFormat') : null;\n });\n const inputErrorMessage = computed(() => (isTouchDevice.value ? props.errorMessage : computedErrorMessage.value));\n const inputType = computed(() => (isTouchDevice.value ? 'time' : undefined));\n const inputModelValue = computed(() => props.modelValue);\n const computedPlaceholder = computed(() => (isTouchDevice ? undefined : props.placeholder));\n const timeDescription = computed(() =>\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n );\n\n const hasTimeInterval = computed(() => isValidTimeInterval(props.interval));\n // On touch devices the native time input already restricts the selectable times through `step`\n const isTimeDropdown = computed(() => hasTimeInterval.value && !isTouchDevice.value);\n const timeItems = computed(() =>\n generateTimeOptions(props.interval).map(timeOption => ({ label: timeOption, value: timeOption }))\n );\n const nativeStep = computed(() => {\n if (!isTouchDevice.value) {\n return undefined;\n }\n\n return hasTimeInterval.value ? props.interval * 60 : 1;\n });\n\n watch(\n () => props.interval,\n interval => {\n if (interval != null && !isValidTimeInterval(interval)) {\n printDevelopmentWarning(\n `[bento-input-time] The \"interval\" prop must be a whole number of minutes of at least 5 that divides a full day, e.g. 5, 15, 30 or 60. Received \"${interval}\", falling back to a free text time input.`\n );\n }\n },\n { immediate: true }\n );\n\n const validateTime = (timeText: string) => {\n if (!timeText) {\n internalError.value = false;\n return;\n }\n\n const isValid = isValidTimeString(timeText);\n internalError.value = !isValid;\n\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n const validateTimeWithDebounce = debounce(validateTime, VALIDATION_DEBOUNCE_TIME);\n\n // Watch for external modelValue changes (e.g., when parent resets the value)\n watch(\n () => props.modelValue,\n newValue => {\n const timeText = String(newValue ?? '');\n // Clear the error only when the new value is a complete, valid time string\n if (timeText.length === 8 && isValidTimeString(timeText)) {\n internalError.value = false;\n }\n }\n );\n\n const onInput = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n if (isTouchDevice.value) {\n // A `step` of whole minutes hides the seconds in the native input, so they are added back\n const nativeValue = String(value ?? '');\n const shouldAppendSeconds = hasTimeInterval.value && nativeValue.length === 5;\n\n emit('update:model-value', shouldAppendSeconds ? `${nativeValue}:00` : nativeValue);\n emit('input:valid');\n } else {\n const formatted = formatTimeInputValue(String(value ?? ''));\n emit('update:model-value', formatted);\n validateTimeWithDebounce(formatted);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isTouchDevice.value) {\n validateTimeInput(event);\n }\n emit('keydown', event);\n };\n\n const onTimeSelected = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n internalError.value = false;\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Input time component for entering time values in HH:MM:SS format.\n * This is an extension of the `bento-input-field` component with built-in\n * time formatting and validation logic.\n *\n * @usage\n * import { BentoInputTime } from '@adyen/bento-vue2';\n *\n * const timeValue = ref('');\n *\n * export default {\n * components: { BentoInputTime },\n * template: `\n * <bento-input-time\n * label=\"Start time\"\n * :model-value=\"timeValue\"\n * @update:model-value=\"newValue => timeValue.value = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-time',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-time.scss\" />\n"],"names":["validDigitRegex","hourRegex","minuteRegex","MAX_TIME_INPUT_LENGTH","MINUTES_IN_A_DAY","MIN_TIME_INTERVAL","minutesToTimeString","minutes","hours","remainingMinutes","timeStringToSeconds","timeText","seconds","isValidTimeString","isValidTimeInterval","interval","generateTimeOptions","options","snapTimeToInterval","direction","intervalInSeconds","lastOptionInSeconds","totalSeconds","roundedSeconds","validateTimeInput","event","selectionStart","value","isAllowedKey","isValidKey","isValidColon","isAtMaxLength","formatTimeInputValue","formattedValue","secondToLastDigit","lastDigit","__default__","messages","VALIDATION_DEBOUNCE_TIME","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","slots","useSlots","hasSlot","useHasSlot","isTouchDevice","useTouchDevice","t","useI18n","internalError","ref","computedErrorMessage","computed","props","inputErrorMessage","inputType","inputModelValue","computedPlaceholder","timeDescription","hasTimeInterval","isTimeDropdown","timeItems","timeOption","nativeStep","watch","printDevelopmentWarning","validateTime","isValid","emit","validateTimeWithDebounce","debounce","newValue","nativeValue","shouldAppendSeconds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A;AAAA,IAGJ,GAEJE,IAAAC,EAAAJ,GAAA5B,CAAA;AAGA,WAAA0B;AAAA,MAAA,MAAAX,EAAA;AAAA,MACgB,CAAAkB,MAAA;AAER,cAAA5D,IAAA,OAAA4D,KAAA,EAAA;AAEA,QAAA5D,EAAA,WAAA,KAAAE,EAAAF,CAAA,MACIsC,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ,wXAGJ,CAAAtB,MAAA;AACI,UAAA,EAAA0B,EAAA,YAAAA,EAAA;AAIA,YAAAR,EAAA,OAAA;AAEI,gBAAA2B,IAAA,OAAA7C,KAAA,EAAA,GACA8C,IAAAd,EAAA,SAAAa,EAAA,WAAA;AAEA,UAAAJ,EAAA,sBAAAK,IAAA,GAAAD,CAAA,QAAAA,CAAA,GACAJ,EAAA,aAAA;AAAA,QAAkB,OAAA;AAElB,gBAAAM,IAAA1C,EAAA,OAAAL,KAAA,EAAA,CAAA;AACA,UAAAyC,EAAA,sBAAAM,CAAA,GACAL,EAAAK,CAAA;AAAA,QAAkC;AAAA,IACtC,cAGJ,CAAAjD,MAAA;AACI,MAAAoB,EAAA,SACIrB,EAAAC,CAAA,GAEJ2C,EAAA,WAAA3C,CAAA;AAAA,IAAqB,mBAGzB,CAAAE,MAAA;AACI,MAAA0B,EAAA,YAAAA,EAAA,aAIAJ,EAAA,QAAA,IACAmB,EAAA,sBAAA,OAAAzC,KAAA,EAAA,CAAA,GACAyC,EAAA,aAAA;AAAA,IAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as r } from "vue";
2
- import { B as n } from "./typography.D1OZJbEa.js";
3
- import { F as a } from "./footer-actions.C9STwwcv.js";
4
- import { D as i } from "./dialog-page.Bct3zOQO.js";
2
+ import { B as n } from "./typography.Cd386LC_.js";
3
+ import { F as a } from "./footer-actions.B8f-gEQV.js";
4
+ import { D as i } from "./dialog-page.DORdXmEm.js";
5
5
  import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
6
  import "../assets/inspector-page.css";
7
7
  const y = ["small", "large"], c = /* @__PURE__ */ r({
@@ -38,4 +38,4 @@ export {
38
38
  y as B,
39
39
  b as i
40
40
  };
41
- //# sourceMappingURL=inspector-page.BRC_7uro.js.map
41
+ //# sourceMappingURL=inspector-page.IoC9naSV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspector-page.BRC_7uro.js","sources":["../../src/components/inspector/inspector.types.ts"],"sourcesContent":["export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorRelativeLayout = 'push-content' | 'overlay-content';\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n\nexport interface BentoInspectorProps {\n /**\n * ID of the current active inspector page\n */\n activePage?: string;\n\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component.\n * Used for accessibility and the single page inspector.\n * When using `bento-inspector-page` this title is only used for accessibility purposes\n */\n title: string;\n\n /**\n * The appearance of the inspector relative to the main content. Defaults to `push-content`.\n *\n * - `push-content`: The inspector pushes the main content to the side, resizing it to fit.\n * - `overlay-content`: The inspector opens on top of the main content, without affecting its layout.\n */\n relativeLayout?: BentoInspectorRelativeLayout;\n\n /**\n * An optional HTMLElement to focus on when returning focus from the inspector\n * to the main page content (e.g. via the `Ctrl+Shift+S` keyboard shortcut).\n *\n * By default, the inspector attempts to return focus to the element that was active before it opened.\n * However, if that trigger element is removed from the DOM (e.g., via a `v-if`), focus cannot be returned.\n *\n * Providing a `pageFocusAnchor` (e.g. role=\"gridcell\") ensures that the\n * focus context is preserved for accessibility.\n */\n pageFocusAnchor?: HTMLElement;\n}\n"],"names":["BentoInspectorSizeOptions"],"mappings":";;;;;;AAAO,MAAAA,IAAA,CAAA,SAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"inspector-page.IoC9naSV.js","sources":["../../src/components/inspector/inspector.types.ts"],"sourcesContent":["export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorRelativeLayout = 'push-content' | 'overlay-content';\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n\nexport interface BentoInspectorProps {\n /**\n * ID of the current active inspector page\n */\n activePage?: string;\n\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component.\n * Used for accessibility and the single page inspector.\n * When using `bento-inspector-page` this title is only used for accessibility purposes\n */\n title: string;\n\n /**\n * The appearance of the inspector relative to the main content. Defaults to `push-content`.\n *\n * - `push-content`: The inspector pushes the main content to the side, resizing it to fit.\n * - `overlay-content`: The inspector opens on top of the main content, without affecting its layout.\n */\n relativeLayout?: BentoInspectorRelativeLayout;\n\n /**\n * An optional HTMLElement to focus on when returning focus from the inspector\n * to the main page content (e.g. via the `Ctrl+Shift+S` keyboard shortcut).\n *\n * By default, the inspector attempts to return focus to the element that was active before it opened.\n * However, if that trigger element is removed from the DOM (e.g., via a `v-if`), focus cannot be returned.\n *\n * Providing a `pageFocusAnchor` (e.g. role=\"gridcell\") ensures that the\n * focus context is preserved for accessibility.\n */\n pageFocusAnchor?: HTMLElement;\n}\n"],"names":["BentoInspectorSizeOptions"],"mappings":";;;;;;AAAO,MAAAA,IAAA,CAAA,SAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { ref as a, watch as R, defineComponent as V, computed as v, provide as k, toRef as $, nextTick as Y } from "vue";
2
- import { d as K, B as J } from "./typography.D1OZJbEa.js";
3
- import { B as U } from "./button.DII5Ifwa.js";
2
+ import { d as K, B as J } from "./typography.Cd386LC_.js";
3
+ import { B as U } from "./button.tsTeQRcP.js";
4
4
  import { B as X } from "./loading-indicator.PxbRzshH.js";
5
5
  import { B as j, g as q, s as W, a as Z, f as Q } from "./focus-trap.fd6_d2EW.js";
6
6
  import { E as ee } from "./expand.zENZmw3W.js";
@@ -110,7 +110,7 @@ const ue = {
110
110
  'BentoInspector "active-page" as optional',
111
111
  `Make sure to set the "active-page" prop and keep it in sync with "update:active-page".
112
112
  "active-page" prop will be required in the next version`,
113
- "2.0.0"
113
+ "3.0.0"
114
114
  ), { __sfc: !0, props: e, emit: n, t, returnToMainContentDescriptionId: i, wrapper: s, inspector: C, page: T, returnContentButton: b, expandButton: E, closeButton: M, inspectorLastFocusedElement: _, internalActivePage: m, pages: l, previousPages: I, animation: B, isAnimationActive: x, wrapperWidth: S, computedContainerClasses: w, isCompact: d, computedPageLastFocusedElement: f, conditionalClass: H, inspectorAriaLabel: G, findValidFocusFallback: g, getOrderedFocusableElements: h, setFocus: y, handleTabNavigation: N, handleSectionFocus: z, moveFocusBetweenSections: A, focusElement: p, updatePage: D, unregisterPage: P, registerPage: F, BentoTypography: J, BentoButton: U, BentoLoadingIndicator: X, BentoFocusTrap: j, ExpandIcon: ee, CrossIcon: te };
115
115
  }
116
116
  });
@@ -133,10 +133,10 @@ var ve = function() {
133
133
  Ce,
134
134
  !1,
135
135
  null,
136
- "110ca0c0"
136
+ "28828352"
137
137
  );
138
138
  const De = _e.exports;
139
139
  export {
140
140
  De as B
141
141
  };
142
- //# sourceMappingURL=inspector.IOtNex1r.js.map
142
+ //# sourceMappingURL=inspector.BwtV4rE9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.IOtNex1r.js","sources":["../../src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\"></slot>\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\" class=\"b-inspector__focus-trap\">\n <div class=\"b-inspector__container\" :class=\"computedContainerClasses\">\n <template v-if=\"!isCompact\">\n <bento-button\n ref=\"returnContentButton\"\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >\n {{ t('returnToMainContentDescription') }}\n </span>\n </template>\n <div v-if=\"pages.length === 0\" class=\"b-inspector__header\">\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\"></slot>\n </div>\n <div class=\"b-inspector__icons\">\n <bento-button\n v-if=\"expandable\"\n ref=\"expandButton\"\n variant=\"tertiary\"\n :aria-label=\"t('expand')\"\n @click=\"emit('expand')\"\n >\n <template #iconLeft>\n <expand-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n <bento-button\n ref=\"closeButton\"\n :aria-label=\"t('close')\"\n variant=\"tertiary\"\n @click=\"emit('update:is-open', false)\"\n >\n <template #iconLeft>\n <cross-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement, getFocusableIn } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import {\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal/dialog-page/dialog-page.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from '@/internal/dialog-page/dialog-page.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n activePage: { default: '' },\n expandable: { type: Boolean, default: false },\n isOpen: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n size: { default: 'small' },\n title: null,\n relativeLayout: { default: 'push-content' },\n pageFocusAnchor: { default: null }\n});\n\n const emit = defineEmits([\"update:is-open\", \"update:active-page\", \"expand\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n // These refs allow keyboard navigation to follow the intended order independently of the DOM order.\n const returnContentButton = ref(null);\n const expandButton = ref(null);\n const closeButton = ref(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n const internalActivePage = ref(props.activePage);\n\n // Multiple page navigation\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isAnimationActive = ref(false);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n const computedContainerClasses = computed(() => {\n return {\n 'b-inspector__container--padded': pages.value.length === 0, // No pages are registered\n };\n });\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n [`b-inspector--multi-paged`]: pages.value.length,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n /**\n * Returns the Inspector's intended tab order.\n *\n * The content must remain before the icon buttons in the DOM for the Inspector animations,\n * so the keyboard order is managed separately. The return button is omitted automatically in compact mode.\n */\n const getOrderedFocusableElements = () => {\n const navigationButtons = [\n returnContentButton.value?.$el,\n expandButton.value?.$el,\n closeButton.value?.$el,\n ].filter(Boolean) as Array<HTMLElement>;\n const contentFocusableElements = getFocusableIn(inspector.value)\n .map(({ node }) => node)\n .filter(element => !navigationButtons.includes(element));\n\n return [...navigationButtons, ...contentFocusableElements];\n };\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n if (isCompact.value) {\n // The compact focus trap uses DOM order when it initially moves focus.\n // Explicitly focus the first ordered control so content does not skip the icon buttons.\n focusElement(getOrderedFocusableElements()[0]);\n } else {\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n }\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = (event: KeyboardEvent) => {\n // Prevent the browser's DOM-based tab order and use the Inspector-specific order instead.\n const direction = event.shiftKey ? -1 : 1;\n const focusableElements = getOrderedFocusableElements();\n const currentIndex = focusableElements.indexOf(getActiveElement());\n const nextIndex = currentIndex + direction;\n\n // Compact inspectors trap focus, so navigation should wrap around instead of returning focus to the page.\n if (isCompact.value && focusableElements.length > 0) {\n event.preventDefault();\n focusableElements[(nextIndex + focusableElements.length) % focusableElements.length].focus();\n return;\n }\n\n const focusableEl = focusableElements[nextIndex];\n\n // At either end of the Inspector, return focus to the page.\n if (!focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n return;\n }\n\n event.preventDefault();\n focusableEl.focus();\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n /**\n * Multiple page navigation and page registration\n */\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage: internalActivePage,\n animation,\n isAnimationActive,\n isOpen: toRef(props, 'isOpen'),\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n internalActivePage.value = props.activePage;\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","returnContentButton","expandButton","closeButton","inspectorLastFocusedElement","internalActivePage","props","pages","previousPages","animation","BentoDialogPageAnimation","isAnimationActive","wrapperWidth","useElementSize","computedContainerClasses","computed","isCompact","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","getOrderedFocusableElements","navigationButtons","contentFocusableElements","getFocusableIn","node","element","setFocus$1","nextTick","focusElement","setFocus","handleTabNavigation","event","direction","focusableElements","nextIndex","getActiveElement","focusableEl","emit","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","updatePage","page2","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","toRef","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IA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;AAAA,MACJ;AAAA,IACJ,GAGJtB,EAAA,cACIgD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"inspector.BwtV4rE9.js","sources":["../../src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\"></slot>\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\" class=\"b-inspector__focus-trap\">\n <div class=\"b-inspector__container\" :class=\"computedContainerClasses\">\n <template v-if=\"!isCompact\">\n <bento-button\n ref=\"returnContentButton\"\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >\n {{ t('returnToMainContentDescription') }}\n </span>\n </template>\n <div v-if=\"pages.length === 0\" class=\"b-inspector__header\">\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\"></slot>\n </div>\n <div class=\"b-inspector__icons\">\n <bento-button\n v-if=\"expandable\"\n ref=\"expandButton\"\n variant=\"tertiary\"\n :aria-label=\"t('expand')\"\n @click=\"emit('expand')\"\n >\n <template #iconLeft>\n <expand-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n <bento-button\n ref=\"closeButton\"\n :aria-label=\"t('close')\"\n variant=\"tertiary\"\n @click=\"emit('update:is-open', false)\"\n >\n <template #iconLeft>\n <cross-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement, getFocusableIn } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import {\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal/dialog-page/dialog-page.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from '@/internal/dialog-page/dialog-page.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n activePage: { default: '' },\n expandable: { type: Boolean, default: false },\n isOpen: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n size: { default: 'small' },\n title: null,\n relativeLayout: { default: 'push-content' },\n pageFocusAnchor: { default: null }\n});\n\n const emit = defineEmits([\"update:is-open\", \"update:active-page\", \"expand\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n // These refs allow keyboard navigation to follow the intended order independently of the DOM order.\n const returnContentButton = ref(null);\n const expandButton = ref(null);\n const closeButton = ref(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n const internalActivePage = ref(props.activePage);\n\n // Multiple page navigation\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isAnimationActive = ref(false);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n const computedContainerClasses = computed(() => {\n return {\n 'b-inspector__container--padded': pages.value.length === 0, // No pages are registered\n };\n });\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n [`b-inspector--multi-paged`]: pages.value.length,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n /**\n * Returns the Inspector's intended tab order.\n *\n * The content must remain before the icon buttons in the DOM for the Inspector animations,\n * so the keyboard order is managed separately. The return button is omitted automatically in compact mode.\n */\n const getOrderedFocusableElements = () => {\n const navigationButtons = [\n returnContentButton.value?.$el,\n expandButton.value?.$el,\n closeButton.value?.$el,\n ].filter(Boolean) as Array<HTMLElement>;\n const contentFocusableElements = getFocusableIn(inspector.value)\n .map(({ node }) => node)\n .filter(element => !navigationButtons.includes(element));\n\n return [...navigationButtons, ...contentFocusableElements];\n };\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n if (isCompact.value) {\n // The compact focus trap uses DOM order when it initially moves focus.\n // Explicitly focus the first ordered control so content does not skip the icon buttons.\n focusElement(getOrderedFocusableElements()[0]);\n } else {\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n }\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = (event: KeyboardEvent) => {\n // Prevent the browser's DOM-based tab order and use the Inspector-specific order instead.\n const direction = event.shiftKey ? -1 : 1;\n const focusableElements = getOrderedFocusableElements();\n const currentIndex = focusableElements.indexOf(getActiveElement());\n const nextIndex = currentIndex + direction;\n\n // Compact inspectors trap focus, so navigation should wrap around instead of returning focus to the page.\n if (isCompact.value && focusableElements.length > 0) {\n event.preventDefault();\n focusableElements[(nextIndex + focusableElements.length) % focusableElements.length].focus();\n return;\n }\n\n const focusableEl = focusableElements[nextIndex];\n\n // At either end of the Inspector, return focus to the page.\n if (!focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n return;\n }\n\n event.preventDefault();\n focusableEl.focus();\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n /**\n * Multiple page navigation and page registration\n */\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage: internalActivePage,\n animation,\n isAnimationActive,\n isOpen: toRef(props, 'isOpen'),\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n internalActivePage.value = props.activePage;\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","returnContentButton","expandButton","closeButton","inspectorLastFocusedElement","internalActivePage","props","pages","previousPages","animation","BentoDialogPageAnimation","isAnimationActive","wrapperWidth","useElementSize","computedContainerClasses","computed","isCompact","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","getOrderedFocusableElements","navigationButtons","contentFocusableElements","getFocusableIn","node","element","setFocus$1","nextTick","focusElement","setFocus","handleTabNavigation","event","direction","focusableElements","nextIndex","getActiveElement","focusableEl","emit","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","updatePage","page2","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","toRef","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;AAEI,IAAA,CAAAN,EAAA,SAAA,CAAAM,KAAA,CAAAN,EAAA,MAAA,SAAAM,CAAA,MAKAL,EAAA,MAAA,QAAAK,CAAA,GAEAL,EAAA,MAAA,SAAA,KACIA,EAAA,MAAA,IAAA;AAAA,EACJ,CAAA,GAkBJ;AAAA,IAAO,wBAVP,MAAA;AACI,iBAAAM,KAAAN,EAAA;AACI,YAAAM,KAAA,SAAA,KAAA,SAAAA,CAAA;AACI,iBAAAA;AAIR,aAAA;AAAA,IAAO;AAAA,EAIP;AAER;;;;;;;;;;;;;GC0RIC,KAAA,EAAA,MAAA,EAAA,UAAAC,GAAA,EAAA;;;;;;;;;;;;;;;iBAzNA,EAAA,EAAA,IAAAC,GAAA,GACAC,IAAAC,GAAA,gCAAA,GACAC,IAAAX,EAAA,IAAA,GACAY,IAAAZ,EAAA,IAAA,GACAa,IAAAb,EAAA,IAAA,GAEAc,IAAAd,EAAA,IAAA,GACAe,IAAAf,EAAA,IAAA,GACAgB,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,IAAA,GACAkB,IAAAlB,EAAAmB,EAAA,UAAA,GAGAC,IAAApB,EAAA,CAAA,CAAA,GACAqB,IAAArB,EAAA,CAAA,CAAA,GACAsB,IAAAtB,EAAAuB,GAAA,uBAAA,GACAC,IAAAxB,EAAA,EAAA,GAEA,EAAA,OAAAyB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E,YAAA9C;AAAA,MACrD,WAAAI;AAAA,MACZ,mBAAAE;AAAA,MACA,QAAAyC,EAAA9C,GAAA,QAAA;AAAA,MAC6B,OAAAC;AAAA,MAC7B,eAAAC;AAAA,MACA,YAAAoC;AAAA,IACA,CAAA,GAGJM,EAAAG,IAAAJ,CAAA,GAEA3D;AAAA,MAAA,MAAAgB,EAAA;AAAA,MACgB,MAAA;AAER,QAAAA,EAAA,eACID,EAAA,QAAAC,EAAA,YACAsB,EAAA;AAAA,MACJ;AAAA,IACJ,GAGJtB,EAAA,cACIgD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, provide as b, toRef as L, computed as e, useSlots as R, inject as g, ref as i, watch as $, nextTick as x, onMounted as E } from "vue";
2
2
  import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
3
- import { B as S } from "./typography.D1OZJbEa.js";
3
+ import { B as S } from "./typography.Cd386LC_.js";
4
4
  import { u as z } from "./use-has-slot.C9lQZ6nz.js";
5
5
  import { k as T } from "./index.CL3TXc0a.js";
6
6
  import "../assets/layout-row.css";
@@ -87,4 +87,4 @@ export {
87
87
  V as a,
88
88
  U as l
89
89
  };
90
- //# sourceMappingURL=layout-row.LBn6aJv4.js.map
90
+ //# sourceMappingURL=layout-row.DYx7F4cb.js.map