@adyen/bento-vue3 2.0.1-rc.0 → 2.0.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/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{accordion-item.l88yjGPT.js → accordion-item.BMxeTYDy.js} +2 -2
- package/dist/chunks/{accordion-item.l88yjGPT.js.map → accordion-item.BMxeTYDy.js.map} +1 -1
- package/dist/chunks/{action-bar.CDkRNAoE.js → action-bar.CWjLoeOU.js} +3 -3
- package/dist/chunks/{action-bar.CDkRNAoE.js.map → action-bar.CWjLoeOU.js.map} +1 -1
- package/dist/chunks/{ai-tag.BijlneJD.js → ai-tag.CjrOE5yl.js} +2 -2
- package/dist/chunks/{ai-tag.BijlneJD.js.map → ai-tag.CjrOE5yl.js.map} +1 -1
- package/dist/chunks/{alert.Bplzzgm3.js → alert.C8Pe1-OO.js} +98 -80
- package/dist/chunks/alert.C8Pe1-OO.js.map +1 -0
- package/dist/chunks/{base-modal.DKCKkQDy.js → base-modal.Bn4ZXwv6.js} +4 -4
- package/dist/chunks/{base-modal.DKCKkQDy.js.map → base-modal.Bn4ZXwv6.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.CqFhtqhV.js → button-actions-with-menu.CrbF2BSQ.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.CqFhtqhV.js.map → button-actions-with-menu.CrbF2BSQ.js.map} +1 -1
- package/dist/chunks/{button-actions.796MVzQq.js → button-actions.uIjzze43.js} +2 -2
- package/dist/chunks/{button-actions.796MVzQq.js.map → button-actions.uIjzze43.js.map} +1 -1
- package/dist/chunks/{calendar.C60WoNOM.js → calendar.Dtba7fcs.js} +18 -18
- package/dist/chunks/{calendar.C60WoNOM.js.map → calendar.Dtba7fcs.js.map} +1 -1
- package/dist/chunks/{card.Dvp16GwX.js → card.a8QL14dy.js} +4 -4
- package/dist/chunks/{card.Dvp16GwX.js.map → card.a8QL14dy.js.map} +1 -1
- package/dist/chunks/{checkbox-group.DTGifncj.js → checkbox-group.BCzNXT1-.js} +3 -3
- package/dist/chunks/{checkbox-group.DTGifncj.js.map → checkbox-group.BCzNXT1-.js.map} +1 -1
- package/dist/chunks/{checkbox.X1EMa3FW.js → checkbox.0RmIkniU.js} +14 -14
- package/dist/chunks/{checkbox.X1EMa3FW.js.map → checkbox.0RmIkniU.js.map} +1 -1
- package/dist/chunks/{code-snippet.DEsJSJVK.js → code-snippet.BbswO6TU.js} +4 -4
- package/dist/chunks/{code-snippet.DEsJSJVK.js.map → code-snippet.BbswO6TU.js.map} +1 -1
- package/dist/chunks/{controls-group.DerSnhym.js → controls-group.KarFHKUT.js} +2 -2
- package/dist/chunks/{controls-group.DerSnhym.js.map → controls-group.KarFHKUT.js.map} +1 -1
- package/dist/chunks/{copy.DNczgREu.js → copy.C92qFRaR.js} +3 -3
- package/dist/chunks/{copy.DNczgREu.js.map → copy.C92qFRaR.js.map} +1 -1
- package/dist/chunks/{dashboard-section.l2FpRDRL.js → dashboard-section.Bv-SveGN.js} +3 -3
- package/dist/chunks/{dashboard-section.l2FpRDRL.js.map → dashboard-section.Bv-SveGN.js.map} +1 -1
- package/dist/chunks/{dashed-underline.BCAYJqCs.js → dashed-underline.C3lSC1_R.js} +3 -3
- package/dist/chunks/{dashed-underline.BCAYJqCs.js.map → dashed-underline.C3lSC1_R.js.map} +1 -1
- package/dist/chunks/{data-grid-template.8nSTkhta.js → data-grid-template.DqZmPeze.js} +4 -4
- package/dist/chunks/{data-grid-template.8nSTkhta.js.map → data-grid-template.DqZmPeze.js.map} +1 -1
- package/dist/chunks/{data-grid.CjR--S7q.js → data-grid.vBDlLHOW.js} +19 -19
- package/dist/chunks/{data-grid.CjR--S7q.js.map → data-grid.vBDlLHOW.js.map} +1 -1
- package/dist/chunks/{date-picker.kX0OtzF-.js → date-picker.Dnr2HuxA.js} +7 -7
- package/dist/chunks/{date-picker.kX0OtzF-.js.map → date-picker.Dnr2HuxA.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BiCTjOGe.js → date-range-picker.CuBygd3O.js} +32 -32
- package/dist/chunks/{date-range-picker.BiCTjOGe.js.map → date-range-picker.CuBygd3O.js.map} +1 -1
- package/dist/chunks/{draggable-handle.C4CTHXxX.js → draggable-handle.Cvc8gHzx.js} +2 -2
- package/dist/chunks/{draggable-handle.C4CTHXxX.js.map → draggable-handle.Cvc8gHzx.js.map} +1 -1
- package/dist/chunks/{draggable.GtQJVBaG.js → draggable.BZsgR26I.js} +2 -2
- package/dist/chunks/{draggable.GtQJVBaG.js.map → draggable.BZsgR26I.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.ChTtNLjy.js → dropdown-tag.Bn5FPeEL.js} +3 -3
- package/dist/chunks/{dropdown-tag.ChTtNLjy.js.map → dropdown-tag.Bn5FPeEL.js.map} +1 -1
- package/dist/chunks/{dropdown.D_mKfQ6f.js → dropdown.D_jkFrMd.js} +5 -5
- package/dist/chunks/{dropdown.D_mKfQ6f.js.map → dropdown.D_jkFrMd.js.map} +1 -1
- package/dist/chunks/{empty-state.Ds2tRTWX.js → empty-state.DpUC-3wv.js} +2 -2
- package/dist/chunks/{empty-state.Ds2tRTWX.js.map → empty-state.DpUC-3wv.js.map} +1 -1
- package/dist/chunks/{field-label.2cXs_CZy.js → field-label.Cz11fn_F.js} +2 -2
- package/dist/chunks/{field-label.2cXs_CZy.js.map → field-label.Cz11fn_F.js.map} +1 -1
- package/dist/chunks/{file-uploader.AlkcCFhN.js → file-uploader.BglImnqw.js} +6 -7
- package/dist/chunks/{file-uploader.AlkcCFhN.js.map → file-uploader.BglImnqw.js.map} +1 -1
- package/dist/chunks/filter-bar.DG4GTi8L.js +3971 -0
- package/dist/chunks/filter-bar.DG4GTi8L.js.map +1 -0
- package/dist/chunks/{focus-trap.BgyHTR_3.js → focus-trap.Co-S6goa.js} +2 -1
- package/dist/chunks/{focus-trap.BgyHTR_3.js.map → focus-trap.Co-S6goa.js.map} +1 -1
- package/dist/chunks/{footer-actions.CjiK4krX.js → footer-actions.Dl20Q1WX.js} +2 -2
- package/dist/chunks/{footer-actions.CjiK4krX.js.map → footer-actions.Dl20Q1WX.js.map} +1 -1
- package/dist/chunks/{form-layout-title.BB-65dko.js → form-layout-title.BZFh_nGD.js} +2 -2
- package/dist/chunks/{form-layout-title.BB-65dko.js.map → form-layout-title.BZFh_nGD.js.map} +1 -1
- package/dist/chunks/{header-with-views.DncSeESj.js → header-with-views.WJlXgGI5.js} +10 -10
- package/dist/chunks/{header-with-views.DncSeESj.js.map → header-with-views.WJlXgGI5.js.map} +1 -1
- package/dist/chunks/{header.CcbbavgV.js → header.Bi3MPZKE.js} +4 -4
- package/dist/chunks/{header.CcbbavgV.js.map → header.Bi3MPZKE.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.i_J-4snn.js → info-icon-with-popover.uSr6-jzR.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.i_J-4snn.js.map → info-icon-with-popover.uSr6-jzR.js.map} +1 -1
- package/dist/chunks/{info-icon.Bs4_4xiO.js → info-icon.Zlg6Sgz0.js} +3 -3
- package/dist/chunks/{info-icon.Bs4_4xiO.js.map → info-icon.Zlg6Sgz0.js.map} +1 -1
- package/dist/chunks/{input-field-password.DJJWboYN.js → input-field-password.CJZxudne.js} +4 -4
- package/dist/chunks/{input-field-password.DJJWboYN.js.map → input-field-password.CJZxudne.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.s6e7fRXS.js → input-field-phone-number.OJ4MG9Gf.js} +2 -2
- package/dist/chunks/{input-field-phone-number.s6e7fRXS.js.map → input-field-phone-number.OJ4MG9Gf.js.map} +1 -1
- package/dist/chunks/{input-field.D-9DhR3q.js → input-field.IyNujUZt.js} +3 -3
- package/dist/chunks/{input-field.D-9DhR3q.js.map → input-field.IyNujUZt.js.map} +1 -1
- package/dist/chunks/{input-time.B8CjTnFN.js → input-time.BJ6YqkFi.js} +3 -3
- package/dist/chunks/{input-time.B8CjTnFN.js.map → input-time.BJ6YqkFi.js.map} +1 -1
- package/dist/chunks/{inspector-page.ddc8uxW0.js → inspector-page.D42_PXHM.js} +2 -2
- package/dist/chunks/{inspector-page.ddc8uxW0.js.map → inspector-page.D42_PXHM.js.map} +1 -1
- package/dist/chunks/{inspector.M8CDE070.js → inspector.BBgrupfO.js} +2 -2
- package/dist/chunks/{inspector.M8CDE070.js.map → inspector.BBgrupfO.js.map} +1 -1
- package/dist/chunks/{list-item.H7_fNTdv.js → list-item.CT7dyMQH.js} +3 -3
- package/dist/chunks/{list-item.H7_fNTdv.js.map → list-item.CT7dyMQH.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.D4dI6JjW.js → listbox-option-tag.CwrFdsY1.js} +2 -2
- package/dist/chunks/{listbox-option-tag.D4dI6JjW.js.map → listbox-option-tag.CwrFdsY1.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.xBCeCfKq.js → modal-fullscreen.I5bjqzfd.js} +3 -3
- package/dist/chunks/{modal-fullscreen.xBCeCfKq.js.map → modal-fullscreen.I5bjqzfd.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DI5FvZCo.js → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DI5FvZCo.js.map → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.C3PlLAW0.js → navigation-menu-group.BJ9ZsXEn.js} +3 -3
- package/dist/chunks/{navigation-menu-group.C3PlLAW0.js.map → navigation-menu-group.BJ9ZsXEn.js.map} +1 -1
- package/dist/chunks/{pagination.BDWvQSLE.js → pagination.C5gZxtZY.js} +2 -2
- package/dist/chunks/{pagination.BDWvQSLE.js.map → pagination.C5gZxtZY.js.map} +1 -1
- package/dist/chunks/popover.types.dhllh3NP.js +6 -0
- package/dist/chunks/{popover.types.CXIAfp1m.js.map → popover.types.dhllh3NP.js.map} +1 -1
- package/dist/chunks/{popper-container.lfk_dyZi.js → popper-container.Rfj8UdMD.js} +2 -2
- package/dist/chunks/{popper-container.lfk_dyZi.js.map → popper-container.Rfj8UdMD.js.map} +1 -1
- package/dist/chunks/{radio-group.BCSEk7bG.js → radio-group.XmRPh03c.js} +3 -3
- package/dist/chunks/{radio-group.BCSEk7bG.js.map → radio-group.XmRPh03c.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.-rhl_Odb.js → rich-text-editor.Cv_Vwt-6.js} +5 -5
- package/dist/chunks/{rich-text-editor.-rhl_Odb.js.map → rich-text-editor.Cv_Vwt-6.js.map} +1 -1
- package/dist/chunks/{search-bar.9OVo47s4.js → search-bar.5tObtLfW.js} +3 -3
- package/dist/chunks/{search-bar.9OVo47s4.js.map → search-bar.5tObtLfW.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DLIwusR0.js → secondary-nav.DApIImQ0.js} +4 -4
- package/dist/chunks/{secondary-nav.DLIwusR0.js.map → secondary-nav.DApIImQ0.js.map} +1 -1
- package/dist/chunks/{segmented-control.CVGuMpfp.js → segmented-control.CEt2dz4n.js} +2 -2
- package/dist/chunks/{segmented-control.CVGuMpfp.js.map → segmented-control.CEt2dz4n.js.map} +1 -1
- package/dist/chunks/{selection-card-group.BdPFzMeI.js → selection-card-group.DHXtJpoB.js} +10 -10
- package/dist/chunks/{selection-card-group.BdPFzMeI.js.map → selection-card-group.DHXtJpoB.js.map} +1 -1
- package/dist/chunks/{sidepanel.DAJe9Vze.js → sidepanel._30g8POM.js} +4 -4
- package/dist/chunks/{sidepanel.DAJe9Vze.js.map → sidepanel._30g8POM.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DHhqoy1c.js → structured-list-item.CBzznwcF.js} +4 -4
- package/dist/chunks/{structured-list-item.DHhqoy1c.js.map → structured-list-item.CBzznwcF.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.q3UovoFz.js → summary-grid.types.BR_EGvRg.js} +5 -5
- package/dist/chunks/{summary-grid.types.q3UovoFz.js.map → summary-grid.types.BR_EGvRg.js.map} +1 -1
- package/dist/chunks/{tab.BnQFECsk.js → tab.D_k5AVHk.js} +2 -2
- package/dist/chunks/{tab.BnQFECsk.js.map → tab.D_k5AVHk.js.map} +1 -1
- package/dist/chunks/{tag.CYht36pa.js → tag.BE1j0Oid.js} +2 -2
- package/dist/chunks/{tag.CYht36pa.js.map → tag.BE1j0Oid.js.map} +1 -1
- package/dist/chunks/{textarea.Co2I-8Xo.js → textarea.BYshPd98.js} +2 -2
- package/dist/chunks/{textarea.Co2I-8Xo.js.map → textarea.BYshPd98.js.map} +1 -1
- package/dist/chunks/{timeline-item.cWOsHLlm.js → timeline-item.Sy_DSw6p.js} +6 -6
- package/dist/chunks/{timeline-item.cWOsHLlm.js.map → timeline-item.Sy_DSw6p.js.map} +1 -1
- package/dist/chunks/{title-details.BoXlSA06.js → title-details.C4ZvxPMu.js} +2 -2
- package/dist/chunks/{title-details.BoXlSA06.js.map → title-details.C4ZvxPMu.js.map} +1 -1
- package/dist/chunks/{tooltip.870vHAR2.js → tooltip.TFOGHOO0.js} +3 -3
- package/dist/chunks/{tooltip.870vHAR2.js.map → tooltip.TFOGHOO0.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ddox1H1m.js → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js} +4 -4
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ddox1H1m.js.map → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.C3Dpcve8.js → use-date-input-formatter._ik1DYYV.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.C3Dpcve8.js.map → use-date-input-formatter._ik1DYYV.js.map} +1 -1
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js +36 -0
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +4 -4
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +55 -55
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +2 -2
- package/dist/internal.js +11 -11
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/assets/date-filter.css +0 -1
- package/dist/assets/date-range-filter.css +0 -1
- package/dist/assets/input-with-dropdown-filter.css +0 -1
- package/dist/chunks/alert.Bplzzgm3.js.map +0 -1
- package/dist/chunks/date-filter.75o-NSBz.js +0 -156
- package/dist/chunks/date-filter.75o-NSBz.js.map +0 -1
- package/dist/chunks/date-range-filter.J5p9ECm7.js +0 -946
- package/dist/chunks/date-range-filter.J5p9ECm7.js.map +0 -1
- package/dist/chunks/filter-bar.CdUM6KUq.js +0 -2554
- package/dist/chunks/filter-bar.CdUM6KUq.js.map +0 -1
- package/dist/chunks/input-with-dropdown-filter.BBQAFXkw.js +0 -100
- package/dist/chunks/input-with-dropdown-filter.BBQAFXkw.js.map +0 -1
- package/dist/chunks/popover.types.CXIAfp1m.js +0 -6
- package/dist/chunks/select-avatar-filter.BcvevMzz.js +0 -55
- package/dist/chunks/select-avatar-filter.BcvevMzz.js.map +0 -1
- package/dist/chunks/select-country-filter.D9sGjia8.js +0 -56
- package/dist/chunks/select-country-filter.D9sGjia8.js.map +0 -1
- package/dist/chunks/select-currency-filter.oeGe4-X4.js +0 -91
- package/dist/chunks/select-currency-filter.oeGe4-X4.js.map +0 -1
- package/dist/chunks/select-payment-method-filter.uSfKXqOm.js +0 -55
- package/dist/chunks/select-payment-method-filter.uSfKXqOm.js.map +0 -1
- package/dist/chunks/select-tag-filter.BuKVAYC6.js +0 -63
- package/dist/chunks/select-tag-filter.BuKVAYC6.js.map +0 -1
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js +0 -34
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js.map +0 -1
- package/dist/chunks/warning-filled.Bzh3ib0x.js +0 -25
- package/dist/chunks/warning-filled.Bzh3ib0x.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as k, ref as c, watch as b, computed as T, openBlock as p, createElementBlock as V, withKeys as w, createVNode as o, unref as e, withCtx as t, createTextVNode as r, toDisplayString as s, createBlock as v, createElementVNode as C, createCommentVNode as I } from "vue";
|
|
2
|
-
import { u as N, c as D, h as K } from "./button-actions.
|
|
2
|
+
import { u as N, c as D, h as K } from "./button-actions.uIjzze43.js";
|
|
3
3
|
import { B as u } from "./typography.wIM07Hbl.js";
|
|
4
4
|
import { u as R } from "./index.B875RXHM.js";
|
|
5
5
|
import { g as L } from "./generate-uid.DBWe4g6T.js";
|
|
@@ -135,4 +135,4 @@ const A = {
|
|
|
135
135
|
export {
|
|
136
136
|
$ as a
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=ai-tag.
|
|
138
|
+
//# sourceMappingURL=ai-tag.CjrOE5yl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tag.
|
|
1
|
+
{"version":3,"file":"ai-tag.CjrOE5yl.js","sources":["../../../vue2/src/components/ai-tag/ai-tag.vue"],"sourcesContent":["<template>\n <div ref=\"aiTagRef\" class=\"b-ai-tag\" @keydown.esc=\"closePopover\">\n <bento-toggle-button\n ref=\"targetElement\"\n :toggled=\"toggled\"\n :aria-controls=\"popoverId\"\n variant=\"secondary\"\n condensed\n class=\"b-ai-tag__trigger\"\n @update:toggled=\"onToggle\"\n >\n <template #iconLeft>\n <artificial-intelligence-ai-icon class=\"b-ai-tag__trigger-icon\" :aria-hidden=\"true\" />\n </template>\n {{ t('ai') }}\n </bento-toggle-button>\n\n <bento-popover\n v-if=\"targetElement\"\n :id=\"popoverId\"\n :open=\"toggled\"\n :target-element=\"targetElement\"\n :actions=\"popoverActions\"\n actions-layout=\"fill-container\"\n :title=\"t('aiExplained')\"\n trap-all\n :trap-all-options=\"{ onDeactivate: closePopover, allowOutsideClick: true }\"\n fixed-positioning\n overflow-visible\n @dismiss=\"closePopover\"\n >\n <template #headerIcon>\n <artificial-intelligence-ai-icon class=\"b-ai-tag__popover-header-icon\" :aria-hidden=\"true\" />\n </template>\n <div class=\"b-ai-tag__popover-content\">\n <bento-typography v-if=\"influencedValue\" variant=\"title\" medium class=\"b-ai-tag__influenced-value\">\n {{ influencedValue }}\n </bento-typography>\n\n <bento-typography variant=\"title\">\n {{ title }}\n </bento-typography>\n\n <bento-typography>\n {{ description }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoToggleButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { useClickOutside } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/utils/ts/generate-uid';\n import type { BentoButtonActionsList } from '@/components/button/components/button-actions/button-actions.types';\n import ArtificialIntelligenceAiIcon from '@adyen/ui-assets-icons-16/vue/artificial-intelligence-ai-filled';\n import type { BentoAiTagProps } from './ai-tag.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoAiTagProps>(), {\n influencedValue: undefined,\n toggled: false,\n action: undefined,\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const toggled = ref(props.toggled);\n const aiTagRef = ref<HTMLElement | null>(null);\n const targetElement = ref<InstanceType<typeof BentoToggleButton> | null>(null);\n const popoverId = generateUid('b-ai-tag-popover');\n\n watch(\n () => props.toggled,\n value => {\n toggled.value = value;\n }\n );\n\n useClickOutside(aiTagRef, () => {\n closePopover();\n });\n\n const popoverActions = computed<BentoButtonActionsList>(() =>\n props.action\n ? [\n {\n ...props.action,\n variant: 'secondary',\n },\n ]\n : undefined\n );\n\n const emit = defineEmits<{\n /**\n * Triggered when the popover is toggled\n */\n (e: 'update:toggled', toggled: boolean): void;\n }>();\n\n const onToggle = (value: boolean) => {\n toggled.value = value;\n emit('update:toggled', value);\n };\n\n const closePopover = () => {\n if (toggled.value) {\n onToggle(false);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * The AI tag is a component used to transparently identify content, data, or experiences that have been generated or\n * enhanced by artificial intelligence.\n *\n * @example\n * import { BentoAiTag } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAiTag },\n * template: `\n * <bento-ai-tag\n * title=\"Input fields auto-filled by AI\"\n * description=\"Based on your documents uploaded, AI has auto-filled some information for you.\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./ai-tag.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","toggled","ref","aiTagRef","targetElement","popoverId","generateUid","watch","value","useClickOutside","closePopover","popoverActions","computed","emit","__emit","onToggle"],"mappings":";;;;;;;;;;;;;;;;;;;;+CA0IIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;AA1EA,UAAAC,IAAAC,GAMA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAJ,EAAA,CAAA,GAEAK,IAAAC,EAAAL,EAAA,OAAA,GACAM,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,IAAAC,EAAA,kBAAA;AAEA,IAAAC;AAAA,MAAA,MAAAV,EAAA;AAAA,MACgB,CAAAW,MAAA;AAER,QAAAP,EAAA,QAAAO;AAAA,MAAgB;AAAA,IACpB,GAGJC,EAAAN,GAAA,MAAA;AACI,MAAAO,EAAA;AAAA,IAAa,CAAA;AAGjB,UAAAC,IAAAC;AAAA,MAAuB,MAAAf,EAAA,SAAA;AAAA,QAEb;AAAA,UACI,GAAAA,EAAA;AAAA,UACa,SAAA;AAAA,QACA;AAAA,MACb,IAAA;AAAA,IAEJ,GAGVgB,IAAAC,GAOAC,IAAA,CAAAP,MAAA;AACI,MAAAP,EAAA,QAAAO,GACAK,EAAA,kBAAAL,CAAA;AAAA,IAA4B,GAGhCE,IAAA,MAAA;AACI,MAAAT,EAAA,SACIc,EAAA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,52 +1,69 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { c as
|
|
3
|
-
import { B as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as W } from "./warning-filled.Bzh3ib0x.js";
|
|
6
|
-
import { _ as z } from "./cross-circle-fill.DJbpTaVE.js";
|
|
7
|
-
import { _ as q } from "./checkmark-circle-fill.Caog04lx.js";
|
|
1
|
+
import { getCurrentInstance as H, openBlock as n, createElementBlock as C, mergeProps as v, toDisplayString as L, createCommentVNode as d, createElementVNode as i, unref as s, defineComponent as G, useSlots as N, computed as u, onMounted as R, normalizeClass as M, createBlock as h, resolveDynamicComponent as A, withCtx as _, renderSlot as m, createVNode as D } from "vue";
|
|
2
|
+
import { c as w, a as P, B as y } from "./typography.wIM07Hbl.js";
|
|
3
|
+
import { B as Z } from "./button.Ciflfide.js";
|
|
4
|
+
import { _ as F } from "./cross-small.B6P0qFHF.js";
|
|
8
5
|
/* empty css */
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { _ as U } from "./cross-circle-fill.DJbpTaVE.js";
|
|
7
|
+
import { _ as W } from "./checkmark-circle-fill.Caog04lx.js";
|
|
8
|
+
import { u as z } from "./use-has-slot.CyMiImRQ.js";
|
|
9
|
+
import { u as q } from "./index.B875RXHM.js";
|
|
10
|
+
import { _ as x } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
11
|
import "../assets/alert.css";
|
|
13
|
-
var
|
|
14
|
-
const
|
|
12
|
+
var p = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.TIP = "tip", e))(p || {}), r = /* @__PURE__ */ ((e) => (e.WARNING = "warning", e.CRITICAL = "critical", e.HIGHLIGHT = "highlight", e.SUCCESS = "success", e))(r || {}), S = /* @__PURE__ */ ((e) => (e.CLOSE_ALERT = "close-alert", e))(S || {});
|
|
13
|
+
const j = { key: 0 }, J = {
|
|
14
|
+
__name: "warning-filled",
|
|
15
|
+
setup(e) {
|
|
16
|
+
const c = H();
|
|
17
|
+
return String(c?.uid ?? c?.proxy?._uid), (t, o) => (n(), C("svg", v({ role: "img" }, t.$attrs, {
|
|
18
|
+
class: "ui-assets-icons-16",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
width: "16",
|
|
21
|
+
height: "16",
|
|
22
|
+
fill: "none"
|
|
23
|
+
}), [
|
|
24
|
+
t.$attrs["svg-title"] ? (n(), C("title", j, L(t.$attrs["svg-title"]), 1)) : d("", !0),
|
|
25
|
+
o[0] || (o[0] = i("path", {
|
|
26
|
+
fill: "#001222",
|
|
27
|
+
d: "M5.72456 2.45856C6.84306 0.797505 9.35301 0.852915 10.3789 2.62457L15 10.6246C16.0585 12.4537 14.7382 14.7493 12.6201 14.7496H3.37984C1.26177 14.7493 -0.0573711 12.4537 1.00093 10.6246L5.62105 2.62457L5.72456 2.45856ZM8.20991 10.3492C8.02 10.3092 7.80975 10.3298 7.62984 10.4097C7.44993 10.4897 7.28964 10.61 7.17964 10.7798C7.06984 10.9397 7.00984 11.1397 7.00972 11.3394C7.00972 11.6092 7.11997 11.8594 7.29976 12.0494C7.48973 12.2394 7.73976 12.3394 8.00972 12.3394L7.99995 12.3297C8.19979 12.3296 8.38964 12.2696 8.55952 12.1597C8.71947 12.0497 8.84966 11.8895 8.92964 11.7095C9.00952 11.5296 9.03016 11.3293 8.99019 11.1295C8.95014 10.9396 8.85955 10.7596 8.71968 10.6197C8.57975 10.4799 8.39975 10.3792 8.20991 10.3492ZM7.24995 4.57965V9.07965H8.74995V4.57965H7.24995Z"
|
|
28
|
+
}, null, -1))
|
|
29
|
+
], 16));
|
|
30
|
+
}
|
|
31
|
+
}, K = { key: 0 }, O = ["clip-path"], X = ["id"], Y = {
|
|
15
32
|
__name: "info-filled",
|
|
16
33
|
setup(e) {
|
|
17
|
-
const
|
|
18
|
-
return (
|
|
34
|
+
const c = H(), t = String(c?.uid ?? c?.proxy?._uid);
|
|
35
|
+
return (o, a) => (n(), C("svg", v({ role: "img" }, o.$attrs, {
|
|
19
36
|
class: "ui-assets-icons-16",
|
|
20
37
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21
38
|
width: "16",
|
|
22
39
|
height: "16",
|
|
23
40
|
fill: "none"
|
|
24
41
|
}), [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"clip-path": "url(#uia-ui-assets/icons-16-info_filled__a" +
|
|
42
|
+
o.$attrs["svg-title"] ? (n(), C("title", K, L(o.$attrs["svg-title"]), 1)) : d("", !0),
|
|
43
|
+
i("g", {
|
|
44
|
+
"clip-path": "url(#uia-ui-assets/icons-16-info_filled__a" + s(t) + ")"
|
|
28
45
|
}, a[0] || (a[0] = [
|
|
29
|
-
|
|
46
|
+
i("path", {
|
|
30
47
|
fill: "#001222",
|
|
31
48
|
"fill-rule": "evenodd",
|
|
32
49
|
d: "M5.03418 0.839544C6.45015 0.253058 8.00853 0.0992122 9.51172 0.398138C11.015 0.697159 12.3966 1.43547 13.4805 2.51923C14.5642 3.60301 15.3025 4.98476 15.6016 6.48798C15.9005 7.99113 15.7466 9.54958 15.1602 10.9655C14.5736 12.3816 13.5801 13.5925 12.3057 14.444C11.1109 15.2423 9.71924 15.6917 8.28711 15.7448L8 15.7497C5.94458 15.7497 3.97294 14.9336 2.51953 13.4802C1.06623 12.0268 0.250005 10.055 0.25 7.9997C0.250066 6.4671 0.70424 4.96838 1.55566 3.69404C2.40724 2.41967 3.61814 1.42609 5.03418 0.839544ZM6.25 6.2497V7.7497H7.25V10.2497H6.25V11.7497H9.75V10.2497H8.75V6.2497H6.25ZM7.75 3.4997C7.58674 3.4997 7.42763 3.54211 7.28418 3.61786C7.25386 3.63389 7.22303 3.64949 7.19434 3.66865L7.07812 3.75947C7.04744 3.78732 7.01817 3.817 6.99121 3.84833C6.97917 3.86236 6.96827 3.8776 6.95703 3.89228C6.93942 3.91522 6.9228 3.93915 6.90723 3.96357C6.90005 3.97485 6.89248 3.98618 6.88574 3.99775C6.86351 4.03594 6.84324 4.07574 6.82617 4.11689L6.78027 4.25751C6.77017 4.29795 6.7628 4.33927 6.75781 4.38056C6.75552 4.39961 6.75411 4.41902 6.75293 4.43818C6.75166 4.45856 6.75196 4.47926 6.75195 4.4997C6.75195 4.52207 6.75144 4.54472 6.75293 4.56708C6.75579 4.60979 6.76114 4.65273 6.76953 4.69501L6.80859 4.83661C6.82299 4.87685 6.84098 4.91584 6.86035 4.9538C6.86847 4.96971 6.87775 4.98522 6.88672 5.00068C6.89748 5.01922 6.90895 5.03753 6.9209 5.05536C6.93323 5.07376 6.94544 5.09248 6.95898 5.11005C6.98495 5.14371 7.01269 5.17643 7.04297 5.20673L7.1543 5.30341C7.19021 5.33003 7.2285 5.35325 7.26758 5.3747C7.27775 5.38031 7.28847 5.38508 7.29883 5.39033C7.32903 5.40554 7.35995 5.41924 7.3916 5.43134C7.40264 5.43559 7.41361 5.44018 7.4248 5.44404C7.46721 5.45855 7.51041 5.47134 7.55469 5.48017C7.59672 5.48853 7.63919 5.49291 7.68164 5.49579C7.70021 5.49707 7.71872 5.49751 7.7373 5.49775C7.76179 5.49804 7.78614 5.49729 7.81055 5.49579C7.82982 5.49462 7.84899 5.4932 7.86816 5.49091C7.90982 5.48592 7.95139 5.47962 7.99219 5.46943L8.13281 5.42353C8.1739 5.40649 8.21283 5.38517 8.25098 5.36298C8.2626 5.35623 8.27383 5.3487 8.28516 5.3415C8.30964 5.32589 8.33345 5.30934 8.35645 5.29169C8.37116 5.28043 8.38633 5.26958 8.40039 5.25751C8.43176 5.23053 8.46235 5.20229 8.49023 5.17158L8.58105 5.05536C8.69084 4.89096 8.75 4.6974 8.75 4.4997C8.74992 4.2346 8.64449 3.98013 8.45703 3.79267C8.26951 3.60523 8.01514 3.4997 7.75 3.4997Z",
|
|
33
50
|
"clip-rule": "evenodd"
|
|
34
51
|
}, null, -1)
|
|
35
|
-
]), 8,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
id: "uia-ui-assets/icons-16-info_filled__a" +
|
|
52
|
+
]), 8, O),
|
|
53
|
+
i("defs", null, [
|
|
54
|
+
i("clipPath", {
|
|
55
|
+
id: "uia-ui-assets/icons-16-info_filled__a" + s(t)
|
|
39
56
|
}, a[1] || (a[1] = [
|
|
40
|
-
|
|
57
|
+
i("rect", {
|
|
41
58
|
width: "16",
|
|
42
59
|
height: "16",
|
|
43
60
|
fill: "#fff"
|
|
44
61
|
}, null, -1)
|
|
45
|
-
]), 8,
|
|
62
|
+
]), 8, X)
|
|
46
63
|
])
|
|
47
64
|
], 16));
|
|
48
65
|
}
|
|
49
|
-
},
|
|
66
|
+
}, b = {
|
|
50
67
|
"de-DE": { close: "Schließen", criticalIcon: "Kritisches Symbol", highlightIcon: "Symbol hervorheben", successIcon: "Erfolgssymbol", warningIcon: "Warnungssymbol" },
|
|
51
68
|
"en-GB": { close: "Close", criticalIcon: "Critical icon", highlightIcon: "Highlight icon", successIcon: "Success icon", warningIcon: "Warning icon" },
|
|
52
69
|
"en-US": { close: "Close", criticalIcon: "Critical icon", highlightIcon: "Highlight icon", successIcon: "Success icon", warningIcon: "Warning icon" },
|
|
@@ -58,62 +75,62 @@ const J = { key: 0 }, K = ["clip-path"], O = ["id"], X = {
|
|
|
58
75
|
"ja-JP": { close: "閉じる", criticalIcon: "重大アイコン", highlightIcon: "ハイライトアイコン", successIcon: "成功アイコン", warningIcon: "警告アイコン" },
|
|
59
76
|
"pt-BR": { close: "Fechar", criticalIcon: "Ícone crítico", highlightIcon: "Ícone de destaque", successIcon: "Ícone de sucesso", warningIcon: "Ícone de aviso" },
|
|
60
77
|
"zh-CN": { close: "关闭", criticalIcon: "关键图标", highlightIcon: "高亮图标", successIcon: "成功图标", warningIcon: "警告图标" }
|
|
61
|
-
},
|
|
78
|
+
}, Q = ["role"], ee = { class: "b-alert__icon" }, te = { class: "b-alert__content" }, oe = {
|
|
62
79
|
key: 2,
|
|
63
80
|
class: "b-alert__actions",
|
|
64
81
|
"data-testid": "alert-actions"
|
|
65
|
-
},
|
|
66
|
-
i18n: { messages:
|
|
82
|
+
}, se = {
|
|
83
|
+
i18n: { messages: b },
|
|
67
84
|
name: "bento-alert"
|
|
68
|
-
},
|
|
69
|
-
...
|
|
85
|
+
}, ne = /* @__PURE__ */ G({
|
|
86
|
+
...se,
|
|
70
87
|
props: {
|
|
71
88
|
closeButton: { type: Boolean, default: !1 },
|
|
72
|
-
type: { default:
|
|
73
|
-
variant: { default:
|
|
89
|
+
type: { default: r.HIGHLIGHT },
|
|
90
|
+
variant: { default: p.DEFAULT }
|
|
74
91
|
},
|
|
75
92
|
emits: ["close-alert"],
|
|
76
|
-
setup(e, { emit:
|
|
77
|
-
const
|
|
78
|
-
[`b-alert--${
|
|
79
|
-
[`b-alert--${
|
|
80
|
-
})),
|
|
81
|
-
switch (
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
return q;
|
|
86
|
-
case s.WARNING:
|
|
93
|
+
setup(e, { emit: c }) {
|
|
94
|
+
const t = N(), o = z(t), a = c, l = e, { t: f } = q({ messages: b }), I = u(() => l.variant === p.TIP), $ = u(() => ({
|
|
95
|
+
[`b-alert--${l.type}`]: l.type,
|
|
96
|
+
[`b-alert--${p.TIP}`]: I.value
|
|
97
|
+
})), T = u(() => f(`${l.type}Icon`)), B = u(() => {
|
|
98
|
+
switch (l.type) {
|
|
99
|
+
case r.CRITICAL:
|
|
100
|
+
return U;
|
|
101
|
+
case r.SUCCESS:
|
|
87
102
|
return W;
|
|
88
|
-
case
|
|
103
|
+
case r.WARNING:
|
|
104
|
+
return J;
|
|
105
|
+
case r.HIGHLIGHT:
|
|
89
106
|
default:
|
|
90
|
-
return
|
|
107
|
+
return Y;
|
|
91
108
|
}
|
|
92
|
-
}),
|
|
93
|
-
el:
|
|
94
|
-
variant: I.value ?
|
|
109
|
+
}), E = u(() => ({
|
|
110
|
+
el: P.DIV,
|
|
111
|
+
variant: I.value ? w.CAPTION : w.BODY,
|
|
95
112
|
wide: !0
|
|
96
|
-
})),
|
|
97
|
-
a(
|
|
113
|
+
})), V = u(() => l.type === r.HIGHLIGHT ? "status" : "alert"), k = () => {
|
|
114
|
+
a(S.CLOSE_ALERT);
|
|
98
115
|
};
|
|
99
116
|
return R(() => {
|
|
100
|
-
if (!
|
|
117
|
+
if (!t.default && !t.description)
|
|
101
118
|
throw new Error("Alert Component requires a title or a description");
|
|
102
|
-
}), (
|
|
119
|
+
}), (g, ie) => (n(), C("div", {
|
|
103
120
|
class: "b-alert",
|
|
104
|
-
role:
|
|
121
|
+
role: V.value
|
|
105
122
|
}, [
|
|
106
|
-
|
|
107
|
-
class:
|
|
123
|
+
i("div", {
|
|
124
|
+
class: M(["b-alert__inner-container", $.value])
|
|
108
125
|
}, [
|
|
109
|
-
|
|
110
|
-
(
|
|
126
|
+
i("div", ee, [
|
|
127
|
+
(n(), h(A(B.value), {
|
|
111
128
|
"aria-hidden": "true",
|
|
112
|
-
"svg-title":
|
|
129
|
+
"svg-title": T.value
|
|
113
130
|
}, null, 8, ["svg-title"]))
|
|
114
131
|
]),
|
|
115
|
-
|
|
116
|
-
o
|
|
132
|
+
i("div", te, [
|
|
133
|
+
s(o)("default") && !I.value ? (n(), h(s(y), {
|
|
117
134
|
key: 0,
|
|
118
135
|
class: "b-alert__title",
|
|
119
136
|
el: "div",
|
|
@@ -121,46 +138,47 @@ const J = { key: 0 }, K = ["clip-path"], O = ["id"], X = {
|
|
|
121
138
|
strongest: "",
|
|
122
139
|
wide: ""
|
|
123
140
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
m(
|
|
141
|
+
default: _(() => [
|
|
142
|
+
m(g.$slots, "default", {}, void 0, !0)
|
|
126
143
|
]),
|
|
127
144
|
_: 3
|
|
128
145
|
})) : d("", !0),
|
|
129
|
-
o
|
|
146
|
+
s(o)("description") ? (n(), h(s(y), v({
|
|
130
147
|
key: 1,
|
|
131
148
|
class: "b-alert__description"
|
|
132
|
-
},
|
|
133
|
-
default:
|
|
134
|
-
m(
|
|
149
|
+
}, E.value, { "data-testid": "alert-description" }), {
|
|
150
|
+
default: _(() => [
|
|
151
|
+
m(g.$slots, "description", {}, void 0, !0)
|
|
135
152
|
]),
|
|
136
153
|
_: 3
|
|
137
154
|
}, 16)) : d("", !0),
|
|
138
|
-
o
|
|
139
|
-
m(
|
|
155
|
+
s(o)("actions") && !I.value ? (n(), C("div", oe, [
|
|
156
|
+
m(g.$slots, "actions", {}, void 0, !0)
|
|
140
157
|
])) : d("", !0)
|
|
141
158
|
]),
|
|
142
|
-
|
|
159
|
+
g.closeButton ? (n(), h(s(Z), {
|
|
143
160
|
key: 0,
|
|
144
161
|
class: "b-alert__close-button",
|
|
145
162
|
variant: "tertiary",
|
|
146
163
|
type: "button",
|
|
147
|
-
onClick:
|
|
164
|
+
onClick: k
|
|
148
165
|
}, {
|
|
149
|
-
default:
|
|
150
|
-
|
|
151
|
-
"svg-title":
|
|
166
|
+
default: _(() => [
|
|
167
|
+
D(s(F), {
|
|
168
|
+
"svg-title": s(f)("close")
|
|
152
169
|
}, null, 8, ["svg-title"])
|
|
153
170
|
]),
|
|
154
171
|
_: 1
|
|
155
172
|
})) : d("", !0)
|
|
156
173
|
], 2)
|
|
157
|
-
], 8,
|
|
174
|
+
], 8, Q));
|
|
158
175
|
}
|
|
159
|
-
}),
|
|
176
|
+
}), pe = /* @__PURE__ */ x(ne, [["__scopeId", "data-v-79dadb95"]]);
|
|
160
177
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
178
|
+
pe as B,
|
|
179
|
+
J as _,
|
|
180
|
+
S as a,
|
|
181
|
+
r as b,
|
|
182
|
+
p as c
|
|
165
183
|
};
|
|
166
|
-
//# sourceMappingURL=alert.
|
|
184
|
+
//# sourceMappingURL=alert.C8Pe1-OO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.C8Pe1-OO.js","sources":["../../../vue2/src/components/alert/alert.types.ts","../../../ui-assets/icons-16/dist/vue/warning-filled.vue","../../../ui-assets/icons-16/dist/vue/info-filled.vue","../../../vue2/src/components/alert/alert.vue"],"sourcesContent":["/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoAlertVariant {\n DEFAULT = 'default',\n TIP = 'tip',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoAlertTypeOption {\n WARNING = 'warning',\n CRITICAL = 'critical',\n HIGHLIGHT = 'highlight',\n SUCCESS = 'success',\n}\n\n/**\n * @deprecated Since v2.0.0. Use `@close-alert` instead.\n */\nexport enum BentoAlertEvent {\n CLOSE_ALERT = 'close-alert',\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M5.72456 2.45856C6.84306 0.797505 9.35301 0.852915 10.3789 2.62457L15 10.6246C16.0585 12.4537 14.7382 14.7493 12.6201 14.7496H3.37984C1.26177 14.7493 -0.0573711 12.4537 1.00093 10.6246L5.62105 2.62457L5.72456 2.45856ZM8.20991 10.3492C8.02 10.3092 7.80975 10.3298 7.62984 10.4097C7.44993 10.4897 7.28964 10.61 7.17964 10.7798C7.06984 10.9397 7.00984 11.1397 7.00972 11.3394C7.00972 11.6092 7.11997 11.8594 7.29976 12.0494C7.48973 12.2394 7.73976 12.3394 8.00972 12.3394L7.99995 12.3297C8.19979 12.3296 8.38964 12.2696 8.55952 12.1597C8.71947 12.0497 8.84966 11.8895 8.92964 11.7095C9.00952 11.5296 9.03016 11.3293 8.99019 11.1295C8.95014 10.9396 8.85955 10.7596 8.71968 10.6197C8.57975 10.4799 8.39975 10.3792 8.20991 10.3492ZM7.24995 4.57965V9.07965H8.74995V4.57965H7.24995Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g :clip-path=\"'url(#uia-ui-assets/icons-16-info_filled__a' + uuid + ')'\"><path fill=\"#001222\" fill-rule=\"evenodd\" d=\"M5.03418 0.839544C6.45015 0.253058 8.00853 0.0992122 9.51172 0.398138C11.015 0.697159 12.3966 1.43547 13.4805 2.51923C14.5642 3.60301 15.3025 4.98476 15.6016 6.48798C15.9005 7.99113 15.7466 9.54958 15.1602 10.9655C14.5736 12.3816 13.5801 13.5925 12.3057 14.444C11.1109 15.2423 9.71924 15.6917 8.28711 15.7448L8 15.7497C5.94458 15.7497 3.97294 14.9336 2.51953 13.4802C1.06623 12.0268 0.250005 10.055 0.25 7.9997C0.250066 6.4671 0.70424 4.96838 1.55566 3.69404C2.40724 2.41967 3.61814 1.42609 5.03418 0.839544ZM6.25 6.2497V7.7497H7.25V10.2497H6.25V11.7497H9.75V10.2497H8.75V6.2497H6.25ZM7.75 3.4997C7.58674 3.4997 7.42763 3.54211 7.28418 3.61786C7.25386 3.63389 7.22303 3.64949 7.19434 3.66865L7.07812 3.75947C7.04744 3.78732 7.01817 3.817 6.99121 3.84833C6.97917 3.86236 6.96827 3.8776 6.95703 3.89228C6.93942 3.91522 6.9228 3.93915 6.90723 3.96357C6.90005 3.97485 6.89248 3.98618 6.88574 3.99775C6.86351 4.03594 6.84324 4.07574 6.82617 4.11689L6.78027 4.25751C6.77017 4.29795 6.7628 4.33927 6.75781 4.38056C6.75552 4.39961 6.75411 4.41902 6.75293 4.43818C6.75166 4.45856 6.75196 4.47926 6.75195 4.4997C6.75195 4.52207 6.75144 4.54472 6.75293 4.56708C6.75579 4.60979 6.76114 4.65273 6.76953 4.69501L6.80859 4.83661C6.82299 4.87685 6.84098 4.91584 6.86035 4.9538C6.86847 4.96971 6.87775 4.98522 6.88672 5.00068C6.89748 5.01922 6.90895 5.03753 6.9209 5.05536C6.93323 5.07376 6.94544 5.09248 6.95898 5.11005C6.98495 5.14371 7.01269 5.17643 7.04297 5.20673L7.1543 5.30341C7.19021 5.33003 7.2285 5.35325 7.26758 5.3747C7.27775 5.38031 7.28847 5.38508 7.29883 5.39033C7.32903 5.40554 7.35995 5.41924 7.3916 5.43134C7.40264 5.43559 7.41361 5.44018 7.4248 5.44404C7.46721 5.45855 7.51041 5.47134 7.55469 5.48017C7.59672 5.48853 7.63919 5.49291 7.68164 5.49579C7.70021 5.49707 7.71872 5.49751 7.7373 5.49775C7.76179 5.49804 7.78614 5.49729 7.81055 5.49579C7.82982 5.49462 7.84899 5.4932 7.86816 5.49091C7.90982 5.48592 7.95139 5.47962 7.99219 5.46943L8.13281 5.42353C8.1739 5.40649 8.21283 5.38517 8.25098 5.36298C8.2626 5.35623 8.27383 5.3487 8.28516 5.3415C8.30964 5.32589 8.33345 5.30934 8.35645 5.29169C8.37116 5.28043 8.38633 5.26958 8.40039 5.25751C8.43176 5.23053 8.46235 5.20229 8.49023 5.17158L8.58105 5.05536C8.69084 4.89096 8.75 4.6974 8.75 4.4997C8.74992 4.2346 8.64449 3.98013 8.45703 3.79267C8.26951 3.60523 8.01514 3.4997 7.75 3.4997Z\" clip-rule=\"evenodd\"/></g><defs><clipPath :id=\"'uia-ui-assets/icons-16-info_filled__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <div class=\"b-alert\" :role=\"computedRole\">\n <div class=\"b-alert__inner-container\" :class=\"alertConditionalClasses\">\n <div class=\"b-alert__icon\">\n <component :is=\"iconComponent\" aria-hidden=\"true\" :svg-title=\"iconSvgTitle\" />\n </div>\n\n <div class=\"b-alert__content\">\n <bento-typography\n v-if=\"hasSlot('default') && !isTipVariant\"\n class=\"b-alert__title\"\n el=\"div\"\n variant=\"body\"\n strongest\n wide\n >\n <slot />\n </bento-typography>\n\n <bento-typography\n v-if=\"hasSlot('description')\"\n class=\"b-alert__description\"\n v-bind=\"descriptionTypography\"\n data-testid=\"alert-description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n\n <div v-if=\"hasSlot('actions') && !isTipVariant\" class=\"b-alert__actions\" data-testid=\"alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n\n <bento-button\n v-if=\"closeButton\"\n class=\"b-alert__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n @click=\"onCloseButtonClick\"\n >\n <cross-small :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n\n // Component\n import { BentoAlertEvent, BentoAlertTypeOption, BentoAlertVariant } from '@/components/alert/alert.types';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n\n import CrossSmall from '@adyen/ui-assets-icons-16/vue/cross-small';\n import Warning from '@adyen/ui-assets-icons-16/vue/warning-filled';\n import CrossCircle from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import CheckedCircle from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import Info from '@adyen/ui-assets-icons-16/vue/info-filled';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<{\n /**\n * Emits event when the alert is closed. `closeButton` must be `true`\n */\n (e: 'close-alert');\n }>();\n\n const props = withDefaults(\n defineProps<{\n /**\n * Adds a close button on the right side of the alert\n */\n closeButton?: boolean;\n\n /**\n * Type of a alert; set a distinctive icon and color. Defaults to highlight.\n * @values HIGHLIGHT, SUCCESS, CRITICAL, WARNING\n */\n type?: BentoAlertTypeOption | `${BentoAlertTypeOption}`;\n\n /**\n * Variant for the alert\n * @values DEFAULT, TIP\n */\n variant?: BentoAlertVariant | `${BentoAlertVariant}`;\n }>(),\n {\n closeButton: false,\n type: BentoAlertTypeOption.HIGHLIGHT,\n variant: BentoAlertVariant.DEFAULT,\n }\n );\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const isTipVariant = computed(() => props.variant === BentoAlertVariant.TIP);\n\n const alertConditionalClasses = computed(() => ({\n [`b-alert--${props.type}`]: props.type,\n [`b-alert--${BentoAlertVariant.TIP}`]: isTipVariant.value,\n }));\n\n const iconSvgTitle = computed(() => t(`${props.type}Icon`));\n\n const iconComponent = computed(() => {\n switch (props.type) {\n case BentoAlertTypeOption.CRITICAL:\n return CrossCircle;\n case BentoAlertTypeOption.SUCCESS:\n return CheckedCircle;\n case BentoAlertTypeOption.WARNING:\n return Warning;\n case BentoAlertTypeOption.HIGHLIGHT:\n default:\n return Info;\n }\n });\n\n const descriptionTypography = computed(() => ({\n el: BentoTypographyElement.DIV,\n variant: isTipVariant.value ? BentoTypographyVariant.CAPTION : BentoTypographyVariant.BODY,\n wide: true,\n }));\n\n const computedRole = computed(() => (props.type === BentoAlertTypeOption.HIGHLIGHT ? 'status' : 'alert'));\n\n const onCloseButtonClick = () => {\n emit(BentoAlertEvent.CLOSE_ALERT);\n };\n\n onMounted(() => {\n if (!slots.default && !slots.description) {\n throw new Error('Alert Component requires a title or a description');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An Alert component is used to display a persistent\n * notification containing information important to the user\n *\n * @example\n * import { BentoAlert, BentoAlertTypeOption } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAlert },\n * template: `\n * <bento-alert type=\"highlight\">\n * Title of the Alert\n * </bento-alert>\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-alert',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./alert.scss\" />\n"],"names":["BentoAlertVariant","BentoAlertVariant2","BentoAlertTypeOption","BentoAlertTypeOption2","BentoAlertEvent","BentoAlertEvent2","instance","getCurrentInstance","uuid","__default__","messages","slots","useSlots","hasSlot","useHasSlot","emit","__emit","props","__props","t","useI18n","isTipVariant","computed","alertConditionalClasses","iconSvgTitle","iconComponent","_sfc_main$4","_sfc_main$3","_sfc_main$2","_sfc_main$1","descriptionTypography","BentoTypographyElement","BentoTypographyVariant","computedRole","onCloseButtonClick","onMounted"],"mappings":";;;;;;;;;;;AAGO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAQLE,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA;;;;AChBZ,UAAAE,IAAAC,EAAA;AAIA,kBAAAD,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;ACJA,UAAAA,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC4JIG,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,E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{ useAttrs as ue, defineComponent as F, useSlots as V, ref as f, computed as d, inject as ce, watch as U, nextTick as de, onUnmounted as me, openBlock as L, createBlock as E, normalizeClass as K, createSlots as X, withCtx as i, createElementVNode as y, normalizeStyle as C, unref as a, renderSlot as c, createCommentVNode as G, createVNode as H, onMounted as ge, provide as N, toRefs as ve, createElementBlock as fe, mergeProps as pe, withKeys as be, withDirectives as _e } from "vue";
|
|
2
2
|
import { B as ye } from "./button.Ciflfide.js";
|
|
3
|
-
import { B as Le } from "./focus-trap.
|
|
3
|
+
import { B as Le } from "./focus-trap.Co-S6goa.js";
|
|
4
4
|
import { u as Z } from "./use-has-slot.CyMiImRQ.js";
|
|
5
5
|
import { u as he } from "./index.B875RXHM.js";
|
|
6
|
-
import { l as Ae } from "./button-actions.
|
|
6
|
+
import { l as Ae } from "./button-actions.uIjzze43.js";
|
|
7
7
|
import { g as Ce } from "./generate-uid.DBWe4g6T.js";
|
|
8
8
|
import { B as Ee } from "./directive.D1-d-C2K.js";
|
|
9
9
|
import { _ as Oe } from "./cross.Daa8LxjC.js";
|
|
10
10
|
import { B as Ie, D as ke, a as Pe } from "./dialog-page.keys.Dym9e6k3.js";
|
|
11
11
|
import { B as Q } from "./typography.wIM07Hbl.js";
|
|
12
|
-
import { F as Se } from "./footer-actions.
|
|
12
|
+
import { F as Se } from "./footer-actions.Dl20Q1WX.js";
|
|
13
13
|
import { D as De } from "./dialog-page.D60pjDsQ.js";
|
|
14
14
|
import { o as Be } from "./resize.Bqks3WUm.js";
|
|
15
15
|
import { G as Te, a as Ne } from "./grid-layout.CCWNscU_.js";
|
|
@@ -438,4 +438,4 @@ export {
|
|
|
438
438
|
Fe as g,
|
|
439
439
|
ca as h
|
|
440
440
|
};
|
|
441
|
-
//# sourceMappingURL=base-modal.
|
|
441
|
+
//# sourceMappingURL=base-modal.Bn4ZXwv6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-modal.DKCKkQDy.js","sources":["../../../vue2/src/composables/use-attribute-routing/use-attribute-routing.ts","../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/modal.keys.ts","../../../vue2/src/components/modal/components/modal-page/modal-page.vue","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["import { type SetupContext, useAttrs } from 'vue';\n\nexport type Attributes = SetupContext['attrs'];\n\nexport interface AttributeRouting {\n getAriaAttributes: (attrs?: Attributes) => Attributes;\n getRootAttributes: (attrs?: Attributes) => Attributes;\n}\n\n/**\n * Routes ARIA attributes away from a component root to its semantic element.\n *\n * @returns Functions that return ARIA and root attribute groups.\n */\nexport const useAttributeRouting = (): AttributeRouting => {\n const attrs = useAttrs();\n\n const filterAttrs = (attrsArg: Attributes, shouldInclude: (key: string) => boolean): Attributes =>\n Object.fromEntries(Object.entries(attrsArg).filter(([key]) => shouldInclude(key)));\n\n return {\n getAriaAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => key.startsWith('aria-')),\n getRootAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => !key.startsWith('aria-')),\n };\n};\n","/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","export const MODAL_CONFIG_INJECTION_KEY = Symbol('modal config data injection key');\n","<template>\n <dialog-page\n ref=\"page\"\n class=\"b-modal-page\"\n :class=\"modalPageConditionalClasses\"\n :page-id=\"pageId\"\n :always-show-border=\"hasColumnLayout\"\n :back-button-styling=\"customPaddingStyles?.backButton\"\n :previous-page=\"previousPage\"\n @animationend=\"isAnimationActive = false\"\n >\n <template v-if=\"hasSlot('default') || showCloseButton\" #header>\n <div class=\"b-modal-page__header-container\" :style=\"customPaddingStyles.header\">\n <div class=\"b-modal-page__header\">\n <bento-typography class=\"b-modal-page__title\" el=\"span\" variant=\"title\" stronger>\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n </div>\n </div>\n </template>\n\n <template #content>\n <div\n class=\"b-modal-page__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n el=\"div\"\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-page__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"hasSlot('actions')\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <div aria-label=\"modal actions\" class=\"b-modal-page__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </template>\n <template v-else-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, nextTick, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoTypography } from '@/components/typography';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n\n import { FooterActions } from '@/components/internal/footer-actions';\n\n import DialogPage from '@/internal/dialog-page/dialog-page.vue';\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import type { BentoModalPageProps } from './modal-page.types';\n\n const CLOSE_BUTTON_ICON_WIDTH = 26;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const page = ref<InstanceType<typeof DialogPage>>(null);\n\n const props = withDefaults(defineProps<BentoModalPageProps>(), {\n actions: null,\n actionsLabel: null,\n columnsSize: BentoModalColumnLayoutVariant.SMALLER,\n customPadding: null,\n destructiveActions: false,\n withColumnLayout: false,\n pageId: undefined,\n previousPage: undefined,\n });\n\n const modalPageConditionalClasses = computed(() => ({\n 'b-modal-page--custom-padding': props.customPadding,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-page__content--with-header': hasSlot('default'),\n 'b-modal-page__content--with-actions': hasSlot('actions') || props.actions?.length,\n }));\n\n // Setting custom padding styles\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: {\n ...xPadding,\n paddingTop: props.customPadding,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n flex: 1,\n },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n backButton: { top: props.customPadding, paddingLeft: props.customPadding },\n };\n });\n\n // Column layout styles\n const hasColumnLayout = computed(() => props.withColumnLayout && size.value === BentoModalSize.LARGE);\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n // Register page to parent component and inject data from parent component\n const { activePage, height, isAnimationActive, pageCustomPadding, showCloseButton, size } =\n inject<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY);\n\n const isCurrentPage = computed(() => activePage.value === props.pageId || !activePage.value);\n\n // Animation\n // Set resize observer on mount of update the height of the dialog on resize\n let pageElementObserver: ResizeObserver | null = null;\n\n // Watching activePage changes to set the height of the page and set isAnimationActive\n watch(\n () => activePage.value,\n async (value, oldValue) => {\n if (isCurrentPage.value) {\n await nextTick();\n height.value = `${page.value?.$el?.clientHeight}px`;\n pageCustomPadding.value = props.customPadding;\n // only set isAnimationActive to true if its going from two different pages and not from null to the first page\n isAnimationActive.value = oldValue !== undefined;\n\n pageElementObserver = observeSizeOfElement(page.value, () => {\n const pageHeight = `${page.value?.$el?.clientHeight}px`;\n if (pageHeight && pageHeight !== height.value) {\n height.value = pageHeight;\n }\n });\n }\n },\n { immediate: true }\n );\n\n // Disconnect observer on unmounting the page\n onUnmounted(() => {\n pageElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalPage is used to render different pages of the Modal component\n *\n * @example\n * import { BentoModal, BentoModalPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal, BentoModalPage },\n * template: `\n * <bento-modal active-page='page1' :is-open='true'>\n * <bento-modal-page\n * pageId='page1'\n * actions-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1\n * <template #content>\n * Page 1 content\n * </template>\n * </bento-modal-page>\n * <bento-modal-page\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2\n * <template #content>\n * Page 2 content\n * </template>\n * </bento-modal-page>\n * </bento-modal>\n * `\n * }\n */\n export default defineComponent({});\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-page.scss\" />\n","<template>\n <div v-bind=\"getRootAttributes($attrs)\" class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"$attrs?.['aria-label'] ?? t('ariaLabelFallback')\"\n :style=\"{ height: height }\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap\n v-if=\"isOpen || initiallyOpen\"\n :id=\"modalId\"\n v-bento-click-outside-directive=\"closeModalOnClickOutside\"\n >\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-page\n v-else\n :with-column-layout=\"withColumnLayout\"\n :size=\"size\"\n :custom-padding=\"customPadding\"\n :columns-size=\"columnsSize\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1\n ><slot name=\"content-col-1\"></slot\n ></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2\n ><slot name=\"content-col-2\"></slot\n ></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n <template v-if=\"hasSlot('actions')\" #actions><slot name=\"actions\"></slot></template>\n </bento-modal-page>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoButton, type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { useAttributeRouting, useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n import messages from './messages.json';\n\n import { BentoModalPage } from '@/components/modal/components/modal-page';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const { getRootAttributes } = useAttributeRouting();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const pageCustomPadding = ref(props.customPadding);\n\n const customPaddingStyles = computed(() => {\n if (!pageCustomPadding.value) {\n return {};\n }\n\n return { top: pageCustomPadding.value, right: pageCustomPadding.value };\n });\n\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit('close-modal');\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emitCloseEvent();\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n const closeModalOnClickOutside = () => {\n if (props.isDismissible) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n 'b-modal-base__container--animation': isAnimationActive.value,\n }));\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n // add the first page to the array when the modal opens\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n\n // Modal pagination\n const { activePage, isOpen, size } = toRefs(props);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n const height = ref('');\n const isAnimationActive = ref(false);\n\n provide<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY, {\n activePage,\n height,\n isAnimationActive,\n pageCustomPadding,\n showCloseButton,\n size,\n });\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["useAttributeRouting","attrs","useAttrs","filterAttrs","attrsArg","shouldInclude","key","overrideAttrs","BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","MODAL_CONFIG_INJECTION_KEY","__default__$1","defineComponent","slots","useSlots","hasSlot","useHasSlot","page","ref","props","__props","modalPageConditionalClasses","computed","modalContentConditionalClasses","customPaddingStyles","xPadding","content","hasColumnLayout","size","computedColumnWidth","activePage","height","isAnimationActive","pageCustomPadding","showCloseButton","inject","isCurrentPage","pageElementObserver","watch","value","oldValue","nextTick","observeSizeOfElement","pageHeight","onUnmounted","__default__","messages","t","useI18n","getRootAttributes","modal","isClosing","modalId","generateUid","emit","__emit","openModal","emitCloseEvent","closeModalAfterAnimation","previousPages","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","modalConditionalClasses","newIsOpen","newModalValue","oldModalValue","onMounted","__expose","provide","MODAL_DIALOG_ID_INJECTION_KEY","isOpen","toRefs","animation","BentoDialogPageAnimation","pages","updatePage","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,MAAA;AACH,QAAAC,IAAAC,GAAA,GAEAC,IAAA,CAAAC,GAAAC,MAAA,OAAA,YAAA,OAAA,QAAAD,CAAA,EAAA,OAAA,CAAA,CAAAE,CAAA,MAAAD,EAAAC,CAAA,CAAA,CAAA;AAGA,SAAA;AAAA,IAAO,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,IACmG,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAA,CAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,EACC;AAE/G;ACrBO,IAAAE,KAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,SAAA,UAFQA,IAAAD,MAAA,CAAA,CAAA,GAQLE,KAAA,kBAAAC,OACHA,EAAA,UAAA,qBACAA,EAAA,SAAA,oBAFQA,IAAAD,MAAA,CAAA,CAAA,GAQLE,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GASLE,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAMLE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,eAAA,eAFQA,IAAAD,KAAA,CAAA,CAAA,GAQLE,KAAA,kBAAAC,OACHA,EAAA,eAAA,gBACAA,EAAA,cAAA,eACAA,EAAA,OAAA,QACAA,EAAA,kBAAA,mBAJQA,IAAAD,MAAA,CAAA,CAAA,GAOL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,EAAA,OAAA,OAAA,CAAAI,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAIzEE,KAAA,CAAAD,OACIA,KACIJ,EAAA,MAAA,KAAAI,CAAA,GAGJ,EAAA,gBAAAF,GAAAE,CAAA,EAAA,IAGJjD,IAAAb,EAAA,EAAA,GACAc,IAAAd,EAAA,EAAA;AAEA,WAAAoD,EAAA5D,IAAA;AAAA,MAA0D,YAAAoB;AAAA,MACtD,QAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAN;AAAA,IACA,CAAA,GAGJ0C,EAAAY,IAAA;AAAA,MAAqE,YAAApD;AAAA,MACjE,WAAA4C;AAAA,MACA,QAAAF;AAAA,MACA,OAAAI;AAAA,MACA,eAAAjB;AAAA,MACA,YAAAkB;AAAA,IACA,CAAA,GAGJP,EAAAa,IAAAF,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"base-modal.Bn4ZXwv6.js","sources":["../../../vue2/src/composables/use-attribute-routing/use-attribute-routing.ts","../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/modal.keys.ts","../../../vue2/src/components/modal/components/modal-page/modal-page.vue","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["import { type SetupContext, useAttrs } from 'vue';\n\nexport type Attributes = SetupContext['attrs'];\n\nexport interface AttributeRouting {\n getAriaAttributes: (attrs?: Attributes) => Attributes;\n getRootAttributes: (attrs?: Attributes) => Attributes;\n}\n\n/**\n * Routes ARIA attributes away from a component root to its semantic element.\n *\n * @returns Functions that return ARIA and root attribute groups.\n */\nexport const useAttributeRouting = (): AttributeRouting => {\n const attrs = useAttrs();\n\n const filterAttrs = (attrsArg: Attributes, shouldInclude: (key: string) => boolean): Attributes =>\n Object.fromEntries(Object.entries(attrsArg).filter(([key]) => shouldInclude(key)));\n\n return {\n getAriaAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => key.startsWith('aria-')),\n getRootAttributes: overrideAttrs => filterAttrs(overrideAttrs ?? attrs, key => !key.startsWith('aria-')),\n };\n};\n","/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","export const MODAL_CONFIG_INJECTION_KEY = Symbol('modal config data injection key');\n","<template>\n <dialog-page\n ref=\"page\"\n class=\"b-modal-page\"\n :class=\"modalPageConditionalClasses\"\n :page-id=\"pageId\"\n :always-show-border=\"hasColumnLayout\"\n :back-button-styling=\"customPaddingStyles?.backButton\"\n :previous-page=\"previousPage\"\n @animationend=\"isAnimationActive = false\"\n >\n <template v-if=\"hasSlot('default') || showCloseButton\" #header>\n <div class=\"b-modal-page__header-container\" :style=\"customPaddingStyles.header\">\n <div class=\"b-modal-page__header\">\n <bento-typography class=\"b-modal-page__title\" el=\"span\" variant=\"title\" stronger>\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n </div>\n </div>\n </template>\n\n <template #content>\n <div\n class=\"b-modal-page__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n el=\"div\"\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-page__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"hasSlot('actions')\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <div aria-label=\"modal actions\" class=\"b-modal-page__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </template>\n <template v-else-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-modal-page__actions-container\" :style=\"customPaddingStyles.actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, nextTick, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoTypography } from '@/components/typography';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n\n import { FooterActions } from '@/components/internal/footer-actions';\n\n import DialogPage from '@/internal/dialog-page/dialog-page.vue';\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import type { BentoModalPageProps } from './modal-page.types';\n\n const CLOSE_BUTTON_ICON_WIDTH = 26;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const page = ref<InstanceType<typeof DialogPage>>(null);\n\n const props = withDefaults(defineProps<BentoModalPageProps>(), {\n actions: null,\n actionsLabel: null,\n columnsSize: BentoModalColumnLayoutVariant.SMALLER,\n customPadding: null,\n destructiveActions: false,\n withColumnLayout: false,\n pageId: undefined,\n previousPage: undefined,\n });\n\n const modalPageConditionalClasses = computed(() => ({\n 'b-modal-page--custom-padding': props.customPadding,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-page__content--with-header': hasSlot('default'),\n 'b-modal-page__content--with-actions': hasSlot('actions') || props.actions?.length,\n }));\n\n // Setting custom padding styles\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: {\n ...xPadding,\n paddingTop: props.customPadding,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n flex: 1,\n },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n backButton: { top: props.customPadding, paddingLeft: props.customPadding },\n };\n });\n\n // Column layout styles\n const hasColumnLayout = computed(() => props.withColumnLayout && size.value === BentoModalSize.LARGE);\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n // Register page to parent component and inject data from parent component\n const { activePage, height, isAnimationActive, pageCustomPadding, showCloseButton, size } =\n inject<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY);\n\n const isCurrentPage = computed(() => activePage.value === props.pageId || !activePage.value);\n\n // Animation\n // Set resize observer on mount of update the height of the dialog on resize\n let pageElementObserver: ResizeObserver | null = null;\n\n // Watching activePage changes to set the height of the page and set isAnimationActive\n watch(\n () => activePage.value,\n async (value, oldValue) => {\n if (isCurrentPage.value) {\n await nextTick();\n height.value = `${page.value?.$el?.clientHeight}px`;\n pageCustomPadding.value = props.customPadding;\n // only set isAnimationActive to true if its going from two different pages and not from null to the first page\n isAnimationActive.value = oldValue !== undefined;\n\n pageElementObserver = observeSizeOfElement(page.value, () => {\n const pageHeight = `${page.value?.$el?.clientHeight}px`;\n if (pageHeight && pageHeight !== height.value) {\n height.value = pageHeight;\n }\n });\n }\n },\n { immediate: true }\n );\n\n // Disconnect observer on unmounting the page\n onUnmounted(() => {\n pageElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalPage is used to render different pages of the Modal component\n *\n * @example\n * import { BentoModal, BentoModalPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal, BentoModalPage },\n * template: `\n * <bento-modal active-page='page1' :is-open='true'>\n * <bento-modal-page\n * pageId='page1'\n * actions-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1\n * <template #content>\n * Page 1 content\n * </template>\n * </bento-modal-page>\n * <bento-modal-page\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2\n * <template #content>\n * Page 2 content\n * </template>\n * </bento-modal-page>\n * </bento-modal>\n * `\n * }\n */\n export default defineComponent({});\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-page.scss\" />\n","<template>\n <div v-bind=\"getRootAttributes($attrs)\" class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"$attrs?.['aria-label'] ?? t('ariaLabelFallback')\"\n :style=\"{ height: height }\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap\n v-if=\"isOpen || initiallyOpen\"\n :id=\"modalId\"\n v-bento-click-outside-directive=\"closeModalOnClickOutside\"\n >\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-page\n v-else\n :with-column-layout=\"withColumnLayout\"\n :size=\"size\"\n :custom-padding=\"customPadding\"\n :columns-size=\"columnsSize\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1\n ><slot name=\"content-col-1\"></slot\n ></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2\n ><slot name=\"content-col-2\"></slot\n ></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n <template v-if=\"hasSlot('actions')\" #actions><slot name=\"actions\"></slot></template>\n </bento-modal-page>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\n import { type BentoModalConfigData } from '@/components/modal/modal.internal.types';\n import { BentoButton, type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { useAttributeRouting, useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n import messages from './messages.json';\n\n import { BentoModalPage } from '@/components/modal/components/modal-page';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { MODAL_CONFIG_INJECTION_KEY } from '../../modal.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const { getRootAttributes } = useAttributeRouting();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: 'update:active-page', page: string): void;\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const pageCustomPadding = ref(props.customPadding);\n\n const customPaddingStyles = computed(() => {\n if (!pageCustomPadding.value) {\n return {};\n }\n\n return { top: pageCustomPadding.value, right: pageCustomPadding.value };\n });\n\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit('close-modal');\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emitCloseEvent();\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n const closeModalOnClickOutside = () => {\n if (props.isDismissible) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n 'b-modal-base__container--animation': isAnimationActive.value,\n }));\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n // add the first page to the array when the modal opens\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n\n // Modal pagination\n const { activePage, isOpen, size } = toRefs(props);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n const height = ref('');\n const isAnimationActive = ref(false);\n\n provide<BentoModalConfigData>(MODAL_CONFIG_INJECTION_KEY, {\n activePage,\n height,\n isAnimationActive,\n pageCustomPadding,\n showCloseButton,\n size,\n });\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["useAttributeRouting","attrs","useAttrs","filterAttrs","attrsArg","shouldInclude","key","overrideAttrs","BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","MODAL_CONFIG_INJECTION_KEY","__default__$1","defineComponent","slots","useSlots","hasSlot","useHasSlot","page","ref","props","__props","modalPageConditionalClasses","computed","modalContentConditionalClasses","customPaddingStyles","xPadding","content","hasColumnLayout","size","computedColumnWidth","activePage","height","isAnimationActive","pageCustomPadding","showCloseButton","inject","isCurrentPage","pageElementObserver","watch","value","oldValue","nextTick","observeSizeOfElement","pageHeight","onUnmounted","__default__","messages","t","useI18n","getRootAttributes","modal","isClosing","modalId","generateUid","emit","__emit","openModal","emitCloseEvent","closeModalAfterAnimation","previousPages","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","modalConditionalClasses","newIsOpen","newModalValue","oldModalValue","onMounted","__expose","provide","MODAL_DIALOG_ID_INJECTION_KEY","isOpen","toRefs","animation","BentoDialogPageAnimation","pages","updatePage","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,MAAA;AACH,QAAAC,IAAAC,GAAA,GAEAC,IAAA,CAAAC,GAAAC,MAAA,OAAA,YAAA,OAAA,QAAAD,CAAA,EAAA,OAAA,CAAA,CAAAE,CAAA,MAAAD,EAAAC,CAAA,CAAA,CAAA;AAGA,SAAA;AAAA,IAAO,mBAAA,CAAAC,MAAAJ,EAAAI,KAAAN,GAAA,CAAAK,MAAAA,EAAA,WAAA,OAAA,CAAA;AAAA,IACmG,mBAAA,CAAA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AAAkB;AAAA,IACA,CAAA,GAGJP,EAAAa,IAAAF,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/chunks/{button-actions-with-menu.CqFhtqhV.js → button-actions-with-menu.CrbF2BSQ.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as f, watch as _, nextTick as m, defineComponent as y, toRef as b, computed as p, provide as h, openBlock as A, createElementBlock as w, createElementVNode as B, normalizeClass as N, createVNode as k, unref as E, createBlock as T, createCommentVNode as C } from "vue";
|
|
2
|
-
import { M as I, d as W, B as M, f as R } from "./button-actions.
|
|
2
|
+
import { M as I, d as W, B as M, f as R } from "./button-actions.uIjzze43.js";
|
|
3
3
|
import { b as g } from "./index.DCpihRYV.js";
|
|
4
4
|
import { _ as O } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
5
|
import "../assets/button-actions-with-menu.css";
|
|
@@ -82,4 +82,4 @@ const L = (v) => {
|
|
|
82
82
|
export {
|
|
83
83
|
J as B
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=button-actions-with-menu.
|
|
85
|
+
//# sourceMappingURL=button-actions-with-menu.CrbF2BSQ.js.map
|