@adyen/bento-vue2 1.27.0 → 1.28.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.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/index.d.ts +403 -187
- package/dist/accordion.js +3 -101
- package/dist/accordion.js.map +1 -1
- package/dist/action-bar.js +2 -146
- package/dist/action-bar.js.map +1 -1
- package/dist/alert.js +5 -116
- package/dist/alert.js.map +1 -1
- package/dist/assets/{index9.css → accordion-item.css} +1 -1
- package/dist/assets/{index11.css → action-bar.css} +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/{index4.css → card.css} +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/{index47.css → dashboard-section.css} +1 -1
- package/dist/assets/dashed-underline.css +1 -0
- package/dist/assets/{index49.css → data-grid-template.css} +1 -1
- package/dist/assets/data-grid.css +1 -0
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/filter-bar.css +1 -0
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/{index38.css → menu.css} +1 -1
- package/dist/assets/{index24.css → modal-fullscreen.css} +1 -1
- package/dist/assets/{index33.css → popover.css} +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/segmented-control.css +1 -0
- package/dist/assets/selection-card-group.css +1 -0
- package/dist/assets/{index36.css → sidepanel.css} +1 -1
- package/dist/assets/status.css +1 -0
- package/dist/assets/toggle.css +1 -0
- package/dist/assets/tutorial.css +1 -0
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +22 -24
- package/dist/badge.js.map +1 -1
- package/dist/button.js +14 -94
- package/dist/button.js.map +1 -1
- package/dist/card.js +4 -114
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +8 -155
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/1-generic-use.CZhwP2Yc.js +5 -0
- package/dist/chunks/1-generic-use.CZhwP2Yc.js.map +1 -0
- package/dist/chunks/1-generic-use.R6x8PEGA.js +5 -0
- package/dist/chunks/1-generic-use.R6x8PEGA.js.map +1 -0
- package/dist/chunks/2-generic-use.CNKjB4B7.js +5 -0
- package/dist/chunks/2-generic-use.CNKjB4B7.js.map +1 -0
- package/dist/chunks/2-generic-use.w0fUhovx.js +5 -0
- package/dist/chunks/2-generic-use.w0fUhovx.js.map +1 -0
- package/dist/chunks/3-generic-use.BLEzR04g.js +5 -0
- package/dist/chunks/3-generic-use.BLEzR04g.js.map +1 -0
- package/dist/chunks/3-generic-use.D3NFHgI4.js +5 -0
- package/dist/chunks/3-generic-use.D3NFHgI4.js.map +1 -0
- package/dist/chunks/4-generic-use.CULEpvgj.js +5 -0
- package/dist/chunks/4-generic-use.CULEpvgj.js.map +1 -0
- package/dist/chunks/4-generic-use.D82y3n39.js +5 -0
- package/dist/chunks/4-generic-use.D82y3n39.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js +11 -0
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js.map +1 -0
- package/dist/chunks/accordion-item.DmnrjNzw.js +100 -0
- package/dist/chunks/accordion-item.DmnrjNzw.js.map +1 -0
- package/dist/chunks/action-bar.Bebh6PHI.js +147 -0
- package/dist/chunks/action-bar.Bebh6PHI.js.map +1 -0
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js +5 -0
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js.map +1 -0
- package/dist/chunks/adding-payment-methods.Dle8zt43.js +5 -0
- package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +1 -0
- package/dist/chunks/adyen-giving.Ffw_DlJK.js +5 -0
- package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +1 -0
- package/dist/chunks/adyen-giving.LiKHj_jY.js +5 -0
- package/dist/chunks/adyen-giving.LiKHj_jY.js.map +1 -0
- package/dist/chunks/alert.CJyTM4Az.js +96 -0
- package/dist/chunks/alert.CJyTM4Az.js.map +1 -0
- package/dist/chunks/{aria-label.ac9651a5.js → aria-label.CaUURpnB.js} +1 -1
- package/dist/chunks/{aria-label.ac9651a5.js.map → aria-label.CaUURpnB.js.map} +1 -1
- package/dist/chunks/{index.ccc7e8d7.js → avatar-image.DhlR-7Yg.js} +22 -24
- package/dist/chunks/avatar-image.DhlR-7Yg.js.map +1 -0
- package/dist/chunks/base-button.DER7_IsF.js +86 -0
- package/dist/chunks/{base-button.852204dc.js.map → base-button.DER7_IsF.js.map} +1 -1
- package/dist/chunks/{base-modal.4fb7528b.js → base-modal.C5I7bR0d.js} +42 -46
- package/dist/chunks/{base-modal.4fb7528b.js.map → base-modal.C5I7bR0d.js.map} +1 -1
- package/dist/chunks/{base-modal.keys.b08a6bdf.js → base-modal.keys.C2PQXcE2.js} +1 -1
- package/dist/chunks/{base-modal.keys.b08a6bdf.js.map → base-modal.keys.C2PQXcE2.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.bf968959.js → button-actions-with-menu.f3yuLK-L.js} +25 -27
- package/dist/chunks/{button-actions-with-menu.bf968959.js.map → button-actions-with-menu.f3yuLK-L.js.map} +1 -1
- package/dist/chunks/{button-actions.87e589e3.js → button-actions.Bg9ey0p6.js} +29 -31
- package/dist/chunks/{button-actions.87e589e3.js.map → button-actions.Bg9ey0p6.js.map} +1 -1
- package/dist/chunks/{button.cb90b55c.js → button.DhAUh5JA.js} +22 -24
- package/dist/chunks/{button.cb90b55c.js.map → button.DhAUh5JA.js.map} +1 -1
- package/dist/chunks/{calendar.f02e0a5a.js → calendar.B69z8gjb.js} +287 -332
- package/dist/chunks/{calendar.f02e0a5a.js.map → calendar.B69z8gjb.js.map} +1 -1
- package/dist/chunks/card.70Xvba2C.js +115 -0
- package/dist/chunks/card.70Xvba2C.js.map +1 -0
- package/dist/chunks/checkbox-group.B-KdeRXC.js +152 -0
- package/dist/chunks/checkbox-group.B-KdeRXC.js.map +1 -0
- package/dist/chunks/{checkbox-input.1c3cc8ed.js → checkbox-input.DwDwI2BD.js} +27 -30
- package/dist/chunks/{checkbox-input.1c3cc8ed.js.map → checkbox-input.DwDwI2BD.js.map} +1 -1
- package/dist/chunks/{checkbox.9f9c978a.js → checkbox.Bi2RDBEZ.js} +21 -23
- package/dist/chunks/{checkbox.9f9c978a.js.map → checkbox.Bi2RDBEZ.js.map} +1 -1
- package/dist/chunks/checkmark-circle-fill.DVl6QSwm.js +24 -0
- package/dist/chunks/{checkmark-circle-fill.345311d2.js.map → checkmark-circle-fill.DVl6QSwm.js.map} +1 -1
- package/dist/chunks/{checkmark-small.520f01b1.js → checkmark-small.BtF8b2gE.js} +6 -8
- package/dist/chunks/{checkmark-small.520f01b1.js.map → checkmark-small.BtF8b2gE.js.map} +1 -1
- package/dist/chunks/{chevron-left.5edf02ac.js → chevron-left.CtnrsqUy.js} +13 -17
- package/dist/chunks/{chevron-left.5edf02ac.js.map → chevron-left.CtnrsqUy.js.map} +1 -1
- package/dist/chunks/{chevron-up.81185563.js → chevron-up.B2uWhZf7.js} +14 -18
- package/dist/chunks/{chevron-up.81185563.js.map → chevron-up.B2uWhZf7.js.map} +1 -1
- package/dist/chunks/click-outside.DABh6NLr.js +23 -0
- package/dist/chunks/click-outside.DABh6NLr.js.map +1 -0
- package/dist/chunks/code-snippet.C4IbjAhH.js +968 -0
- package/dist/chunks/code-snippet.C4IbjAhH.js.map +1 -0
- package/dist/chunks/{controls-group.121a307d.js → controls-group.cSRFiEVO.js} +17 -19
- package/dist/chunks/{controls-group.121a307d.js.map → controls-group.cSRFiEVO.js.map} +1 -1
- package/dist/chunks/{copy.6808b2dc.js → copy.BtFWFG3q.js} +15 -19
- package/dist/chunks/{copy.6808b2dc.js.map → copy.BtFWFG3q.js.map} +1 -1
- package/dist/chunks/country.KayLT0zy.js +93 -0
- package/dist/chunks/country.KayLT0zy.js.map +1 -0
- package/dist/chunks/{country.types.002caff2.js → country.types.Br0AjxGy.js} +5 -5
- package/dist/chunks/{country.types.002caff2.js.map → country.types.Br0AjxGy.js.map} +1 -1
- package/dist/chunks/{cross-circle-fill.27580c4b.js → cross-circle-fill.CnYH4R_h.js} +7 -9
- package/dist/chunks/{cross-circle-fill.27580c4b.js.map → cross-circle-fill.CnYH4R_h.js.map} +1 -1
- package/dist/chunks/{cross-small.e851e0de.js → cross-small.BLUwtRB-.js} +9 -11
- package/dist/chunks/{cross-small.e851e0de.js.map → cross-small.BLUwtRB-.js.map} +1 -1
- package/dist/chunks/{cross.04678d81.js → cross.CsUPDmaA.js} +9 -11
- package/dist/chunks/{cross.04678d81.js.map → cross.CsUPDmaA.js.map} +1 -1
- package/dist/chunks/currency.H7n7RQiX.js +113 -0
- package/dist/chunks/currency.H7n7RQiX.js.map +1 -0
- package/dist/chunks/dashboard-section.BcH-_en7.js +105 -0
- package/dist/chunks/dashboard-section.BcH-_en7.js.map +1 -0
- package/dist/chunks/dashed-underline.ChUlcFJR.js +59 -0
- package/dist/chunks/dashed-underline.ChUlcFJR.js.map +1 -0
- package/dist/chunks/data-grid-template.DqG5bNeD.js +66 -0
- package/dist/chunks/data-grid-template.DqG5bNeD.js.map +1 -0
- package/dist/chunks/{data-grid-template.keys.a819a991.js → data-grid-template.keys.2_AkxuNT.js} +1 -1
- package/dist/chunks/{data-grid-template.keys.a819a991.js.map → data-grid-template.keys.2_AkxuNT.js.map} +1 -1
- package/dist/chunks/data-grid.XsiB40Po.js +2022 -0
- package/dist/chunks/data-grid.XsiB40Po.js.map +1 -0
- package/dist/chunks/{date-input.9186a0bf.js → date-input.BqBdAO1E.js} +1 -1
- package/dist/chunks/{date-input.9186a0bf.js.map → date-input.BqBdAO1E.js.map} +1 -1
- package/dist/chunks/date-picker.ByP2Wpo0.js +196 -0
- package/dist/chunks/date-picker.ByP2Wpo0.js.map +1 -0
- package/dist/chunks/{index.854d6498.js → date-range-picker.DJPZi8ql.js} +113 -117
- package/dist/chunks/date-range-picker.DJPZi8ql.js.map +1 -0
- package/dist/chunks/{index.614a5138.js → date.DKjxxR6P.js} +44 -51
- package/dist/chunks/date.DKjxxR6P.js.map +1 -0
- package/dist/chunks/{debounce.b5ef6acf.js → debounce.DUTu11PS.js} +1 -1
- package/dist/chunks/{debounce.b5ef6acf.js.map → debounce.DUTu11PS.js.map} +1 -1
- package/dist/chunks/{dialog-page.7fd7d006.js → dialog-page.DAh0M4mT.js} +20 -24
- package/dist/chunks/{dialog-page.7fd7d006.js.map → dialog-page.DAh0M4mT.js.map} +1 -1
- package/dist/chunks/divider.BZfeYmB9.js +30 -0
- package/dist/chunks/divider.BZfeYmB9.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.d0f17d96.js → dropdown-default-textbox.CKOkl_Qa.js} +30 -34
- package/dist/chunks/{dropdown-default-textbox.d0f17d96.js.map → dropdown-default-textbox.CKOkl_Qa.js.map} +1 -1
- package/dist/chunks/dropdown-tag.DCMKQy-E.js +214 -0
- package/dist/chunks/dropdown-tag.DCMKQy-E.js.map +1 -0
- package/dist/chunks/{dropdown.a8037bca.js → dropdown.yhhQCKve.js} +230 -240
- package/dist/chunks/dropdown.yhhQCKve.js.map +1 -0
- package/dist/chunks/empty-state.BqVOj4v1.js +151 -0
- package/dist/chunks/empty-state.BqVOj4v1.js.map +1 -0
- package/dist/chunks/error-message.BSxUoE3_.js +107 -0
- package/dist/chunks/{error-message.bdcc1020.js.map → error-message.BSxUoE3_.js.map} +1 -1
- package/dist/chunks/events.CMzGybJJ.js +47 -0
- package/dist/chunks/{events.f14a214b.js.map → events.CMzGybJJ.js.map} +1 -1
- package/dist/chunks/filter-bar.Cpimgf_J.js +2119 -0
- package/dist/chunks/filter-bar.Cpimgf_J.js.map +1 -0
- package/dist/chunks/{fixed-scroller.82ef6187.js → fixed-scroller.Bq1AgPnw.js} +18 -20
- package/dist/chunks/{fixed-scroller.82ef6187.js.map → fixed-scroller.Bq1AgPnw.js.map} +1 -1
- package/dist/chunks/{index.1deef79e.js → focus-trap.DSkLNO_i.js} +35 -37
- package/dist/chunks/focus-trap.DSkLNO_i.js.map +1 -0
- package/dist/chunks/{footer-actions.58d14a16.js → footer-actions.DqMRmlV_.js} +11 -13
- package/dist/chunks/{footer-actions.58d14a16.js.map → footer-actions.DqMRmlV_.js.map} +1 -1
- package/dist/chunks/form-layout-title.BzNU0B72.js +187 -0
- package/dist/chunks/form-layout-title.BzNU0B72.js.map +1 -0
- package/dist/chunks/{form-layout.types.a7a1438d.js → form-layout.types.D3EKzbE7.js} +1 -1
- package/dist/chunks/{form-layout.types.a7a1438d.js.map → form-layout.types.D3EKzbE7.js.map} +1 -1
- package/dist/chunks/{get-slot-text.99c3d860.js → get-slot-text.Cgn-E48s.js} +2 -2
- package/dist/chunks/{get-slot-text.99c3d860.js.map → get-slot-text.Cgn-E48s.js.map} +1 -1
- package/dist/chunks/{grid-layout.e0025286.js → grid-layout.HvTAa4to.js} +11 -13
- package/dist/chunks/{grid-layout.e0025286.js.map → grid-layout.HvTAa4to.js.map} +1 -1
- package/dist/chunks/header.DmKHCmXh.js +245 -0
- package/dist/chunks/header.DmKHCmXh.js.map +1 -0
- package/dist/chunks/{i18n.eb5b985b.js → i18n.BQkEbtPM.js} +2 -2
- package/dist/chunks/{i18n.eb5b985b.js.map → i18n.BQkEbtPM.js.map} +1 -1
- package/dist/chunks/image.B3uqhFjl.js +82 -0
- package/dist/chunks/image.B3uqhFjl.js.map +1 -0
- package/dist/chunks/{index.fdf12170.js → index.B_EJflcs.js} +2 -2
- package/dist/chunks/{index.fdf12170.js.map → index.B_EJflcs.js.map} +1 -1
- package/dist/chunks/{index.f55fdc32.js → index.B_UZQ6qF.js} +209 -243
- package/dist/chunks/{index.f55fdc32.js.map → index.B_UZQ6qF.js.map} +1 -1
- package/dist/chunks/{index.4c062058.js → index.Cl4_42j5.js} +1 -1
- package/dist/chunks/{index.4c062058.js.map → index.Cl4_42j5.js.map} +1 -1
- package/dist/chunks/{index.561786f6.js → index.OCPp3NST.js} +3 -3
- package/dist/chunks/{index.561786f6.js.map → index.OCPp3NST.js.map} +1 -1
- package/dist/chunks/{index.d80206ed.js → index.Z84QE0E2.js} +2 -2
- package/dist/chunks/{index.d80206ed.js.map → index.Z84QE0E2.js.map} +1 -1
- package/dist/chunks/{index.86453263.js → index.xqFSZOAb.js} +2 -2
- package/dist/chunks/{index.86453263.js.map → index.xqFSZOAb.js.map} +1 -1
- package/dist/chunks/info-icon.CLguYHRt.js +41 -0
- package/dist/chunks/info-icon.CLguYHRt.js.map +1 -0
- package/dist/chunks/{info.8b6328aa.js → info.CyeBsLgt.js} +9 -11
- package/dist/chunks/{info.8b6328aa.js.map → info.CyeBsLgt.js.map} +1 -1
- package/dist/chunks/input-field.BnlEPPYr.js +218 -0
- package/dist/chunks/input-field.BnlEPPYr.js.map +1 -0
- package/dist/chunks/internal-error.BLZodVBE.js +5 -0
- package/dist/chunks/internal-error.BLZodVBE.js.map +1 -0
- package/dist/chunks/internal-error.BmrwJFpR.js +5 -0
- package/dist/chunks/internal-error.BmrwJFpR.js.map +1 -0
- package/dist/chunks/{keyboard-navigation.bbc3d15c.js → keyboard-navigation.Clz1jOaA.js} +2 -2
- package/dist/chunks/{keyboard-navigation.bbc3d15c.js.map → keyboard-navigation.Clz1jOaA.js.map} +1 -1
- package/dist/chunks/{index.bd1d28d0.js → link.DJ1A53gF.js} +20 -24
- package/dist/chunks/link.DJ1A53gF.js.map +1 -0
- package/dist/chunks/listbox-option-tag.BDjsYOE1.js +75 -0
- package/dist/chunks/listbox-option-tag.BDjsYOE1.js.map +1 -0
- package/dist/chunks/{loading-button.692dbdc8.js → loading-button.CoF1IhEU.js} +32 -34
- package/dist/chunks/{loading-button.692dbdc8.js.map → loading-button.CoF1IhEU.js.map} +1 -1
- package/dist/chunks/loading-indicator.DXc7I1Lm.js +48 -0
- package/dist/chunks/loading-indicator.DXc7I1Lm.js.map +1 -0
- package/dist/chunks/{index.a48e7f99.js → menu.2TwUMlA9.js} +82 -94
- package/dist/chunks/menu.2TwUMlA9.js.map +1 -0
- package/dist/chunks/modal-fullscreen.BB_8EMNo.js +196 -0
- package/dist/chunks/modal-fullscreen.BB_8EMNo.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.keys.b9f31632.js → modal-fullscreen.keys.CMba3hYp.js} +1 -1
- package/dist/chunks/{modal-fullscreen.keys.b9f31632.js.map → modal-fullscreen.keys.CMba3hYp.js.map} +1 -1
- package/dist/chunks/modal.DLwvcaRx.js +439 -0
- package/dist/chunks/modal.DLwvcaRx.js.map +1 -0
- package/dist/chunks/no-results-found.Bg_ZcEid.js +5 -0
- package/dist/chunks/no-results-found.Bg_ZcEid.js.map +1 -0
- package/dist/chunks/no-results-found.BqvYsBR6.js +5 -0
- package/dist/chunks/no-results-found.BqvYsBR6.js.map +1 -0
- package/dist/chunks/notifications-cleared.BMZk37uf.js +5 -0
- package/dist/chunks/notifications-cleared.BMZk37uf.js.map +1 -0
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js +5 -0
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +1 -0
- package/dist/chunks/{on-click-outside.3e0c3e2a.js → on-click-outside.CcNG5w7_.js} +1 -1
- package/dist/chunks/{on-click-outside.3e0c3e2a.js.map → on-click-outside.CcNG5w7_.js.map} +1 -1
- package/dist/chunks/page-not-found.COJLPVaU.js +5 -0
- package/dist/chunks/page-not-found.COJLPVaU.js.map +1 -0
- package/dist/chunks/page-not-found.DWW6W-PZ.js +5 -0
- package/dist/chunks/page-not-found.DWW6W-PZ.js.map +1 -0
- package/dist/chunks/pagination.BXjbVe4Z.js +494 -0
- package/dist/chunks/pagination.BXjbVe4Z.js.map +1 -0
- package/dist/chunks/{payment-method.c55dd352.js → payment-method.D9Qx-s4V.js} +19 -21
- package/dist/chunks/{payment-method.c55dd352.js.map → payment-method.D9Qx-s4V.js.map} +1 -1
- package/dist/chunks/payment-method.types.CJKfZQN5.js +5 -0
- package/dist/chunks/payment-method.types.CJKfZQN5.js.map +1 -0
- package/dist/chunks/planned-maintenance.C61sWB9h.js +5 -0
- package/dist/chunks/planned-maintenance.C61sWB9h.js.map +1 -0
- package/dist/chunks/planned-maintenance.jmWYTdet.js +5 -0
- package/dist/chunks/planned-maintenance.jmWYTdet.js.map +1 -0
- package/dist/chunks/{index.0a30d358.js → popover.B8YH92W8.js} +31 -37
- package/dist/chunks/popover.B8YH92W8.js.map +1 -0
- package/dist/chunks/{index.c8621e8e.js → popper-container.Bt02N3o1.js} +12 -15
- package/dist/chunks/popper-container.Bt02N3o1.js.map +1 -0
- package/dist/chunks/radio-group.CPbBFTzB.js +211 -0
- package/dist/chunks/radio-group.CPbBFTzB.js.map +1 -0
- package/dist/chunks/{radio-input.c6550a9c.js → radio-input.BQcC0INR.js} +17 -19
- package/dist/chunks/radio-input.BQcC0INR.js.map +1 -0
- package/dist/chunks/referrals.BvtT-kQS.js +5 -0
- package/dist/chunks/referrals.BvtT-kQS.js.map +1 -0
- package/dist/chunks/referrals.aX8WZigH.js +5 -0
- package/dist/chunks/referrals.aX8WZigH.js.map +1 -0
- package/dist/chunks/{refresh.71a03998.js → refresh.BKI9WwKh.js} +7 -9
- package/dist/chunks/{refresh.71a03998.js.map → refresh.BKI9WwKh.js.map} +1 -1
- package/dist/chunks/{resize.a041304d.js → resize.Bqks3WUm.js} +1 -1
- package/dist/chunks/{resize.a041304d.js.map → resize.Bqks3WUm.js.map} +1 -1
- package/dist/chunks/search-bar.CsAgO-t5.js +89 -0
- package/dist/chunks/search-bar.CsAgO-t5.js.map +1 -0
- package/dist/chunks/{search.471270fe.js → search.CBKhp7zB.js} +10 -12
- package/dist/chunks/{search.471270fe.js.map → search.CBKhp7zB.js.map} +1 -1
- package/dist/chunks/secondary-nav.CNgpPxUU.js +97 -0
- package/dist/chunks/secondary-nav.CNgpPxUU.js.map +1 -0
- package/dist/chunks/segmented-control.B49WbyTl.js +111 -0
- package/dist/chunks/segmented-control.B49WbyTl.js.map +1 -0
- package/dist/chunks/segmented-control.types.BHRLV8KU.js +5 -0
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -0
- package/dist/chunks/selection-card-group.DlOs8BkR.js +247 -0
- package/dist/chunks/selection-card-group.DlOs8BkR.js.map +1 -0
- package/dist/chunks/sidepanel.BBjm2QvZ.js +187 -0
- package/dist/chunks/sidepanel.BBjm2QvZ.js.map +1 -0
- package/dist/chunks/{sidepanel.keys.1ed8a57c.js → sidepanel.keys.R0DKQuYx.js} +1 -1
- package/dist/chunks/{sidepanel.keys.1ed8a57c.js.map → sidepanel.keys.R0DKQuYx.js.map} +1 -1
- package/dist/chunks/status.types.BhbOYpZx.js +36 -0
- package/dist/chunks/status.types.BhbOYpZx.js.map +1 -0
- package/dist/chunks/step.DY8Txb6a.js +234 -0
- package/dist/chunks/step.DY8Txb6a.js.map +1 -0
- package/dist/chunks/{index.3c69be27.js → structured-list-item.C9NTVDvT.js} +18 -22
- package/dist/chunks/structured-list-item.C9NTVDvT.js.map +1 -0
- package/dist/chunks/success.DhioLvPD.js +5 -0
- package/dist/chunks/success.DhioLvPD.js.map +1 -0
- package/dist/chunks/success.nNwxJRBS.js +5 -0
- package/dist/chunks/success.nNwxJRBS.js.map +1 -0
- package/dist/chunks/summary-grid-item-custom.CJpDnoPw.js +573 -0
- package/dist/chunks/summary-grid-item-custom.CJpDnoPw.js.map +1 -0
- package/dist/chunks/{summary-grid.keys.1d1028c2.js → summary-grid.keys.BBbFrFGF.js} +1 -1
- package/dist/chunks/{summary-grid.keys.1d1028c2.js.map → summary-grid.keys.BBbFrFGF.js.map} +1 -1
- package/dist/chunks/tabs.CE65f3E_.js +140 -0
- package/dist/chunks/tabs.CE65f3E_.js.map +1 -0
- package/dist/chunks/{tabs.keys.358742f2.js → tabs.keys.Bc2pSKRw.js} +1 -1
- package/dist/chunks/{tabs.keys.358742f2.js.map → tabs.keys.Bc2pSKRw.js.map} +1 -1
- package/dist/chunks/tag.bhKrZHTU.js +64 -0
- package/dist/chunks/tag.bhKrZHTU.js.map +1 -0
- package/dist/chunks/{teleport.84b0f20b.js → teleport.CQKBJZU5.js} +14 -16
- package/dist/chunks/{teleport.84b0f20b.js.map → teleport.CQKBJZU5.js.map} +1 -1
- package/dist/chunks/textarea.CcKbtQBs.js +208 -0
- package/dist/chunks/textarea.CcKbtQBs.js.map +1 -0
- package/dist/chunks/timeline-item.ScTrUBKC.js +364 -0
- package/dist/chunks/timeline-item.ScTrUBKC.js.map +1 -0
- package/dist/chunks/toast.0EYDj8o-.js +165 -0
- package/dist/chunks/toast.0EYDj8o-.js.map +1 -0
- package/dist/chunks/toggle-button.2U-vbQhk.js +83 -0
- package/dist/chunks/toggle-button.2U-vbQhk.js.map +1 -0
- package/dist/chunks/toggle.CiOVTWlk.js +121 -0
- package/dist/chunks/toggle.CiOVTWlk.js.map +1 -0
- package/dist/chunks/{tooltip.efddb5f3.js → tooltip.DR8rbIYw.js} +29 -32
- package/dist/chunks/tooltip.DR8rbIYw.js.map +1 -0
- package/dist/chunks/tutorial.DMm12L0S.js +335 -0
- package/dist/chunks/tutorial.DMm12L0S.js.map +1 -0
- package/dist/chunks/{index.e29a6907.js → typography.Bjtu3Gca.js} +30 -32
- package/dist/chunks/typography.Bjtu3Gca.js.map +1 -0
- package/dist/chunks/{unique-id.a2a2b458.js → unique-id.XFfoKuc2.js} +14 -20
- package/dist/chunks/{unique-id.a2a2b458.js.map → unique-id.XFfoKuc2.js.map} +1 -1
- package/dist/chunks/upload-files.5wQwbfkp.js +5 -0
- package/dist/chunks/upload-files.5wQwbfkp.js.map +1 -0
- package/dist/chunks/upload-files.jTQY6y2X.js +5 -0
- package/dist/chunks/upload-files.jTQY6y2X.js.map +1 -0
- package/dist/chunks/{use-bento-toast-controller.5dac1f3c.js → use-bento-toast-controller.BifdE4ak.js} +4 -4
- package/dist/chunks/{use-bento-toast-controller.5dac1f3c.js.map → use-bento-toast-controller.BifdE4ak.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.98a9ed01.js → use-cached-selected-values.CVLzxvTi.js} +217 -237
- package/dist/chunks/{use-cached-selected-values.98a9ed01.js.map → use-cached-selected-values.CVLzxvTi.js.map} +1 -1
- package/dist/chunks/{use-click-outside.941d1600.js → use-click-outside.DbjR7Lh4.js} +2 -2
- package/dist/chunks/{use-click-outside.941d1600.js.map → use-click-outside.DbjR7Lh4.js.map} +1 -1
- package/dist/chunks/{use-country-items.6b7985bf.js → use-country-items.C25TI6tp.js} +4 -4
- package/dist/chunks/{use-country-items.6b7985bf.js.map → use-country-items.C25TI6tp.js.map} +1 -1
- package/dist/chunks/{use-default-slot-validator.b9bff4c6.js → use-default-slot-validator.BDn0wkYP.js} +2 -2
- package/dist/chunks/{use-default-slot-validator.b9bff4c6.js.map → use-default-slot-validator.BDn0wkYP.js.map} +1 -1
- package/dist/chunks/{use-expandable-content-height.62fc84e5.js → use-expandable-content-height.GkjjbmPy.js} +1 -1
- package/dist/chunks/{use-expandable-content-height.62fc84e5.js.map → use-expandable-content-height.GkjjbmPy.js.map} +1 -1
- package/dist/chunks/{use-form-layout-loading.d03e5d48.js → use-form-layout-loading.D3lALhtC.js} +2 -2
- package/dist/chunks/{use-form-layout-loading.d03e5d48.js.map → use-form-layout-loading.D3lALhtC.js.map} +1 -1
- package/dist/chunks/use-has-slot.C9lQZ6nz.js +6 -0
- package/dist/chunks/{use-has-slot.fbeb19ec.js.map → use-has-slot.C9lQZ6nz.js.map} +1 -1
- package/dist/chunks/warning-filled.CLKRzGMT.js +24 -0
- package/dist/chunks/warning-filled.CLKRzGMT.js.map +1 -0
- package/dist/chunks/wrong-environment.BOsyKdRI.js +5 -0
- package/dist/chunks/wrong-environment.BOsyKdRI.js.map +1 -0
- package/dist/chunks/wrong-environment.BiHTPtbJ.js +5 -0
- package/dist/chunks/wrong-environment.BiHTPtbJ.js.map +1 -0
- package/dist/click-outside.js +2 -20
- package/dist/click-outside.js.map +1 -1
- package/dist/code-snippet.js +5 -2052
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +8 -97
- package/dist/country.js.map +1 -1
- package/dist/currency.js +3 -112
- package/dist/currency.js.map +1 -1
- package/dist/dashboard-template.js +3 -106
- package/dist/dashboard-template.js.map +1 -1
- package/dist/dashed-underline.js +5 -0
- package/dist/dashed-underline.js.map +1 -0
- package/dist/data-grid-template.js +2 -65
- package/dist/data-grid-template.js.map +1 -1
- package/dist/data-grid.js +8 -1986
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +5 -197
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +12 -227
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +5 -143
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +5 -2156
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +5 -192
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +2 -246
- package/dist/header.js.map +1 -1
- package/dist/image.js +4 -81
- package/dist/image.js.map +1 -1
- package/dist/index.js +270 -266
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +2 -40
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +7 -217
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +15 -15
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +3 -47
- package/dist/loading-indicator.js.map +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +3 -197
- package/dist/modal-fullscreen.js.map +1 -1
- package/dist/modal.js +11 -451
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +2 -507
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +4 -4
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +6 -213
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +6 -90
- package/dist/search-bar.js.map +1 -1
- package/dist/secondary-nav.js +2 -100
- package/dist/secondary-nav.js.map +1 -1
- package/dist/segmented-control.js +4 -214
- package/dist/segmented-control.js.map +1 -1
- package/dist/selection-card.js +4 -248
- package/dist/selection-card.js.map +1 -1
- package/dist/sidepanel.js +4 -189
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +3 -40
- package/dist/status.js.map +1 -1
- package/dist/stepper.js +5 -237
- package/dist/stepper.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +9 -584
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +3 -141
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -63
- package/dist/tag.js.map +1 -1
- package/dist/textarea.js +2 -209
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +7 -367
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +2 -168
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +4 -120
- package/dist/toggle.js.map +1 -1
- package/dist/tutorial.js +2 -340
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +308 -194
- package/package.json +5 -7
- package/dist/assets/index15.css +0 -1
- package/dist/assets/index32.css +0 -1
- package/dist/assets/index34.css +0 -1
- package/dist/assets/index35.css +0 -1
- package/dist/assets/index45.css +0 -1
- package/dist/assets/index48.css +0 -1
- package/dist/assets/index6.css +0 -1
- package/dist/chunks/1-generic-use.3ea646cd.js +0 -5
- package/dist/chunks/1-generic-use.3ea646cd.js.map +0 -1
- package/dist/chunks/1-generic-use.ccca5813.js +0 -5
- package/dist/chunks/1-generic-use.ccca5813.js.map +0 -1
- package/dist/chunks/2-generic-use.443db127.js +0 -5
- package/dist/chunks/2-generic-use.443db127.js.map +0 -1
- package/dist/chunks/2-generic-use.d69d7c08.js +0 -5
- package/dist/chunks/2-generic-use.d69d7c08.js.map +0 -1
- package/dist/chunks/3-generic-use.9f74667f.js +0 -5
- package/dist/chunks/3-generic-use.9f74667f.js.map +0 -1
- package/dist/chunks/3-generic-use.fe7ae2ce.js +0 -5
- package/dist/chunks/3-generic-use.fe7ae2ce.js.map +0 -1
- package/dist/chunks/4-generic-use.0356f4a1.js +0 -5
- package/dist/chunks/4-generic-use.0356f4a1.js.map +0 -1
- package/dist/chunks/4-generic-use.cd04bad0.js +0 -5
- package/dist/chunks/4-generic-use.cd04bad0.js.map +0 -1
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js +0 -33
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js.map +0 -1
- package/dist/chunks/adding-payment-methods.d570e03e.js +0 -5
- package/dist/chunks/adding-payment-methods.d570e03e.js.map +0 -1
- package/dist/chunks/adding-payment-methods.e419d6c0.js +0 -5
- package/dist/chunks/adding-payment-methods.e419d6c0.js.map +0 -1
- package/dist/chunks/adyen-giving.480913b5.js +0 -5
- package/dist/chunks/adyen-giving.480913b5.js.map +0 -1
- package/dist/chunks/adyen-giving.54ed984c.js +0 -5
- package/dist/chunks/adyen-giving.54ed984c.js.map +0 -1
- package/dist/chunks/base-button.852204dc.js +0 -88
- package/dist/chunks/checkmark-circle-fill.345311d2.js +0 -26
- package/dist/chunks/dropdown.a8037bca.js.map +0 -1
- package/dist/chunks/error-message.bdcc1020.js +0 -111
- package/dist/chunks/events.f14a214b.js +0 -50
- package/dist/chunks/index.0a30d358.js.map +0 -1
- package/dist/chunks/index.1deef79e.js.map +0 -1
- package/dist/chunks/index.3c69be27.js.map +0 -1
- package/dist/chunks/index.614a5138.js.map +0 -1
- package/dist/chunks/index.854d6498.js.map +0 -1
- package/dist/chunks/index.939dd5cf.js +0 -32
- package/dist/chunks/index.939dd5cf.js.map +0 -1
- package/dist/chunks/index.a48e7f99.js.map +0 -1
- package/dist/chunks/index.bd1d28d0.js.map +0 -1
- package/dist/chunks/index.c8621e8e.js.map +0 -1
- package/dist/chunks/index.ccc7e8d7.js.map +0 -1
- package/dist/chunks/index.e29a6907.js.map +0 -1
- package/dist/chunks/internal-error.35cbb071.js +0 -5
- package/dist/chunks/internal-error.35cbb071.js.map +0 -1
- package/dist/chunks/internal-error.9a4823ed.js +0 -5
- package/dist/chunks/internal-error.9a4823ed.js.map +0 -1
- package/dist/chunks/listbox-option-tag.8708be60.js +0 -107
- package/dist/chunks/listbox-option-tag.8708be60.js.map +0 -1
- package/dist/chunks/no-results-found.58856d70.js +0 -5
- package/dist/chunks/no-results-found.58856d70.js.map +0 -1
- package/dist/chunks/no-results-found.cbb12f78.js +0 -5
- package/dist/chunks/no-results-found.cbb12f78.js.map +0 -1
- package/dist/chunks/notifications-cleared.71025c22.js +0 -5
- package/dist/chunks/notifications-cleared.71025c22.js.map +0 -1
- package/dist/chunks/notifications-cleared.c4f4bed4.js +0 -5
- package/dist/chunks/notifications-cleared.c4f4bed4.js.map +0 -1
- package/dist/chunks/page-not-found.a500440d.js +0 -5
- package/dist/chunks/page-not-found.a500440d.js.map +0 -1
- package/dist/chunks/page-not-found.d1a84ba7.js +0 -5
- package/dist/chunks/page-not-found.d1a84ba7.js.map +0 -1
- package/dist/chunks/planned-maintenance.7fa5ac16.js +0 -5
- package/dist/chunks/planned-maintenance.7fa5ac16.js.map +0 -1
- package/dist/chunks/planned-maintenance.cff01aed.js +0 -5
- package/dist/chunks/planned-maintenance.cff01aed.js.map +0 -1
- package/dist/chunks/radio-input.c6550a9c.js.map +0 -1
- package/dist/chunks/referrals.178ce0eb.js +0 -5
- package/dist/chunks/referrals.178ce0eb.js.map +0 -1
- package/dist/chunks/referrals.599047da.js +0 -5
- package/dist/chunks/referrals.599047da.js.map +0 -1
- package/dist/chunks/success.41981fe8.js +0 -5
- package/dist/chunks/success.41981fe8.js.map +0 -1
- package/dist/chunks/success.77fac78b.js +0 -5
- package/dist/chunks/success.77fac78b.js.map +0 -1
- package/dist/chunks/tooltip.efddb5f3.js.map +0 -1
- package/dist/chunks/upload-files.2708eca7.js +0 -5
- package/dist/chunks/upload-files.2708eca7.js.map +0 -1
- package/dist/chunks/upload-files.b4cd9f8b.js +0 -5
- package/dist/chunks/upload-files.b4cd9f8b.js.map +0 -1
- package/dist/chunks/use-has-slot.fbeb19ec.js +0 -6
- package/dist/chunks/wrong-environment.c73b0bc0.js +0 -5
- package/dist/chunks/wrong-environment.c73b0bc0.js.map +0 -1
- package/dist/chunks/wrong-environment.f890a237.js +0 -5
- package/dist/chunks/wrong-environment.f890a237.js.map +0 -1
- /package/dist/assets/{index.css → alert.css} +0 -0
- /package/dist/assets/{index2.css → avatar-image.css} +0 -0
- /package/dist/assets/{index8.css → badge.css} +0 -0
- /package/dist/assets/{index5.css → checkbox-group.css} +0 -0
- /package/dist/assets/{index10.css → code-snippet.css} +0 -0
- /package/dist/assets/{index7.css → country.css} +0 -0
- /package/dist/assets/{index13.css → date-picker.css} +0 -0
- /package/dist/assets/{index23.css → date-range-picker.css} +0 -0
- /package/dist/assets/{index16.css → divider.css} +0 -0
- /package/dist/assets/{index17.css → dropdown-tag.css} +0 -0
- /package/dist/assets/{index18.css → empty-state.css} +0 -0
- /package/dist/assets/{index27.css → focus-trap.css} +0 -0
- /package/dist/assets/{index19.css → form-layout-title.css} +0 -0
- /package/dist/assets/{index26.css → header.css} +0 -0
- /package/dist/assets/{index28.css → info-icon.css} +0 -0
- /package/dist/assets/{index44.css → input-field.css} +0 -0
- /package/dist/assets/{index29.css → link.css} +0 -0
- /package/dist/assets/{index30.css → loading-indicator.css} +0 -0
- /package/dist/assets/{index25.css → pagination.css} +0 -0
- /package/dist/assets/{index37.css → popper-container.css} +0 -0
- /package/dist/assets/{index40.css → radio-group.css} +0 -0
- /package/dist/assets/{index31.css → search-bar.css} +0 -0
- /package/dist/assets/{index39.css → secondary-nav.css} +0 -0
- /package/dist/assets/{index12.css → step.css} +0 -0
- /package/dist/assets/{index20.css → structured-list-item.css} +0 -0
- /package/dist/assets/{index21.css → summary-grid-item-custom.css} +0 -0
- /package/dist/assets/{index22.css → tabs.css} +0 -0
- /package/dist/assets/{index14.css → tag.css} +0 -0
- /package/dist/assets/{index41.css → textarea.css} +0 -0
- /package/dist/assets/{index42.css → timeline-item.css} +0 -0
- /package/dist/assets/{index43.css → toast.css} +0 -0
- /package/dist/assets/{index3.css → toggle-button.css} +0 -0
- /package/dist/assets/{index46.css → typography.css} +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { defineComponent as $, ref as c, computed as d, watch as k, onMounted as Y, nextTick as q } from "vue";
|
|
2
|
+
import "./index.Cl4_42j5.js";
|
|
3
|
+
import { C as L } from "./cross-small.BLUwtRB-.js";
|
|
4
|
+
import { u as P } from "./i18n.BQkEbtPM.js";
|
|
5
|
+
import { B as N } from "./button.DhAUh5JA.js";
|
|
6
|
+
import { B as U } from "./typography.Bjtu3Gca.js";
|
|
7
|
+
import { n as B } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
|
+
import { u as O } from "./use-bento-toast-controller.BifdE4ak.js";
|
|
9
|
+
import "../assets/toast.css";
|
|
10
|
+
const M = {
|
|
11
|
+
"en-US": {
|
|
12
|
+
dismiss: "Dismiss"
|
|
13
|
+
}
|
|
14
|
+
}, W = {
|
|
15
|
+
i18n: { messages: M }
|
|
16
|
+
}, z = /* @__PURE__ */ $({
|
|
17
|
+
...W,
|
|
18
|
+
__name: "toast-item",
|
|
19
|
+
props: {
|
|
20
|
+
toast: { type: Object, required: !0 }
|
|
21
|
+
},
|
|
22
|
+
setup(m) {
|
|
23
|
+
const t = m, { t: s } = P();
|
|
24
|
+
return { __sfc: !0, props: t, t: s, onAction: () => {
|
|
25
|
+
typeof t.toast.action.handler == "function" && t.toast.action.handler(), t.toast.dismiss();
|
|
26
|
+
}, CrossIcon: L, BentoButton: N, BentoTypography: U };
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var V = function() {
|
|
30
|
+
var t = this, s = t._self._c, e = t._self._setupProxy;
|
|
31
|
+
return s("div", { staticClass: "b-toast-item" }, [s("output", { staticClass: "b-toast-item__text", attrs: { role: "status" } }, [s(e.BentoTypography, { attrs: { title: t.toast.text, el: "span", variant: "body", strongest: "" } }, [t._v(" " + t._s(t.toast.text) + " ")])], 1), t.toast.action ? s(e.BentoButton, { staticClass: "b-toast-item__btn", attrs: { variant: "tertiary", "data-testid": "toast-item-action-btn" }, on: { click: e.onAction } }, [t._v(" " + t._s(t.toast.action.text) + " ")]) : t._e(), s(e.BentoButton, { staticClass: "b-toast-item__btn", attrs: { variant: "tertiary", "data-testid": "toast-item-close-btn" }, on: { click: function(o) {
|
|
32
|
+
return t.toast.dismiss();
|
|
33
|
+
} }, scopedSlots: t._u([{ key: "iconLeft", fn: function() {
|
|
34
|
+
return [s(e.CrossIcon, { attrs: { "svg-title": e.t("dismiss") } })];
|
|
35
|
+
}, proxy: !0 }]) })], 1);
|
|
36
|
+
}, j = [], E = /* @__PURE__ */ B(
|
|
37
|
+
z,
|
|
38
|
+
V,
|
|
39
|
+
j,
|
|
40
|
+
!1,
|
|
41
|
+
null,
|
|
42
|
+
"e4019e01"
|
|
43
|
+
);
|
|
44
|
+
const H = E.exports, F = /* @__PURE__ */ $({
|
|
45
|
+
__name: "toast-shadow-stack",
|
|
46
|
+
emits: ["update"],
|
|
47
|
+
setup(m, { emit: t }) {
|
|
48
|
+
const { stack: s } = O(), e = c(), o = c(), u = c(), _ = c(), f = [o, u, _], v = d(() => s.value.slice(0, 3)), r = async () => {
|
|
49
|
+
await q();
|
|
50
|
+
const { top: h } = e.value.getBoundingClientRect(), T = s.value.map((b, y) => {
|
|
51
|
+
if (y > 2)
|
|
52
|
+
return { ...b, bottom: 0, height: 0 };
|
|
53
|
+
const { height: p, top: g } = f[y].value.$el.getBoundingClientRect();
|
|
54
|
+
return { ...b, height: p, bottom: g - h };
|
|
55
|
+
});
|
|
56
|
+
t("update", T);
|
|
57
|
+
};
|
|
58
|
+
return k(s, r), Y(() => {
|
|
59
|
+
s.value.length > 0 && r();
|
|
60
|
+
}), { __sfc: !0, stack: s, emit: t, shadowStack: e, toast0: o, toast1: u, toast2: _, toastRefs: f, toasts: v, shareToastsWithDimensions: r, ToastItem: H };
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var X = function() {
|
|
64
|
+
var t = this, s = t._self._c, e = t._self._setupProxy;
|
|
65
|
+
return s("div", { ref: "shadowStack", staticClass: "b-toast-shadow-stack" }, [e.toasts[0] ? s(e.ToastItem, { ref: "toast0", attrs: { toast: e.toasts[0] } }) : t._e(), e.toasts[1] ? s(e.ToastItem, { ref: "toast1", attrs: { toast: e.toasts[1] } }) : t._e(), e.toasts[2] ? s(e.ToastItem, { ref: "toast2", attrs: { toast: e.toasts[2] } }) : t._e()], 1);
|
|
66
|
+
}, G = [], J = /* @__PURE__ */ B(
|
|
67
|
+
F,
|
|
68
|
+
X,
|
|
69
|
+
G,
|
|
70
|
+
!1,
|
|
71
|
+
null,
|
|
72
|
+
"9e646b8f"
|
|
73
|
+
);
|
|
74
|
+
const K = J.exports, Q = /* @__PURE__ */ $({
|
|
75
|
+
__name: "toast",
|
|
76
|
+
setup(m) {
|
|
77
|
+
const s = c(!1), { stack: e } = O();
|
|
78
|
+
k(
|
|
79
|
+
e,
|
|
80
|
+
(a) => {
|
|
81
|
+
a.length > 0 && !s.value && (s.value = !0);
|
|
82
|
+
},
|
|
83
|
+
{ immediate: !0 }
|
|
84
|
+
);
|
|
85
|
+
const o = c(!1), u = c([]), _ = 40, f = 10, v = d(() => u.value.length), r = d(() => Math.min(o.value ? 2 : 0, v.value - 1)), h = d(() => {
|
|
86
|
+
const a = u.value[r.value];
|
|
87
|
+
return a ? a.bottom + a.height : 0;
|
|
88
|
+
}), T = d(() => {
|
|
89
|
+
const a = h.value - _;
|
|
90
|
+
return u.value.map((n, l) => {
|
|
91
|
+
const S = l > r.value, R = !o.value && l > 1, D = S ? a + f * (R ? 2 : 1) : n.bottom;
|
|
92
|
+
return {
|
|
93
|
+
...n,
|
|
94
|
+
styles: {
|
|
95
|
+
height: `${S ? _ : n.height}px`,
|
|
96
|
+
transform: S ? `translateY(${D * -1}px) scaleX(${R ? "0.8" : "0.9"})` : `translateY(${D * -1}px)`,
|
|
97
|
+
"z-index": v.value - l
|
|
98
|
+
},
|
|
99
|
+
// first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation
|
|
100
|
+
dismissTransform: l > 0 && l < (o.value ? 4 : 3) ? `translateY(${(D - n.height) * -1}px) scale(0.5, 0.1)` : null,
|
|
101
|
+
isFirst: l === 0,
|
|
102
|
+
isInert: l > (o.value ? 2 : 0)
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
}), b = (a) => {
|
|
106
|
+
a.dataset.dismissTransform && (a.style.transform = a.dataset.dismissTransform);
|
|
107
|
+
}, y = d(() => {
|
|
108
|
+
let a = 0;
|
|
109
|
+
if (r.value >= 0) {
|
|
110
|
+
const n = f * Math.min(v.value - 1 - r.value, o.value ? 1 : 2);
|
|
111
|
+
a = Math.min(h.value + n, document.body.parentElement.clientHeight);
|
|
112
|
+
}
|
|
113
|
+
return `${a}px`;
|
|
114
|
+
});
|
|
115
|
+
let p = null, g = null, i = 5e3;
|
|
116
|
+
const I = (a, n) => {
|
|
117
|
+
g = Date.now(), p = setTimeout(() => a.dismiss(), n);
|
|
118
|
+
}, A = (a) => {
|
|
119
|
+
clearTimeout(p), a ? (i = 5e3, o.value || I(a, i)) : i = 0;
|
|
120
|
+
};
|
|
121
|
+
k(
|
|
122
|
+
() => T.value[0],
|
|
123
|
+
(a, n) => {
|
|
124
|
+
(a == null ? void 0 : a.id) !== (n == null ? void 0 : n.id) && A(a);
|
|
125
|
+
},
|
|
126
|
+
{ immediate: !0 }
|
|
127
|
+
);
|
|
128
|
+
const C = () => {
|
|
129
|
+
i = i - Date.now() + g, clearTimeout(p);
|
|
130
|
+
}, x = () => {
|
|
131
|
+
i > 0 && I(T.value[0], i);
|
|
132
|
+
};
|
|
133
|
+
k(o, (a) => {
|
|
134
|
+
a ? C() : x();
|
|
135
|
+
});
|
|
136
|
+
const w = c();
|
|
137
|
+
return { __sfc: !0, TOAST_DISPLAY_DURATION: 5e3, renderToast: s, stack: e, hovered: o, toastsWithDimensions: u, collapsedToastHeight: _, stackIndicatorHeight: f, queueSize: v, lastVisibleToastIndex: r, lastVisibleToastBottom: h, queue: T, onBeforeToastLeave: b, stackHeight: y, dismissTimout: p, timeoutStart: g, remainingTimeToDismiss: i, startTimer: I, startNewDismissTimer: A, pauseDismissTimer: C, resumeDismissTimer: x, root: w, checkHover: () => setTimeout(() => {
|
|
138
|
+
o.value = o.value ? w.value.matches(":hover") : !1;
|
|
139
|
+
}), ToastShadowStack: K, ToastItem: H };
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var Z = function() {
|
|
143
|
+
var t = this, s = t._self._c, e = t._self._setupProxy;
|
|
144
|
+
return e.renderToast ? s("div", { ref: "root", staticClass: "b-toast", style: { height: e.stackHeight }, attrs: { "data-testid": "toast" }, on: { mouseenter: function(o) {
|
|
145
|
+
e.hovered = !0;
|
|
146
|
+
}, mouseleave: function(o) {
|
|
147
|
+
e.hovered = !1;
|
|
148
|
+
} } }, [s(e.ToastShadowStack, { on: { update: function(o) {
|
|
149
|
+
e.toastsWithDimensions = o;
|
|
150
|
+
} } }), s("transition-group", { attrs: { name: "b-toast__queue", tag: "div", "aria-live": "polite", "enter-class": "b-toast__queue--enter", "leave-to-class": "b-toast__queue--leave-to" }, on: { "before-leave": e.onBeforeToastLeave, "after-leave": e.checkHover } }, t._l(e.queue, function(o) {
|
|
151
|
+
return s(e.ToastItem, t._b({ key: o.id, staticClass: "b-toast__item", class: { "b-toast__item--first": o.isFirst }, style: o.styles, attrs: { toast: o, inert: o.isInert, "data-testid": "toast-item" } }, "toast-item", { "data-dismiss-transform": o.dismissTransform }, !1));
|
|
152
|
+
}), 1)], 1) : t._e();
|
|
153
|
+
}, tt = [], et = /* @__PURE__ */ B(
|
|
154
|
+
Q,
|
|
155
|
+
Z,
|
|
156
|
+
tt,
|
|
157
|
+
!1,
|
|
158
|
+
null,
|
|
159
|
+
"9a3ea236"
|
|
160
|
+
);
|
|
161
|
+
const mt = et.exports;
|
|
162
|
+
export {
|
|
163
|
+
mt as t
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=toast.0EYDj8o-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.0EYDj8o-.js","sources":["../../src/components/toast/components/toast-item/toast-item.vue","../../src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\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 { useBentoToastController } from '@/composables';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n import ToastItem from './components/toast-item/toast-item.vue';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","t","useI18n","props","stack","useBentoToastController","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","emit","watch","onMounted","renderToast","toastStack","hovered","collapsedToastHeight","stackIndicatorHeight","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root"],"mappings":";;;;;;;;;;;;;GAsDIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;iBAbA,EAAA,GAAAC,EAAA,IAAAC,EAAA;kDAEA,MAAA;AACI,MAAA,OAAAC,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;ACxBxB,UAAA,EAAA,OAAAC,EAAA,IAAAC,EAAA,GASAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,GACAE,IAAAF,EAAA,GACAG,IAAAH,EAAA,GACAI,IAAA,CAAAH,GAAAC,GAAAC,CAAA,GAGAE,IAAAC,EAAA,MAAAT,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,GAEAU,IAAA,YAAA;AAEI,YAAAC,EAAA;AAGA,YAAA,EAAA,KAAAC,EAAA,IAAAV,EAAA,MAAA,sBAAA,GAEAW,IAAAb,EAAA,MAAA,IAAA,CAAAc,GAAAC,MAAA;AACI,YAAAA,IAAA;AACI,iBAAA,EAAA,GAAAD,GAAA,QAAA,GAAA,QAAA,EAAA;AAEJ,cAAA,EAAA,QAAAE,GAAA,KAAAC,EAAA,IAAAV,EAAAQ,CAAA,EAAA,MAAA,IAAA,sBAAA;AACA,eAAA,EAAA,GAAAD,GAAA,QAAAE,GAAA,QAAAC,IAAAL,EAAA;AAAA,MAAmD,CAAA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ACkB;AAGtB,UAAAE,IAAA,MAAA;AACI,MAAAN,IAAAA,IAAA,KAAA,IAAA,IAAAD,GACA,aAAAD,CAAA;AAAA,IAA0B,GAG9BS,IAAA,MAAA;AACI,MAAAP,IAAA,KACIC,EAAAZ,EAAA,MAAA,CAAA,GAAAW,CAAA;AAAA,IACJ;AAGJ,IAAArB,EAAAI,GAAA,CAAAyB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA;kcAKA,MAAA,WAAA,MAAA;AAEQ,MAAAoB,EAAA,QAAAA,EAAA,QAAA0B,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as u, computed as d, useSlots as c } from "vue";
|
|
2
|
+
import { B as a } from "./button.DhAUh5JA.js";
|
|
3
|
+
import "./index.Cl4_42j5.js";
|
|
4
|
+
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
|
+
import "../assets/toggle-button.css";
|
|
6
|
+
const g = {}, f = /* @__PURE__ */ u({
|
|
7
|
+
...g,
|
|
8
|
+
__name: "toggle-button",
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Reduces sizing of button
|
|
12
|
+
*/
|
|
13
|
+
condensed: {
|
|
14
|
+
type: a.props.condensed.type,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Disables button functonality
|
|
19
|
+
*/
|
|
20
|
+
disabled: {
|
|
21
|
+
type: a.props.disabled.type,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Sets color set to inverse
|
|
26
|
+
*/
|
|
27
|
+
inverse: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Types of flavour of Button
|
|
33
|
+
* @values primary, secondary, tertiary
|
|
34
|
+
*/
|
|
35
|
+
variant: {
|
|
36
|
+
type: a.props.variant.type,
|
|
37
|
+
default: "primary",
|
|
38
|
+
validator: a.props.variant.validator
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* The state of the button whether it is toggled or not.
|
|
42
|
+
*/
|
|
43
|
+
toggled: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
emits: ["click", "update:toggled"],
|
|
49
|
+
setup(r, { emit: t }) {
|
|
50
|
+
const e = r, o = d(
|
|
51
|
+
() => e.variant === "tertiary" ? "tertiary-with-background" : e.variant
|
|
52
|
+
), s = d(() => ({
|
|
53
|
+
"b-toggle-button--condensed": e == null ? void 0 : e.condensed,
|
|
54
|
+
[`b-toggle-button--${o.value}-toggled`]: e.toggled,
|
|
55
|
+
"b-toggle-button--inverse": e.inverse
|
|
56
|
+
})), n = (l) => {
|
|
57
|
+
l.stopPropagation(), e != null && e.disabled || (t("click", l), t("update:toggled", !e.toggled));
|
|
58
|
+
}, i = c();
|
|
59
|
+
return { __sfc: !0, props: e, emit: t, computedVariant: o, conditionalClasses: s, onClick: n, slots: i, getSlotKeyIfVue3: (l) => ({}), BentoButton: a };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var _ = function() {
|
|
63
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
64
|
+
return e(o.BentoButton, t._b({ staticClass: "b-toggle-button", class: o.conditionalClasses, attrs: { "aria-expanded": `${t.toggled}`, condensed: t.condensed, disabled: t.disabled, inverse: t.inverse, variant: o.computedVariant }, on: { "!click": function(s) {
|
|
65
|
+
return s.stopPropagation(), o.onClick.apply(null, arguments);
|
|
66
|
+
} }, scopedSlots: t._u([t._l(o.slots, function(s, n) {
|
|
67
|
+
return { key: n, fn: function() {
|
|
68
|
+
return [t._t(n, null, null, o.getSlotKeyIfVue3(n))];
|
|
69
|
+
}, proxy: !0 };
|
|
70
|
+
})], null, !0) }, "bento-button", t.$attrs, !1));
|
|
71
|
+
}, m = [], v = /* @__PURE__ */ p(
|
|
72
|
+
f,
|
|
73
|
+
_,
|
|
74
|
+
m,
|
|
75
|
+
!1,
|
|
76
|
+
null,
|
|
77
|
+
"da4cca72"
|
|
78
|
+
);
|
|
79
|
+
const x = v.exports;
|
|
80
|
+
export {
|
|
81
|
+
x as B
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=toggle-button.2U-vbQhk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-button.2U-vbQhk.js","sources":["../../src/components/button/components/toggle-button/toggle-button.vue"],"sourcesContent":["<template>\n <bento-button\n class=\"b-toggle-button\"\n v-bind=\"$attrs\"\n :aria-expanded=\"`${toggled}`\"\n :condensed=\"condensed\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n :variant=\"computedVariant\"\n @click.capture.stop=\"onClick\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]>\n <slot :name=\"innerSlot\" v-bind=\"getSlotKeyIfVue3(innerSlot)\" />\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import BentoButton from '@/components/button/button.vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import { isVue3 } from 'vue-demi';\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n\n /**\n * The state of the button whether it is toggled or not.\n */\n toggled: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Click event handler\n */\n (e: 'click', event: MouseEvent): void;\n\n /**\n * Update the toggle state when the button has been clicked.\n */\n (e: 'update:toggled', newToggleState: boolean): void;\n }>();\n\n const computedVariant = computed(\n () => (props.variant === 'tertiary' ? 'tertiary-with-background' : props.variant) as BentoButtonVariant\n );\n\n const conditionalClasses = computed(() => ({\n [`b-toggle-button--condensed`]: props?.condensed,\n [`b-toggle-button--${computedVariant.value}-toggled`]: props.toggled,\n [`b-toggle-button--inverse`]: props.inverse,\n }));\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n if (!props?.disabled) {\n emit('click', e);\n emit('update:toggled', !props.toggled);\n }\n };\n\n const slots = useSlots();\n // If we don't provide a key to `slot` in vue 3, we will get type errors\n const getSlotKeyIfVue3 = (slotName: string | number) => (isVue3 ? { key: slotName } : {});\n</script>\n\n<script lang=\"ts\">\n /**\n * Toggle button is used to switch between two states (example: menu shown, menu hidden).\n * It functions as a regular button but retains its state to indicate whether the associated menu or element is active or inactive.\n *\n * @example\n * import { BentoToggleButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoToggleButton },\n * template: `\n * <bento-toggle-button state=\"toggled\" variant=\"secondary\">\n * Button that can be toggled\n * </bento-toggle-button>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle-button.scss\" />\n"],"names":["__default__","computedVariant","computed","props","conditionalClasses","onClick","e","emit","slots","useSlots","slotName"],"mappings":";;;;;AAyHI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzCAC,IAAAC;AAAA,MAAwB,MAAAC,EAAA,YAAA,aAAA,6BAAAA,EAAA;AAAA,IACqD,GAG7EC,IAAAF,EAAA,OAAA;AAAA,MAA2C,8BAAAC,KAAA,gBAAAA,EAAA;AAAA,MACA,CAAA,oBAAAF,EAAA,KAAA,UAAA,GAAAE,EAAA;AAAA,MACsB,4BAAAA,EAAA;AAAA,IACzB,EAAA,GAGxCE,IAAA,CAAAC,MAAA;AAEI,MAAAA,EAAA,gBAAA,GACAH,KAAA,QAAAA,EAAA,aACII,EAAA,SAAAD,CAAA,GACAC,EAAA,kBAAA,CAAAJ,EAAA,OAAA;AAAA,IACJ,GAGJK,IAAAC,EAAA;8HAEA,CAAAC,OAAA,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { defineComponent as k, ref as p, computed as u, toRefs as I, watch as A } from "vue";
|
|
2
|
+
import { C as B } from "./checkmark-small.BtF8b2gE.js";
|
|
3
|
+
import { B as L } from "./typography.Bjtu3Gca.js";
|
|
4
|
+
import { g as E } from "./unique-id.XFfoKuc2.js";
|
|
5
|
+
import { u as F } from "./use-default-slot-validator.BDn0wkYP.js";
|
|
6
|
+
import { u as R } from "./use-has-slot.C9lQZ6nz.js";
|
|
7
|
+
import { g } from "./get-slot-text.Cgn-E48s.js";
|
|
8
|
+
import { u as x } from "./aria-label.CaUURpnB.js";
|
|
9
|
+
import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
10
|
+
import "../assets/toggle.css";
|
|
11
|
+
var f = /* @__PURE__ */ ((t) => (t.LABEL_FIRST = "label-first", t))(f || {}), d = /* @__PURE__ */ ((t) => (t.BEFORE = "before", t.AFTER = "after", t))(d || {});
|
|
12
|
+
const D = k({
|
|
13
|
+
name: "bento-toggle",
|
|
14
|
+
components: { BentoTypography: L, CheckmarkSmall: B },
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: void 0
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Disable the toggle (optional)
|
|
28
|
+
*/
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Position of the label relative to the toggle (optional)
|
|
35
|
+
* @values before, after
|
|
36
|
+
*/
|
|
37
|
+
labelPosition: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: d.BEFORE,
|
|
40
|
+
validator: (t) => Object.values(d).includes(t)
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Setting this property to true will set the toggle to read only state.
|
|
44
|
+
*/
|
|
45
|
+
readonly: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Indicates if the switch is "on" or "off"
|
|
51
|
+
*/
|
|
52
|
+
value: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
emits: ["input"],
|
|
58
|
+
setup(t, { attrs: e, slots: a, emit: n }) {
|
|
59
|
+
const l = R(a), r = p(t.value), i = E("toggle-description"), c = g(a)("default"), o = g(a)("description");
|
|
60
|
+
F("bento-toggle", a.default, a.description);
|
|
61
|
+
const b = u(() => l("default") ? g(a)("default") : null), m = p(e["aria-label"]), { ariaLabel: _ } = I(t), y = x({
|
|
62
|
+
ariaLabel: m.value,
|
|
63
|
+
// TODO: take this line away when the aria-label props is removed
|
|
64
|
+
label: _,
|
|
65
|
+
defaultFallback: b
|
|
66
|
+
}), h = u(() => i ?? null), v = u(() => ({
|
|
67
|
+
[`b-toggle--${f.LABEL_FIRST}`]: t.labelPosition === d.BEFORE,
|
|
68
|
+
"b-toggle--disabled": t.disabled,
|
|
69
|
+
"b-toggle--readonly": t.readonly
|
|
70
|
+
})), C = (s) => {
|
|
71
|
+
n("input", s.target.checked);
|
|
72
|
+
}, S = (s) => {
|
|
73
|
+
t.readonly && s.preventDefault();
|
|
74
|
+
};
|
|
75
|
+
return A(
|
|
76
|
+
() => t.value,
|
|
77
|
+
(s) => {
|
|
78
|
+
r.value = s;
|
|
79
|
+
}
|
|
80
|
+
), {
|
|
81
|
+
// Refs
|
|
82
|
+
toggleInput: r,
|
|
83
|
+
// Values
|
|
84
|
+
computedAriaLabel: y,
|
|
85
|
+
computedDescription: h,
|
|
86
|
+
defaultSlotValue: c,
|
|
87
|
+
descriptionSlotValue: o,
|
|
88
|
+
conditionalClasses: v,
|
|
89
|
+
descriptionId: i,
|
|
90
|
+
// Method
|
|
91
|
+
hasSlot: l,
|
|
92
|
+
onChange: C,
|
|
93
|
+
onClick: S
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var O = function() {
|
|
98
|
+
var e = this, a = e._self._c;
|
|
99
|
+
return e._self._setupProxy, a("label", { staticClass: "b-toggle", class: e.conditionalClasses, attrs: { "data-testid": "label" } }, [a("input", { directives: [{ name: "model", rawName: "v-model", value: e.toggleInput, expression: "toggleInput" }], staticClass: "b-toggle__input", attrs: { "aria-label": e.computedAriaLabel, "aria-describedby": e.computedDescription, disabled: e.disabled, "aria-readonly": e.readonly, role: "switch", type: "checkbox" }, domProps: { checked: Array.isArray(e.toggleInput) ? e._i(e.toggleInput, null) > -1 : e.toggleInput }, on: { change: [function(n) {
|
|
100
|
+
var l = e.toggleInput, r = n.target, i = !!r.checked;
|
|
101
|
+
if (Array.isArray(l)) {
|
|
102
|
+
var c = null, o = e._i(l, c);
|
|
103
|
+
r.checked ? o < 0 && (e.toggleInput = l.concat([c])) : o > -1 && (e.toggleInput = l.slice(0, o).concat(l.slice(o + 1)));
|
|
104
|
+
} else
|
|
105
|
+
e.toggleInput = i;
|
|
106
|
+
}, (n) => e.onChange(n)], click: e.onClick } }), a("span", { staticClass: "b-toggle__track", attrs: { "aria-hidden": "true" } }, [a("span", { staticClass: "b-toggle__handle" }, [e.toggleInput ? a("checkmark-small") : e._e()], 1)]), e.hasSlot("default") ? a("span", { staticClass: "b-toggle__label-container" }, [e.hasSlot("default") ? a("bento-typography", { attrs: { el: "span", variant: "body", "data-testid": "inner-label" } }, [e._t("default")], 2) : e._e(), e.hasSlot("default") && e.hasSlot("description") ? a("bento-typography", { staticClass: "b-toggle__description", attrs: { id: e.descriptionId, el: "span", variant: "body" } }, [e._t("description")], 2) : e._e()], 1) : e._e()]);
|
|
107
|
+
}, w = [], P = /* @__PURE__ */ T(
|
|
108
|
+
D,
|
|
109
|
+
O,
|
|
110
|
+
w,
|
|
111
|
+
!1,
|
|
112
|
+
null,
|
|
113
|
+
"dd0561f5"
|
|
114
|
+
);
|
|
115
|
+
const K = P.exports;
|
|
116
|
+
export {
|
|
117
|
+
K as B,
|
|
118
|
+
f as a,
|
|
119
|
+
d as b
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=toggle.CiOVTWlk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.CiOVTWlk.js","sources":["../../src/components/toggle/toggle.types.ts","../../src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs, 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 '@/utils/ts/unique-id';\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 /**\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 defineComponent({\n name: 'bento-toggle',\n components: { BentoTypography, CheckmarkSmall },\n props: {\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 emits: ['input'],\n setup(props, { attrs, slots, emit }) {\n const hasSlot = useHasSlot(slots);\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: 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}`]:\n 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\n return {\n // Refs\n toggleInput,\n\n // Values\n computedAriaLabel,\n computedDescription,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClasses,\n descriptionId,\n\n // Method\n hasSlot,\n onChange,\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","_sfc_main","defineComponent","BentoTypography","CheckmarkSmallIcon","value","props","attrs","slots","emit","hasSlot","useHasSlot","toggleInput","ref","descriptionId","generateUid","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","labelSlot","computed","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;AC0DZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,GAAA,gBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA;AAAA,MAOA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAAL,EAAA;AAAA,MACA,WAAA,CAAAM,MAAA,OAAA,OAAAN,CAAA,EAAA,SAAAM,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,MAAAC,GAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,MAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAP,EAAA,KAAA,GACAQ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|
-
import { computed as d, defineComponent as
|
|
2
|
-
import { l as r } from "./events.
|
|
3
|
-
import { g as
|
|
4
|
-
import {
|
|
5
|
-
import { V as W } from "./index.
|
|
6
|
-
import { B as I } from "./
|
|
7
|
-
import { n as
|
|
1
|
+
import { computed as d, defineComponent as w, reactive as g, nextTick as S } from "vue";
|
|
2
|
+
import { l as r } from "./events.CMzGybJJ.js";
|
|
3
|
+
import { g as b } from "./unique-id.XFfoKuc2.js";
|
|
4
|
+
import { a as v, P as D, c as N } from "./popper-container.Bt02N3o1.js";
|
|
5
|
+
import { V as W } from "./index.Cl4_42j5.js";
|
|
6
|
+
import { B as I } from "./typography.Bjtu3Gca.js";
|
|
7
|
+
import { n as B } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
8
|
import "../assets/tooltip.css";
|
|
9
|
-
const l = { ...
|
|
10
|
-
var A = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(A || {}), R = /* @__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))(R || {}),
|
|
11
|
-
const
|
|
9
|
+
const l = { ...v };
|
|
10
|
+
var A = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(A || {}), R = /* @__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))(R || {}), U = /* @__PURE__ */ ((t) => (t[t.ESCAPE = 27] = "ESCAPE", t[t.ENTER = 13] = "ENTER", t[t.ARROW_LEFT = 37] = "ARROW_LEFT", t[t.ARROW_UP = 38] = "ARROW_UP", t[t.ARROW_RIGHT = 39] = "ARROW_RIGHT", t[t.ARROW_DOWN = 40] = "ARROW_DOWN", t[t.PAGE_UP = 33] = "PAGE_UP", t[t.PAGE_DOWN = 34] = "PAGE_DOWN", t[t.END = 35] = "END", t[t.HOME = 36] = "HOME", t))(U || {});
|
|
11
|
+
const x = {
|
|
12
12
|
name: "tooltip",
|
|
13
13
|
components: { BentoTypography: I, PopperContainer: D },
|
|
14
14
|
props: {
|
|
@@ -57,21 +57,19 @@ const U = {
|
|
|
57
57
|
tabIndex: e
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
}, G =
|
|
60
|
+
}, G = w(x);
|
|
61
61
|
var $ = function() {
|
|
62
62
|
var o = this, e = o._self._c;
|
|
63
63
|
return o._self._setupProxy, e("popper-container", { staticClass: "b-tooltip", class: o.conditionalClasses, attrs: { id: o.id, "aria-role": o.PopperContainerAriaRole.TOOLTIP, "aria-hidden": !o.isShown, arrow: { classes: ["b-tooltip__arrow"] }, "fallback-position": ["top", "bottom", "right", "left"], "is-hidden": !o.isShown, offset: [0, 4], position: o.position, tabindex: o.tabIndex, "target-element": o.targetElement } }, [e("bento-typography", { attrs: { el: "span", variant: "caption" } }, [o._v(" " + o._s(o.content) + " ")])], 1);
|
|
64
|
-
}, H = [], L = /* @__PURE__ */
|
|
64
|
+
}, H = [], L = /* @__PURE__ */ B(
|
|
65
65
|
G,
|
|
66
66
|
$,
|
|
67
67
|
H,
|
|
68
68
|
!1,
|
|
69
69
|
null,
|
|
70
|
-
"48ebca09"
|
|
71
|
-
null,
|
|
72
|
-
null
|
|
70
|
+
"48ebca09"
|
|
73
71
|
);
|
|
74
|
-
const k = L.exports, s = [], h = "aria-describedby", m =
|
|
72
|
+
const k = L.exports, s = [], h = "aria-describedby", m = b("tooltip");
|
|
75
73
|
let n, u = !1;
|
|
76
74
|
const a = g({
|
|
77
75
|
targetElement: null,
|
|
@@ -87,20 +85,20 @@ const a = g({
|
|
|
87
85
|
}
|
|
88
86
|
}, F = () => {
|
|
89
87
|
document.contains(n.$el) && document.body.removeChild(n.$el), n.$destroy(), n = void 0;
|
|
90
|
-
}, O = (t) => Object.values(l).includes(t.arg) ? t.arg : l.TOP,
|
|
88
|
+
}, O = (t) => Object.values(l).includes(t.arg) ? t.arg : l.TOP, E = (t) => s.find(
|
|
91
89
|
(o) => (
|
|
92
90
|
// isEqualNode doesn't work correct for svg element, hence the second check here
|
|
93
91
|
o.target.isEqualNode(t) && o.target === t
|
|
94
92
|
)
|
|
95
93
|
), M = (t) => {
|
|
96
|
-
const o =
|
|
94
|
+
const o = E(t);
|
|
97
95
|
if (!o.content || !t)
|
|
98
96
|
return;
|
|
99
97
|
t && t.setAttribute(h, m);
|
|
100
98
|
let e = !1;
|
|
101
99
|
document.querySelectorAll("dialog").forEach((i) => {
|
|
102
100
|
e = (i == null ? void 0 : i.open) || e;
|
|
103
|
-
}), e && (t.after(n.$el), e = !1), u = !0, n.content = o.content, n.position = o.position, a.content = o.content, a.position = o.position,
|
|
101
|
+
}), e && (t.after(n.$el), e = !1), u = !0, n.content = o.content, n.position = o.position, a.content = o.content, a.position = o.position, S(() => {
|
|
104
102
|
u && (n.targetElement = t, n.isShown = !0, a.targetElement = t, a.isShown = !0);
|
|
105
103
|
});
|
|
106
104
|
}, P = (t) => {
|
|
@@ -126,20 +124,19 @@ const a = g({
|
|
|
126
124
|
s.push(p);
|
|
127
125
|
}
|
|
128
126
|
}, c = (t, o) => {
|
|
129
|
-
const e =
|
|
127
|
+
const e = E(t);
|
|
130
128
|
if (e) {
|
|
131
129
|
if ((e == null ? void 0 : e.content) !== o.value && (e.content = o.value, n.isShown && n.targetElement.isEqualNode(t) && (e.content ? n.content = o.value : n.isShown = !1)), e.position !== o.arg) {
|
|
132
130
|
const i = O(o);
|
|
133
131
|
e.position = i, n.position = i;
|
|
134
132
|
}
|
|
135
|
-
} else
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const o = _(t);
|
|
133
|
+
} else !e && o.value && f(t, o);
|
|
134
|
+
}, _ = (t) => {
|
|
135
|
+
const o = E(t);
|
|
139
136
|
o && (o.removeListeners.forEach((e) => {
|
|
140
137
|
e();
|
|
141
138
|
}), P(), s.splice(s.indexOf(o), 1), s.length === 0 && F());
|
|
142
|
-
},
|
|
139
|
+
}, C = {
|
|
143
140
|
// Vue 2 Directive hooks
|
|
144
141
|
bind(t, o) {
|
|
145
142
|
f(t, o);
|
|
@@ -148,7 +145,7 @@ const a = g({
|
|
|
148
145
|
c(t, o);
|
|
149
146
|
},
|
|
150
147
|
unbind(t) {
|
|
151
|
-
|
|
148
|
+
_(t);
|
|
152
149
|
},
|
|
153
150
|
// Vue 3 Directive hooks
|
|
154
151
|
beforeMount(t, o) {
|
|
@@ -161,13 +158,13 @@ const a = g({
|
|
|
161
158
|
c(t, o);
|
|
162
159
|
},
|
|
163
160
|
unmounted(t) {
|
|
164
|
-
|
|
161
|
+
_(t);
|
|
165
162
|
}
|
|
166
163
|
};
|
|
167
164
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
C as B,
|
|
166
|
+
U as K,
|
|
167
|
+
l as a,
|
|
168
|
+
A as b
|
|
172
169
|
};
|
|
173
|
-
//# sourceMappingURL=tooltip.
|
|
170
|
+
//# sourceMappingURL=tooltip.DR8rbIYw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.DR8rbIYw.js","sources":["../../src/directives/tooltip/tooltip.types.ts","../../src/types/utils-events.ts","../../src/components/tooltip/tooltip.vue","../../src/directives/tooltip/tooltip.ts"],"sourcesContent":["import { PopperContainerPositionBasic } from '@/components/popper-container';\nimport type { DirectiveBinding } from 'vue/types/options';\n\nexport const BentoTooltipPosition = { ...PopperContainerPositionBasic };\nexport type BentoTooltipPosition = PopperContainerPositionBasic;\n\nexport enum BentoTooltipState {\n HIDDEN = 'hidden',\n}\n\nexport interface BentoTooltipDirectiveBinding extends Readonly<DirectiveBinding> {\n readonly value: string;\n}\n","import type { Vue } from 'vue-demi';\n\nexport interface ListenOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n self?: boolean;\n vm?: Vue;\n onCleanup?: () => void;\n}\n\nexport enum EventKey {\n ESCAPE = 'Escape',\n ENTER = 'Enter',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n PAGE_UP = 'PageUp',\n PAGE_DOWN = 'PageDown',\n END = 'End',\n HOME = 'Home',\n}\n\n/**\n * @deprecated `Event.keyCode` is deprecated. Use `EventKey` instead\n */\nexport enum KeyCode {\n ESCAPE = 27,\n ENTER = 13,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n PAGE_UP = 33,\n PAGE_DOWN = 34,\n END = 35,\n HOME = 36,\n}\n","<template>\n <popper-container\n :id=\"id\"\n :aria-role=\"PopperContainerAriaRole.TOOLTIP\"\n :aria-hidden=\"!isShown\"\n :arrow=\"{ classes: ['b-tooltip__arrow'] }\"\n :class=\"conditionalClasses\"\n :fallback-position=\"['top', 'bottom', 'right', 'left']\"\n :is-hidden=\"!isShown\"\n :offset=\"[0, 4]\"\n :position=\"position\"\n :tabindex=\"tabIndex\"\n :target-element=\"targetElement\"\n class=\"b-tooltip\"\n >\n <bento-typography el=\"span\" variant=\"caption\">\n {{ content }}\n </bento-typography>\n </popper-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTooltipPosition, BentoTooltipState } from '@/directives/tooltip/tooltip.types';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoTypography } from '@/components/typography';\n import { VueNodeElement } from '@/types';\n\n /**\n * Tooltip container, to be used internally to render the tooltip container where the text is shown.\n */\n export const Tooltip = {\n name: 'tooltip',\n components: { BentoTypography, PopperContainer },\n props: {\n /**\n * The tooltip's id. Necessary for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Tooltip's target reference to the DOM element or Vue component.\n * The tooltip will position itself relatively to target element, in the specified position.\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Tooltip's position relative to the target element.\n * Possible values are: 'top', 'bottom', 'left' and 'right'.\n */\n position: {\n type: String as PropType<BentoTooltipPosition>,\n default: BentoTooltipPosition.TOP,\n validator: value => Object.values(BentoTooltipPosition).includes(value as BentoTooltipPosition),\n },\n /**\n * Tooltip's offset.\n * If specified, the tooltip will have an offset in pixels between it and the target element\n * in specified position.\n */\n offset: { type: Number, default: 0 },\n /**\n * Tooltip's text content.\n */\n content: { type: String, required: true },\n /**\n * Shows / Hides the Tooltip component\n */\n isShown: { type: Boolean, default: false },\n },\n setup(props) {\n const conditionalClasses = computed(() => ({\n [`b-tooltip--${BentoTooltipState.HIDDEN}`]: !props.isShown,\n }));\n\n const tabIndex = computed((): number => (props.isShown ? 1 : -1));\n\n return {\n // Enums\n PopperContainerAriaRole,\n\n // Values\n conditionalClasses,\n tabIndex,\n };\n },\n };\n\n export default defineComponent(Tooltip);\n</script>\n\n<style lang=\"scss\" scoped src=\"./tooltip.scss\" />\n","import { nextTick, reactive } from 'vue';\nimport { listen } from '@/utils/ts/events';\nimport { generateUid } from '@/utils/ts/unique-id';\nimport { EventKey } from '@/types/utils-events';\nimport { BentoTooltipDirectiveBinding, BentoTooltipPosition } from './tooltip.types';\nimport { createApp, h, isVue2, isVue3, Vue2 } from 'vue-demi';\nimport BentoTooltip from '@/components/tooltip/tooltip.vue';\n\ninterface TooltipInstance {\n target: HTMLElement;\n content: string;\n position: BentoTooltipPosition;\n removeListeners: Array<() => void>;\n}\n\n/**\n * Tooltip directive to render a tooltip on a given HTML element or component.\n *\n * @usage\n * import { BentoTooltipDirective, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltipDirective },\n * template: `\n * <bento-button\n * v-bento-tooltip-directive:BentoTooltipPosition.BOTTOM=\"refToTextContent\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\nconst tooltipInstances: Array<TooltipInstance> = [];\nconst ariaDescribedByAttr = 'aria-describedby';\nconst tooltipId = generateUid('tooltip');\n\nlet tooltipVNode;\n\n// Reusable Tooltip component instance.\nlet tooltip;\n// Global visibility state to prevent tooltips from showing after it being instructed to hide\nlet open = false;\n\nconst tooltipProps = reactive({\n targetElement: null,\n content: 'START_MESSAGE',\n id: tooltipId,\n position: undefined,\n isShown: false,\n});\n\n/**\n * Creates a new Tooltip component instance and inserts it into DOM.\n * @param {HTMLElement} el the target element for the Tooltip\n * @internal\n */\nconst createTooltip = (el: HTMLElement) => {\n // Sets the target's tabindex so as to make the tooltip interactive via keyboard navigation\n el.setAttribute('tabindex', '0');\n\n if (isVue2) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for Vue method in Vue 3 but this code only executes in vue 2 so ignoring.\n const TooltipComponent = Vue2.extend(BentoTooltip);\n tooltip = new TooltipComponent({ propsData: { targetElement: el, content: '', id: tooltipId } }).$mount();\n document.body.appendChild(tooltip.$el);\n } else {\n tooltipProps.targetElement = el;\n tooltip = createApp({\n components: { BentoTooltip },\n setup() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for h method in Vue 2 but this code only executes in vue 3 so ignoring.\n return () => h(BentoTooltip, { ...tooltipProps }, '');\n },\n });\n tooltipVNode = document.createElement('div');\n tooltipVNode.id = 'tooltip-parent';\n document.body.appendChild(tooltipVNode);\n tooltip.mount('#tooltip-parent');\n }\n};\n\n/**\n * Removes Tooltip component instance from the DOM and destroys it.\n * @internal\n */\nconst destroyTooltip = () => {\n if (isVue2) {\n if (document.contains(tooltip.$el)) {\n document.body.removeChild(tooltip.$el);\n }\n tooltip.$destroy();\n } else {\n tooltip.unmount();\n if (document.contains(tooltipVNode)) {\n document.body.removeChild(tooltipVNode);\n }\n }\n\n tooltip = undefined;\n};\n\n/**\n * Returns tooltip position based on the specified argument.\n * By default returns 'top' if no argument is specified.\n * @param {BentoTooltipDirectiveBinding} binding Directive binding object.\n * @returns {string} Tooltip position.\n * @internal\n */\nconst getTooltipPosition = (binding: BentoTooltipDirectiveBinding): BentoTooltipPosition =>\n Object.values(BentoTooltipPosition).includes(binding.arg as BentoTooltipPosition)\n ? (binding.arg as BentoTooltipPosition)\n : BentoTooltipPosition.TOP;\n\n/**\n * Get the correct Tooltip instance for the given target element\n * @param {HTMLElement} el the target element for the Tooltip\n * @returns\n */\nconst getTooltipInstanceForTarget = (el: HTMLElement): TooltipInstance =>\n tooltipInstances.find(\n ctx =>\n // isEqualNode doesn't work correct for svg element, hence the second check here\n ctx.target.isEqualNode(el) && ctx.target === el\n );\n\n/**\n * On mouse enter event updates tooltip with correct content and position, and shows tooltip.\n * @param {?HTMLElement} el - Target element\n * @internal\n */\nconst showTooltip = (el?: HTMLElement) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n\n // If tooltip content is empty – do not show the tooltip\n if (!tooltipInstance.content || !el) {\n return;\n }\n\n if (el) {\n el.setAttribute(ariaDescribedByAttr, tooltipId);\n }\n\n // If the Tooltip is inside a dialog, move tooltip element inside of it\n // It gets restored to <body> when it gets hidden\n let isDialogOpen = false;\n document.querySelectorAll('dialog').forEach(node => {\n isDialogOpen = node?.open || isDialogOpen;\n });\n\n if (isDialogOpen) {\n if (isVue2) {\n el.after(tooltip.$el);\n // eslint-disable-next-line no-underscore-dangle\n } else if (tooltip?._instance?.vnode?.el) {\n // eslint-disable-next-line no-underscore-dangle\n el.after(tooltip?._instance?.vnode?.el);\n }\n isDialogOpen = false;\n }\n\n open = true;\n\n tooltip.content = tooltipInstance.content;\n tooltip.position = tooltipInstance.position;\n\n tooltipProps.content = tooltipInstance.content;\n tooltipProps.position = tooltipInstance.position;\n\n // Do calculations on a next tick, otherwise tooltip position calculations will be wrong\n nextTick(() => {\n // Do not open tooltip if it has been instructed to hide in process\n if (!open) {\n return;\n }\n tooltip.targetElement = el;\n tooltip.isShown = true;\n\n tooltipProps.targetElement = el;\n tooltipProps.isShown = true;\n });\n};\n\n/**\n * On mouse leave event hides the tooltip.\n * @internal\n */\nconst hideTooltip = (el?: HTMLElement) => {\n // Restore the tooltip element to body if it got move out of <body>\n if (tooltip.$el?.parentElement?.tagName && tooltip.$el?.parentElement?.tagName !== 'BODY') {\n document.body.appendChild(tooltip.$el);\n }\n\n open = false;\n tooltip.isShown = false;\n tooltipProps.isShown = false;\n if (el) {\n el.removeAttribute(ariaDescribedByAttr);\n }\n};\n\nconst tooltipBind = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!binding.hasOwnProperty('value') || binding.value) {\n // Create Tooltip component singleton instance\n if (tooltipInstances.length === 0) {\n createTooltip(el);\n }\n\n const show = () => showTooltip(el);\n const hide = () => hideTooltip(el);\n\n // Create and store context object, which has directive related handlers and content.\n const tooltipInstance: TooltipInstance = {\n target: el,\n content: binding.value,\n position: getTooltipPosition(binding),\n removeListeners: [\n listen(el, 'mouseenter', show),\n listen(el, 'mouseleave', hide),\n listen(el, 'focus', show),\n listen(el, 'blur', hide),\n listen(el, 'keydown', evt => {\n const keyboardEvent = <KeyboardEvent>evt;\n if (keyboardEvent.key === EventKey.ESCAPE) {\n hide();\n }\n }),\n ],\n };\n\n tooltipInstances.push(tooltipInstance);\n }\n};\n\nconst tooltipUpdate = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n if (tooltipInstance) {\n // Update tooltip content value if it is changed\n if (tooltipInstance?.content !== binding.value) {\n tooltipInstance.content = binding.value;\n // If tooltip is currently shown for current element – update tooltip's content value\n if (tooltip.isShown && tooltip.targetElement.isEqualNode(el)) {\n if (!tooltipInstance.content) {\n tooltip.isShown = false;\n } else {\n tooltip.content = binding.value;\n }\n\n // This forces the tooltip to refresh and update content in Vue3\n if (isVue3) {\n hideTooltip(el);\n showTooltip(el);\n }\n }\n }\n // Update tooltip position if it is changed\n if (tooltipInstance.position !== binding.arg) {\n const position = getTooltipPosition(binding);\n tooltipInstance.position = position;\n tooltip.position = position;\n }\n } else if (!tooltipInstance && binding.value) {\n // If I don't have a tooltip instance yet but the value passed was updated\n tooltipBind(el, binding);\n }\n};\n\nconst tooltipUnbind = (el: HTMLElement) => {\n const context = getTooltipInstanceForTarget(el);\n\n // Prevent unbinding/removing when there's nothing to unbind, leads to stack overflow errors\n if (!context) {\n return;\n }\n\n context.removeListeners.forEach(removeListener => {\n removeListener();\n });\n\n // If el is removed while tooltip is displayed, the tooltip doesnt hide as\n // there is no el to trigger mouseleave/blur.\n hideTooltip();\n\n tooltipInstances.splice(tooltipInstances.indexOf(context), 1);\n\n // If all the elements using the directive are removed, then no point having\n // the component on the page.\n if (tooltipInstances.length === 0) {\n destroyTooltip();\n }\n};\n\n/**\n * This directive allows you to bind a tooltip to an element.\n * Tooltip can be configured to be shown in one of four positions: 'top', 'left', 'right' and 'bottom'.\n *\n * @example\n * import { BentoTooltipDirective as BentoTooltip, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltip },\n * methods: {\n * contentExpression() {\n * return 'tooltip content';\n * },\n * },\n * template: `<div>\n * <div v-bento-tooltip:left=\"refToTooltipContent\"></div>\n * <div v-bento-tooltip:[TooltipPosition.BOTTOM]=\"refToTooltipContent\"></div>\n *\n * <!-- If you don't specify the position then by default it's `TooltipPosition.TOP` -->\n * <div v-bento-tooltip=\"refToTooltipContent\"></div>\n *\n * <!-- Tooltip content can also be a data property or a method or a computed property as well -->\n * <div v-bento-tooltip=\"contentExpression()\"></div>\n * </div>`,\n * };\n */\nexport const BentoTooltipDirective = {\n // Vue 2 Directive hooks\n bind(el, binding) {\n tooltipBind(el, binding);\n },\n update(el, binding) {\n tooltipUpdate(el, binding);\n },\n unbind(el) {\n tooltipUnbind(el);\n },\n // Vue 3 Directive hooks\n beforeMount(el, binding) {\n tooltipBind(el, binding);\n },\n mounted(el, binding) {\n tooltipUpdate(el, binding);\n },\n updated(el, binding) {\n tooltipUpdate(el, binding);\n },\n unmounted(el) {\n tooltipUnbind(el);\n },\n};\n"],"names":["BentoTooltipPosition","PopperContainerPositionBasic","BentoTooltipState","BentoTooltipState2","EventKey","EventKey2","KeyCode","KeyCode2","Tooltip","BentoTypography","PopperContainer","value","props","conditionalClasses","computed","tabIndex","PopperContainerAriaRole","_sfc_main","defineComponent","tooltipInstances","ariaDescribedByAttr","tooltipId","generateUid","tooltip","open","tooltipProps","reactive","createTooltip","el","TooltipComponent","Vue2","BentoTooltip","destroyTooltip","getTooltipPosition","binding","getTooltipInstanceForTarget","ctx","showTooltip","tooltipInstance","isDialogOpen","node","nextTick","hideTooltip","_b","_a","_d","_c","tooltipBind","show","hide","listen","evt","tooltipUpdate","position","tooltipUnbind","context","removeListener","BentoTooltipDirective"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,EAAA,GAAAC,EAAA;AAGD,IAAAC,IAAA,kBAAAC,OACRA,EAAA,SAAA,UADQA,IAAAD,KAAA,CAAA,CAAA,GCKAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,aAAA,aACAA,EAAA,WAAA,WACAA,EAAA,cAAA,cACAA,EAAA,aAAA,aACAA,EAAA,UAAA,UACAA,EAAA,YAAA,YACAA,EAAA,MAAA,OACAA,EAAA,OAAA,QAVQA,IAAAD,KAAA,CAAA,CAAA,GAgBAE,IAAA,kBAAAC,OACRA,EAAAA,EAAA,SAAA,EAAA,IAAA,UACAA,EAAAA,EAAA,QAAA,EAAA,IAAA,SACAA,EAAAA,EAAA,aAAA,EAAA,IAAA,cACAA,EAAAA,EAAA,WAAA,EAAA,IAAA,YACAA,EAAAA,EAAA,cAAA,EAAA,IAAA,eACAA,EAAAA,EAAA,aAAA,EAAA,IAAA,cACAA,EAAAA,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