@adyen/bento-vue2 1.71.0 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/@types/index.d.ts +405 -581
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/ai-button.css +1 -0
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -0
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/code-snippet.css +1 -1
- package/dist/assets/dashboard-section.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/empty-state.css +1 -1
- package/dist/assets/field-label.css +1 -0
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/focus-trap.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popper-container.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/button.js +11 -9
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{action-bar.C01Tjxh_.js → action-bar.Bxrtx1Vj.js} +3 -3
- package/dist/chunks/{action-bar.C01Tjxh_.js.map → action-bar.Bxrtx1Vj.js.map} +1 -1
- package/dist/chunks/ai-button.FRPkTHz6.js +67 -0
- package/dist/chunks/ai-button.FRPkTHz6.js.map +1 -0
- package/dist/chunks/{base-button.BB5tkzjh.js → base-button.Cv-1788W.js} +6 -6
- package/dist/chunks/base-button.Cv-1788W.js.map +1 -0
- package/dist/chunks/{base-modal.CnIt7hra.js → base-modal.DInbAZlp.js} +4 -4
- package/dist/chunks/{base-modal.CnIt7hra.js.map → base-modal.DInbAZlp.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.B9R0J68W.js → button-actions-with-menu.BtWUxmSL.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.B9R0J68W.js.map → button-actions-with-menu.BtWUxmSL.js.map} +1 -1
- package/dist/chunks/{toggle-button.B1Y2qhzJ.js → button-actions.55vIvDsX.js} +241 -239
- package/dist/chunks/button-actions.55vIvDsX.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/{calendar.DjktWs25.js → calendar.M69sfyB9.js} +290 -287
- package/dist/chunks/{calendar.DjktWs25.js.map → calendar.M69sfyB9.js.map} +1 -1
- package/dist/chunks/{card.DTrBQQAm.js → card.C11dmth8.js} +2 -2
- package/dist/chunks/{card.DTrBQQAm.js.map → card.C11dmth8.js.map} +1 -1
- package/dist/chunks/{checkbox-group.lVv3mWHL.js → checkbox-group.Cr3WdkDM.js} +4 -4
- package/dist/chunks/{checkbox-group.lVv3mWHL.js.map → checkbox-group.Cr3WdkDM.js.map} +1 -1
- package/dist/chunks/{checkbox.C7Yu3rls.js → checkbox.D7-f9Y6w.js} +18 -18
- package/dist/chunks/{checkbox.C7Yu3rls.js.map → checkbox.D7-f9Y6w.js.map} +1 -1
- package/dist/chunks/{chevron-right.C--ZOC9j.js → chevron-left.BS24hEFa.js} +5 -5
- package/dist/chunks/chevron-left.BS24hEFa.js.map +1 -0
- package/dist/chunks/{chip.Bfi-ff5E.js → chip.omQX_Ziq.js} +2 -2
- package/dist/chunks/{chip.Bfi-ff5E.js.map → chip.omQX_Ziq.js.map} +1 -1
- package/dist/chunks/{code-snippet.BvhpH_JE.js → code-snippet.BGrwAxWy.js} +100 -91
- package/dist/chunks/code-snippet.BGrwAxWy.js.map +1 -0
- package/dist/chunks/{controls-group.DUr_o-vW.js → controls-group.CWeUgE2P.js} +2 -2
- package/dist/chunks/{controls-group.DUr_o-vW.js.map → controls-group.CWeUgE2P.js.map} +1 -1
- package/dist/chunks/{copy.CsyXGPuN.js → copy._BdbMnHK.js} +3 -3
- package/dist/chunks/{copy.CsyXGPuN.js.map → copy._BdbMnHK.js.map} +1 -1
- package/dist/chunks/{dashboard-section.CiFxBFnc.js → dashboard-section.e7ozaS9M.js} +3 -3
- package/dist/chunks/{dashboard-section.CiFxBFnc.js.map → dashboard-section.e7ozaS9M.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CTtzy_vE.js → dashed-underline.CGU6o7ni.js} +3 -3
- package/dist/chunks/{dashed-underline.CTtzy_vE.js.map → dashed-underline.CGU6o7ni.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CmfHBR3u.js → data-grid-template.BaPjUlZ2.js} +10 -10
- package/dist/chunks/data-grid-template.BaPjUlZ2.js.map +1 -0
- package/dist/chunks/{data-grid.D2AvGjyH.js → data-grid.B_Ha2vma.js} +772 -726
- package/dist/chunks/data-grid.B_Ha2vma.js.map +1 -0
- package/dist/chunks/{date-picker.Bhe5lCfr.js → date-picker.CGTMHUNH.js} +75 -69
- package/dist/chunks/date-picker.CGTMHUNH.js.map +1 -0
- package/dist/chunks/{date-range-picker.BsQ6kMzK.js → date-range-picker.ChGfJUPq.js} +7 -7
- package/dist/chunks/{date-range-picker.BsQ6kMzK.js.map → date-range-picker.ChGfJUPq.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DaVNZO_q.js → dropdown-tag.Bwl0fY7o.js} +3 -3
- package/dist/chunks/{dropdown-tag.DaVNZO_q.js.map → dropdown-tag.Bwl0fY7o.js.map} +1 -1
- package/dist/chunks/{dropdown.J5FaL_2T.js → dropdown.DQbTuKc5.js} +5 -5
- package/dist/chunks/{dropdown.J5FaL_2T.js.map → dropdown.DQbTuKc5.js.map} +1 -1
- package/dist/chunks/empty-state.DNTrhYUm.js +106 -0
- package/dist/chunks/empty-state.DNTrhYUm.js.map +1 -0
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{error-message.BGuKk5tR.js → field-label.BKzuCnXr.js} +53 -53
- package/dist/chunks/field-label.BKzuCnXr.js.map +1 -0
- package/dist/chunks/{file-uploader.ZHBf2zwh.js → file-uploader.BEClGxsF.js} +3 -3
- package/dist/chunks/{file-uploader.ZHBf2zwh.js.map → file-uploader.BEClGxsF.js.map} +1 -1
- package/dist/chunks/{filter-bar.CNxqgSgM.js → filter-bar.Dnnv0rpV.js} +184 -185
- package/dist/chunks/filter-bar.Dnnv0rpV.js.map +1 -0
- package/dist/chunks/{fixed-scroller.DDYpO7Li.js → fixed-scroller.QCXpkadN.js} +2 -2
- package/dist/chunks/{fixed-scroller.DDYpO7Li.js.map → fixed-scroller.QCXpkadN.js.map} +1 -1
- package/dist/chunks/{focus-trap.COfrmVfx.js → focus-trap.BJfpIboH.js} +155 -144
- package/dist/chunks/{focus-trap.COfrmVfx.js.map → focus-trap.BJfpIboH.js.map} +1 -1
- package/dist/chunks/{footer-actions.CR8l2FSl.js → footer-actions.BTELM6rh.js} +2 -2
- package/dist/chunks/{footer-actions.CR8l2FSl.js.map → footer-actions.BTELM6rh.js.map} +1 -1
- package/dist/chunks/{header-meta.tZNYmQBF.js → header-meta.DZYH-qg-.js} +3 -3
- package/dist/chunks/{header-meta.tZNYmQBF.js.map → header-meta.DZYH-qg-.js.map} +1 -1
- package/dist/chunks/{header-with-views.BXZT6R6N.js → header-with-views.DjZa4Wob.js} +8 -8
- package/dist/chunks/{header-with-views.BXZT6R6N.js.map → header-with-views.DjZa4Wob.js.map} +1 -1
- package/dist/chunks/{header.CwlFMYus.js → header.CQMiTG7f.js} +3 -3
- package/dist/chunks/{header.CwlFMYus.js.map → header.CQMiTG7f.js.map} +1 -1
- package/dist/chunks/{info-icon.JAvdSXdT.js → info-icon.fB7jf3NJ.js} +3 -3
- package/dist/chunks/{info-icon.JAvdSXdT.js.map → info-icon.fB7jf3NJ.js.map} +1 -1
- package/dist/chunks/{input-field-password.C1bzrmje.js → input-field-password.BPujvbx8.js} +5 -5
- package/dist/chunks/{input-field-password.C1bzrmje.js.map → input-field-password.BPujvbx8.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.YTbO3djd.js → input-field-phone-number.bqUe_CVf.js} +5 -5
- package/dist/chunks/{input-field-phone-number.YTbO3djd.js.map → input-field-phone-number.bqUe_CVf.js.map} +1 -1
- package/dist/chunks/{input-field.o-Hie5W9.js → input-field.CwF6ldRY.js} +3 -3
- package/dist/chunks/{input-field.o-Hie5W9.js.map → input-field.CwF6ldRY.js.map} +1 -1
- package/dist/chunks/{inspector.DxteqciY.js → inspector.g3OErNAU.js} +2 -2
- package/dist/chunks/{inspector.DxteqciY.js.map → inspector.g3OErNAU.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.AsRozx37.js → listbox-option-tag.UaD4kmXc.js} +2 -2
- package/dist/chunks/{listbox-option-tag.AsRozx37.js.map → listbox-option-tag.UaD4kmXc.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.B_72Iyh-.js → modal-fullscreen.B-9Ke6Ya.js} +3 -3
- package/dist/chunks/{modal-fullscreen.B_72Iyh-.js.map → modal-fullscreen.B-9Ke6Ya.js.map} +1 -1
- package/dist/chunks/{modal.crwnBhJG.js → modal.qybFapnI.js} +4 -4
- package/dist/chunks/{modal.crwnBhJG.js.map → modal.qybFapnI.js.map} +1 -1
- package/dist/chunks/{pagination.B4SjTHnN.js → pagination.BWTyXMRW.js} +2 -2
- package/dist/chunks/{pagination.B4SjTHnN.js.map → pagination.BWTyXMRW.js.map} +1 -1
- package/dist/chunks/popover.types.iyDoIAOE.js +6 -0
- package/dist/chunks/popover.types.iyDoIAOE.js.map +1 -0
- package/dist/chunks/{popper-container.Dt0SuHXX.js → popper-container.C9KCAJxI.js} +12 -5
- package/dist/chunks/{popper-container.Dt0SuHXX.js.map → popper-container.C9KCAJxI.js.map} +1 -1
- package/dist/chunks/{radio-group.T5hXVLRz.js → radio-group.DHUa6baR.js} +4 -4
- package/dist/chunks/{radio-group.T5hXVLRz.js.map → radio-group.DHUa6baR.js.map} +1 -1
- package/dist/chunks/{rich-text-editor._5fF0vFL.js → rich-text-editor.C905JEDW.js} +4 -4
- package/dist/chunks/{rich-text-editor._5fF0vFL.js.map → rich-text-editor.C905JEDW.js.map} +1 -1
- package/dist/chunks/{search-bar.yIVTIbdP.js → search-bar.CKt_-tZH.js} +3 -3
- package/dist/chunks/{search-bar.yIVTIbdP.js.map → search-bar.CKt_-tZH.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DBetOL_3.js → secondary-nav.B5L2bLmm.js} +2 -2
- package/dist/chunks/{secondary-nav.DBetOL_3.js.map → secondary-nav.B5L2bLmm.js.map} +1 -1
- package/dist/chunks/{segmented-control.DrShqTCa.js → segmented-control.Dc34mUMM.js} +2 -2
- package/dist/chunks/{segmented-control.DrShqTCa.js.map → segmented-control.Dc34mUMM.js.map} +1 -1
- package/dist/chunks/{selection-card-group.3QYPl3w3.js → selection-card-group.CBVKMu6b.js} +10 -10
- package/dist/chunks/{selection-card-group.3QYPl3w3.js.map → selection-card-group.CBVKMu6b.js.map} +1 -1
- package/dist/chunks/{sidepanel.U9XLcivw.js → sidepanel.uWNc58r7.js} +4 -4
- package/dist/chunks/{sidepanel.U9XLcivw.js.map → sidepanel.uWNc58r7.js.map} +1 -1
- package/dist/chunks/{step.DwXkOVky.js → step.D8blWwfR.js} +2 -2
- package/dist/chunks/{step.DwXkOVky.js.map → step.D8blWwfR.js.map} +1 -1
- package/dist/chunks/structured-list-item.BLalgOps.js +90 -0
- package/dist/chunks/structured-list-item.BLalgOps.js.map +1 -0
- package/dist/chunks/{summary-grid.types.BZlzUWVO.js → summary-grid.types.DqzYJ9_N.js} +5 -5
- package/dist/chunks/{summary-grid.types.BZlzUWVO.js.map → summary-grid.types.DqzYJ9_N.js.map} +1 -1
- package/dist/chunks/{tab.ClkH0GtX.js → tab.D8YyoNFV.js} +2 -2
- package/dist/chunks/{tab.ClkH0GtX.js.map → tab.D8YyoNFV.js.map} +1 -1
- package/dist/chunks/{tag.Dcm5YMUI.js → tag.Tjg4linG.js} +2 -2
- package/dist/chunks/{tag.Dcm5YMUI.js.map → tag.Tjg4linG.js.map} +1 -1
- package/dist/chunks/{textarea.B2jAycbX.js → textarea.DUPV-I-L.js} +2 -2
- package/dist/chunks/{textarea.B2jAycbX.js.map → textarea.DUPV-I-L.js.map} +1 -1
- package/dist/chunks/{timeline-item.Dhcs9a0S.js → timeline-item.DaRKHndA.js} +5 -5
- package/dist/chunks/{timeline-item.Dhcs9a0S.js.map → timeline-item.DaRKHndA.js.map} +1 -1
- package/dist/chunks/{tooltip.C94gYIPr.js → tooltip.DOD_4rkI.js} +2 -2
- package/dist/chunks/{tooltip.C94gYIPr.js.map → tooltip.DOD_4rkI.js.map} +1 -1
- package/dist/chunks/{tutorial.DAv_sABs.js → tutorial.BwnRyUoh.js} +4 -4
- package/dist/chunks/{tutorial.DAv_sABs.js.map → tutorial.BwnRyUoh.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DSDrNPbW.js → use-cached-selected-values.C7j6YhuC.js} +4 -4
- package/dist/chunks/use-cached-selected-values.C7j6YhuC.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/dropdown.js +3 -3
- 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/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +174 -172
- package/dist/index.js.map +1 -1
- 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/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.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/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +35 -16
- package/dist/styles/bento-light.css +34 -11
- package/dist/styles/bento.css +34 -11
- package/dist/styles/legacy.css +2108 -0
- package/dist/styles/styleguide.css +34 -11
- package/dist/styles/utility.css +12 -0
- 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 +186 -14
- package/package.json +3 -3
- package/dist/assets/error-message.css +0 -1
- package/dist/assets/toggle-button.css +0 -1
- package/dist/chunks/base-button.BB5tkzjh.js.map +0 -1
- package/dist/chunks/chevron-right.C--ZOC9j.js.map +0 -1
- package/dist/chunks/code-snippet.BvhpH_JE.js.map +0 -1
- package/dist/chunks/data-grid-template.CmfHBR3u.js.map +0 -1
- package/dist/chunks/data-grid.D2AvGjyH.js.map +0 -1
- package/dist/chunks/date-picker.Bhe5lCfr.js.map +0 -1
- package/dist/chunks/empty-state.DAbj9xWF.js +0 -151
- package/dist/chunks/empty-state.DAbj9xWF.js.map +0 -1
- package/dist/chunks/error-message.BGuKk5tR.js.map +0 -1
- package/dist/chunks/filter-bar.CNxqgSgM.js.map +0 -1
- package/dist/chunks/popover.types.BUM8GOuO.js +0 -6
- package/dist/chunks/popover.types.BUM8GOuO.js.map +0 -1
- package/dist/chunks/structured-list-item.DHklFEiK.js +0 -87
- package/dist/chunks/structured-list-item.DHklFEiK.js.map +0 -1
- package/dist/chunks/toggle-button.B1Y2qhzJ.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DSDrNPbW.js.map +0 -1
package/dist/header.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,122 +1,123 @@
|
|
|
1
1
|
import "./chunks/index.Cl4_42j5.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as S, t as y } from "./chunks/use-bento-toast-controller.BKHU1qBv.js";
|
|
3
3
|
import { u as A } from "./chunks/use-bento-toast-controller.BKHU1qBv.js";
|
|
4
4
|
import { p as g, d } from "./chunks/typography.hlOAxsEn.js";
|
|
5
|
-
import { B as _, c as j, b as
|
|
6
|
-
import { a as
|
|
7
|
-
import { B as W } from "./chunks/action-bar.
|
|
5
|
+
import { B as _, c as j, b as K, a as U } from "./chunks/typography.hlOAxsEn.js";
|
|
6
|
+
import { a as H, b as Y } from "./chunks/accordion-item.CoqaoVnC.js";
|
|
7
|
+
import { B as W } from "./chunks/action-bar.Bxrtx1Vj.js";
|
|
8
8
|
import { B as J, c as Q, b as X, a as $ } from "./chunks/alert.CMyL-zWT.js";
|
|
9
9
|
import { B as te } from "./chunks/avatar.KdcsNOsm.js";
|
|
10
10
|
import { B as ae, b as ne, a as re } from "./chunks/button.CilT7NmM.js";
|
|
11
|
-
import { B as Be } from "./chunks/dashed-underline.
|
|
12
|
-
import { B as me, d as pe, a as ue, b as de, g as le, f as ce, e as fe, c as xe } from "./chunks/data-grid.
|
|
13
|
-
import { c as
|
|
14
|
-
import { B as
|
|
15
|
-
import { B as De, a as Ie } from "./chunks/date-range-picker.
|
|
16
|
-
import { B as Le, u as Pe } from "./chunks/dropdown.
|
|
17
|
-
import { B as
|
|
18
|
-
import { B as
|
|
19
|
-
import { B as
|
|
11
|
+
import { B as Be } from "./chunks/dashed-underline.CGU6o7ni.js";
|
|
12
|
+
import { B as me, d as pe, a as ue, b as de, g as le, f as ce, e as fe, c as xe } from "./chunks/data-grid.B_Ha2vma.js";
|
|
13
|
+
import { c as Se, B as ye, a as ge } from "./chunks/card.C11dmth8.js";
|
|
14
|
+
import { B as Ee, a as be } from "./chunks/date-picker.CGTMHUNH.js";
|
|
15
|
+
import { B as De, a as Ie } from "./chunks/date-range-picker.ChGfJUPq.js";
|
|
16
|
+
import { B as Le, u as Pe } from "./chunks/dropdown.DQbTuKc5.js";
|
|
17
|
+
import { B as Fe } from "./chunks/dropdown-default-textbox.CDm-PQfc.js";
|
|
18
|
+
import { B as Ne, a as we } from "./chunks/checkbox.D7-f9Y6w.js";
|
|
19
|
+
import { B as Me } from "./chunks/chip.omQX_Ziq.js";
|
|
20
20
|
import { B as Ae } from "./chunks/click-outside.C1Ud8AA2.js";
|
|
21
|
-
import { c as _e, b as je, a as
|
|
22
|
-
import { c as
|
|
21
|
+
import { c as _e, b as je, a as Ke, B as Ue } from "./chunks/code-snippet.BGrwAxWy.js";
|
|
22
|
+
import { c as He } from "./chunks/country.1yIZNjdj.js";
|
|
23
23
|
import { a as qe, B as We, u as Ze } from "./chunks/country.types.C0Q_hhgJ.js";
|
|
24
24
|
import { c as Qe, B as Xe } from "./chunks/currency.MT3baDtO.js";
|
|
25
25
|
import { B as et, a as tt } from "./chunks/date.BTdCYdkj.js";
|
|
26
26
|
import { B as at } from "./chunks/divider.CFbtmKeQ.js";
|
|
27
|
-
import { B as rt, b as st, c as Bt, a as it } from "./chunks/empty-state.
|
|
28
|
-
import { f as pt } from "./chunks/file-uploader.
|
|
29
|
-
import { B as dt, b as lt, a as ct, c as ft } from "./chunks/filter-bar.
|
|
30
|
-
import { f as
|
|
31
|
-
import { h as
|
|
27
|
+
import { B as rt, b as st, c as Bt, a as it } from "./chunks/empty-state.DNTrhYUm.js";
|
|
28
|
+
import { f as pt } from "./chunks/file-uploader.BEClGxsF.js";
|
|
29
|
+
import { B as dt, b as lt, a as ct, c as ft } from "./chunks/filter-bar.Dnnv0rpV.js";
|
|
30
|
+
import { f as Tt, a as St, c as yt, b as gt } from "./chunks/form-layout-title.aXVuAWiG.js";
|
|
31
|
+
import { h as Et } from "./chunks/header-with-views.DjZa4Wob.js";
|
|
32
32
|
import { B as Ct, a as Dt, b as It } from "./chunks/image.C2D2hKat.js";
|
|
33
|
-
import { B as Lt } from "./chunks/info-icon.
|
|
34
|
-
import { B as
|
|
35
|
-
import { i as
|
|
36
|
-
import { i as
|
|
37
|
-
import { B as qt } from "./chunks/inspector.
|
|
33
|
+
import { B as Lt } from "./chunks/info-icon.fB7jf3NJ.js";
|
|
34
|
+
import { B as Ot, b as Ft, e as Gt, c as Nt, d as wt, a as kt } from "./chunks/input-field.CwF6ldRY.js";
|
|
35
|
+
import { i as Vt, m as At, r as Rt, b as _t, c as jt, a as Kt } from "./chunks/input-field-password.BPujvbx8.js";
|
|
36
|
+
import { i as zt, B as Ht } from "./chunks/input-field-phone-number.bqUe_CVf.js";
|
|
37
|
+
import { B as qt } from "./chunks/inspector.g3OErNAU.js";
|
|
38
38
|
import { B as Zt } from "./chunks/inspector.types.DyHwE18g.js";
|
|
39
39
|
import { l as Qt, a as Xt } from "./chunks/layout-row.BP3lZAOh.js";
|
|
40
40
|
import { B as eo, a as to } from "./chunks/loading-indicator.DXc7I1Lm.js";
|
|
41
41
|
import { B as ao, a as no } from "./chunks/link.C4htMrDV.js";
|
|
42
|
-
import { B as so, a as Bo, b as io, f as mo, g as po, h as uo, c as lo, u as co } from "./chunks/
|
|
43
|
-
import { B as xo } from "./chunks/modal.
|
|
44
|
-
import { c as
|
|
45
|
-
import { m as vo, B as Lo } from "./chunks/modal-fullscreen.
|
|
46
|
-
import { B as
|
|
47
|
-
import { B as
|
|
42
|
+
import { B as so, a as Bo, b as io, f as mo, g as po, h as uo, c as lo, u as co } from "./chunks/button-actions.55vIvDsX.js";
|
|
43
|
+
import { B as xo } from "./chunks/modal.qybFapnI.js";
|
|
44
|
+
import { c as So, e as yo, f as go, g as ho, d as Eo, b as bo, B as Co, a as Do } from "./chunks/base-modal.DInbAZlp.js";
|
|
45
|
+
import { m as vo, B as Lo } from "./chunks/modal-fullscreen.B-9Ke6Ya.js";
|
|
46
|
+
import { B as Oo } from "./chunks/header.CQMiTG7f.js";
|
|
47
|
+
import { B as Go } from "./chunks/pagination.BWTyXMRW.js";
|
|
48
48
|
import { B as wo } from "./chunks/payment-method.DtvfUnit.js";
|
|
49
|
-
import { B as
|
|
50
|
-
import { B as Ao } from "./chunks/popover.types.
|
|
51
|
-
import { p as _o, B as jo, a as
|
|
52
|
-
import { b as
|
|
53
|
-
import { r as Wo } from "./chunks/rich-text-editor.
|
|
54
|
-
import { B as Jo, b as Qo, a as Xo } from "./chunks/search-bar.
|
|
55
|
-
import { s as ea } from "./chunks/secondary-nav.
|
|
56
|
-
import { B as oa, s as aa, a as na } from "./chunks/selection-card-group.
|
|
57
|
-
import { B as sa } from "./chunks/segmented-control.
|
|
49
|
+
import { B as Mo } from "./chunks/payment-method.types.BqtH7RM2.js";
|
|
50
|
+
import { B as Ao } from "./chunks/popover.types.iyDoIAOE.js";
|
|
51
|
+
import { p as _o, B as jo, a as Ko } from "./chunks/promo-banner.MI5NC2UT.js";
|
|
52
|
+
import { b as zo, B as Ho, a as Yo } from "./chunks/radio-group.DHUa6baR.js";
|
|
53
|
+
import { r as Wo } from "./chunks/rich-text-editor.C905JEDW.js";
|
|
54
|
+
import { B as Jo, b as Qo, a as Xo } from "./chunks/search-bar.CKt_-tZH.js";
|
|
55
|
+
import { s as ea } from "./chunks/secondary-nav.B5L2bLmm.js";
|
|
56
|
+
import { B as oa, s as aa, a as na } from "./chunks/selection-card-group.CBVKMu6b.js";
|
|
57
|
+
import { B as sa } from "./chunks/segmented-control.Dc34mUMM.js";
|
|
58
58
|
import { B as ia } from "./chunks/segmented-control.types.BHRLV8KU.js";
|
|
59
|
-
import { a as pa, B as ua, s as da } from "./chunks/sidepanel.
|
|
59
|
+
import { a as pa, B as ua, s as da } from "./chunks/sidepanel.uWNc58r7.js";
|
|
60
60
|
import { s as ca, B as fa } from "./chunks/status.types.BpMK-6IT.js";
|
|
61
|
-
import { a as
|
|
62
|
-
import { B as
|
|
63
|
-
import { s as Da, a as Ia, e as va, b as La, c as Pa, B as
|
|
64
|
-
import { a as wa, B as
|
|
65
|
-
import { B as
|
|
66
|
-
import { B as _a } from "./chunks/textarea.
|
|
67
|
-
import { t as
|
|
61
|
+
import { a as Ta, s as Sa, B as ya, b as ga } from "./chunks/step.D8blWwfR.js";
|
|
62
|
+
import { B as Ea, a as ba } from "./chunks/structured-list-item.BLalgOps.js";
|
|
63
|
+
import { s as Da, a as Ia, e as va, b as La, c as Pa, B as Oa, d as Fa, f as Ga } from "./chunks/summary-grid.types.DqzYJ9_N.js";
|
|
64
|
+
import { a as wa, B as ka } from "./chunks/tab.D8YyoNFV.js";
|
|
65
|
+
import { B as Va, a as Aa } from "./chunks/tag.Tjg4linG.js";
|
|
66
|
+
import { B as _a } from "./chunks/textarea.DUPV-I-L.js";
|
|
67
|
+
import { t as Ka, b as Ua, a as za, c as Ha, B as Ya, d as qa } from "./chunks/timeline-item.DaRKHndA.js";
|
|
68
68
|
import { t as Za } from "./chunks/toast.gMDjItrP.js";
|
|
69
69
|
import { B as Qa, b as Xa, a as $a } from "./chunks/toggle.Ct-5NUGu.js";
|
|
70
|
-
import { t as tn } from "./chunks/tutorial.
|
|
71
|
-
import { a as an, d as nn } from "./chunks/dashboard-section.
|
|
72
|
-
import { d as sn } from "./chunks/data-grid-template.
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
70
|
+
import { t as tn } from "./chunks/tutorial.BwnRyUoh.js";
|
|
71
|
+
import { a as an, d as nn } from "./chunks/dashboard-section.e7ozaS9M.js";
|
|
72
|
+
import { d as sn } from "./chunks/data-grid-template.BaPjUlZ2.js";
|
|
73
|
+
import { a as mn } from "./chunks/ai-button.FRPkTHz6.js";
|
|
74
|
+
import { B as un, a as dn, b as ln } from "./chunks/button-actions.types.BptAXjD8.js";
|
|
75
|
+
import { C as fn, C as xn } from "./chunks/calendar.M69sfyB9.js";
|
|
76
|
+
import { a as Sn, B as yn, a as gn, B as hn } from "./chunks/use-cached-selected-values.C7j6YhuC.js";
|
|
77
|
+
import { d as bn, a as Cn, b as Dn, c as In, e as vn } from "./chunks/dropdown-tag.Bwl0fY7o.js";
|
|
78
|
+
import { C as Pn } from "./chunks/minus-small.DJacLGTw.js";
|
|
79
|
+
import { c as Fn, B as Gn } from "./chunks/checkbox-group.Cr3WdkDM.js";
|
|
80
|
+
import { u as wn, a as kn } from "./chunks/use-country-phon-code.Bui3zD6W.js";
|
|
81
|
+
import { R as Vn } from "./chunks/radio-input.D8mv2EYC.js";
|
|
82
|
+
import { shallowRef as h, ref as l, getCurrentInstance as E } from "vue";
|
|
82
83
|
import * as r from "zod";
|
|
83
|
-
import { D as
|
|
84
|
-
import { a as
|
|
85
|
-
import { B as
|
|
86
|
-
import { b as
|
|
87
|
-
function
|
|
84
|
+
import { D as Rn } from "./chunks/date-input.BqBdAO1E.js";
|
|
85
|
+
import { a as jn, B as Kn } from "./chunks/keyboard-navigation.pB8weElW.js";
|
|
86
|
+
import { B as zn } from "./chunks/directive.Cbdox5VL.js";
|
|
87
|
+
import { b as Yn, c as qn, d as Wn } from "./chunks/tooltip.DOD_4rkI.js";
|
|
88
|
+
function G(e) {
|
|
88
89
|
return e;
|
|
89
90
|
}
|
|
90
91
|
function p(e) {
|
|
91
92
|
if (r && e instanceof r.ZodObject)
|
|
92
93
|
return Object.fromEntries(
|
|
93
|
-
Object.entries(e.shape).map(([t,
|
|
94
|
+
Object.entries(e.shape).map(([t, a]) => r && a instanceof r.ZodDefault ? [t, a._def.defaultValue()] : r && a instanceof r.ZodObject ? [t, p(a)] : [t, void 0])
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function b(e) {
|
|
97
98
|
return e.path.join(".");
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function N({
|
|
100
101
|
validationSchema: e
|
|
101
102
|
}) {
|
|
102
|
-
const t = h({}),
|
|
103
|
-
t.value = {},
|
|
103
|
+
const t = h({}), a = l({}), n = l(p(e)), i = () => {
|
|
104
|
+
t.value = {}, a.value = {};
|
|
104
105
|
}, x = () => {
|
|
105
|
-
i(),
|
|
106
|
+
i(), n.value = p(e);
|
|
106
107
|
};
|
|
107
108
|
return {
|
|
108
109
|
// Values
|
|
109
|
-
errorBag:
|
|
110
|
+
errorBag: a,
|
|
110
111
|
errors: t,
|
|
111
|
-
values:
|
|
112
|
+
values: n,
|
|
112
113
|
// Methods
|
|
113
114
|
handleReset: () => x(),
|
|
114
|
-
submitForm: (
|
|
115
|
+
submitForm: (T) => () => {
|
|
115
116
|
i();
|
|
116
|
-
const u = e.safeParse(
|
|
117
|
-
u.success ?
|
|
118
|
-
const B =
|
|
119
|
-
t.value[B] || (t.value[B] = m.message),
|
|
117
|
+
const u = e.safeParse(n.value);
|
|
118
|
+
u.success ? T(n.value) : u.error.issues.forEach((m) => {
|
|
119
|
+
const B = b(m);
|
|
120
|
+
t.value[B] || (t.value[B] = m.message), a.value[B] ? a.value[B].push(m.message) : a.value[B] = [m.message];
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
123
|
};
|
|
@@ -124,7 +125,7 @@ function G({
|
|
|
124
125
|
const c = Symbol("use-bento-theme");
|
|
125
126
|
function w() {
|
|
126
127
|
var t;
|
|
127
|
-
const e = (t =
|
|
128
|
+
const e = (t = E()) == null ? void 0 : t.proxy[c];
|
|
128
129
|
return e ? { ...e } : (g("useBentoTheme does not work without Vue.use(BentoPlugin)"), {
|
|
129
130
|
getTheme: () => {
|
|
130
131
|
},
|
|
@@ -133,41 +134,42 @@ function w() {
|
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
const C = (e) => {
|
|
136
|
-
e.prototype[y] =
|
|
137
|
-
}
|
|
137
|
+
e.prototype[y] = S();
|
|
138
|
+
};
|
|
139
|
+
var o = /* @__PURE__ */ ((e) => (e.LEGACY = "b-legacy-theme", e.STYLEGUIDE = "b-styleguide-theme", e.BENTO = "", e.BENTO_LIGHT = "b-light-theme", e.BENTO_DARK = "b-dark-theme", e.BENTO_SYSTEM = "b-system", e))(o || {});
|
|
140
|
+
const f = () => {
|
|
138
141
|
var e;
|
|
139
142
|
return ((e = document.body.className.match(/b-\w+-theme/)) == null ? void 0 : e[0]) ?? "";
|
|
140
|
-
}, D = () => window.matchMedia("(prefers-color-scheme: dark)").matches ?
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const t = f(), o = D(), a = e === "b-system" ? o : e;
|
|
144
|
-
a === "b-light-theme" || a === "" ? document.documentElement.style.colorScheme = "light" : a === "b-dark-theme" && (document.documentElement.style.colorScheme = "dark"), t.length && t !== a && document.body.classList.remove(t), a.length && document.body.classList.add(a);
|
|
143
|
+
}, D = () => window.matchMedia("(prefers-color-scheme: dark)").matches ? o.BENTO_DARK : o.BENTO_LIGHT, s = (e) => {
|
|
144
|
+
const t = f(), a = D(), n = e === o.BENTO_SYSTEM ? a : e;
|
|
145
|
+
n === o.BENTO_LIGHT || n === o.BENTO ? document.documentElement.style.colorScheme = "light" : n === o.BENTO_DARK && (document.documentElement.style.colorScheme = "dark"), t.length && t !== n && document.body.classList.remove(t), n.length && document.body.classList.add(n);
|
|
145
146
|
}, I = (e) => {
|
|
146
147
|
const t = {
|
|
147
148
|
getTheme: f,
|
|
148
149
|
setTheme: s
|
|
149
150
|
};
|
|
150
151
|
e.prototype[c] = t;
|
|
151
|
-
},
|
|
152
|
+
}, k = {
|
|
152
153
|
name: "BentoVue",
|
|
153
154
|
install: async (e, {
|
|
154
|
-
theme: t =
|
|
155
|
-
withToast:
|
|
156
|
-
withUtilityClasses:
|
|
155
|
+
theme: t = o.BENTO_LIGHT,
|
|
156
|
+
withToast: a = !1,
|
|
157
|
+
withUtilityClasses: n = !1,
|
|
157
158
|
withDesignTokensCSSInjection: i = !0
|
|
158
159
|
}) => {
|
|
159
|
-
I(e),
|
|
160
|
+
I(e), a && C(e), i && (d(
|
|
160
161
|
"Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin",
|
|
161
162
|
`Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:
|
|
162
163
|
https://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables`,
|
|
163
164
|
"2.0.0"
|
|
164
|
-
), t ===
|
|
165
|
+
), t === o.STYLEGUIDE ? await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css") : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css"), n && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css")), t === o.STYLEGUIDE ? s(o.STYLEGUIDE) : t === o.BENTO_SYSTEM ? s(o.BENTO_SYSTEM) : t === o.BENTO_DARK ? s(o.BENTO_DARK) : (t === o.BENTO && d("Using `BentoTheme.BENTO`", "Please use `BentoTheme.BENTO_LIGHT` instead", "2.0.0"), s(o.BENTO_LIGHT));
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
168
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
H as BentoAccordion,
|
|
170
|
+
Y as BentoAccordionItem,
|
|
170
171
|
W as BentoActionBar,
|
|
172
|
+
mn as BentoAiButton,
|
|
171
173
|
J as BentoAlert,
|
|
172
174
|
Q as BentoAlertEvent,
|
|
173
175
|
X as BentoAlertTypeOption,
|
|
@@ -175,28 +177,28 @@ export {
|
|
|
175
177
|
te as BentoAvatar,
|
|
176
178
|
ae as BentoButton,
|
|
177
179
|
so as BentoButtonActions,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
un as BentoButtonActionsLayout,
|
|
181
|
+
dn as BentoButtonActionsLayoutBasic,
|
|
182
|
+
ln as BentoButtonActionsLayoutExtended,
|
|
181
183
|
ne as BentoButtonPropClass,
|
|
182
184
|
re as BentoButtonVariant,
|
|
183
|
-
|
|
185
|
+
Se as BentoCard,
|
|
184
186
|
ye as BentoCardBackground,
|
|
185
187
|
ge as BentoCardTitleSize,
|
|
186
|
-
|
|
188
|
+
Ne as BentoCheckbox,
|
|
187
189
|
we as BentoCheckboxEvent,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
Fn as BentoCheckboxGroup,
|
|
191
|
+
Gn as BentoCheckboxGroupVariant,
|
|
192
|
+
Pn as BentoCheckboxState,
|
|
193
|
+
Me as BentoChip,
|
|
192
194
|
Ae as BentoClickOutside,
|
|
193
|
-
|
|
195
|
+
zn as BentoClickOutsideDirective,
|
|
194
196
|
_e as BentoCodeSnippet,
|
|
195
197
|
je as BentoCodeSnippetEvent,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
Ke as BentoCodeSnippetSupportedLanguage,
|
|
199
|
+
Ue as BentoCodeSnippetVariant,
|
|
198
200
|
me as BentoColumnOverflow,
|
|
199
|
-
|
|
201
|
+
He as BentoCountry,
|
|
200
202
|
qe as BentoCountryCode,
|
|
201
203
|
We as BentoCountryVariant,
|
|
202
204
|
Qe as BentoCurrency,
|
|
@@ -214,22 +216,22 @@ export {
|
|
|
214
216
|
xe as BentoDatagridStyleState,
|
|
215
217
|
et as BentoDate,
|
|
216
218
|
tt as BentoDateFormat,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
Ee as BentoDatePicker,
|
|
220
|
+
be as BentoDatePickerEvent,
|
|
221
|
+
fn as BentoDatePickerFirstDayOfWeek,
|
|
220
222
|
De as BentoDateRangePicker,
|
|
221
223
|
Ie as BentoDateRangePickerEvent,
|
|
222
|
-
|
|
224
|
+
xn as BentoDateRangePickerFirstDayOfWeek,
|
|
223
225
|
at as BentoDivider,
|
|
224
226
|
Le as BentoDropdown,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
bn as BentoDropdownAvatar,
|
|
228
|
+
Cn as BentoDropdownCountry,
|
|
229
|
+
Dn as BentoDropdownCurrency,
|
|
230
|
+
Sn as BentoDropdownEvent,
|
|
231
|
+
yn as BentoDropdownLazyLoadType,
|
|
232
|
+
In as BentoDropdownPaymentMethod,
|
|
233
|
+
Fe as BentoDropdownSize,
|
|
234
|
+
vn as BentoDropdownTag,
|
|
233
235
|
rt as BentoEmptyState,
|
|
234
236
|
st as BentoEmptyStateImage,
|
|
235
237
|
Bt as BentoEmptyStateImageVariant,
|
|
@@ -239,35 +241,35 @@ export {
|
|
|
239
241
|
lt as BentoFilterBarEvent,
|
|
240
242
|
ct as BentoFilterEvent,
|
|
241
243
|
ft as BentoFilterItemType,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
Tt as BentoFormLayout,
|
|
245
|
+
St as BentoFormLayoutFieldTip,
|
|
244
246
|
yt as BentoFormLayoutGroup,
|
|
245
247
|
gt as BentoFormLayoutTitle,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
Oo as BentoHeader,
|
|
249
|
+
Et as BentoHeaderWithViews,
|
|
248
250
|
Ct as BentoImage,
|
|
249
251
|
Dt as BentoImageAspectRatio,
|
|
250
252
|
It as BentoImageObjectFit,
|
|
251
253
|
Lt as BentoInfoIcon,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
Ot as BentoInputField,
|
|
255
|
+
Ft as BentoInputFieldElementPosition,
|
|
256
|
+
Gt as BentoInputFieldEvent,
|
|
257
|
+
Vt as BentoInputFieldPassword,
|
|
258
|
+
zt as BentoInputFieldPhoneNumber,
|
|
259
|
+
Ht as BentoInputFieldPhoneNumberCountries,
|
|
260
|
+
Nt as BentoInputFieldStateClass,
|
|
259
261
|
wt as BentoInputFieldType,
|
|
260
|
-
|
|
262
|
+
kt as BentoInputFieldVariant,
|
|
261
263
|
qt as BentoInspector,
|
|
262
264
|
Zt as BentoInspectorSizeOptions,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
+
jn as BentoKeyboardNavigationDirective,
|
|
266
|
+
Kn as BentoKeyboardNavigationKeyDownEvent,
|
|
265
267
|
Qt as BentoLayout,
|
|
266
268
|
Xt as BentoLayoutRow,
|
|
267
269
|
ao as BentoLink,
|
|
268
270
|
no as BentoLinkVariant,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
gn as BentoListboxEvent,
|
|
272
|
+
hn as BentoListboxLazyLoadType,
|
|
271
273
|
Bo as BentoLoadingButton,
|
|
272
274
|
io as BentoLoadingButtonState,
|
|
273
275
|
eo as BentoLoadingIndicator,
|
|
@@ -275,28 +277,28 @@ export {
|
|
|
275
277
|
mo as BentoMenu,
|
|
276
278
|
po as BentoMenuEvent,
|
|
277
279
|
xo as BentoModal,
|
|
278
|
-
|
|
280
|
+
So as BentoModalColumnLayoutVariant,
|
|
279
281
|
yo as BentoModalDialogType,
|
|
280
282
|
go as BentoModalEvent,
|
|
281
283
|
vo as BentoModalFullscreen,
|
|
282
284
|
Lo as BentoModalFullscreenPage,
|
|
283
285
|
ho as BentoModalPage,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
Eo as BentoModalRole,
|
|
287
|
+
bo as BentoModalSize,
|
|
286
288
|
Co as BentoModalVariant,
|
|
287
289
|
Do as BentoModalVariantMapping,
|
|
288
|
-
|
|
290
|
+
Go as BentoPagination,
|
|
289
291
|
wo as BentoPaymentMethod,
|
|
290
|
-
|
|
292
|
+
Mo as BentoPaymentMethodType,
|
|
291
293
|
uo as BentoPopover,
|
|
292
294
|
Ao as BentoPopoverPositions,
|
|
293
295
|
_o as BentoPromoBanner,
|
|
294
296
|
jo as BentoPromoBannerColor,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
Ko as BentoPromoBannerLayout,
|
|
298
|
+
zo as BentoRadioButton,
|
|
299
|
+
Vn as BentoRadioButtonStateClass,
|
|
300
|
+
Ho as BentoRadioGroup,
|
|
301
|
+
Yo as BentoRadioGroupVariant,
|
|
300
302
|
Wo as BentoRichTextEditor,
|
|
301
303
|
Jo as BentoSearchBar,
|
|
302
304
|
Qo as BentoSearchBarEvent,
|
|
@@ -312,61 +314,61 @@ export {
|
|
|
312
314
|
da as BentoSidepanelPage,
|
|
313
315
|
ca as BentoStatus,
|
|
314
316
|
fa as BentoStatusVariant,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
+
Ta as BentoStep,
|
|
318
|
+
Sa as BentoStepper,
|
|
317
319
|
ya as BentoStepperTypeOption,
|
|
318
320
|
ga as BentoStepperVariantOption,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
Ea as BentoStructuredList,
|
|
322
|
+
ba as BentoStructuredListItem,
|
|
321
323
|
Da as BentoSummaryGrid,
|
|
322
324
|
Ia as BentoSummaryGridItemAmount,
|
|
323
325
|
va as BentoSummaryGridItemCustom,
|
|
324
326
|
La as BentoSummaryGridItemNumeric,
|
|
325
327
|
Pa as BentoSummaryGridItemPercentage,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
Oa as BentoSummaryGridItemSize,
|
|
329
|
+
Fa as BentoSummaryGridItemText,
|
|
330
|
+
Ga as BentoSummaryGridItemTrendDirection,
|
|
329
331
|
wa as BentoTab,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
+
ka as BentoTabs,
|
|
333
|
+
Va as BentoTag,
|
|
332
334
|
Aa as BentoTagVariant,
|
|
333
335
|
_a as BentoTextarea,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
o as BentoTheme,
|
|
337
|
+
Ka as BentoTimeline,
|
|
338
|
+
Ua as BentoTimelineGapUnit,
|
|
339
|
+
za as BentoTimelineItem,
|
|
340
|
+
Ha as BentoTimelineItemVariant,
|
|
341
|
+
Ya as BentoTimelineShowMorePlacement,
|
|
340
342
|
qa as BentoTimelineStatus,
|
|
341
343
|
Za as BentoToast,
|
|
342
344
|
Qa as BentoToggle,
|
|
343
345
|
lo as BentoToggleButton,
|
|
344
346
|
Xa as BentoToggleLabelPosition,
|
|
345
347
|
$a as BentoTogglePropClass,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
Yn as BentoTooltipDirective,
|
|
349
|
+
qn as BentoTooltipPosition,
|
|
350
|
+
Wn as BentoTooltipState,
|
|
349
351
|
tn as BentoTutorial,
|
|
350
352
|
_ as BentoTypography,
|
|
351
353
|
j as BentoTypographyElement,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
K as BentoTypographyModifier,
|
|
355
|
+
U as BentoTypographyVariant,
|
|
356
|
+
Rn as DateFormat,
|
|
357
|
+
k as default,
|
|
356
358
|
At as minLength,
|
|
357
359
|
Rt as requireLowercase,
|
|
358
360
|
_t as requireNumeric,
|
|
359
361
|
jt as requireSpecialCharacter,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
Kt as requireUppercase,
|
|
363
|
+
G as toTypedSchema,
|
|
362
364
|
w as useBentoTheme,
|
|
363
365
|
c as useBentoThemeKey,
|
|
364
366
|
A as useBentoToastController,
|
|
365
367
|
co as useClickOutside,
|
|
366
368
|
Ze as useCountryCapital,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
369
|
+
wn as useCountryName,
|
|
370
|
+
kn as useCountryPhoneCode,
|
|
371
|
+
N as useForm,
|
|
370
372
|
Pe as useSearchBarFilter
|
|
371
373
|
};
|
|
372
374
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts"],"sourcesContent":["import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { type allKeys, type ErrorBag, type UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param props Form configuration object\n * @param extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns response.errors Object with all the form values and the first error found for that field (if any)\n * @returns response.values Object with all the form values and their current value\n * @returns response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string[];\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { type BentoTheme } from './install';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { type UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport enum BentoTheme {\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import type { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { BentoTheme, setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","getTheme","getThemeForSystemPreference","BentoTheme","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAASA,EAAmCC,GAAe;AACvD,SAAA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AA,IAClB,UAAAT;AAAA,IACA,UAAAG;AAAA,EACJ;AAKK,EAAAN,EAAoB,UAAUP,CAAgB,IAAImB;AAI3D,GC1DMC,IAAuC;AAAA,EACzC,MAAM;AAAA,EACN,SAAS,OACLb,GACA;AAAA,IACI,OAAAO,IAAQF,EAAW;AAAA,IACnB,WAAAS,IAAY;AAAA,IACZ,oBAAAC,IAAqB;AAAA,IACrB,8BAAAC,IAA+B;AAAA,EAAA,MAElC;AACD,IAAAL,EAAaX,CAAG,GAEZc,KACAf,EAAaC,CAAG,GAEhBgB,MACAC;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MACA;AAAA,IACJ,GAEIV,MAAUF,EAAW,aACrB,MAAM,OAAO,oEAAoE,IAEjF,MAAM,OAAO,yDAAyD,GAGtEU,KACA,MAAM,OAAO,uDAAuD,IAIxER,MAAUF,EAAW,aACrBC,EAASD,EAAW,UAAU,IACvBE,MAAUF,EAAW,eAC5BC,EAASD,EAAW,YAAY,IACzBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,KACvBE,MAAUF,EAAW,SAClBY,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASD,EAAW,WAAW;AAAA,EAGnC;AAER;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.types.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts"],"sourcesContent":["import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { type allKeys, type ErrorBag, type UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param props Form configuration object\n * @param extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns response.errors Object with all the form values and the first error found for that field (if any)\n * @returns response.values Object with all the form values and their current value\n * @returns response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string[];\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { type BentoTheme } from './install.types';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { type UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","export enum BentoTheme {\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\nimport { BentoTheme } from './install.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\nimport { BentoTheme } from './composables/use-bento-theme/install.types';\nimport type { PluginObject } from 'vue';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","getTheme","getThemeForSystemPreference","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAASA,EAAmCC,GAAe;AACvD,SAAAA;AACX;AA4BA,SAASC,EAA0CC,GAAmC;AAClF,MAAMC,KAAKD,aAAkBC,EAAE;AAC3B,WAAO,OAAO;AAAA,MACV,OAAO,QAAQD,EAAO,KAAK,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,MACnCF,KAAKE,aAAiBF,EAAE,aAEnB,CAACC,GAAKC,EAAM,KAAK,cAAc,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,G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