@adyen/bento-vue3 1.81.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/dist/@types/components.d.ts +196 -0
  2. package/dist/@types/index.d.ts +17825 -0
  3. package/dist/@types/use-form-v4.d.ts +86 -0
  4. package/dist/accordion.js +6 -0
  5. package/dist/accordion.js.map +1 -0
  6. package/dist/action-bar.js +5 -0
  7. package/dist/action-bar.js.map +1 -0
  8. package/dist/alert.js +8 -0
  9. package/dist/alert.js.map +1 -0
  10. package/dist/assets/accordion-item.css +1 -0
  11. package/dist/assets/action-bar.css +1 -0
  12. package/dist/assets/ai-button.css +1 -0
  13. package/dist/assets/alert.css +1 -0
  14. package/dist/assets/avatar.css +1 -0
  15. package/dist/assets/base-button.css +1 -0
  16. package/dist/assets/base-modal.css +1 -0
  17. package/dist/assets/button-actions-with-menu.css +1 -0
  18. package/dist/assets/button-actions.css +1 -0
  19. package/dist/assets/button.css +1 -0
  20. package/dist/assets/calendar.css +1 -0
  21. package/dist/assets/card.css +1 -0
  22. package/dist/assets/checkbox-group.css +1 -0
  23. package/dist/assets/checkbox-input.css +1 -0
  24. package/dist/assets/checkbox.css +1 -0
  25. package/dist/assets/chip.css +1 -0
  26. package/dist/assets/code-snippet.css +1 -0
  27. package/dist/assets/controls-group.css +1 -0
  28. package/dist/assets/copy.css +1 -0
  29. package/dist/assets/country.css +1 -0
  30. package/dist/assets/currency.css +1 -0
  31. package/dist/assets/dashboard-section.css +1 -0
  32. package/dist/assets/dashed-underline.css +1 -0
  33. package/dist/assets/data-grid-template.css +1 -0
  34. package/dist/assets/data-grid.css +1 -0
  35. package/dist/assets/date-picker.css +1 -0
  36. package/dist/assets/date-range-picker.css +1 -0
  37. package/dist/assets/date.css +1 -0
  38. package/dist/assets/dialog-page.css +1 -0
  39. package/dist/assets/divider.css +1 -0
  40. package/dist/assets/dropdown-default-textbox.css +1 -0
  41. package/dist/assets/dropdown-tag.css +1 -0
  42. package/dist/assets/dropdown.css +1 -0
  43. package/dist/assets/empty-state.css +1 -0
  44. package/dist/assets/field-label.css +1 -0
  45. package/dist/assets/file-uploader.css +1 -0
  46. package/dist/assets/filter-bar.css +1 -0
  47. package/dist/assets/fixed-scroller.css +1 -0
  48. package/dist/assets/focus-trap.css +1 -0
  49. package/dist/assets/footer-actions.css +1 -0
  50. package/dist/assets/form-layout-title.css +1 -0
  51. package/dist/assets/grid-layout.css +1 -0
  52. package/dist/assets/header-meta.css +1 -0
  53. package/dist/assets/header-with-views.css +1 -0
  54. package/dist/assets/header.css +1 -0
  55. package/dist/assets/index.css +1 -0
  56. package/dist/assets/info-icon.css +1 -0
  57. package/dist/assets/input-field-password.css +1 -0
  58. package/dist/assets/input-field-phone-number.css +1 -0
  59. package/dist/assets/input-field.css +1 -0
  60. package/dist/assets/inspector.css +1 -0
  61. package/dist/assets/layout-row.css +1 -0
  62. package/dist/assets/link.css +1 -0
  63. package/dist/assets/listbox-option-tag.css +1 -0
  64. package/dist/assets/loading-indicator.css +1 -0
  65. package/dist/assets/main.css +1 -0
  66. package/dist/assets/modal-fullscreen.css +1 -0
  67. package/dist/assets/pagination.css +1 -0
  68. package/dist/assets/payment-method.css +1 -0
  69. package/dist/assets/popper-container.css +1 -0
  70. package/dist/assets/promo-banner.css +1 -0
  71. package/dist/assets/radio-group.css +1 -0
  72. package/dist/assets/radio-input.css +1 -0
  73. package/dist/assets/rich-text-editor.css +1 -0
  74. package/dist/assets/search-bar.css +1 -0
  75. package/dist/assets/secondary-nav.css +1 -0
  76. package/dist/assets/segmented-control.css +1 -0
  77. package/dist/assets/selection-card-group.css +1 -0
  78. package/dist/assets/sidepanel.css +1 -0
  79. package/dist/assets/status.css +1 -0
  80. package/dist/assets/step.css +1 -0
  81. package/dist/assets/structured-list-item.css +1 -0
  82. package/dist/assets/summary-grid.css +1 -0
  83. package/dist/assets/tab.css +1 -0
  84. package/dist/assets/tag.css +1 -0
  85. package/dist/assets/textarea.css +1 -0
  86. package/dist/assets/timeline-item.css +1 -0
  87. package/dist/assets/toast.css +1 -0
  88. package/dist/assets/toggle.css +1 -0
  89. package/dist/assets/tooltip.css +1 -0
  90. package/dist/assets/tutorial.css +1 -0
  91. package/dist/assets/typography.css +1 -0
  92. package/dist/assets/use-cached-selected-values.css +1 -0
  93. package/dist/avatar.js +5 -0
  94. package/dist/avatar.js.map +1 -0
  95. package/dist/button.js +18 -0
  96. package/dist/button.js.map +1 -0
  97. package/dist/card.js +7 -0
  98. package/dist/card.js.map +1 -0
  99. package/dist/checkbox.js +11 -0
  100. package/dist/checkbox.js.map +1 -0
  101. package/dist/chip.js +5 -0
  102. package/dist/chip.js.map +1 -0
  103. package/dist/chunks/1-generic-use.CZhwP2Yc.js +5 -0
  104. package/dist/chunks/1-generic-use.CZhwP2Yc.js.map +1 -0
  105. package/dist/chunks/1-generic-use.R6x8PEGA.js +5 -0
  106. package/dist/chunks/1-generic-use.R6x8PEGA.js.map +1 -0
  107. package/dist/chunks/2-generic-use.CNKjB4B7.js +5 -0
  108. package/dist/chunks/2-generic-use.CNKjB4B7.js.map +1 -0
  109. package/dist/chunks/2-generic-use.w0fUhovx.js +5 -0
  110. package/dist/chunks/2-generic-use.w0fUhovx.js.map +1 -0
  111. package/dist/chunks/3-generic-use.BLEzR04g.js +5 -0
  112. package/dist/chunks/3-generic-use.BLEzR04g.js.map +1 -0
  113. package/dist/chunks/3-generic-use.D3NFHgI4.js +5 -0
  114. package/dist/chunks/3-generic-use.D3NFHgI4.js.map +1 -0
  115. package/dist/chunks/4-generic-use.CULEpvgj.js +5 -0
  116. package/dist/chunks/4-generic-use.CULEpvgj.js.map +1 -0
  117. package/dist/chunks/4-generic-use.D82y3n39.js +5 -0
  118. package/dist/chunks/4-generic-use.D82y3n39.js.map +1 -0
  119. package/dist/chunks/_plugin-vue_export-helper.CHgC5LLL.js +10 -0
  120. package/dist/chunks/_plugin-vue_export-helper.CHgC5LLL.js.map +1 -0
  121. package/dist/chunks/accordion-item.DHyAfeAu.js +143 -0
  122. package/dist/chunks/accordion-item.DHyAfeAu.js.map +1 -0
  123. package/dist/chunks/action-bar.BsLU4Bp3.js +202 -0
  124. package/dist/chunks/action-bar.BsLU4Bp3.js.map +1 -0
  125. package/dist/chunks/adding-payment-methods.BJZLPxtM.js +5 -0
  126. package/dist/chunks/adding-payment-methods.BJZLPxtM.js.map +1 -0
  127. package/dist/chunks/adding-payment-methods.Dle8zt43.js +5 -0
  128. package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +1 -0
  129. package/dist/chunks/adyen-giving.Ffw_DlJK.js +5 -0
  130. package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +1 -0
  131. package/dist/chunks/adyen-giving.LiKHj_jY.js +5 -0
  132. package/dist/chunks/adyen-giving.LiKHj_jY.js.map +1 -0
  133. package/dist/chunks/ai-button.DaRuea3x.js +93 -0
  134. package/dist/chunks/ai-button.DaRuea3x.js.map +1 -0
  135. package/dist/chunks/alert.C2pusd-_.js +171 -0
  136. package/dist/chunks/alert.C2pusd-_.js.map +1 -0
  137. package/dist/chunks/aria-label.CaUURpnB.js +13 -0
  138. package/dist/chunks/aria-label.CaUURpnB.js.map +1 -0
  139. package/dist/chunks/avatar.P2Fkz2I6.js +95 -0
  140. package/dist/chunks/avatar.P2Fkz2I6.js.map +1 -0
  141. package/dist/chunks/base-button.BSLpAs8A.js +114 -0
  142. package/dist/chunks/base-button.BSLpAs8A.js.map +1 -0
  143. package/dist/chunks/base-modal.Bt3mQ_5Y.js +441 -0
  144. package/dist/chunks/base-modal.Bt3mQ_5Y.js.map +1 -0
  145. package/dist/chunks/bin.DuHlEQBO.js +37 -0
  146. package/dist/chunks/bin.DuHlEQBO.js.map +1 -0
  147. package/dist/chunks/button-actions-with-menu.D2GU8abn.js +93 -0
  148. package/dist/chunks/button-actions-with-menu.D2GU8abn.js.map +1 -0
  149. package/dist/chunks/button-actions.CbEoQYUV.js +1367 -0
  150. package/dist/chunks/button-actions.CbEoQYUV.js.map +1 -0
  151. package/dist/chunks/button-actions.types.BptAXjD8.js +8 -0
  152. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -0
  153. package/dist/chunks/button.DhcxX2GJ.js +131 -0
  154. package/dist/chunks/button.DhcxX2GJ.js.map +1 -0
  155. package/dist/chunks/calendar.CyJXcMz2.js +1962 -0
  156. package/dist/chunks/calendar.CyJXcMz2.js.map +1 -0
  157. package/dist/chunks/card.s3fBTh55.js +228 -0
  158. package/dist/chunks/card.s3fBTh55.js.map +1 -0
  159. package/dist/chunks/checkbox-group.tnj89uhH.js +177 -0
  160. package/dist/chunks/checkbox-group.tnj89uhH.js.map +1 -0
  161. package/dist/chunks/checkbox-input.BXNGT9U0.js +144 -0
  162. package/dist/chunks/checkbox-input.BXNGT9U0.js.map +1 -0
  163. package/dist/chunks/checkbox.Wqhh2aRA.js +257 -0
  164. package/dist/chunks/checkbox.Wqhh2aRA.js.map +1 -0
  165. package/dist/chunks/checkmark-circle-fill._6-d40ru.js +44 -0
  166. package/dist/chunks/checkmark-circle-fill._6-d40ru.js.map +1 -0
  167. package/dist/chunks/checkmark-small.x-gmK2Dt.js +29 -0
  168. package/dist/chunks/checkmark-small.x-gmK2Dt.js.map +1 -0
  169. package/dist/chunks/chevron-down.DCQ6ZLaq.js +29 -0
  170. package/dist/chunks/chevron-down.DCQ6ZLaq.js.map +1 -0
  171. package/dist/chunks/chevron-left.Cfn1uGLH.js +52 -0
  172. package/dist/chunks/chevron-left.Cfn1uGLH.js.map +1 -0
  173. package/dist/chunks/chevron-up.kfuLRpZb.js +29 -0
  174. package/dist/chunks/chevron-up.kfuLRpZb.js.map +1 -0
  175. package/dist/chunks/chip.CoV28mKv.js +71 -0
  176. package/dist/chunks/chip.CoV28mKv.js.map +1 -0
  177. package/dist/chunks/click-outside.C1Ud8AA2.js +23 -0
  178. package/dist/chunks/click-outside.C1Ud8AA2.js.map +1 -0
  179. package/dist/chunks/code-snippet.LRw3jGjV.js +343 -0
  180. package/dist/chunks/code-snippet.LRw3jGjV.js.map +1 -0
  181. package/dist/chunks/codemirror.Cy7iSLbd.js +14628 -0
  182. package/dist/chunks/codemirror.Cy7iSLbd.js.map +1 -0
  183. package/dist/chunks/constructNow.BhymNmy5.js +8 -0
  184. package/dist/chunks/constructNow.BhymNmy5.js.map +1 -0
  185. package/dist/chunks/controls-group.B2Qci77U.js +101 -0
  186. package/dist/chunks/controls-group.B2Qci77U.js.map +1 -0
  187. package/dist/chunks/copy.D5CBHqUB.js +117 -0
  188. package/dist/chunks/copy.D5CBHqUB.js.map +1 -0
  189. package/dist/chunks/country.D484ezGU.js +69 -0
  190. package/dist/chunks/country.D484ezGU.js.map +1 -0
  191. package/dist/chunks/country.types.C0Q_hhgJ.js +269 -0
  192. package/dist/chunks/country.types.C0Q_hhgJ.js.map +1 -0
  193. package/dist/chunks/cross-circle-fill-small.Dv5-PxwF.js +29 -0
  194. package/dist/chunks/cross-circle-fill-small.Dv5-PxwF.js.map +1 -0
  195. package/dist/chunks/cross-circle-fill.CYLL7jfC.js +44 -0
  196. package/dist/chunks/cross-circle-fill.CYLL7jfC.js.map +1 -0
  197. package/dist/chunks/cross-small.n1UO5wNB.js +29 -0
  198. package/dist/chunks/cross-small.n1UO5wNB.js.map +1 -0
  199. package/dist/chunks/cross.B92GxFTY.js +29 -0
  200. package/dist/chunks/cross.B92GxFTY.js.map +1 -0
  201. package/dist/chunks/currency.WmvQjX7l.js +116 -0
  202. package/dist/chunks/currency.WmvQjX7l.js.map +1 -0
  203. package/dist/chunks/dashboard-section.DlokD9Rf.js +165 -0
  204. package/dist/chunks/dashboard-section.DlokD9Rf.js.map +1 -0
  205. package/dist/chunks/dashed-underline.Dw1Iqk0l.js +114 -0
  206. package/dist/chunks/dashed-underline.Dw1Iqk0l.js.map +1 -0
  207. package/dist/chunks/data-grid-template.BwTVHbpB.js +144 -0
  208. package/dist/chunks/data-grid-template.BwTVHbpB.js.map +1 -0
  209. package/dist/chunks/data-grid-template.keys.VezYtHtM.js +5 -0
  210. package/dist/chunks/data-grid-template.keys.VezYtHtM.js.map +1 -0
  211. package/dist/chunks/data-grid.Be6Ao4He.js +4271 -0
  212. package/dist/chunks/data-grid.Be6Ao4He.js.map +1 -0
  213. package/dist/chunks/date-format.B8RU7D42.js +17 -0
  214. package/dist/chunks/date-format.B8RU7D42.js.map +1 -0
  215. package/dist/chunks/date-picker.CYBx1TS_.js +245 -0
  216. package/dist/chunks/date-picker.CYBx1TS_.js.map +1 -0
  217. package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
  218. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
  219. package/dist/chunks/date-range-picker.BgEM0fyZ.js +1109 -0
  220. package/dist/chunks/date-range-picker.BgEM0fyZ.js.map +1 -0
  221. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js +5 -0
  222. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -0
  223. package/dist/chunks/date.DZvVL-uz.js +163 -0
  224. package/dist/chunks/date.DZvVL-uz.js.map +1 -0
  225. package/dist/chunks/debounce.DUTu11PS.js +10 -0
  226. package/dist/chunks/debounce.DUTu11PS.js.map +1 -0
  227. package/dist/chunks/delight.CDBAFnwC.js +5 -0
  228. package/dist/chunks/delight.CDBAFnwC.js.map +1 -0
  229. package/dist/chunks/delight.xKDCvvaS.js +5 -0
  230. package/dist/chunks/delight.xKDCvvaS.js.map +1 -0
  231. package/dist/chunks/dialog-page.BY6T1jYZ.js +175 -0
  232. package/dist/chunks/dialog-page.BY6T1jYZ.js.map +1 -0
  233. package/dist/chunks/differenceInMonths.Cab3nOsb.js +1590 -0
  234. package/dist/chunks/differenceInMonths.Cab3nOsb.js.map +1 -0
  235. package/dist/chunks/directive.Cbdox5VL.js +23 -0
  236. package/dist/chunks/directive.Cbdox5VL.js.map +1 -0
  237. package/dist/chunks/divider.Dho4_hQ7.js +33 -0
  238. package/dist/chunks/divider.Dho4_hQ7.js.map +1 -0
  239. package/dist/chunks/dot.ob6N-5Um.js +29 -0
  240. package/dist/chunks/dot.ob6N-5Um.js.map +1 -0
  241. package/dist/chunks/dropdown-default-textbox.CNrsjXUU.js +425 -0
  242. package/dist/chunks/dropdown-default-textbox.CNrsjXUU.js.map +1 -0
  243. package/dist/chunks/dropdown-tag.DmIHi3i-.js +301 -0
  244. package/dist/chunks/dropdown-tag.DmIHi3i-.js.map +1 -0
  245. package/dist/chunks/dropdown.Be6ses6k.js +833 -0
  246. package/dist/chunks/dropdown.Be6ses6k.js.map +1 -0
  247. package/dist/chunks/empty-state.Be6M8ivH.js +140 -0
  248. package/dist/chunks/empty-state.Be6M8ivH.js.map +1 -0
  249. package/dist/chunks/es6.MoTTyETW.js +12 -0
  250. package/dist/chunks/es6.MoTTyETW.js.map +1 -0
  251. package/dist/chunks/events.BQOQSSb7.js +44 -0
  252. package/dist/chunks/events.BQOQSSb7.js.map +1 -0
  253. package/dist/chunks/expand.C9IAqYYL.js +33 -0
  254. package/dist/chunks/expand.C9IAqYYL.js.map +1 -0
  255. package/dist/chunks/field-label.Cu6X9V0_.js +158 -0
  256. package/dist/chunks/field-label.Cu6X9V0_.js.map +1 -0
  257. package/dist/chunks/file-uploader.Bdhm4TVh.js +2299 -0
  258. package/dist/chunks/file-uploader.Bdhm4TVh.js.map +1 -0
  259. package/dist/chunks/filter-bar.CLNU1Ixm.js +3211 -0
  260. package/dist/chunks/filter-bar.CLNU1Ixm.js.map +1 -0
  261. package/dist/chunks/fixed-scroller.Dmg8r9QP.js +147 -0
  262. package/dist/chunks/fixed-scroller.Dmg8r9QP.js.map +1 -0
  263. package/dist/chunks/focus-trap.BaHvK7aT.js +1171 -0
  264. package/dist/chunks/focus-trap.BaHvK7aT.js.map +1 -0
  265. package/dist/chunks/footer-actions.C_EniPHo.js +110 -0
  266. package/dist/chunks/footer-actions.C_EniPHo.js.map +1 -0
  267. package/dist/chunks/form-field.D_2g7vaP.js +10 -0
  268. package/dist/chunks/form-field.D_2g7vaP.js.map +1 -0
  269. package/dist/chunks/form-layout-title.sxPU_lB_.js +214 -0
  270. package/dist/chunks/form-layout-title.sxPU_lB_.js.map +1 -0
  271. package/dist/chunks/form-layout.types.bZW9iR6_.js +5 -0
  272. package/dist/chunks/form-layout.types.bZW9iR6_.js.map +1 -0
  273. package/dist/chunks/generate-uid.NJ8tVoha.js +32 -0
  274. package/dist/chunks/generate-uid.NJ8tVoha.js.map +1 -0
  275. package/dist/chunks/get-slot-text.CQRAP2_q.js +12 -0
  276. package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -0
  277. package/dist/chunks/getRoundingMethod.C3eaeGLR.js +10 -0
  278. package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -0
  279. package/dist/chunks/getTimezoneOffsetInMilliseconds.B7sxiukN.js +484 -0
  280. package/dist/chunks/getTimezoneOffsetInMilliseconds.B7sxiukN.js.map +1 -0
  281. package/dist/chunks/grid-layout.DDaRNz4-.js +114 -0
  282. package/dist/chunks/grid-layout.DDaRNz4-.js.map +1 -0
  283. package/dist/chunks/header-meta.DMjERxW-.js +221 -0
  284. package/dist/chunks/header-meta.DMjERxW-.js.map +1 -0
  285. package/dist/chunks/header-with-views.CVgISUVn.js +2426 -0
  286. package/dist/chunks/header-with-views.CVgISUVn.js.map +1 -0
  287. package/dist/chunks/header.Dq5aBp9l.js +141 -0
  288. package/dist/chunks/header.Dq5aBp9l.js.map +1 -0
  289. package/dist/chunks/image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js +47 -0
  290. package/dist/chunks/image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js.map +1 -0
  291. package/dist/chunks/index.CWuzEfiV.js +6 -0
  292. package/dist/chunks/index.CWuzEfiV.js.map +1 -0
  293. package/dist/chunks/index.E60QniEu.js +592 -0
  294. package/dist/chunks/index.E60QniEu.js.map +1 -0
  295. package/dist/chunks/index.pdBj0KQU.js +15 -0
  296. package/dist/chunks/index.pdBj0KQU.js.map +1 -0
  297. package/dist/chunks/info-icon.C7RAAeQQ.js +35 -0
  298. package/dist/chunks/info-icon.C7RAAeQQ.js.map +1 -0
  299. package/dist/chunks/info.BKwey1HA.js +44 -0
  300. package/dist/chunks/info.BKwey1HA.js.map +1 -0
  301. package/dist/chunks/input-field-password.BhksIaXB.js +396 -0
  302. package/dist/chunks/input-field-password.BhksIaXB.js.map +1 -0
  303. package/dist/chunks/input-field-phone-number.jW5pH96y.js +3333 -0
  304. package/dist/chunks/input-field-phone-number.jW5pH96y.js.map +1 -0
  305. package/dist/chunks/input-field.CYBjHzVA.js +318 -0
  306. package/dist/chunks/input-field.CYBjHzVA.js.map +1 -0
  307. package/dist/chunks/inspector.BBhrSgO6.js +200 -0
  308. package/dist/chunks/inspector.BBhrSgO6.js.map +1 -0
  309. package/dist/chunks/inspector.types.DyHwE18g.js +5 -0
  310. package/dist/chunks/inspector.types.DyHwE18g.js.map +1 -0
  311. package/dist/chunks/internal-error.BLZodVBE.js +5 -0
  312. package/dist/chunks/internal-error.BLZodVBE.js.map +1 -0
  313. package/dist/chunks/internal-error.BmrwJFpR.js +5 -0
  314. package/dist/chunks/internal-error.BmrwJFpR.js.map +1 -0
  315. package/dist/chunks/keyboard-navigation.DWmhelVv.js +66 -0
  316. package/dist/chunks/keyboard-navigation.DWmhelVv.js.map +1 -0
  317. package/dist/chunks/layout-row.BxP9SxrL.js +100 -0
  318. package/dist/chunks/layout-row.BxP9SxrL.js.map +1 -0
  319. package/dist/chunks/link.cwPmWlsk.js +116 -0
  320. package/dist/chunks/link.cwPmWlsk.js.map +1 -0
  321. package/dist/chunks/listbox-option-tag.VRGb_04i.js +57 -0
  322. package/dist/chunks/listbox-option-tag.VRGb_04i.js.map +1 -0
  323. package/dist/chunks/loading-indicator.Db794TT5.js +33 -0
  324. package/dist/chunks/loading-indicator.Db794TT5.js.map +1 -0
  325. package/dist/chunks/minus-small.DYIyF5XW.js +32 -0
  326. package/dist/chunks/minus-small.DYIyF5XW.js.map +1 -0
  327. package/dist/chunks/modal-fullscreen.hOTnlB9T.js +285 -0
  328. package/dist/chunks/modal-fullscreen.hOTnlB9T.js.map +1 -0
  329. package/dist/chunks/modal.vue_vue_type_script_setup_true_lang.DFCZG9Zc.js +501 -0
  330. package/dist/chunks/modal.vue_vue_type_script_setup_true_lang.DFCZG9Zc.js.map +1 -0
  331. package/dist/chunks/no-results-found.Bg_ZcEid.js +5 -0
  332. package/dist/chunks/no-results-found.Bg_ZcEid.js.map +1 -0
  333. package/dist/chunks/no-results-found.BqvYsBR6.js +5 -0
  334. package/dist/chunks/no-results-found.BqvYsBR6.js.map +1 -0
  335. package/dist/chunks/notifications-cleared.BMZk37uf.js +5 -0
  336. package/dist/chunks/notifications-cleared.BMZk37uf.js.map +1 -0
  337. package/dist/chunks/notifications-cleared.C7W9ZXY7.js +5 -0
  338. package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +1 -0
  339. package/dist/chunks/on-click-outside.D9aY9g8G.js +101 -0
  340. package/dist/chunks/on-click-outside.D9aY9g8G.js.map +1 -0
  341. package/dist/chunks/page-not-found.COJLPVaU.js +5 -0
  342. package/dist/chunks/page-not-found.COJLPVaU.js.map +1 -0
  343. package/dist/chunks/page-not-found.DWW6W-PZ.js +5 -0
  344. package/dist/chunks/page-not-found.DWW6W-PZ.js.map +1 -0
  345. package/dist/chunks/pagination.Cj_FYHm-.js +461 -0
  346. package/dist/chunks/pagination.Cj_FYHm-.js.map +1 -0
  347. package/dist/chunks/payment-method.CExDsirg.js +128 -0
  348. package/dist/chunks/payment-method.CExDsirg.js.map +1 -0
  349. package/dist/chunks/payment-method.types.BqtH7RM2.js +5 -0
  350. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -0
  351. package/dist/chunks/planned-maintenance.C61sWB9h.js +5 -0
  352. package/dist/chunks/planned-maintenance.C61sWB9h.js.map +1 -0
  353. package/dist/chunks/planned-maintenance.jmWYTdet.js +5 -0
  354. package/dist/chunks/planned-maintenance.jmWYTdet.js.map +1 -0
  355. package/dist/chunks/popover.types.DgfeurkF.js +6 -0
  356. package/dist/chunks/popover.types.DgfeurkF.js.map +1 -0
  357. package/dist/chunks/popper-container.I9gzp1NR.js +1413 -0
  358. package/dist/chunks/popper-container.I9gzp1NR.js.map +1 -0
  359. package/dist/chunks/promo-banner.B-TLTLEd.js +126 -0
  360. package/dist/chunks/promo-banner.B-TLTLEd.js.map +1 -0
  361. package/dist/chunks/radio-group.C0qJThJ2.js +278 -0
  362. package/dist/chunks/radio-group.C0qJThJ2.js.map +1 -0
  363. package/dist/chunks/radio-input.CBNE-AkM.js +95 -0
  364. package/dist/chunks/radio-input.CBNE-AkM.js.map +1 -0
  365. package/dist/chunks/referrals.BvtT-kQS.js +5 -0
  366. package/dist/chunks/referrals.BvtT-kQS.js.map +1 -0
  367. package/dist/chunks/referrals.aX8WZigH.js +5 -0
  368. package/dist/chunks/referrals.aX8WZigH.js.map +1 -0
  369. package/dist/chunks/refresh.BB4ouvz_.js +29 -0
  370. package/dist/chunks/refresh.BB4ouvz_.js.map +1 -0
  371. package/dist/chunks/resize.Bqks3WUm.js +15 -0
  372. package/dist/chunks/resize.Bqks3WUm.js.map +1 -0
  373. package/dist/chunks/rich-text-editor.CDcfVhGv.js +6224 -0
  374. package/dist/chunks/rich-text-editor.CDcfVhGv.js.map +1 -0
  375. package/dist/chunks/search-bar.CIi1zffn.js +116 -0
  376. package/dist/chunks/search-bar.CIi1zffn.js.map +1 -0
  377. package/dist/chunks/search.PczW-onY.js +44 -0
  378. package/dist/chunks/search.PczW-onY.js.map +1 -0
  379. package/dist/chunks/secondary-nav.C9ApoJ-J.js +138 -0
  380. package/dist/chunks/secondary-nav.C9ApoJ-J.js.map +1 -0
  381. package/dist/chunks/segmented-control.PlGfqyxH.js +145 -0
  382. package/dist/chunks/segmented-control.PlGfqyxH.js.map +1 -0
  383. package/dist/chunks/segmented-control.types.BHRLV8KU.js +5 -0
  384. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -0
  385. package/dist/chunks/selection-card-group.DjlLf4oi.js +415 -0
  386. package/dist/chunks/selection-card-group.DjlLf4oi.js.map +1 -0
  387. package/dist/chunks/show.CT4Augxb.js +64 -0
  388. package/dist/chunks/show.CT4Augxb.js.map +1 -0
  389. package/dist/chunks/sidepanel.CiyGOtAx.js +254 -0
  390. package/dist/chunks/sidepanel.CiyGOtAx.js.map +1 -0
  391. package/dist/chunks/status.types.-l2qJxLn.js +44 -0
  392. package/dist/chunks/status.types.-l2qJxLn.js.map +1 -0
  393. package/dist/chunks/step.rYLkDMZ0.js +267 -0
  394. package/dist/chunks/step.rYLkDMZ0.js.map +1 -0
  395. package/dist/chunks/structured-list-item.CsUD3M_V.js +111 -0
  396. package/dist/chunks/structured-list-item.CsUD3M_V.js.map +1 -0
  397. package/dist/chunks/success.DhioLvPD.js +5 -0
  398. package/dist/chunks/success.DhioLvPD.js.map +1 -0
  399. package/dist/chunks/success.nNwxJRBS.js +5 -0
  400. package/dist/chunks/success.nNwxJRBS.js.map +1 -0
  401. package/dist/chunks/summary-grid.keys.Xx-W5a2w.js +6 -0
  402. package/dist/chunks/summary-grid.keys.Xx-W5a2w.js.map +1 -0
  403. package/dist/chunks/summary-grid.types.BzPSYDUX.js +496 -0
  404. package/dist/chunks/summary-grid.types.BzPSYDUX.js.map +1 -0
  405. package/dist/chunks/tab.BAwuVDsV.js +252 -0
  406. package/dist/chunks/tab.BAwuVDsV.js.map +1 -0
  407. package/dist/chunks/tabs.keys.B4qGhjp2.js +7 -0
  408. package/dist/chunks/tabs.keys.B4qGhjp2.js.map +1 -0
  409. package/dist/chunks/tag.EDED27n5.js +57 -0
  410. package/dist/chunks/tag.EDED27n5.js.map +1 -0
  411. package/dist/chunks/textarea.7MePsezm.js +254 -0
  412. package/dist/chunks/textarea.7MePsezm.js.map +1 -0
  413. package/dist/chunks/timeline-item.D6SeOiVe.js +428 -0
  414. package/dist/chunks/timeline-item.D6SeOiVe.js.map +1 -0
  415. package/dist/chunks/toast.BFw86uEp.js +221 -0
  416. package/dist/chunks/toast.BFw86uEp.js.map +1 -0
  417. package/dist/chunks/toggle.BHCUjMpp.js +143 -0
  418. package/dist/chunks/toggle.BHCUjMpp.js.map +1 -0
  419. package/dist/chunks/tooltip.B76ucISL.js +202 -0
  420. package/dist/chunks/tooltip.B76ucISL.js.map +1 -0
  421. package/dist/chunks/truncate.BfIl_-71.js +8 -0
  422. package/dist/chunks/truncate.BfIl_-71.js.map +1 -0
  423. package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.CyO3qbAU.js +421 -0
  424. package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.CyO3qbAU.js.map +1 -0
  425. package/dist/chunks/typography.yBEME_Gu.js +83 -0
  426. package/dist/chunks/typography.yBEME_Gu.js.map +1 -0
  427. package/dist/chunks/upload-files.5wQwbfkp.js +5 -0
  428. package/dist/chunks/upload-files.5wQwbfkp.js.map +1 -0
  429. package/dist/chunks/upload-files.jTQY6y2X.js +5 -0
  430. package/dist/chunks/upload-files.jTQY6y2X.js.map +1 -0
  431. package/dist/chunks/use-bento-toast-controller.DK1PV3YW.js +50 -0
  432. package/dist/chunks/use-bento-toast-controller.DK1PV3YW.js.map +1 -0
  433. package/dist/chunks/use-cached-selected-values.DimYI3lv.js +1702 -0
  434. package/dist/chunks/use-cached-selected-values.DimYI3lv.js.map +1 -0
  435. package/dist/chunks/use-country-items.Dzbl2UsO.js +30 -0
  436. package/dist/chunks/use-country-items.Dzbl2UsO.js.map +1 -0
  437. package/dist/chunks/use-country-phon-code.Bui3zD6W.js +5621 -0
  438. package/dist/chunks/use-country-phon-code.Bui3zD6W.js.map +1 -0
  439. package/dist/chunks/use-default-slot-validator.O02rzsob.js +16 -0
  440. package/dist/chunks/use-default-slot-validator.O02rzsob.js.map +1 -0
  441. package/dist/chunks/use-expandable-content-height.GkjjbmPy.js +17 -0
  442. package/dist/chunks/use-expandable-content-height.GkjjbmPy.js.map +1 -0
  443. package/dist/chunks/use-form-layout-loading.CWbjZiwP.js +12 -0
  444. package/dist/chunks/use-form-layout-loading.CWbjZiwP.js.map +1 -0
  445. package/dist/chunks/use-has-slot.B7eQSabc.js +15 -0
  446. package/dist/chunks/use-has-slot.B7eQSabc.js.map +1 -0
  447. package/dist/chunks/warning-filled.BMGD0G-_.js +29 -0
  448. package/dist/chunks/warning-filled.BMGD0G-_.js.map +1 -0
  449. package/dist/chunks/wrong-environment.BOsyKdRI.js +5 -0
  450. package/dist/chunks/wrong-environment.BOsyKdRI.js.map +1 -0
  451. package/dist/chunks/wrong-environment.BiHTPtbJ.js +5 -0
  452. package/dist/chunks/wrong-environment.BiHTPtbJ.js.map +1 -0
  453. package/dist/click-outside.js +5 -0
  454. package/dist/click-outside.js.map +1 -0
  455. package/dist/code-snippet.js +8 -0
  456. package/dist/code-snippet.js.map +1 -0
  457. package/dist/country.js +12 -0
  458. package/dist/country.js.map +1 -0
  459. package/dist/currency.js +6 -0
  460. package/dist/currency.js.map +1 -0
  461. package/dist/dashboard-template.js +6 -0
  462. package/dist/dashboard-template.js.map +1 -0
  463. package/dist/dashed-underline.js +5 -0
  464. package/dist/dashed-underline.js.map +1 -0
  465. package/dist/data-grid-template.js +5 -0
  466. package/dist/data-grid-template.js.map +1 -0
  467. package/dist/data-grid.js +13 -0
  468. package/dist/data-grid.js.map +1 -0
  469. package/dist/date-picker.js +10 -0
  470. package/dist/date-picker.js.map +1 -0
  471. package/dist/date-range-picker.js +10 -0
  472. package/dist/date-range-picker.js.map +1 -0
  473. package/dist/date.js +6 -0
  474. package/dist/date.js.map +1 -0
  475. package/dist/divider.js +5 -0
  476. package/dist/divider.js.map +1 -0
  477. package/dist/dropdown.js +16 -0
  478. package/dist/dropdown.js.map +1 -0
  479. package/dist/empty-state.js +8 -0
  480. package/dist/empty-state.js.map +1 -0
  481. package/dist/file-uploader.js +5 -0
  482. package/dist/file-uploader.js.map +1 -0
  483. package/dist/filter-bar.js +9 -0
  484. package/dist/filter-bar.js.map +1 -0
  485. package/dist/focus-trap.js +5 -0
  486. package/dist/focus-trap.js.map +1 -0
  487. package/dist/fonts/fonts.css +2 -0
  488. package/dist/form-layout.js +8 -0
  489. package/dist/form-layout.js.map +1 -0
  490. package/dist/header-with-views.js +5 -0
  491. package/dist/header-with-views.js.map +1 -0
  492. package/dist/header.js +5 -0
  493. package/dist/header.js.map +1 -0
  494. package/dist/image.js +7 -0
  495. package/dist/image.js.map +1 -0
  496. package/dist/index.js +439 -0
  497. package/dist/index.js.map +1 -0
  498. package/dist/info-icon.js +5 -0
  499. package/dist/info-icon.js.map +1 -0
  500. package/dist/input-field-password.js +10 -0
  501. package/dist/input-field-password.js.map +1 -0
  502. package/dist/input-field-phone-number.js +6 -0
  503. package/dist/input-field-phone-number.js.map +1 -0
  504. package/dist/input-field.js +10 -0
  505. package/dist/input-field.js.map +1 -0
  506. package/dist/inspector.js +7 -0
  507. package/dist/inspector.js.map +1 -0
  508. package/dist/internal.js +45 -0
  509. package/dist/internal.js.map +1 -0
  510. package/dist/layout.js +6 -0
  511. package/dist/layout.js.map +1 -0
  512. package/dist/link.js +6 -0
  513. package/dist/link.js.map +1 -0
  514. package/dist/loading-indicator.js +6 -0
  515. package/dist/loading-indicator.js.map +1 -0
  516. package/dist/menu.js +6 -0
  517. package/dist/menu.js.map +1 -0
  518. package/dist/modal-fullscreen.js +6 -0
  519. package/dist/modal-fullscreen.js.map +1 -0
  520. package/dist/modal.js +14 -0
  521. package/dist/modal.js.map +1 -0
  522. package/dist/pagination.js +5 -0
  523. package/dist/pagination.js.map +1 -0
  524. package/dist/payment-method.js +7 -0
  525. package/dist/payment-method.js.map +1 -0
  526. package/dist/popover.js +7 -0
  527. package/dist/popover.js.map +1 -0
  528. package/dist/popper-container.js +9 -0
  529. package/dist/popper-container.js.map +1 -0
  530. package/dist/promo-banner.js +7 -0
  531. package/dist/promo-banner.js.map +1 -0
  532. package/dist/radio-group.js +9 -0
  533. package/dist/radio-group.js.map +1 -0
  534. package/dist/rich-text-editor.js +5 -0
  535. package/dist/rich-text-editor.js.map +1 -0
  536. package/dist/search-bar.js +9 -0
  537. package/dist/search-bar.js.map +1 -0
  538. package/dist/secondary-nav.js +5 -0
  539. package/dist/secondary-nav.js.map +1 -0
  540. package/dist/segmented-control.js +7 -0
  541. package/dist/segmented-control.js.map +1 -0
  542. package/dist/selection-card.js +7 -0
  543. package/dist/selection-card.js.map +1 -0
  544. package/dist/sidepanel.js +7 -0
  545. package/dist/sidepanel.js.map +1 -0
  546. package/dist/status.js +6 -0
  547. package/dist/status.js.map +1 -0
  548. package/dist/stepper.js +8 -0
  549. package/dist/stepper.js.map +1 -0
  550. package/dist/structured-list.js +6 -0
  551. package/dist/structured-list.js.map +1 -0
  552. package/dist/styles/bento-dark.css +2133 -0
  553. package/dist/styles/bento-light.css +2132 -0
  554. package/dist/styles/bento.css +2132 -0
  555. package/dist/styles/legacy.css +2132 -0
  556. package/dist/styles/styleguide.css +2187 -0
  557. package/dist/styles/utility.css +1002 -0
  558. package/dist/summary-grid.js +12 -0
  559. package/dist/summary-grid.js.map +1 -0
  560. package/dist/tabs.js +6 -0
  561. package/dist/tabs.js.map +1 -0
  562. package/dist/tag.js +6 -0
  563. package/dist/tag.js.map +1 -0
  564. package/dist/textarea.js +5 -0
  565. package/dist/textarea.js.map +1 -0
  566. package/dist/timeline.js +10 -0
  567. package/dist/timeline.js.map +1 -0
  568. package/dist/toast.js +5 -0
  569. package/dist/toast.js.map +1 -0
  570. package/dist/toggle.js +7 -0
  571. package/dist/toggle.js.map +1 -0
  572. package/dist/tutorial.js +5 -0
  573. package/dist/tutorial.js.map +1 -0
  574. package/dist/typography.js +8 -0
  575. package/dist/typography.js.map +1 -0
  576. package/dist/use-form-v4.js +8300 -0
  577. package/dist/use-form-v4.js.map +1 -0
  578. package/dist/web-types.json +49 -0
  579. package/package.json +13 -12
@@ -0,0 +1,221 @@
1
+ import { defineComponent as L, createElementBlock as $, openBlock as r, createElementVNode as G, createBlock as b, createCommentVNode as T, createVNode as B, unref as y, withCtx as I, createTextVNode as H, toDisplayString as R, ref as d, computed as _, watch as S, onMounted as J, nextTick as X, normalizeStyle as K, TransitionGroup as Q, Fragment as Z, renderList as F, mergeProps as tt } from "vue";
2
+ import { u as P } from "./use-bento-toast-controller.DK1PV3YW.js";
3
+ import { C as et } from "./cross-small.n1UO5wNB.js";
4
+ import { u as st } from "./index.pdBj0KQU.js";
5
+ import { B as Y } from "./button.DhcxX2GJ.js";
6
+ import { B as at } from "./typography.yBEME_Gu.js";
7
+ import { _ as M } from "./_plugin-vue_export-helper.CHgC5LLL.js";
8
+ import "../assets/toast.css";
9
+ const U = {
10
+ "en-US": {
11
+ dismiss: "Dismiss"
12
+ },
13
+ "ja-JP": {
14
+ dismiss: "却下"
15
+ },
16
+ "pt-BR": {
17
+ dismiss: "Descartar"
18
+ }
19
+ }, ot = { class: "b-toast-item" }, nt = {
20
+ class: "b-toast-item__text",
21
+ role: "status"
22
+ }, it = {
23
+ i18n: { messages: U }
24
+ }, rt = /* @__PURE__ */ L({
25
+ ...it,
26
+ __name: "toast-item",
27
+ props: {
28
+ toast: { type: Object, required: !0 }
29
+ },
30
+ setup(l) {
31
+ const n = l, { t: u } = st({ messages: U }), a = () => {
32
+ typeof n.toast.action.handler == "function" && n.toast.action.handler(), n.toast.dismiss();
33
+ };
34
+ return (c, i) => (r(), $("div", ot, [
35
+ G("output", nt, [
36
+ B(y(at), {
37
+ title: l.toast.text,
38
+ el: "span",
39
+ variant: "body",
40
+ strongest: ""
41
+ }, {
42
+ default: I(() => [
43
+ H(R(l.toast.text), 1)
44
+ ]),
45
+ _: 1
46
+ }, 8, ["title"])
47
+ ]),
48
+ l.toast.action ? (r(), b(y(Y), {
49
+ key: 0,
50
+ class: "b-toast-item__btn",
51
+ variant: "tertiary",
52
+ "data-testid": "toast-item-action-btn",
53
+ onClick: a
54
+ }, {
55
+ default: I(() => [
56
+ H(R(l.toast.action.text), 1)
57
+ ]),
58
+ _: 1
59
+ })) : T("", !0),
60
+ B(y(Y), {
61
+ class: "b-toast-item__btn",
62
+ variant: "tertiary",
63
+ "data-testid": "toast-item-close-btn",
64
+ onClick: i[0] || (i[0] = (m) => l.toast.dismiss())
65
+ }, {
66
+ iconLeft: I(() => [
67
+ B(y(et), {
68
+ "svg-title": y(u)("dismiss")
69
+ }, null, 8, ["svg-title"])
70
+ ]),
71
+ _: 1
72
+ })
73
+ ]));
74
+ }
75
+ }), x = /* @__PURE__ */ M(rt, [["__scopeId", "data-v-7887b018"]]), lt = /* @__PURE__ */ L({
76
+ __name: "toast-shadow-stack",
77
+ emits: ["update"],
78
+ setup(l, { emit: n }) {
79
+ const { stack: u } = P(), a = n, c = d(), i = d(), m = d(), p = d(), h = [i, m, p], v = _(() => u.value.slice(0, 3)), D = async () => {
80
+ await X();
81
+ const { top: f } = c.value.getBoundingClientRect(), g = u.value.map((o, k) => {
82
+ if (k > 2)
83
+ return { ...o, bottom: 0, height: 0 };
84
+ const { height: w, top: C } = h[k].value.$el.getBoundingClientRect();
85
+ return { ...o, height: w, bottom: C - f };
86
+ });
87
+ a("update", g);
88
+ };
89
+ return S(u, D), J(() => {
90
+ u.value.length > 0 && D();
91
+ }), (f, g) => (r(), $("div", {
92
+ ref_key: "shadowStack",
93
+ ref: c,
94
+ class: "b-toast-shadow-stack"
95
+ }, [
96
+ v.value[0] ? (r(), b(x, {
97
+ key: 0,
98
+ ref_key: "toast0",
99
+ ref: i,
100
+ toast: v.value[0]
101
+ }, null, 8, ["toast"])) : T("", !0),
102
+ v.value[1] ? (r(), b(x, {
103
+ key: 1,
104
+ ref_key: "toast1",
105
+ ref: m,
106
+ toast: v.value[1]
107
+ }, null, 8, ["toast"])) : T("", !0),
108
+ v.value[2] ? (r(), b(x, {
109
+ key: 2,
110
+ ref_key: "toast2",
111
+ ref: p,
112
+ toast: v.value[2]
113
+ }, null, 8, ["toast"])) : T("", !0)
114
+ ], 512));
115
+ }
116
+ }), ut = /* @__PURE__ */ M(lt, [["__scopeId", "data-v-81490a5e"]]), z = 5e3, E = 40, O = 10, ct = /* @__PURE__ */ L({
117
+ __name: "toast",
118
+ setup(l) {
119
+ const n = d(!1), { stack: u } = P();
120
+ S(
121
+ u,
122
+ (t) => {
123
+ t.length > 0 && !n.value && (n.value = !0);
124
+ },
125
+ { immediate: !0 }
126
+ );
127
+ const a = d(!1), c = d([]), i = _(() => c.value.length), m = _(() => Math.min(a.value ? 2 : 0, i.value - 1)), p = _(() => {
128
+ const t = c.value[m.value];
129
+ return t ? t.bottom + t.height : 0;
130
+ }), h = _(() => {
131
+ const t = p.value - E;
132
+ return c.value.map((e, s) => {
133
+ const V = s > m.value, A = !a.value && s > 1, q = V ? t + O * (A ? 2 : 1) : e.bottom;
134
+ return {
135
+ ...e,
136
+ styles: {
137
+ height: `${V ? E : e.height}px`,
138
+ transform: V ? `translateY(${q * -1}px) scaleX(${A ? "0.8" : "0.9"})` : `translateY(${q * -1}px)`,
139
+ "z-index": i.value - s
140
+ },
141
+ // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation
142
+ dismissTransform: s > 0 && s < (a.value ? 4 : 3) ? `translateY(${(q - e.height) * -1}px) scale(0.5, 0.1)` : null,
143
+ isFirst: s === 0,
144
+ isInert: s > (a.value ? 2 : 0)
145
+ };
146
+ });
147
+ }), v = (t) => {
148
+ t.dataset.dismissTransform && (t.style.transform = t.dataset.dismissTransform);
149
+ }, D = _(() => {
150
+ let t = 0;
151
+ if (m.value >= 0) {
152
+ const e = O * Math.min(i.value - 1 - m.value, a.value ? 1 : 2);
153
+ t = Math.min(p.value + e, document.body.parentElement.clientHeight);
154
+ }
155
+ return `${t}px`;
156
+ });
157
+ let f = null, g = null, o = z;
158
+ const k = (t, e) => {
159
+ g = Date.now(), f = setTimeout(() => t.dismiss(), e);
160
+ }, w = (t) => {
161
+ clearTimeout(f), t ? (o = z, a.value || k(t, o)) : o = 0;
162
+ };
163
+ S(
164
+ () => h.value[0],
165
+ (t, e) => {
166
+ (t == null ? void 0 : t.id) !== (e == null ? void 0 : e.id) && w(t);
167
+ },
168
+ { immediate: !0 }
169
+ );
170
+ const C = () => {
171
+ o = o - Date.now() + g, clearTimeout(f);
172
+ }, W = () => {
173
+ o > 0 && k(h.value[0], o);
174
+ };
175
+ S(a, (t) => {
176
+ t ? C() : W();
177
+ });
178
+ const N = d(), j = () => setTimeout(() => {
179
+ a.value = a.value ? N.value.matches(":hover") : !1;
180
+ });
181
+ return (t, e) => n.value ? (r(), $("div", {
182
+ key: 0,
183
+ ref_key: "root",
184
+ ref: N,
185
+ class: "b-toast",
186
+ "data-testid": "toast",
187
+ style: K({ height: D.value }),
188
+ onMouseenter: e[1] || (e[1] = (s) => a.value = !0),
189
+ onMouseleave: e[2] || (e[2] = (s) => a.value = !1)
190
+ }, [
191
+ B(ut, {
192
+ onUpdate: e[0] || (e[0] = (s) => c.value = s)
193
+ }),
194
+ B(Q, {
195
+ name: "b-toast__queue",
196
+ tag: "div",
197
+ "aria-live": "polite",
198
+ "enter-class": "b-toast__queue--enter",
199
+ "leave-to-class": "b-toast__queue--leave-to",
200
+ onBeforeLeave: v,
201
+ onAfterLeave: j
202
+ }, {
203
+ default: I(() => [
204
+ (r(!0), $(Z, null, F(h.value, (s) => (r(), b(x, tt({ ref_for: !0 }, { "data-dismiss-transform": s.dismissTransform }, {
205
+ key: s.id,
206
+ toast: s,
207
+ style: s.styles,
208
+ class: [{ "b-toast__item--first": s.isFirst }, "b-toast__item"],
209
+ inert: s.isInert,
210
+ "data-testid": "toast-item"
211
+ }), null, 16, ["toast", "style", "class", "inert"]))), 128))
212
+ ]),
213
+ _: 1
214
+ })
215
+ ], 36)) : T("", !0);
216
+ }
217
+ }), gt = /* @__PURE__ */ M(ct, [["__scopeId", "data-v-4487b91a"]]);
218
+ export {
219
+ gt as B
220
+ };
221
+ //# sourceMappingURL=toast.BFw86uEp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.BFw86uEp.js","sources":["../../../vue2/src/components/toast/components/toast-item/toast-item.vue","../../../vue2/src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../../vue2/src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\n /**\n *\n */\n (e: 'update', toasts: Array<BentoToastItemWithDimensions>): void;\n }>();\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import ToastItem from './components/toast-item/toast-item.vue';\n import { useBentoToastController } from '@/composables/use-bento-toast-controller';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","onAction","stack","useBentoToastController","emit","__emit","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","watch","onMounted","TOAST_DISPLAY_DURATION","collapsedToastHeight","stackIndicatorHeight","renderToast","toastStack","hovered","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root","checkHover"],"mappings":"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"}
@@ -0,0 +1,143 @@
1
+ import { defineComponent as T, useSlots as w, useAttrs as D, ref as O, computed as d, toRefs as V, watch as $, createElementBlock as m, openBlock as s, normalizeClass as N, withDirectives as U, createElementVNode as p, createCommentVNode as u, unref as t, vModelCheckbox as j, createBlock as f, withCtx as _, renderSlot as v } from "vue";
2
+ import { C as z } from "./checkmark-small.x-gmK2Dt.js";
3
+ import { B as y } from "./typography.yBEME_Gu.js";
4
+ import { g as H } from "./generate-uid.NJ8tVoha.js";
5
+ import { u as M } from "./use-default-slot-validator.O02rzsob.js";
6
+ import { u as P } from "./use-has-slot.B7eQSabc.js";
7
+ import { g as q } from "./get-slot-text.CQRAP2_q.js";
8
+ import { u as G } from "./aria-label.CaUURpnB.js";
9
+ import { _ as J } from "./_plugin-vue_export-helper.CHgC5LLL.js";
10
+ import "../assets/toggle.css";
11
+ var h = /* @__PURE__ */ ((e) => (e.LABEL_FIRST = "label-first", e))(h || {}), c = /* @__PURE__ */ ((e) => (e.BEFORE = "before", e.AFTER = "after", e))(c || {});
12
+ const K = ["aria-label", "aria-describedby", "disabled", "aria-readonly"], Q = {
13
+ class: "b-toggle__track",
14
+ "aria-hidden": "true"
15
+ }, W = { class: "b-toggle__handle" }, X = {
16
+ key: 0,
17
+ class: "b-toggle__label-container"
18
+ }, Y = {
19
+ name: "bento-toggle"
20
+ }, Z = /* @__PURE__ */ T({
21
+ ...Y,
22
+ props: {
23
+ /**
24
+ * @deprecated from version 2.0.0. Use the aria-label attribute instead.
25
+ */
26
+ /**
27
+ * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label
28
+ */
29
+ ariaLabel: {
30
+ type: String,
31
+ default: void 0
32
+ },
33
+ /**
34
+ * Disable the toggle (optional)
35
+ */
36
+ disabled: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ /**
41
+ * Position of the label relative to the toggle (optional)
42
+ * @values before, after
43
+ */
44
+ labelPosition: {
45
+ type: String,
46
+ default: c.BEFORE,
47
+ validator: (e) => Object.values(c).includes(e)
48
+ },
49
+ /**
50
+ * Setting this property to true will set the toggle to read only state.
51
+ */
52
+ readonly: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ /**
57
+ * Indicates if the switch is "on" or "off"
58
+ */
59
+ value: {
60
+ type: Boolean,
61
+ default: !1
62
+ }
63
+ },
64
+ emits: ["input"],
65
+ setup(e, { emit: k }) {
66
+ const r = w(), B = D(), o = P(r), l = e, S = k, n = O(l.value), g = H("toggle-description");
67
+ M("bento-toggle", r.default, r.description);
68
+ const C = d(() => o("default") ? q(r)("default") : null), E = d(() => B["aria-label"]), { ariaLabel: L } = V(l), A = G({
69
+ ariaLabel: E.value,
70
+ // TODO: take this line away when the aria-label props is removed
71
+ label: L,
72
+ defaultFallback: C
73
+ }), F = d(() => g ?? null), R = d(() => ({
74
+ [`b-toggle--${h.LABEL_FIRST}`]: l.labelPosition === c.BEFORE,
75
+ "b-toggle--disabled": l.disabled,
76
+ "b-toggle--readonly": l.readonly
77
+ })), I = (a) => {
78
+ S("input", a.target.checked);
79
+ }, x = (a) => {
80
+ l.readonly && a.preventDefault();
81
+ };
82
+ return $(
83
+ () => l.value,
84
+ (a) => {
85
+ n.value = a;
86
+ }
87
+ ), (a, i) => (s(), m("label", {
88
+ class: N(["b-toggle", R.value]),
89
+ "data-testid": "label"
90
+ }, [
91
+ U(p("input", {
92
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => n.value = b),
93
+ "aria-label": t(A),
94
+ "aria-describedby": F.value,
95
+ disabled: e.disabled,
96
+ "aria-readonly": e.readonly,
97
+ role: "switch",
98
+ class: "b-toggle__input",
99
+ type: "checkbox",
100
+ onChange: i[1] || (i[1] = (b) => I(b)),
101
+ onClick: x
102
+ }, null, 40, K), [
103
+ [j, n.value]
104
+ ]),
105
+ p("span", Q, [
106
+ p("span", W, [
107
+ n.value ? (s(), f(t(z), { key: 0 })) : u("", !0)
108
+ ])
109
+ ]),
110
+ t(o)("default") ? (s(), m("span", X, [
111
+ t(o)("default") ? (s(), f(t(y), {
112
+ key: 0,
113
+ el: "span",
114
+ variant: "body",
115
+ "data-testid": "inner-label"
116
+ }, {
117
+ default: _(() => [
118
+ v(a.$slots, "default", {}, void 0, !0)
119
+ ]),
120
+ _: 3
121
+ })) : u("", !0),
122
+ t(o)("default") && t(o)("description") ? (s(), f(t(y), {
123
+ key: 1,
124
+ id: t(g),
125
+ el: "span",
126
+ variant: "body",
127
+ class: "b-toggle__description"
128
+ }, {
129
+ default: _(() => [
130
+ v(a.$slots, "description", {}, void 0, !0)
131
+ ]),
132
+ _: 3
133
+ }, 8, ["id"])) : u("", !0)
134
+ ])) : u("", !0)
135
+ ], 2));
136
+ }
137
+ }), de = /* @__PURE__ */ J(Z, [["__scopeId", "data-v-38eb4f78"]]);
138
+ export {
139
+ de as B,
140
+ h as a,
141
+ c as b
142
+ };
143
+ //# sourceMappingURL=toggle.BHCUjMpp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.BHCUjMpp.js","sources":["../../../vue2/src/components/toggle/toggle.types.ts","../../../vue2/src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type PropType, ref, toRefs, useAttrs, useSlots, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/core/utils/ts';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n (e: 'input', value: boolean): void;\n }>();\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string | null => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = computed(() => attrs['aria-label'] as string);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]: props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default {\n name: 'bento-toggle',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","__default__","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","props","__props","emit","__emit","toggleInput","ref","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCyJRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApHA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GA2CAC,IAAAC,GAIAC,IAAAC,EAAAL,EAAA,KAAA,GACAM,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAd,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAe,IAAAC,EAAA,MAAAZ,EAAA,SAAA,IAAAa,EAAAjB,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAkB,IAAAF,EAAA,MAAAd,EAAA,YAAA,CAAA,GACA,EAAA,WAAAiB,EAAA,IAAAC,EAAAd,CAAA,GACAe,IAAAC,EAAA;AAAA,MAAuC,WAAAJ,EAAA;AAAA;AAAA,MACL,OAAAC;AAAA,MAEvB,iBAAAJ;AAAA,IACU,CAAA,GAGrBQ,IAAAP,EAAA,MAAAJ,KAAA,IAAA,GAEAY,IAAAR,EAAA,OAAA;AAAA,MAAuE,CAAA,aAAArB,EAAA,WAAA,EAAA,GAAAW,EAAA,kBAAAT,EAAA;AAAA,MACiC,sBAAAS,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCmB,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAA,SAAAkB,EAAA,OAAA,OAAA;AAAA,IAAwD,GAI5DC,IAAA,CAAAD,MAAA;AACI,MAAApB,EAAA,YACIoB,EAAA,eAAA;AAAA,IACJ;AAGJ,WAAAE;AAAA,MAAA,MAAAtB,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAAnB,EAAA,QAAAmB;AAAA,MAAoB;AAAA,IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,202 @@
1
+ import { defineComponent as C, computed as _, createBlock as k, openBlock as I, unref as f, normalizeClass as x, withCtx as b, createVNode as U, createTextVNode as H, toDisplayString as W, reactive as $, nextTick as q, createApp as L, h as F } from "vue";
2
+ import { l as p } from "./events.BQOQSSb7.js";
3
+ import { g as G } from "./generate-uid.NJ8tVoha.js";
4
+ import { a as S, P as j, c as M } from "./popper-container.I9gzp1NR.js";
5
+ import { B as V } from "./typography.yBEME_Gu.js";
6
+ import { _ as z } from "./_plugin-vue_export-helper.CHgC5LLL.js";
7
+ import "../assets/tooltip.css";
8
+ const A = { ...S };
9
+ var Y = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(Y || {}), O = /* @__PURE__ */ ((t) => (t.ESCAPE = "Escape", t.ENTER = "Enter", t.ARROW_LEFT = "ArrowLeft", t.ARROW_UP = "ArrowUp", t.ARROW_RIGHT = "ArrowRight", t.ARROW_DOWN = "ArrowDown", t.PAGE_UP = "PageUp", t.PAGE_DOWN = "PageDown", t.END = "End", t.HOME = "Home", t.TAB = "Tab", t))(O || {});
10
+ const v = { ...S };
11
+ var D = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(D || {});
12
+ const J = {
13
+ name: "tooltip"
14
+ }, Q = /* @__PURE__ */ C({
15
+ ...J,
16
+ props: {
17
+ /**
18
+ * The tooltip's id. Necessary for accessibility purposes.
19
+ */
20
+ id: { type: String, default: null },
21
+ /**
22
+ * Tooltip's target reference to the DOM element or Vue component.
23
+ * The tooltip will position itself relatively to target element, in the specified position.
24
+ */
25
+ targetElement: { type: [Element, Object], required: !0 },
26
+ /**
27
+ * Tooltip's position relative to the target element.
28
+ * Possible values are: 'top', 'bottom', 'left' and 'right'.
29
+ */
30
+ position: {
31
+ type: String,
32
+ default: v.TOP,
33
+ validator: (t) => Object.values(v).includes(t)
34
+ },
35
+ /**
36
+ * Tooltip's offset.
37
+ * If specified, the tooltip will have an offset in pixels between it and the target element
38
+ * in specified position.
39
+ */
40
+ offset: { type: Number, default: 0 },
41
+ /**
42
+ * Tooltip's text content.
43
+ */
44
+ content: { type: String, required: !0 },
45
+ /**
46
+ * Shows / Hides the Tooltip component
47
+ */
48
+ isShown: { type: Boolean, default: !1 },
49
+ /**
50
+ * Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].
51
+ * Useful when not using auto as starting placement.
52
+ * @see {@link https://floating-ui.com/docs/flip#fallbackplacements}
53
+ */
54
+ fallbackPosition: {
55
+ type: [Array, String],
56
+ default: () => ["top", "bottom", "right", "left"]
57
+ },
58
+ /**
59
+ * Disables focus-trap for tooltip.
60
+ * Useful for maintaining focus on the target element.
61
+ */
62
+ disabledFocusTrap: { type: Boolean, default: !1 }
63
+ },
64
+ setup(t) {
65
+ const o = t, e = _(() => ({
66
+ [`b-tooltip--${D.HIDDEN}`]: !o.isShown
67
+ }));
68
+ return (i, a) => (I(), k(f(j), {
69
+ id: t.id,
70
+ "aria-role": f(M).TOOLTIP,
71
+ arrow: { classes: ["b-tooltip__arrow"] },
72
+ class: x([e.value, "b-tooltip"]),
73
+ "fallback-position": t.fallbackPosition,
74
+ "is-hidden": !t.isShown,
75
+ offset: [0, 4],
76
+ position: t.position,
77
+ "target-element": t.targetElement,
78
+ "disabled-focus-trap": t.disabledFocusTrap
79
+ }, {
80
+ default: b(() => [
81
+ U(f(V), {
82
+ el: "span",
83
+ variant: "caption"
84
+ }, {
85
+ default: b(() => [
86
+ H(W(t.content), 1)
87
+ ]),
88
+ _: 1
89
+ })
90
+ ]),
91
+ _: 1
92
+ }, 8, ["id", "aria-role", "class", "fallback-position", "is-hidden", "position", "target-element", "disabled-focus-trap"]));
93
+ }
94
+ }), w = /* @__PURE__ */ z(Q, [["__scopeId", "data-v-72e03ce3"]]), c = [], B = "aria-describedby", N = G("tooltip");
95
+ let d, n, h = !1;
96
+ const s = $({
97
+ targetElement: null,
98
+ content: "START_MESSAGE",
99
+ id: N,
100
+ position: void 0,
101
+ isShown: !1
102
+ }), X = (t) => {
103
+ t.setAttribute("tabindex", "0"), s.targetElement = t, n = L({
104
+ components: { Tooltip: w },
105
+ setup() {
106
+ return () => F(w, { ...s }, "");
107
+ }
108
+ }), d = document.createElement("div"), d.id = "tooltip-parent", document.body.appendChild(d), n.mount("#tooltip-parent");
109
+ }, Z = () => {
110
+ n.unmount(), document.contains(d) && document.body.removeChild(d), n = void 0;
111
+ }, y = (t) => Object.values(A).includes(t.arg) ? t.arg : A.TOP, T = (t) => c.find(
112
+ (o) => (
113
+ // isEqualNode doesn't work correct for svg element, hence the second check here
114
+ o.target.isEqualNode(t) && o.target === t
115
+ )
116
+ ), R = (t) => {
117
+ var i, a, r, u;
118
+ const o = T(t);
119
+ if (!o.content || !t)
120
+ return;
121
+ t && t.setAttribute(B, N);
122
+ let e = !1;
123
+ document.querySelectorAll("dialog").forEach((l) => {
124
+ e = (l == null ? void 0 : l.open) || e;
125
+ }), e && ((a = (i = n == null ? void 0 : n._instance) == null ? void 0 : i.vnode) != null && a.el && t.after((u = (r = n == null ? void 0 : n._instance) == null ? void 0 : r.vnode) == null ? void 0 : u.el), e = !1), h = !0, n.content = o.content, n.position = o.position, s.content = o.content, s.position = o.position, q(() => {
126
+ h && (n.targetElement = t, n.isShown = !0, s.targetElement = t, s.isShown = !0);
127
+ });
128
+ }, g = (t) => {
129
+ var o, e, i, a;
130
+ (e = (o = n.$el) == null ? void 0 : o.parentElement) != null && e.tagName && ((a = (i = n.$el) == null ? void 0 : i.parentElement) == null ? void 0 : a.tagName) !== "BODY" && document.body.appendChild(n.$el), h = !1, n.isShown = !1, s.isShown = !1, t && t.removeAttribute(B);
131
+ }, E = (t, o) => {
132
+ if (!o.hasOwnProperty("value") || o.value) {
133
+ c.length === 0 && X(t);
134
+ const e = () => R(t), i = () => g(t), a = {
135
+ target: t,
136
+ content: o.value,
137
+ position: y(o),
138
+ removeListeners: [
139
+ p(t, "mouseenter", e),
140
+ p(t, "mouseleave", i),
141
+ p(t, "focus", () => {
142
+ t.matches(":focus-visible") && e();
143
+ }),
144
+ p(t, "blur", (r) => {
145
+ var l;
146
+ ((l = r.relatedTarget) == null ? void 0 : l.getAttribute("role")) !== "tooltip" && i();
147
+ }),
148
+ p(t, "keydown", (r) => {
149
+ r.key === O.ESCAPE && i();
150
+ })
151
+ ]
152
+ };
153
+ c.push(a);
154
+ }
155
+ }, m = (t, o) => {
156
+ const e = T(t);
157
+ if (e) {
158
+ if ((e == null ? void 0 : e.content) !== o.value && (e.content = o.value, n.isShown && n.targetElement.isEqualNode(t) && (e.content ? n.content = o.value : n.isShown = !1, g(t), R(t))), e.position !== o.arg) {
159
+ const i = y(o);
160
+ e.position = i, n.position = i;
161
+ }
162
+ } else !e && o.value && E(t, o);
163
+ }, P = (t) => {
164
+ const o = T(t);
165
+ o && (o.removeListeners.forEach((e) => {
166
+ e();
167
+ }), g(), c.splice(c.indexOf(o), 1), c.length === 0 && Z());
168
+ }, at = {
169
+ // Vue 2 Directive hooks
170
+ bind(t, o) {
171
+ E(t, o);
172
+ },
173
+ update(t, o) {
174
+ m(t, o);
175
+ },
176
+ unbind(t) {
177
+ P(t);
178
+ },
179
+ // Vue 3 Directive hooks
180
+ beforeMount(t, o) {
181
+ E(t, o);
182
+ },
183
+ mounted(t, o) {
184
+ m(t, o);
185
+ },
186
+ updated(t, o) {
187
+ m(t, o);
188
+ },
189
+ unmounted(t) {
190
+ P(t);
191
+ }
192
+ };
193
+ export {
194
+ v as B,
195
+ O as E,
196
+ w as T,
197
+ D as a,
198
+ at as b,
199
+ A as c,
200
+ Y as d
201
+ };
202
+ //# sourceMappingURL=tooltip.B76ucISL.js.map