@adyen/bento-vue2 1.34.0 → 1.35.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/dist/@types/index.d.ts +2 -2
- package/dist/accordion.js +1 -1
- package/dist/action-bar.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/alert.css +1 -1
- package/dist/assets/avatar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/code-snippet.css +1 -1
- package/dist/assets/copy.css +1 -1
- package/dist/assets/currency.css +1 -0
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/tutorial.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +4 -4
- package/dist/card.js +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/chunks/accordion-item.C0EeQmpM.js +116 -0
- package/dist/chunks/accordion-item.C0EeQmpM.js.map +1 -0
- package/dist/chunks/{action-bar.CsRmYQ-k.js → action-bar.CTS-sRPZ.js} +52 -38
- package/dist/chunks/{action-bar.CsRmYQ-k.js.map → action-bar.CTS-sRPZ.js.map} +1 -1
- package/dist/chunks/{alert.DtT7BRdr.js → alert.BOAVcKqt.js} +30 -23
- package/dist/chunks/alert.BOAVcKqt.js.map +1 -0
- package/dist/chunks/{avatar.0ffdL8i0.js → avatar.qcWk9clF.js} +9 -9
- package/dist/chunks/avatar.qcWk9clF.js.map +1 -0
- package/dist/chunks/{base-modal.zHjXVjwU.js → base-modal.HSuNJt-7.js} +18 -12
- package/dist/chunks/{base-modal.zHjXVjwU.js.map → base-modal.HSuNJt-7.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.B6Nb6Ohu.js → button-actions-with-menu.GyJNwaZ5.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.B6Nb6Ohu.js.map → button-actions-with-menu.GyJNwaZ5.js.map} +1 -1
- package/dist/chunks/{button-actions.BQHr68sA.js → button-actions.fnn5w4Jz.js} +3 -3
- package/dist/chunks/{button-actions.BQHr68sA.js.map → button-actions.fnn5w4Jz.js.map} +1 -1
- package/dist/chunks/{button.79klAcOK.js → button.B1JELmx-.js} +2 -2
- package/dist/chunks/{button.79klAcOK.js.map → button.B1JELmx-.js.map} +1 -1
- package/dist/chunks/{calendar.CaTMWZUM.js → calendar.BBQUZ8xu.js} +230 -230
- package/dist/chunks/calendar.BBQUZ8xu.js.map +1 -0
- package/dist/chunks/card.DqxilNhb.js +123 -0
- package/dist/chunks/card.DqxilNhb.js.map +1 -0
- package/dist/chunks/{checkbox-group.D_mCZMPr.js → checkbox-group.CdMkjLu1.js} +4 -4
- package/dist/chunks/{checkbox-group.D_mCZMPr.js.map → checkbox-group.CdMkjLu1.js.map} +1 -1
- package/dist/chunks/{checkbox-input.BH7MGdMj.js → checkbox-input.Ce0AY_e_.js} +14 -13
- package/dist/chunks/checkbox-input.Ce0AY_e_.js.map +1 -0
- package/dist/chunks/{checkbox.CaX67eM_.js → checkbox.CVSzcaHk.js} +38 -28
- package/dist/chunks/{checkbox.CaX67eM_.js.map → checkbox.CVSzcaHk.js.map} +1 -1
- package/dist/chunks/{checkmark-circle-fill.DVl6QSwm.js → checkmark-circle-fill.By9RNf5T.js} +4 -4
- package/dist/chunks/{checkmark-circle-fill.DVl6QSwm.js.map → checkmark-circle-fill.By9RNf5T.js.map} +1 -1
- package/dist/chunks/{checkmark-small.BtF8b2gE.js → checkmark-small.C8T8ISN6.js} +4 -4
- package/dist/chunks/checkmark-small.C8T8ISN6.js.map +1 -0
- package/dist/chunks/{chevron-left.CtnrsqUy.js → chevron-left.CvIsaXjZ.js} +6 -6
- package/dist/chunks/chevron-left.CvIsaXjZ.js.map +1 -0
- package/dist/chunks/{chevron-up.B2uWhZf7.js → chevron-up.DqJmLciO.js} +6 -6
- package/dist/chunks/chevron-up.DqJmLciO.js.map +1 -0
- package/dist/chunks/{code-snippet.DgKK7fE8.js → code-snippet.BcZJFqdH.js} +45 -36
- package/dist/chunks/code-snippet.BcZJFqdH.js.map +1 -0
- package/dist/chunks/{controls-group.6aTaRWFI.js → controls-group.BES2y5Y7.js} +2 -2
- package/dist/chunks/{controls-group.6aTaRWFI.js.map → controls-group.BES2y5Y7.js.map} +1 -1
- package/dist/chunks/{copy.B1DYKX_q.js → copy.qAUSogPB.js} +35 -26
- package/dist/chunks/copy.qAUSogPB.js.map +1 -0
- package/dist/chunks/{cross-circle-fill-small.Oj6lPaDy.js → cross-circle-fill-small.YhLgeipP.js} +4 -4
- package/dist/chunks/cross-circle-fill-small.YhLgeipP.js.map +1 -0
- package/dist/chunks/{cross-circle-fill.CnYH4R_h.js → cross-circle-fill.BawVYNw7.js} +4 -4
- package/dist/chunks/{cross-circle-fill.CnYH4R_h.js.map → cross-circle-fill.BawVYNw7.js.map} +1 -1
- package/dist/chunks/{cross-small.BLUwtRB-.js → cross-small.CZqsjZDz.js} +4 -4
- package/dist/chunks/cross-small.CZqsjZDz.js.map +1 -0
- package/dist/chunks/{cross.CsUPDmaA.js → cross.CJ5EEL2c.js} +4 -4
- package/dist/chunks/{cross.CsUPDmaA.js.map → cross.CJ5EEL2c.js.map} +1 -1
- package/dist/chunks/{currency.D_2CN1OJ.js → currency.CbZqZrBz.js} +9 -8
- package/dist/chunks/{currency.D_2CN1OJ.js.map → currency.CbZqZrBz.js.map} +1 -1
- package/dist/chunks/{dashboard-section.DWfQGGwS.js → dashboard-section.QTsJqS-s.js} +3 -3
- package/dist/chunks/{dashboard-section.DWfQGGwS.js.map → dashboard-section.QTsJqS-s.js.map} +1 -1
- package/dist/chunks/{dashed-underline.C7gLtEqx.js → dashed-underline.BnBP41jp.js} +2 -2
- package/dist/chunks/{dashed-underline.C7gLtEqx.js.map → dashed-underline.BnBP41jp.js.map} +1 -1
- package/dist/chunks/{data-grid-template.2xocKVqX.js → data-grid-template.CY3uHWRY.js} +3 -3
- package/dist/chunks/{data-grid-template.2xocKVqX.js.map → data-grid-template.CY3uHWRY.js.map} +1 -1
- package/dist/chunks/{data-grid.CUn6MrZz.js → data-grid.CZjS7HUz.js} +483 -436
- package/dist/chunks/data-grid.CZjS7HUz.js.map +1 -0
- package/dist/chunks/{date-picker.C6_KbCYT.js → date-picker.C5uid7SP.js} +91 -83
- package/dist/chunks/date-picker.C5uid7SP.js.map +1 -0
- package/dist/chunks/{date-range-picker.DaTgBXP1.js → date-range-picker.R5v1ZX-X.js} +265 -243
- package/dist/chunks/date-range-picker.R5v1ZX-X.js.map +1 -0
- package/dist/chunks/{date.DaiTzNEZ.js → date.C0uwNQjg.js} +80 -80
- package/dist/chunks/{date.DaiTzNEZ.js.map → date.C0uwNQjg.js.map} +1 -1
- package/dist/chunks/{dialog-page.bmDDYmn9.js → dialog-page.j_L6c9ZP.js} +5 -4
- package/dist/chunks/dialog-page.j_L6c9ZP.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.kQ3pHsZe.js → dropdown-default-textbox.BFx4TF5u.js} +4 -4
- package/dist/chunks/{dropdown-default-textbox.kQ3pHsZe.js.map → dropdown-default-textbox.BFx4TF5u.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.pJ_sQbJN.js → dropdown-tag.B8A03Cck.js} +3 -3
- package/dist/chunks/{dropdown-tag.pJ_sQbJN.js.map → dropdown-tag.B8A03Cck.js.map} +1 -1
- package/dist/chunks/{dropdown.DpsQPLy-.js → dropdown.h_j0DsN2.js} +159 -139
- package/dist/chunks/dropdown.h_j0DsN2.js.map +1 -0
- package/dist/chunks/{empty-state.C2ba_wDp.js → empty-state.CaQuZx7L.js} +2 -2
- package/dist/chunks/{empty-state.C2ba_wDp.js.map → empty-state.CaQuZx7L.js.map} +1 -1
- package/dist/chunks/{error-message.BnFyGbR7.js → error-message.3tVTq0sW.js} +28 -14
- package/dist/chunks/{error-message.BnFyGbR7.js.map → error-message.3tVTq0sW.js.map} +1 -1
- package/dist/chunks/es6.BvpG4Oi6.js.map +1 -1
- package/dist/chunks/{expand.CwwKq7Uc.js → expand.C263WARj.js} +4 -4
- package/dist/chunks/{expand.CwwKq7Uc.js.map → expand.C263WARj.js.map} +1 -1
- package/dist/chunks/{filter-bar.DGBvcKsz.js → filter-bar.DgiUmFql.js} +605 -589
- package/dist/chunks/filter-bar.DgiUmFql.js.map +1 -0
- package/dist/chunks/{fixed-scroller.CQWDnydO.js → fixed-scroller.DcdAycgk.js} +3 -3
- package/dist/chunks/{fixed-scroller.CQWDnydO.js.map → fixed-scroller.DcdAycgk.js.map} +1 -1
- package/dist/chunks/{footer-actions.CwHY2-Ap.js → footer-actions.C1TgWA9J.js} +3 -3
- package/dist/chunks/{footer-actions.CwHY2-Ap.js.map → footer-actions.C1TgWA9J.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CRsR3o2x.js → form-layout-title.DW8y285m.js} +2 -2
- package/dist/chunks/{form-layout-title.CRsR3o2x.js.map → form-layout-title.DW8y285m.js.map} +1 -1
- package/dist/chunks/{index.B_UZQ6qF.js → get-date-locale.BN8xEjY0.js} +855 -204
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +1 -0
- package/dist/chunks/{header.BmNDoXio.js → header.Nh_SoSJP.js} +80 -74
- package/dist/chunks/{header.BmNDoXio.js.map → header.Nh_SoSJP.js.map} +1 -1
- package/dist/chunks/{index.Z84QE0E2.js → index.CrhTVr5J.js} +2 -2
- package/dist/chunks/{index.Z84QE0E2.js.map → index.CrhTVr5J.js.map} +1 -1
- package/dist/chunks/{index.xqFSZOAb.js → index.DDnf1O9p.js} +2 -2
- package/dist/chunks/{index.xqFSZOAb.js.map → index.DDnf1O9p.js.map} +1 -1
- package/dist/chunks/{index.B_EJflcs.js → index.DPafeRJa.js} +2 -2
- package/dist/chunks/{index.B_EJflcs.js.map → index.DPafeRJa.js.map} +1 -1
- package/dist/chunks/{info-icon.DNn4oZsB.js → info-icon.bQl_RleE.js} +2 -2
- package/dist/chunks/{info-icon.DNn4oZsB.js.map → info-icon.bQl_RleE.js.map} +1 -1
- package/dist/chunks/{info.CyeBsLgt.js → info.D4SG-AIm.js} +4 -4
- package/dist/chunks/{info.CyeBsLgt.js.map → info.D4SG-AIm.js.map} +1 -1
- package/dist/chunks/{input-field.S5HIZtYA.js → input-field.nBUtoYwF.js} +3 -3
- package/dist/chunks/{input-field.S5HIZtYA.js.map → input-field.nBUtoYwF.js.map} +1 -1
- package/dist/chunks/{inspector.types.D6kCCKNk.js → inspector.types.DJTWyZ9x.js} +19 -11
- package/dist/chunks/{inspector.types.D6kCCKNk.js.map → inspector.types.DJTWyZ9x.js.map} +1 -1
- package/dist/chunks/{link.Xce4kDGy.js → link.BKxmPIV5.js} +4 -3
- package/dist/chunks/link.BKxmPIV5.js.map +1 -0
- package/dist/chunks/{loading-button.DDPZYO6r.js → loading-button.CsaWlmzb.js} +40 -26
- package/dist/chunks/loading-button.CsaWlmzb.js.map +1 -0
- package/dist/chunks/{menu.DSOJEn4v.js → menu.BhT5t7Ev.js} +7 -6
- package/dist/chunks/{menu.DSOJEn4v.js.map → menu.BhT5t7Ev.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BQKE0bm0.js → modal-fullscreen.BlqMgvmn.js} +27 -21
- package/dist/chunks/{modal-fullscreen.BQKE0bm0.js.map → modal-fullscreen.BlqMgvmn.js.map} +1 -1
- package/dist/chunks/{modal.ClqkmzVZ.js → modal.DCtgRb44.js} +26 -20
- package/dist/chunks/modal.DCtgRb44.js.map +1 -0
- package/dist/chunks/{pagination.he0lQGAV.js → pagination.CM_9J0dZ.js} +6 -5
- package/dist/chunks/pagination.CM_9J0dZ.js.map +1 -0
- package/dist/chunks/{popover.UmNw_M-C.js → popover.DFWeWyxd.js} +4 -4
- package/dist/chunks/{popover.UmNw_M-C.js.map → popover.DFWeWyxd.js.map} +1 -1
- package/dist/chunks/{radio-group.D7cuMKzV.js → radio-group.o2Kroy4O.js} +3 -3
- package/dist/chunks/{radio-group.D7cuMKzV.js.map → radio-group.o2Kroy4O.js.map} +1 -1
- package/dist/chunks/{refresh.BKI9WwKh.js → refresh.Bc9FzGjJ.js} +4 -4
- package/dist/chunks/{refresh.BKI9WwKh.js.map → refresh.Bc9FzGjJ.js.map} +1 -1
- package/dist/chunks/{search-bar.BPyYb0WB.js → search-bar.BRlauT9L.js} +16 -8
- package/dist/chunks/{search-bar.BPyYb0WB.js.map → search-bar.BRlauT9L.js.map} +1 -1
- package/dist/chunks/{search.CBKhp7zB.js → search.pVu-JVAN.js} +4 -4
- package/dist/chunks/{search.CBKhp7zB.js.map → search.pVu-JVAN.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CMUfpgQf.js → secondary-nav.lWetIbb8.js} +2 -2
- package/dist/chunks/{secondary-nav.CMUfpgQf.js.map → secondary-nav.lWetIbb8.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DbMfzyTG.js → selection-card-group.BWZOX7l7.js} +4 -4
- package/dist/chunks/{selection-card-group.DbMfzyTG.js.map → selection-card-group.BWZOX7l7.js.map} +1 -1
- package/dist/chunks/{sidepanel.Ck6Ts9RR.js → sidepanel.B5CKqH1u.js} +25 -19
- package/dist/chunks/{sidepanel.Ck6Ts9RR.js.map → sidepanel.B5CKqH1u.js.map} +1 -1
- package/dist/chunks/{step.CjJtlBk6.js → step.vF0pNW-K.js} +7 -6
- package/dist/chunks/step.vF0pNW-K.js.map +1 -0
- package/dist/chunks/{structured-list-item.DpLscUX4.js → structured-list-item.IElHaBHs.js} +24 -18
- package/dist/chunks/{structured-list-item.DpLscUX4.js.map → structured-list-item.IElHaBHs.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.B7Re6OCf.js → summary-grid-item-custom.CMsS1kro.js} +3 -3
- package/dist/chunks/{summary-grid-item-custom.B7Re6OCf.js.map → summary-grid-item-custom.CMsS1kro.js.map} +1 -1
- package/dist/chunks/{tabs.D4ORafqH.js → tabs.D8Ni3Zfb.js} +2 -2
- package/dist/chunks/{tabs.D4ORafqH.js.map → tabs.D8Ni3Zfb.js.map} +1 -1
- package/dist/chunks/{textarea.BRMpTWKS.js → textarea.2RrKj5Mr.js} +4 -4
- package/dist/chunks/{textarea.BRMpTWKS.js.map → textarea.2RrKj5Mr.js.map} +1 -1
- package/dist/chunks/{timeline-item.jh7UnviR.js → timeline-item.fF0fFDb9.js} +58 -51
- package/dist/chunks/timeline-item.fF0fFDb9.js.map +1 -0
- package/dist/chunks/{toast.3LxCDPiT.js → toast.CMdDpqMg.js} +3 -3
- package/dist/chunks/{toast.3LxCDPiT.js.map → toast.CMdDpqMg.js.map} +1 -1
- package/dist/chunks/{toggle-button.bt3zBzdC.js → toggle-button.CGvkVs_H.js} +2 -2
- package/dist/chunks/{toggle-button.bt3zBzdC.js.map → toggle-button.CGvkVs_H.js.map} +1 -1
- package/dist/chunks/{toggle.CLgGH4Jr.js → toggle.yiNF7ndg.js} +2 -2
- package/dist/chunks/{toggle.CLgGH4Jr.js.map → toggle.yiNF7ndg.js.map} +1 -1
- package/dist/chunks/{tutorial.DERGsCkg.js → tutorial.D2msGkwn.js} +86 -73
- package/dist/chunks/tutorial.D2msGkwn.js.map +1 -0
- package/dist/chunks/{use-cached-selected-values.B39-iEp4.js → use-cached-selected-values.it4ENg3q.js} +62 -47
- package/dist/chunks/use-cached-selected-values.it4ENg3q.js.map +1 -0
- package/dist/chunks/{warning-filled.CLKRzGMT.js → warning-filled.Cd0kVWwa.js} +4 -4
- package/dist/chunks/{warning-filled.CLKRzGMT.js.map → warning-filled.Cd0kVWwa.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/currency.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.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +54 -54
- package/dist/info-icon.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +7 -7
- package/dist/link.js +1 -1
- 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 +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.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.css +3 -0
- package/dist/styles/legacy.css +3 -0
- package/dist/styles/styleguide.css +3 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/chunks/accordion-item.IMlV_Vik.js +0 -100
- package/dist/chunks/accordion-item.IMlV_Vik.js.map +0 -1
- package/dist/chunks/alert.DtT7BRdr.js.map +0 -1
- package/dist/chunks/avatar.0ffdL8i0.js.map +0 -1
- package/dist/chunks/calendar.CaTMWZUM.js.map +0 -1
- package/dist/chunks/card.ignL7-CH.js +0 -115
- package/dist/chunks/card.ignL7-CH.js.map +0 -1
- package/dist/chunks/checkbox-input.BH7MGdMj.js.map +0 -1
- package/dist/chunks/checkmark-small.BtF8b2gE.js.map +0 -1
- package/dist/chunks/chevron-left.CtnrsqUy.js.map +0 -1
- package/dist/chunks/chevron-up.B2uWhZf7.js.map +0 -1
- package/dist/chunks/code-snippet.DgKK7fE8.js.map +0 -1
- package/dist/chunks/copy.B1DYKX_q.js.map +0 -1
- package/dist/chunks/cross-circle-fill-small.Oj6lPaDy.js.map +0 -1
- package/dist/chunks/cross-small.BLUwtRB-.js.map +0 -1
- package/dist/chunks/data-grid.CUn6MrZz.js.map +0 -1
- package/dist/chunks/date-picker.C6_KbCYT.js.map +0 -1
- package/dist/chunks/date-range-picker.DaTgBXP1.js.map +0 -1
- package/dist/chunks/dialog-page.bmDDYmn9.js.map +0 -1
- package/dist/chunks/dropdown.DpsQPLy-.js.map +0 -1
- package/dist/chunks/filter-bar.DGBvcKsz.js.map +0 -1
- package/dist/chunks/index.B_UZQ6qF.js.map +0 -1
- package/dist/chunks/link.Xce4kDGy.js.map +0 -1
- package/dist/chunks/loading-button.DDPZYO6r.js.map +0 -1
- package/dist/chunks/modal.ClqkmzVZ.js.map +0 -1
- package/dist/chunks/pagination.he0lQGAV.js.map +0 -1
- package/dist/chunks/step.CjJtlBk6.js.map +0 -1
- package/dist/chunks/timeline-item.jh7UnviR.js.map +0 -1
- package/dist/chunks/tutorial.DERGsCkg.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.B39-iEp4.js.map +0 -1
- /package/dist/assets/{cross.css → main.css} +0 -0
package/dist/card.js
CHANGED
package/dist/checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as t, a } from "./chunks/checkbox.
|
|
2
|
-
import { C as x } from "./chunks/checkbox-input.
|
|
3
|
-
import { c as B, B as c } from "./chunks/checkbox-group.
|
|
1
|
+
import { B as t, a } from "./chunks/checkbox.CVSzcaHk.js";
|
|
2
|
+
import { C as x } from "./chunks/checkbox-input.Ce0AY_e_.js";
|
|
3
|
+
import { c as B, B as c } from "./chunks/checkbox-group.CdMkjLu1.js";
|
|
4
4
|
export {
|
|
5
5
|
t as BentoCheckbox,
|
|
6
6
|
a as BentoCheckboxEvent,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineComponent as u, provide as x, toRef as h, ref as _, inject as g, computed as y, watch as l } from "vue";
|
|
2
|
+
import { n as m } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
3
|
+
import { B as E } from "./typography.CqQaHXhq.js";
|
|
4
|
+
import { C as O, a as T } from "./chevron-up.DqJmLciO.js";
|
|
5
|
+
import { g as p } from "./unique-id.XFfoKuc2.js";
|
|
6
|
+
import { o as N } from "./resize.Bqks3WUm.js";
|
|
7
|
+
import { u as S } from "./i18n.BQkEbtPM.js";
|
|
8
|
+
import { u as z } from "./use-expandable-content-height.GkjjbmPy.js";
|
|
9
|
+
import "../assets/accordion-item.css";
|
|
10
|
+
const f = Symbol("accordion title size injection key"), R = {}, $ = /* @__PURE__ */ u({
|
|
11
|
+
...R,
|
|
12
|
+
__name: "accordion",
|
|
13
|
+
props: {
|
|
14
|
+
/**
|
|
15
|
+
* Controls accordion title size.
|
|
16
|
+
* @values default, small
|
|
17
|
+
*/
|
|
18
|
+
titleSize: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "default"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(i) {
|
|
24
|
+
const e = i;
|
|
25
|
+
return x(f, h(e, "titleSize")), { __sfc: !0, props: e };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var B = function() {
|
|
29
|
+
var e = this, n = e._self._c;
|
|
30
|
+
return e._self._setupProxy, n("div", { staticClass: "b-accordion" }, [e._t("default")], 2);
|
|
31
|
+
}, A = [], D = /* @__PURE__ */ m(
|
|
32
|
+
$,
|
|
33
|
+
B,
|
|
34
|
+
A,
|
|
35
|
+
!1,
|
|
36
|
+
null,
|
|
37
|
+
"fb182a1c"
|
|
38
|
+
);
|
|
39
|
+
const G = D.exports, H = {
|
|
40
|
+
"en-US": {
|
|
41
|
+
collapse: "Collapse",
|
|
42
|
+
expand: "Expand"
|
|
43
|
+
},
|
|
44
|
+
"pt-BR": {
|
|
45
|
+
collapse: "Recolher",
|
|
46
|
+
expand: "Expandir"
|
|
47
|
+
},
|
|
48
|
+
"ja-JP": {
|
|
49
|
+
collapse: "折りたたむ",
|
|
50
|
+
expand: "展開"
|
|
51
|
+
}
|
|
52
|
+
}, M = {
|
|
53
|
+
i18n: { messages: H }
|
|
54
|
+
}, U = /* @__PURE__ */ u({
|
|
55
|
+
...M,
|
|
56
|
+
__name: "accordion-item",
|
|
57
|
+
props: {
|
|
58
|
+
/**
|
|
59
|
+
* Sets the title of the accordion item.
|
|
60
|
+
*/
|
|
61
|
+
title: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: !0
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Controls if the content is visible or hidden.
|
|
67
|
+
*/
|
|
68
|
+
isExpanded: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
emits: ["update:is-expanded"],
|
|
74
|
+
setup(i, { emit: e }) {
|
|
75
|
+
const n = i, t = "b-accordion-item__animation--content", { t: d } = S(), o = _(null), s = _(n.isExpanded), v = p("accordionItemButton"), b = p("accordionItemContent"), I = g(f, "default"), { updateContentHeight: r, contentHeight: c } = z(o, s), C = y(() => c.value ? { "max-height": c.value } : {});
|
|
76
|
+
return l(
|
|
77
|
+
() => n.isExpanded,
|
|
78
|
+
(a) => {
|
|
79
|
+
s.value = a;
|
|
80
|
+
}
|
|
81
|
+
), l(
|
|
82
|
+
() => o.value,
|
|
83
|
+
() => {
|
|
84
|
+
let a = null;
|
|
85
|
+
!a && o.value && (a = N(o.value, () => {
|
|
86
|
+
o.value && r();
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
), l(
|
|
90
|
+
s,
|
|
91
|
+
(a) => {
|
|
92
|
+
e("update:is-expanded", a), r();
|
|
93
|
+
},
|
|
94
|
+
{ immediate: !0 }
|
|
95
|
+
), { __sfc: !0, CONTENT_TRANSITION_NAME: t, props: n, emit: e, t: d, contentDiv: o, isOpen: s, buttonId: v, contentId: b, titleSize: I, updateContentHeight: r, contentHeight: c, contentMaxHeight: C, BentoTypography: E, ChevronDownIcon: O, ChevronUpIcon: T };
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var j = function() {
|
|
99
|
+
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
100
|
+
return n("div", { staticClass: "b-accordion-item" }, [n(t.BentoTypography, { attrs: { el: "h3", variant: t.titleSize === "small" ? "body" : "title", strongest: t.titleSize === "small" } }, [n("button", { staticClass: "b-accordion-item__button", attrs: { id: t.buttonId, "aria-controls": t.contentId, "aria-expanded": `${t.isOpen}`, type: "button" }, on: { click: function(d) {
|
|
101
|
+
t.isOpen = !t.isOpen;
|
|
102
|
+
} } }, [t.isOpen ? n(t.ChevronUpIcon, { staticClass: "b-accordion-item__icon", attrs: { "svg-title": t.t("collapse"), "aria-hidden": "true" } }) : n(t.ChevronDownIcon, { staticClass: "b-accordion-item__icon", attrs: { "svg-title": t.t("expand"), "aria-hidden": "true" } }), e._v(" " + e._s(e.title) + " ")], 1)]), n("Transition", { attrs: { name: t.CONTENT_TRANSITION_NAME } }, [t.isOpen ? n("div", { style: t.contentMaxHeight, attrs: { id: t.contentId, "aria-labelledby": t.buttonId, role: "region" } }, [n("div", { ref: "contentDiv", staticClass: "b-accordion-item__content" }, [e._t("default")], 2)]) : e._e()])], 1);
|
|
103
|
+
}, w = [], P = /* @__PURE__ */ m(
|
|
104
|
+
U,
|
|
105
|
+
j,
|
|
106
|
+
w,
|
|
107
|
+
!1,
|
|
108
|
+
null,
|
|
109
|
+
"5ae9b692"
|
|
110
|
+
);
|
|
111
|
+
const Q = P.exports;
|
|
112
|
+
export {
|
|
113
|
+
G as a,
|
|
114
|
+
Q as b
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=accordion-item.C0EeQmpM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-item.C0EeQmpM.js","sources":["../../src/components/accordion/accordion.keys.ts","../../src/components/accordion/accordion.vue","../../src/components/accordion/components/accordion-item.vue"],"sourcesContent":["export const ACCORDION_TITLE_SIZE_INJECTION_KEY = Symbol('accordion title size injection key');\n","<template>\n <div class=\"b-accordion\">\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { PropType, provide, toRef } from 'vue';\n\n import { ACCORDION_TITLE_SIZE_INJECTION_KEY } from './accordion.keys';\n\n import type { BentoAccordionTitleSize } from './accordion.types';\n\n const props = defineProps({\n /**\n * Controls accordion title size.\n * @values default, small\n */\n titleSize: {\n type: String as PropType<BentoAccordionTitleSize>,\n default: 'default',\n },\n });\n\n provide(ACCORDION_TITLE_SIZE_INJECTION_KEY, toRef(props, 'titleSize'));\n</script>\n\n<script lang=\"ts\">\n /**\n * An accordion is a vertical stack of interactive headers used to reveal or hide\n * sections of content associated with these headers.\n *\n * This component must only have `BentoAccordionItem` components in its default slot.\n *\n * Accordion items should be collapsed by default.\n *\n * @example\n * import { BentoAccordion, BentoAccordionItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAccordion, BentoAccordionItem },\n * template: `\n * <bento-accordion>\n * <bento-accordion-item title=\"Item 1\">\n * Content for item 1\n * </bento-accordion-item>\n * <bento-accordion-item title=\"Item 2\">\n * Content for item 2\n * </bento-accordion-item>\n * </bento-accordion>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./accordion.scss\" />\n","<template>\n <div class=\"b-accordion-item\">\n <bento-typography\n el=\"h3\"\n :variant=\"titleSize === 'small' ? 'body' : 'title'\"\n :strongest=\"titleSize === 'small'\"\n >\n <button\n :id=\"buttonId\"\n :aria-controls=\"contentId\"\n :aria-expanded=\"`${isOpen}`\"\n type=\"button\"\n class=\"b-accordion-item__button\"\n @click=\"isOpen = !isOpen\"\n >\n <chevron-up-icon\n v-if=\"isOpen\"\n class=\"b-accordion-item__icon\"\n :svg-title=\"t('collapse')\"\n aria-hidden=\"true\"\n />\n <chevron-down-icon v-else class=\"b-accordion-item__icon\" :svg-title=\"t('expand')\" aria-hidden=\"true\" />\n {{ title }}\n </button>\n </bento-typography>\n\n <Transition :name=\"CONTENT_TRANSITION_NAME\">\n <div v-if=\"isOpen\" :id=\"contentId\" :aria-labelledby=\"buttonId\" role=\"region\" :style=\"contentMaxHeight\">\n <div ref=\"contentDiv\" class=\"b-accordion-item__content\">\n <slot />\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, watch } from 'vue';\n\n import { BentoTypography } from '@/components/typography';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n import { generateUid } from '@/utils/ts/unique-id';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { ACCORDION_TITLE_SIZE_INJECTION_KEY } from '../accordion.keys';\n\n import type { BentoAccordionTitleSize } from '../accordion.types';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const CONTENT_TRANSITION_NAME = 'b-accordion-item__animation--content';\n\n const props = defineProps({\n /**\n * Sets the title of the accordion item.\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Controls if the content is visible or hidden.\n */\n isExpanded: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits([\"update:is-expanded\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentDiv = ref<HTMLDivElement>(null);\n const isOpen = ref(props.isExpanded);\n\n // Generating IDs\n const buttonId = generateUid('accordionItemButton');\n const contentId = generateUid('accordionItemContent');\n\n // Injecting prop from parent\n const titleSize = inject<`${BentoAccordionTitleSize}`>(ACCORDION_TITLE_SIZE_INJECTION_KEY, 'default');\n\n // Getting and setting the item height to be able to handle height animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, isOpen);\n\n const contentMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n watch(\n () => props.isExpanded,\n value => {\n isOpen.value = value;\n }\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n watch(\n isOpen,\n value => {\n // Enable two-way data binding for `isExpanded`\n emit('update:is-expanded', value);\n\n updateContentHeight();\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An accordion item is an interactive header used to reveal or hide a\n * section of content associated with this header.\n *\n * This component must always be wrapped by a `BentoAccordion` component.\n *\n * @example\n * import { BentoAccordion, BentoAccordionItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAccordion, BentoAccordionItem },\n * template: `\n * <bento-accordion>\n * <bento-accordion-item title=\"Item 1\">\n * Content for item 1\n * </bento-accordion-item>\n * <bento-accordion-item title=\"Item 2\">\n * Content for item 2\n * </bento-accordion-item>\n * </bento-accordion>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./accordion-item.scss\" />\n"],"names":["ACCORDION_TITLE_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","__default__","messages","CONTENT_TRANSITION_NAME","t","useI18n","contentDiv","ref","isOpen","buttonId","generateUid","contentId","titleSize","inject","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","computed","watch","value","observer","observeSizeOfElement","emit"],"mappings":";;;;;;;;;AAAa,MAAAA,IAAA,OAAA,oCAAA,GCqDTC,IAAA,CAAA;;;;;;;;;;;;;;;AA7BA,WAAAC,EAAAF,GAAAG,EAAAC,GAAA,WAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GCgIAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;iBAlGAC,IAAA,wCAqBA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAGAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAAP,EAAA,UAAA,GAGAS,IAAAC,EAAA,qBAAA,GACAC,IAAAD,EAAA,sBAAA,GAGAE,IAAAC,EAAAjB,GAAA,SAAA,GAGA,EAAA,qBAAAkB,GAAA,eAAAC,EAAA,IAAAC,EAAAV,GAAAE,CAAA,GAEAS,IAAAC,EAAA,MAAAH,EAAA,QAAA,EAAA,cAAAA,EAAA,MAAA,IAAA,CAAA,CAAA;AAEA,WAAAI;AAAA,MAAA,MAAAnB,EAAA;AAAA,MACgB,CAAAoB,MAAA;AAER,QAAAZ,EAAA,QAAAY;AAAA,MAAe;AAAA,IACnB,GAGJD;AAAA,MAAA,MAAAb,EAAA;AAAA,MACqB,MAAA;AAEb,YAAAe,IAAA;AACA,QAAA,CAAAA,KAAAf,EAAA,UACIe,IAAAC,EAAAhB,EAAA,OAAA,MAAA;AACI,UAAAA,EAAA,SACIQ,EAAA;AAAA,QACJ,CAAA;AAAA,MAER;AAAA,IACJ,GAGJK;AAAA,MAAAX;AAAA,MACI,CAAAY,MAAA;AAGI,QAAAG,EAAA,sBAAAH,CAAA,GAEAN,EAAA;AAAA,MAAoB;AAAA,MACxB,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as x, computed as c, ref as b, toRefs as O, watch as g, provide as
|
|
2
|
-
import { B as
|
|
1
|
+
import { defineComponent as x, computed as c, ref as b, toRefs as O, watch as g, provide as P, nextTick as B } from "vue";
|
|
2
|
+
import { B as V } from "./button.B1JELmx-.js";
|
|
3
3
|
import { B as R } from "./typography.CqQaHXhq.js";
|
|
4
|
-
import { B as F } from "./button-actions-with-menu.
|
|
5
|
-
import { C as W } from "./cross.
|
|
4
|
+
import { B as F } from "./button-actions-with-menu.GyJNwaZ5.js";
|
|
5
|
+
import { C as W } from "./cross.CJ5EEL2c.js";
|
|
6
6
|
import { u as L } from "./i18n.BQkEbtPM.js";
|
|
7
7
|
import { u as k } from "./index.iCshT3Hx.js";
|
|
8
|
-
import { P as M } from "./popover.
|
|
9
|
-
import { B as U } from "./button-actions.
|
|
8
|
+
import { P as M } from "./popover.DFWeWyxd.js";
|
|
9
|
+
import { B as U } from "./button-actions.fnn5w4Jz.js";
|
|
10
10
|
import { n as z } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
11
11
|
import "../assets/action-bar.css";
|
|
12
12
|
const D = {
|
|
@@ -17,10 +17,24 @@ const D = {
|
|
|
17
17
|
save: "Save",
|
|
18
18
|
selected: "selected",
|
|
19
19
|
unsavedChanges: "unsaved change | unsaved changes"
|
|
20
|
+
},
|
|
21
|
+
"pt-BR": {
|
|
22
|
+
cancel: "Cancelar",
|
|
23
|
+
close: "Fechar",
|
|
24
|
+
save: "Salvar",
|
|
25
|
+
selected: "selecionados",
|
|
26
|
+
unsavedChanges: "alteração não salva | alterações não salvas"
|
|
27
|
+
},
|
|
28
|
+
"ja-JP": {
|
|
29
|
+
cancel: "キャンセル",
|
|
30
|
+
close: "閉じる",
|
|
31
|
+
save: "保存",
|
|
32
|
+
selected: "選択済み",
|
|
33
|
+
unsavedChanges: "未保存の変更"
|
|
20
34
|
}
|
|
21
35
|
}, G = {
|
|
22
36
|
i18n: { messages: D }
|
|
23
|
-
},
|
|
37
|
+
}, J = /* @__PURE__ */ x({
|
|
24
38
|
...G,
|
|
25
39
|
__name: "action-bar",
|
|
26
40
|
props: {
|
|
@@ -45,7 +59,7 @@ const D = {
|
|
|
45
59
|
visibleActions: {
|
|
46
60
|
type: Number,
|
|
47
61
|
default: 4,
|
|
48
|
-
validator: (
|
|
62
|
+
validator: (o) => o > 0 && o <= 4
|
|
49
63
|
},
|
|
50
64
|
/**
|
|
51
65
|
* Use when there are sticky elements at the bottom, like sticky pagination
|
|
@@ -78,12 +92,12 @@ const D = {
|
|
|
78
92
|
}
|
|
79
93
|
},
|
|
80
94
|
emits: ["close", "cancel", "save"],
|
|
81
|
-
setup(
|
|
82
|
-
const
|
|
95
|
+
setup(o, { emit: e }) {
|
|
96
|
+
const a = o, t = 100, v = 7, C = 500, m = 32, { t: r, tc: S } = L(), E = c(() => a.selectionLabel ? a.selectionLabel : r("selected")), l = b(null), { extraBottomSpacing: y, visibleActions: A } = O(a), { width: i } = k(), n = b(null), u = b(null), h = c(() => a.variant === "confirmation");
|
|
83
97
|
g(
|
|
84
98
|
() => A.value,
|
|
85
|
-
(
|
|
86
|
-
u.value =
|
|
99
|
+
(s) => {
|
|
100
|
+
u.value = s <= 4 ? s : 4, n.value = u.value;
|
|
87
101
|
},
|
|
88
102
|
{ immediate: !0 }
|
|
89
103
|
);
|
|
@@ -91,57 +105,57 @@ const D = {
|
|
|
91
105
|
"b-action-bar--extra-spacing": y.value,
|
|
92
106
|
"b-action-bar--confirmation": h.value
|
|
93
107
|
}));
|
|
94
|
-
|
|
108
|
+
P(M, v);
|
|
95
109
|
const T = c(() => {
|
|
96
|
-
const
|
|
110
|
+
const s = a.actions.map((w) => ({
|
|
97
111
|
...w,
|
|
98
112
|
variant: "secondary"
|
|
99
|
-
})),
|
|
100
|
-
return [...
|
|
113
|
+
})), _ = s.slice(0, n.value).reverse(), f = s.slice(n.value);
|
|
114
|
+
return [..._, ...f];
|
|
101
115
|
}), N = c(() => [
|
|
102
116
|
{
|
|
103
117
|
title: r("save"),
|
|
104
|
-
event: () =>
|
|
118
|
+
event: () => e("save")
|
|
105
119
|
},
|
|
106
120
|
{
|
|
107
121
|
title: r("cancel"),
|
|
108
122
|
variant: "secondary",
|
|
109
|
-
event: () =>
|
|
123
|
+
event: () => e("cancel")
|
|
110
124
|
}
|
|
111
|
-
]),
|
|
112
|
-
await B(), i.value > l.value.clientWidth +
|
|
113
|
-
},
|
|
114
|
-
await B(), i.value < l.value.clientWidth +
|
|
125
|
+
]), d = async () => {
|
|
126
|
+
await B(), i.value > l.value.clientWidth + m + t && n.value < u.value && (n.value += 1, d());
|
|
127
|
+
}, p = async () => {
|
|
128
|
+
await B(), i.value < l.value.clientWidth + m && n.value > 0 && (n.value -= 1, p());
|
|
115
129
|
};
|
|
116
130
|
return g(
|
|
117
131
|
() => i.value,
|
|
118
|
-
async (
|
|
132
|
+
async (s, _) => {
|
|
119
133
|
if (await B(), !l.value)
|
|
120
134
|
return;
|
|
121
|
-
const
|
|
122
|
-
i.value < C ?
|
|
135
|
+
const f = s > _;
|
|
136
|
+
i.value < C ? n.value = 0 : f ? d() : p();
|
|
123
137
|
},
|
|
124
138
|
{ immediate: !0 }
|
|
125
|
-
), { __sfc: !0, AVERAGE_BUTTON_SIZE: t, MENU_OFFSET:
|
|
139
|
+
), { __sfc: !0, AVERAGE_BUTTON_SIZE: t, MENU_OFFSET: v, RESPONSIVE_BREAKPOINT: C, SPACING: m, props: a, emit: e, t: r, tc: S, label: E, actionBar: l, extraBottomSpacing: y, visibleActions: A, width: i, internalDisplayedActions: n, internalVisibleActions: u, isConfirmationVariant: h, conditionalClasses: I, actionsInternal: T, confirmationActions: N, showActions: d, hideActions: p, BentoButton: V, BentoButtonActions: U, BentoTypography: R, ButtonActionsWithMenu: F, CrossIcon: W };
|
|
126
140
|
}
|
|
127
141
|
});
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
return
|
|
142
|
+
var K = function() {
|
|
143
|
+
var e = this, a = e._self._c, t = e._self._setupProxy;
|
|
144
|
+
return a("Transition", { attrs: { name: "b-action-bar__animation", appear: "" } }, [a("section", { staticClass: "b-action-bar", class: t.conditionalClasses, attrs: { "aria-label": t.t("actionBar") } }, [a("div", { ref: "actionBar", staticClass: "b-action-bar__container" }, [t.isConfirmationVariant ? e._e() : a("div", { staticClass: "b-action-bar__close-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", inverse: "", "aria-label": t.t("close") }, on: { click: function(v) {
|
|
131
145
|
return t.emit("close");
|
|
132
|
-
} }, scopedSlots:
|
|
133
|
-
return [
|
|
134
|
-
}, proxy: !0 }], null, !1, 4214210411) })], 1),
|
|
135
|
-
},
|
|
136
|
-
K,
|
|
137
|
-
q,
|
|
146
|
+
} }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
147
|
+
return [a(t.CrossIcon, { attrs: { "aria-hidden": !0 } })];
|
|
148
|
+
}, proxy: !0 }], null, !1, 4214210411) })], 1), a(t.BentoTypography, { staticClass: "b-action-bar__selection", attrs: { el: "span", stronger: "" } }, [e._v(" " + e._s(e.itemCounter) + " " + e._s(t.isConfirmationVariant ? t.tc("unsavedChanges", e.itemCounter) : t.label) + " ")]), t.isConfirmationVariant ? a(t.BentoButtonActions, { staticClass: "b-action-bar__actions", attrs: { actions: t.confirmationActions, inverse: "" } }) : a(t.ButtonActionsWithMenu, { staticClass: "b-action-bar__actions", attrs: { actions: t.actionsInternal, "displayed-actions": t.internalDisplayedActions, "menu-position": "top-end", inverse: "" } })], 1)])]);
|
|
149
|
+
}, j = [], q = /* @__PURE__ */ z(
|
|
138
150
|
J,
|
|
151
|
+
K,
|
|
152
|
+
j,
|
|
139
153
|
!1,
|
|
140
154
|
null,
|
|
141
155
|
"be92816e"
|
|
142
156
|
);
|
|
143
|
-
const
|
|
157
|
+
const st = q.exports;
|
|
144
158
|
export {
|
|
145
|
-
|
|
159
|
+
st as B
|
|
146
160
|
};
|
|
147
|
-
//# sourceMappingURL=action-bar.
|
|
161
|
+
//# sourceMappingURL=action-bar.CTS-sRPZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.CsRmYQ-k.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;GA8OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"action-bar.CTS-sRPZ.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { defineComponent as I, useSlots as y, computed as r, onMounted as T } from "vue";
|
|
2
2
|
import { c as S, a as c, B as b } from "./typography.CqQaHXhq.js";
|
|
3
|
-
import { B as H } from "./button.
|
|
4
|
-
import { C as B } from "./cross-small.
|
|
5
|
-
import { W as w } from "./warning-filled.
|
|
6
|
-
import { C as L } from "./cross-circle-fill.
|
|
7
|
-
import { C as
|
|
3
|
+
import { B as H } from "./button.B1JELmx-.js";
|
|
4
|
+
import { C as B } from "./cross-small.CZqsjZDz.js";
|
|
5
|
+
import { W as w } from "./warning-filled.Cd0kVWwa.js";
|
|
6
|
+
import { C as L } from "./cross-circle-fill.BawVYNw7.js";
|
|
7
|
+
import { C as R } from "./checkmark-circle-fill.By9RNf5T.js";
|
|
8
|
+
/* empty css */
|
|
8
9
|
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
10
|
+
import { u as E } from "./use-has-slot.C9lQZ6nz.js";
|
|
11
|
+
import { u as G } from "./i18n.BQkEbtPM.js";
|
|
11
12
|
import "../assets/alert.css";
|
|
12
|
-
var
|
|
13
|
+
var i = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.TIP = "tip", e))(i || {}), o = /* @__PURE__ */ ((e) => (e.WARNING = "warning", e.CRITICAL = "critical", e.HIGHLIGHT = "highlight", e.SUCCESS = "success", e))(o || {}), u = /* @__PURE__ */ ((e) => (e.CLOSE_ALERT = "close-alert", e))(u || {});
|
|
13
14
|
let _ = 0;
|
|
14
15
|
const V = {
|
|
15
16
|
beforeCreate() {
|
|
@@ -27,44 +28,50 @@ var $ = function() {
|
|
|
27
28
|
null,
|
|
28
29
|
null
|
|
29
30
|
);
|
|
30
|
-
const
|
|
31
|
+
const F = P.exports, k = {
|
|
31
32
|
"en-US": {
|
|
32
33
|
highlightIcon: "Highlight icon",
|
|
33
34
|
successIcon: "Success icon",
|
|
34
35
|
criticalIcon: "Critical icon",
|
|
35
36
|
warningIcon: "Warning icon",
|
|
36
37
|
close: "Close"
|
|
38
|
+
},
|
|
39
|
+
"pt-BR": {
|
|
40
|
+
close: "Fechar"
|
|
41
|
+
},
|
|
42
|
+
"ja-JP": {
|
|
43
|
+
close: "閉じる"
|
|
37
44
|
}
|
|
38
|
-
},
|
|
39
|
-
i18n: { messages:
|
|
45
|
+
}, x = {
|
|
46
|
+
i18n: { messages: k },
|
|
40
47
|
name: "bento-alert"
|
|
41
48
|
}, N = /* @__PURE__ */ I({
|
|
42
|
-
...
|
|
49
|
+
...x,
|
|
43
50
|
props: {
|
|
44
51
|
closeButton: { type: Boolean, default: !1 },
|
|
45
52
|
type: { default: o.HIGHLIGHT },
|
|
46
|
-
variant: { default:
|
|
53
|
+
variant: { default: i.DEFAULT }
|
|
47
54
|
},
|
|
48
55
|
emits: ["close-alert"],
|
|
49
56
|
setup(e, { emit: s }) {
|
|
50
|
-
const t = e, a = y(), C =
|
|
57
|
+
const t = e, a = y(), C = E(a), { t: l } = G(), n = r(() => t.variant === i.TIP), d = r(() => ({
|
|
51
58
|
[`b-alert--${t.type}`]: t.type,
|
|
52
|
-
[`b-alert--${
|
|
59
|
+
[`b-alert--${i.TIP}`]: n.value
|
|
53
60
|
})), f = r(() => l(`${t.type}Icon`)), m = r(() => {
|
|
54
61
|
switch (t.type) {
|
|
55
62
|
case o.CRITICAL:
|
|
56
63
|
return L;
|
|
57
64
|
case o.SUCCESS:
|
|
58
|
-
return
|
|
65
|
+
return R;
|
|
59
66
|
case o.WARNING:
|
|
60
67
|
return w;
|
|
61
68
|
case o.HIGHLIGHT:
|
|
62
69
|
default:
|
|
63
|
-
return
|
|
70
|
+
return F;
|
|
64
71
|
}
|
|
65
72
|
}), h = r(() => ({
|
|
66
73
|
el: S.DIV,
|
|
67
|
-
variant:
|
|
74
|
+
variant: n.value ? c.CAPTION : c.BODY,
|
|
68
75
|
wide: !0
|
|
69
76
|
})), g = r(() => t.type === o.HIGHLIGHT ? "status" : "alert"), v = () => {
|
|
70
77
|
s(u.CLOSE_ALERT);
|
|
@@ -72,7 +79,7 @@ const k = P.exports, x = {
|
|
|
72
79
|
return T(() => {
|
|
73
80
|
if (!a.default && !a.description)
|
|
74
81
|
throw new Error("Alert Component requires a title or a description");
|
|
75
|
-
}), { __sfc: !0, slots: a, hasSlot: C, emit: s, props: t, t: l, isTipVariant:
|
|
82
|
+
}), { __sfc: !0, slots: a, hasSlot: C, emit: s, props: t, t: l, isTipVariant: n, alertConditionalClasses: d, iconSvgTitle: f, iconComponent: m, descriptionTypography: h, computedRole: g, onCloseButtonClick: v, BentoTypography: b, BentoButton: H, CrossSmall: B };
|
|
76
83
|
}
|
|
77
84
|
});
|
|
78
85
|
var U = function() {
|
|
@@ -86,11 +93,11 @@ var U = function() {
|
|
|
86
93
|
null,
|
|
87
94
|
"2c793db1"
|
|
88
95
|
);
|
|
89
|
-
const
|
|
96
|
+
const tt = D.exports;
|
|
90
97
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
tt as B,
|
|
99
|
+
i as a,
|
|
93
100
|
o as b,
|
|
94
101
|
u as c
|
|
95
102
|
};
|
|
96
|
-
//# sourceMappingURL=alert.
|
|
103
|
+
//# sourceMappingURL=alert.BOAVcKqt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.BOAVcKqt.js","sources":["../../src/components/alert/alert.types.ts","../../../../node_modules/.pnpm/@adyen+ui-assets-icons-16@6.0.2_vue@2.7.16/node_modules/@adyen/ui-assets-icons-16/dist/vue/info-filled.vue","../../src/components/alert/alert.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoAlertVariant {\n DEFAULT = 'default',\n TIP = 'tip',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoAlertTypeOption {\n WARNING = 'warning',\n CRITICAL = 'critical',\n HIGHLIGHT = 'highlight',\n SUCCESS = 'success',\n}\n\n/**\n * @deprecated from version 2.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><g :clip-path=\"'url(#uia-icons-16-info_filled__a' + uuid + ')'\"><path fill=\"#00112C\" d=\"M5.0342 0.839937C6.45033 0.253358 8.00859 0.0998821 9.51195 0.398918C11.0153 0.697953 12.3962 1.43607 13.4801 2.51993C14.5639 3.60378 15.3021 4.9847 15.6011 6.48805C15.9001 7.99141 15.7466 9.54967 15.1601 10.9658C14.5735 12.3819 13.5801 13.5923 12.3057 14.4439C11.0312 15.2955 9.53281 15.75 8 15.75C5.94457 15.75 3.97333 14.9335 2.51992 13.4801C1.06652 12.0267 0.25 10.0554 0.25 8C0.25 6.4672 0.704529 4.96881 1.55611 3.69433C2.40769 2.41985 3.61808 1.42652 5.0342 0.839937ZM8.75 4.5C8.75 4.23478 8.64464 3.98043 8.45711 3.79289C8.26957 3.60536 8.01522 3.5 7.75 3.5C7.55222 3.5 7.35888 3.55865 7.19443 3.66853C7.02998 3.77841 6.90181 3.93459 6.82612 4.11732C6.75043 4.30004 6.73063 4.50111 6.76921 4.69509C6.8078 4.88907 6.90304 5.06725 7.04289 5.20711C7.18275 5.34696 7.36093 5.4422 7.55491 5.48079C7.74889 5.51937 7.94996 5.49957 8.13268 5.42388C8.31541 5.34819 8.47159 5.22002 8.58147 5.05557C8.69135 4.89112 8.75 4.69778 8.75 4.5ZM8.75 6.25H6.25V7.75H7.25V10.25H6.25V11.75H9.75V10.25H8.75V6.25Z\"/></g><defs><clipPath :id=\"'uia-icons-16-info_filled__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\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 && !isTipVariant\"\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([\"close-alert\"]);\n\n const props = defineProps({\n closeButton: { type: Boolean, default: false },\n type: { default: BentoAlertTypeOption.HIGHLIGHT },\n variant: { default: BentoAlertVariant.DEFAULT }\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","uuid","_sfc_main$1","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","isTipVariant","computed","props","alertConditionalClasses","iconSvgTitle","iconComponent","CrossCircleFillIcon","CheckmarkIcon","WarningIcon","Info","descriptionTypography","BentoTypographyElement","BentoTypographyVariant","computedRole","onCloseButtonClick","emit","onMounted"],"mappings":";;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA;ACdZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GC8HIE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;iBA3EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAUA,EAAA,GAAAI,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAC,EAAA,YAAAlB,EAAA,GAAA,GAEAmB,IAAAF,EAAA,OAAA;AAAA,MAAgD,CAAA,YAAAC,EAAA,IAAA,EAAA,GAAAA,EAAA;AAAA,MACV,CAAA,YAAAlB,EAAA,GAAA,EAAA,GAAAgB,EAAA;AAAA,IACkB,EAAA,GAGxDI,IAAAH,EAAA,MAAAH,EAAA,GAAAI,EAAA,IAAA,MAAA,CAAA,GAEAG,IAAAJ,EAAA,MAAA;AACI,cAAAC,EAAA,MAAA;AAAA,QAAoB,KAAAhB,EAAA;AAEZ,iBAAAoB;AAAA,QAAO,KAAApB,EAAA;AAEP,iBAAAqB;AAAA,QAAO,KAAArB,EAAA;AAEP,iBAAAsB;AAAA,QAAO,KAAAtB,EAAA;AAAA,QACe;AAEtB,iBAAAuB;AAAA,MAAO;AAAA,IACf,CAAA,GAGJC,IAAAT,EAAA,OAAA;AAAA,MAA8C,IAAAU,EAAA;AAAA,MACf,SAAAX,EAAA,QAAAY,EAAA,UAAAA,EAAA;AAAA,MAC2D,MAAA;AAAA,IAChF,EAAA,GAGVC,IAAAZ,EAAA,MAAAC,EAAA,SAAAhB,EAAA,YAAA,WAAA,OAAA,GAEA4B,IAAA,MAAA;AACI,MAAAC,EAAA3B,EAAA,WAAA;AAAA,IAAgC;AAGpC,WAAA4B,EAAA,MAAA;AACI,UAAA,CAAAtB,EAAA,WAAA,CAAAA,EAAA;AACI,cAAA,IAAA,MAAA,mDAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|
|
@@ -3,7 +3,7 @@ import { B as p } from "./typography.CqQaHXhq.js";
|
|
|
3
3
|
import "./index.Cl4_42j5.js";
|
|
4
4
|
import { n as v } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import "../assets/avatar.css";
|
|
6
|
-
const
|
|
6
|
+
const d = (t) => {
|
|
7
7
|
const a = b(t);
|
|
8
8
|
return n(() => a.value ? a.value.trim().charAt(0).toUpperCase() : null);
|
|
9
9
|
};
|
|
@@ -18,7 +18,7 @@ const L = {}, y = /* @__PURE__ */ _({
|
|
|
18
18
|
variant: { default: o.LARGE }
|
|
19
19
|
},
|
|
20
20
|
setup(t) {
|
|
21
|
-
const a = t, { username: r } = m(a), e =
|
|
21
|
+
const a = t, { username: r } = m(a), e = d(r), c = n(() => ({
|
|
22
22
|
[`b-avatar-image--${o.SMALL}`]: a.variant === o.SMALL,
|
|
23
23
|
[`b-avatar-image--${a.color}`]: a.color
|
|
24
24
|
}));
|
|
@@ -27,14 +27,14 @@ const L = {}, y = /* @__PURE__ */ _({
|
|
|
27
27
|
});
|
|
28
28
|
var g = function() {
|
|
29
29
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
30
|
-
return r("div", { staticClass: "b-avatar-image", class: e.conditionalClasses, attrs: { "aria-hidden": "true", "data-testid": "avatar" } }, [a.src ? r("img", { staticClass: "b-avatar-image__image", attrs: { src: a.src, alt: "
|
|
30
|
+
return r("div", { staticClass: "b-avatar-image", class: e.conditionalClasses, attrs: { "aria-hidden": "true", "data-testid": "avatar" } }, [a.src ? r("img", { staticClass: "b-avatar-image__image", attrs: { src: a.src, alt: "", "data-testid": "avatar-content" } }) : r("div", { staticClass: "b-avatar-image__default", attrs: { "data-testid": "avatar-content" } }, [r(e.BentoTypography, { attrs: { el: "span", variant: "body", strongest: "" } }, [a._v(" " + a._s(e.initials) + " ")])], 1)]);
|
|
31
31
|
}, C = [], E = /* @__PURE__ */ v(
|
|
32
32
|
y,
|
|
33
33
|
g,
|
|
34
34
|
C,
|
|
35
35
|
!1,
|
|
36
36
|
null,
|
|
37
|
-
"
|
|
37
|
+
"7cac2ac2"
|
|
38
38
|
);
|
|
39
39
|
const h = E.exports, A = {
|
|
40
40
|
name: "bento-avatar"
|
|
@@ -46,11 +46,11 @@ const h = E.exports, A = {
|
|
|
46
46
|
username: null
|
|
47
47
|
},
|
|
48
48
|
setup(t) {
|
|
49
|
-
const a = t, { username: r } = m(a), e = n(() => a.iconOnly ? a.username : null), c = n(() => a.src ? null : a.username), u =
|
|
49
|
+
const a = t, { username: r } = m(a), e = n(() => a.iconOnly ? a.username : null), c = n(() => a.src ? null : a.username), u = d(r), l = n(() => u.value ? u.value.charCodeAt(0) - 65 : null), f = n(() => {
|
|
50
50
|
const i = 26 / Object.keys(s).length;
|
|
51
51
|
return l.value <= i ? s.YELLOW : l.value <= i * 2 ? s.BLUE : l.value <= i * 3 ? s.GREEN : s.RED;
|
|
52
52
|
});
|
|
53
|
-
return { __sfc: !0, props: a, username: r, computedAriaLabel: e, computedUsername: c, initials: u, charCode: l, avatarColor:
|
|
53
|
+
return { __sfc: !0, props: a, username: r, computedAriaLabel: e, computedUsername: c, initials: u, charCode: l, avatarColor: f, AvatarImage: h, BentoAvatarImageVariant: o, BentoTypography: p };
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
var R = function() {
|
|
@@ -64,8 +64,8 @@ var R = function() {
|
|
|
64
64
|
null,
|
|
65
65
|
"2be0bf91"
|
|
66
66
|
);
|
|
67
|
-
const
|
|
67
|
+
const W = B.exports;
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
W as B
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=avatar.
|
|
71
|
+
//# sourceMappingURL=avatar.qcWk9clF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.qcWk9clF.js","sources":["../../src/composables/initials.ts","../../src/components/avatar/components/avatar-image/avatar-image.types.ts","../../src/components/avatar/components/avatar-image/avatar-image.vue","../../src/components/avatar/avatar.vue"],"sourcesContent":["import { computed, ComputedRef, ref } from 'vue';\nimport { MaybeRef } from '@/types';\n\n/** Extracts the first letter of a username\n * @param username - The name to return the initials of\n * Common patterns:\n * 1. John => J\n * 2. John Smith => J\n * John Smith Doe Holly => J\n */\nexport const useInitials = (username: MaybeRef<string | null>): ComputedRef<string | null> => {\n const computedUsername = ref(username);\n return computed(() => (computedUsername.value ? computedUsername.value.trim().charAt(0).toUpperCase() : null));\n};\n","export enum BentoAvatarImageVariant {\n LARGE = 'large',\n SMALL = 'small',\n}\n\nexport enum BentoAvatarImageColor {\n BLUE = 'blue',\n GREEN = 'green',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-avatar-image\" :class=\"conditionalClasses\" aria-hidden=\"true\" data-testid=\"avatar\">\n <img v-if=\"src\" :src=\"src\" class=\"b-avatar-image__image\" alt=\"\" data-testid=\"avatar-content\" />\n <div v-else class=\"b-avatar-image__default\" data-testid=\"avatar-content\">\n <bento-typography el=\"span\" variant=\"body\" strongest>\n {{ initials }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { BentoAvatarImageColor, BentoAvatarImageVariant } from './avatar-image.types';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = defineProps({\n color: { default: BentoAvatarImageColor.YELLOW },\n src: { default: null },\n username: { default: null },\n variant: { default: BentoAvatarImageVariant.LARGE }\n});\n\n const { username } = toRefs(props);\n const initials = useInitials(username);\n\n const conditionalClasses = computed(() => ({\n [`b-avatar-image--${BentoAvatarImageVariant.SMALL}`]: props.variant === BentoAvatarImageVariant.SMALL,\n [`b-avatar-image--${props.color}`]: props.color,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Image used as user profile inside bento-avatar.\n *\n * @example\n * import { AvatarImage } from './components/avatar-image';\n *\n * export default {\n * components: { AvatarImage },\n * template: `<avatar-image :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar-image.scss\" />\n","<template>\n <div class=\"b-avatar\" :aria-label=\"computedAriaLabel\">\n <avatar-image\n :src=\"src\"\n :username=\"computedUsername\"\n :variant=\"BentoAvatarImageVariant.SMALL\"\n :color=\"avatarColor\"\n />\n <bento-typography v-if=\"!iconOnly\" class=\"b-avatar__label\" el=\"span\" variant=\"body\">\n {{ username }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { AvatarImage, BentoAvatarImageColor, BentoAvatarImageVariant } from './components/avatar-image';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = defineProps({\n iconOnly: { type: Boolean, default: false },\n src: { default: null },\n username: null\n});\n\n const { username } = toRefs(props);\n\n const computedAriaLabel = computed(() => (props.iconOnly ? props.username : null));\n const computedUsername = computed(() => (!props.src ? props.username : null));\n const initials = useInitials(username);\n\n // Returns the UTF-16 char code\n const charCode = computed(() => (initials.value ? initials.value.charCodeAt(0) - 65 : null));\n\n // Returns a computed color based on the letter passed\n const avatarColor = computed(() => {\n const numberOfAlphabetLetters = 26;\n const numberOfColors = Object.keys(BentoAvatarImageColor).length;\n const rangeStep = numberOfAlphabetLetters / numberOfColors;\n\n if (charCode.value <= rangeStep) {\n return BentoAvatarImageColor.YELLOW;\n }\n if (charCode.value <= rangeStep * 2) {\n return BentoAvatarImageColor.BLUE;\n }\n if (charCode.value <= rangeStep * 3) {\n return BentoAvatarImageColor.GREEN;\n }\n return BentoAvatarImageColor.RED;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Displays an user profile including an avatar and optionally a label.\n *\n * @example\n * import { BentoAvatar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAvatar },\n * template: `<bento-avatar :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {\n name: 'bento-avatar',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar.scss\" />\n"],"names":["useInitials","username","computedUsername","ref","computed","BentoAvatarImageVariant","BentoAvatarImageVariant2","BentoAvatarImageColor","BentoAvatarImageColor2","__default__$1","toRefs","props","initials","conditionalClasses","__default__","computedAriaLabel","charCode","avatarColor","rangeStep"],"mappings":";;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAAC,IAAAC,EAAAF,CAAA;AACA,SAAAG,EAAA,MAAAF,EAAA,QAAAA,EAAA,MAAA,KAAA,EAAA,OAAA,CAAA,EAAA,YAAA,IAAA,IAAA;AACJ;ACbY,IAAAG,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UAJQA,IAAAD,KAAA,CAAA,CAAA;ACwCR,MAAAE,IAAA,CAAA;;;;;;;;;;iBArBA,EAAA,UAAAR,EAAA,IAAAS,EAAAC,CAAA,GACAC,IAAAZ,EAAAC,CAAA,GAEAY,IAAAT,EAAA,OAAA;AAAA,MAA2C,CAAA,mBAAAC,EAAA,KAAA,EAAA,GAAAM,EAAA,YAAAN,EAAA;AAAA,MACyD,CAAA,mBAAAM,EAAA,KAAA,EAAA,GAAAA,EAAA;AAAA,IACtD,EAAA;;;;;;;;;;;;;;;qBCqC9CG,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;iBA1CA,EAAA,UAAAb,EAAA,IAAAS,EAAAC,CAAA,GAEAI,IAAAX,EAAA,MAAAO,EAAA,WAAAA,EAAA,WAAA,IAAA,GACAT,IAAAE,EAAA,MAAAO,EAAA,MAAA,OAAAA,EAAA,QAAA,GACAC,IAAAZ,EAAAC,CAAA,GAGAe,IAAAZ,EAAA,MAAAQ,EAAA,QAAAA,EAAA,MAAA,WAAA,CAAA,IAAA,KAAA,IAAA,GAGAK,IAAAb,EAAA,MAAA;AAGI,YAAAc,IAAA,KADA,OAAA,KAAAX,CAAA,EAAA;AAGA,aAAAS,EAAA,SAAAE,IACIX,EAAA,SAEJS,EAAA,SAAAE,IAAA,IACIX,EAAA,OAEJS,EAAA,SAAAE,IAAA,IACIX,EAAA,QAEJA,EAAA;AAAA,IAA6B,CAAA;;;;;;;;;;;;;;;;"}
|