@adyen/bento-vue3 1.69.0 → 1.70.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 +250 -823
- 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/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.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/controls-group.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/info-icon.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/loading-indicator.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/popper-container.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/tag.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/toggle-button.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/assets/typography.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +2 -2
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.H062lKz1.js → accordion-item.6etqAJV9.js} +2 -2
- package/dist/chunks/{accordion-item.H062lKz1.js.map → accordion-item.6etqAJV9.js.map} +1 -1
- package/dist/chunks/{action-bar.CbO7oNER.js → action-bar.CweA2FeY.js} +5 -5
- package/dist/chunks/{action-bar.CbO7oNER.js.map → action-bar.CweA2FeY.js.map} +1 -1
- package/dist/chunks/alert.Dzx5MzgE.js +171 -0
- package/dist/chunks/alert.Dzx5MzgE.js.map +1 -0
- package/dist/chunks/{avatar.BtxoYBvq.js → avatar.Dq59yj6m.js} +2 -2
- package/dist/chunks/{avatar.BtxoYBvq.js.map → avatar.Dq59yj6m.js.map} +1 -1
- package/dist/chunks/{base-button.Bcwm87OM.js → base-button.CjYb5Y8k.js} +2 -2
- package/dist/chunks/{base-button.Bcwm87OM.js.map → base-button.CjYb5Y8k.js.map} +1 -1
- package/dist/chunks/{base-modal.7vdoT8zp.js → base-modal.BrBcILSe.js} +6 -6
- package/dist/chunks/{base-modal.7vdoT8zp.js.map → base-modal.BrBcILSe.js.map} +1 -1
- package/dist/chunks/bin.DuHlEQBO.js +37 -0
- package/dist/chunks/bin.DuHlEQBO.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.zdsGh7un.js → button-actions-with-menu.CBuoSd3w.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.zdsGh7un.js.map → button-actions-with-menu.CBuoSd3w.js.map} +1 -1
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/{button.wMNce6wZ.js → button.C-MAa6ut.js} +4 -4
- package/dist/chunks/{button.wMNce6wZ.js.map → button.C-MAa6ut.js.map} +1 -1
- package/dist/chunks/{calendar.CYrrR8wd.js → calendar.DFHiga9k.js} +32 -32
- package/dist/chunks/{calendar.CYrrR8wd.js.map → calendar.DFHiga9k.js.map} +1 -1
- package/dist/chunks/{card.CNYYIpQW.js → card.BspLDcas.js} +4 -4
- package/dist/chunks/{card.CNYYIpQW.js.map → card.BspLDcas.js.map} +1 -1
- package/dist/chunks/{checkbox-group.fX5_d3XZ.js → checkbox-group.DIXgr1WQ.js} +6 -6
- package/dist/chunks/{checkbox-group.fX5_d3XZ.js.map → checkbox-group.DIXgr1WQ.js.map} +1 -1
- package/dist/chunks/{checkbox-input.B1hV3DU-.js → checkbox-input.BXNGT9U0.js} +2 -2
- package/dist/chunks/{checkbox-input.B1hV3DU-.js.map → checkbox-input.BXNGT9U0.js.map} +1 -1
- package/dist/chunks/{checkbox.C62ek8A8.js → checkbox.M6lKj2hQ.js} +6 -6
- package/dist/chunks/{checkbox.C62ek8A8.js.map → checkbox.M6lKj2hQ.js.map} +1 -1
- package/dist/chunks/{chip.CoBGGkn7.js → chip.DcpP3zb6.js} +3 -3
- package/dist/chunks/{chip.CoBGGkn7.js.map → chip.DcpP3zb6.js.map} +1 -1
- package/dist/chunks/{code-snippet.CrKl93Wq.js → code-snippet.CKrxKjkQ.js} +7 -7
- package/dist/chunks/{code-snippet.CrKl93Wq.js.map → code-snippet.CKrxKjkQ.js.map} +1 -1
- package/dist/chunks/{controls-group.2xftPPd7.js → controls-group.CXVHTaYp.js} +32 -29
- package/dist/chunks/controls-group.CXVHTaYp.js.map +1 -0
- package/dist/chunks/{copy.-8xjj6Hr.js → copy.C4DAAiPw.js} +5 -5
- package/dist/chunks/{copy.-8xjj6Hr.js.map → copy.C4DAAiPw.js.map} +1 -1
- package/dist/chunks/{country.BdqTkF7A.js → country.RVvsGwuV.js} +3 -3
- package/dist/chunks/{country.BdqTkF7A.js.map → country.RVvsGwuV.js.map} +1 -1
- package/dist/chunks/{currency.XiEfa4LT.js → currency.CN4UnCx8.js} +2 -2
- package/dist/chunks/{currency.XiEfa4LT.js.map → currency.CN4UnCx8.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Di16gWGI.js → dashboard-section.Cll3tn0q.js} +3 -3
- package/dist/chunks/{dashboard-section.Di16gWGI.js.map → dashboard-section.Cll3tn0q.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CyZEW1LZ.js → dashed-underline.2OYxO-Rh.js} +4 -4
- package/dist/chunks/{dashed-underline.CyZEW1LZ.js.map → dashed-underline.2OYxO-Rh.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CnYNEhPR.js → data-grid-template.CTRHofoW.js} +4 -4
- package/dist/chunks/{data-grid-template.CnYNEhPR.js.map → data-grid-template.CTRHofoW.js.map} +1 -1
- package/dist/chunks/{data-grid.aEQt05d9.js → data-grid.DMOTTywp.js} +185 -185
- package/dist/chunks/data-grid.DMOTTywp.js.map +1 -0
- package/dist/chunks/{date-picker.Bk0A3rha.js → date-picker.CBlQ0ql7.js} +18 -18
- package/dist/chunks/{date-picker.Bk0A3rha.js.map → date-picker.CBlQ0ql7.js.map} +1 -1
- package/dist/chunks/{date-range-picker.l-CSmXBk.js → date-range-picker.D-gGqpFB.js} +25 -25
- package/dist/chunks/{date-range-picker.l-CSmXBk.js.map → date-range-picker.D-gGqpFB.js.map} +1 -1
- package/dist/chunks/{date.BZENjOb6.js → date.4GAXrgy5.js} +2 -2
- package/dist/chunks/{date.BZENjOb6.js.map → date.4GAXrgy5.js.map} +1 -1
- package/dist/chunks/{dialog-page.BJaRwRhF.js → dialog-page.VSJgHY3C.js} +3 -3
- package/dist/chunks/{dialog-page.BJaRwRhF.js.map → dialog-page.VSJgHY3C.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.DWgL31p1.js → dropdown-default-textbox.CGsOngY1.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.DWgL31p1.js.map → dropdown-default-textbox.CGsOngY1.js.map} +1 -1
- package/dist/chunks/dropdown-tag.DlFpUeXa.js +296 -0
- package/dist/chunks/dropdown-tag.DlFpUeXa.js.map +1 -0
- package/dist/chunks/{dropdown.Co86azLK.js → dropdown.agfzvJZE.js} +22 -22
- package/dist/chunks/{dropdown.Co86azLK.js.map → dropdown.agfzvJZE.js.map} +1 -1
- package/dist/chunks/{empty-state.YNNEDsnK.js → empty-state.BTaeZdQu.js} +3 -3
- package/dist/chunks/{empty-state.YNNEDsnK.js.map → empty-state.BTaeZdQu.js.map} +1 -1
- package/dist/chunks/{error-message.Cu4cIfdg.js → error-message.B1P5ictH.js} +5 -5
- package/dist/chunks/{error-message.Cu4cIfdg.js.map → error-message.B1P5ictH.js.map} +1 -1
- package/dist/chunks/{file-uploader.09149Fx8.js → file-uploader.Vac1Cu0i.js} +21 -19
- package/dist/chunks/file-uploader.Vac1Cu0i.js.map +1 -0
- package/dist/chunks/{filter-bar.D6n7Srr5.js → filter-bar.uUpoP-XZ.js} +233 -236
- package/dist/chunks/filter-bar.uUpoP-XZ.js.map +1 -0
- package/dist/chunks/{fixed-scroller.QlDKOD7y.js → fixed-scroller.DSGxXiAH.js} +2 -2
- package/dist/chunks/{fixed-scroller.QlDKOD7y.js.map → fixed-scroller.DSGxXiAH.js.map} +1 -1
- package/dist/chunks/{footer-actions.0cBTJ1kw.js → footer-actions.gRKTKGts.js} +4 -4
- package/dist/chunks/{footer-actions.0cBTJ1kw.js.map → footer-actions.gRKTKGts.js.map} +1 -1
- package/dist/chunks/{form-layout-title.Cq_xVPUq.js → form-layout-title.DdRqnXXi.js} +3 -3
- package/dist/chunks/{form-layout-title.Cq_xVPUq.js.map → form-layout-title.DdRqnXXi.js.map} +1 -1
- package/dist/chunks/{header-meta.BJGF0E3r.js → header-meta.Ct79L1O8.js} +5 -5
- package/dist/chunks/{header-meta.BJGF0E3r.js.map → header-meta.Ct79L1O8.js.map} +1 -1
- package/dist/chunks/{header-with-views.Drzq84zs.js → header-with-views.BVHdSAKp.js} +211 -207
- package/dist/chunks/header-with-views.BVHdSAKp.js.map +1 -0
- package/dist/chunks/{header.B6DzOioR.js → header.Cd1P8lYK.js} +4 -4
- package/dist/chunks/{header.B6DzOioR.js.map → header.Cd1P8lYK.js.map} +1 -1
- package/dist/chunks/{info-icon.DKnzFXy1.js → info-icon.Bl0iKUfC.js} +7 -7
- package/dist/chunks/{info-icon.DKnzFXy1.js.map → info-icon.Bl0iKUfC.js.map} +1 -1
- package/dist/chunks/info.BKwey1HA.js +44 -0
- package/dist/chunks/info.BKwey1HA.js.map +1 -0
- package/dist/chunks/{input-field-password.DC8lJFsr.js → input-field-password.DkIWrrxy.js} +7 -7
- package/dist/chunks/{input-field-password.DC8lJFsr.js.map → input-field-password.DkIWrrxy.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BbMEzDiR.js → input-field-phone-number.EXlRu8qq.js} +9 -9
- package/dist/chunks/{input-field-phone-number.BbMEzDiR.js.map → input-field-phone-number.EXlRu8qq.js.map} +1 -1
- package/dist/chunks/{input-field.6bH4yGb2.js → input-field.CgbiOju9.js} +4 -4
- package/dist/chunks/{input-field.6bH4yGb2.js.map → input-field.CgbiOju9.js.map} +1 -1
- package/dist/chunks/{inspector.Bsv68G-e.js → inspector.BGtTMtE0.js} +4 -4
- package/dist/chunks/{inspector.Bsv68G-e.js.map → inspector.BGtTMtE0.js.map} +1 -1
- package/dist/chunks/{layout-row.CIg1pwOd.js → layout-row.BPfOPn4x.js} +2 -2
- package/dist/chunks/{layout-row.CIg1pwOd.js.map → layout-row.BPfOPn4x.js.map} +1 -1
- package/dist/chunks/{link.Di0rtpOj.js → link.cwPmWlsk.js} +2 -2
- package/dist/chunks/{link.Di0rtpOj.js.map → link.cwPmWlsk.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.C6WHiASI.js → listbox-option-tag.CDIkX7nh.js} +3 -3
- package/dist/chunks/{listbox-option-tag.C6WHiASI.js.map → listbox-option-tag.CDIkX7nh.js.map} +1 -1
- package/dist/chunks/{loading-indicator.BmAQqPP2.js → loading-indicator.VHi5tbZa.js} +2 -2
- package/dist/chunks/{loading-indicator.BmAQqPP2.js.map → loading-indicator.VHi5tbZa.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BHzyS4y7.js → modal-fullscreen.-Q-7GMyT.js} +5 -5
- package/dist/chunks/{modal-fullscreen.BHzyS4y7.js.map → modal-fullscreen.-Q-7GMyT.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CqDhzFJ9.js → modal.vue_vue_type_script_setup_true_lang.TFh7p51f.js} +6 -6
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CqDhzFJ9.js.map → modal.vue_vue_type_script_setup_true_lang.TFh7p51f.js.map} +1 -1
- package/dist/chunks/{pagination.BuYH2_62.js → pagination.DW_HPEIu.js} +4 -4
- package/dist/chunks/{pagination.BuYH2_62.js.map → pagination.DW_HPEIu.js.map} +1 -1
- package/dist/chunks/{payment-method.4cnK2M5b.js → payment-method.CDnn1bjo.js} +2 -2
- package/dist/chunks/{payment-method.4cnK2M5b.js.map → payment-method.CDnn1bjo.js.map} +1 -1
- package/dist/chunks/popover.types.COM6oQgq.js +6 -0
- package/dist/chunks/{popover.types.BQILgzhs.js.map → popover.types.COM6oQgq.js.map} +1 -1
- package/dist/chunks/{popper-container.idDrquM6.js → popper-container.CgJzEQ7N.js} +2 -2
- package/dist/chunks/{popper-container.idDrquM6.js.map → popper-container.CgJzEQ7N.js.map} +1 -1
- package/dist/chunks/{promo-banner.il4_mdEk.js → promo-banner.BbqIA4Ce.js} +3 -3
- package/dist/chunks/{promo-banner.il4_mdEk.js.map → promo-banner.BbqIA4Ce.js.map} +1 -1
- package/dist/chunks/{radio-group.BG8W9epW.js → radio-group.CbLIPi7h.js} +77 -69
- package/dist/chunks/radio-group.CbLIPi7h.js.map +1 -0
- package/dist/chunks/{radio-input.DvPjlvPm.js → radio-input.odN9FOyr.js} +2 -2
- package/dist/chunks/{radio-input.DvPjlvPm.js.map → radio-input.odN9FOyr.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.vqti0Ls0.js → rich-text-editor.C0hJeV4H.js} +7 -7
- package/dist/chunks/{rich-text-editor.vqti0Ls0.js.map → rich-text-editor.C0hJeV4H.js.map} +1 -1
- package/dist/chunks/{search-bar.RGL70u_Y.js → search-bar.CvAi2t3-.js} +3 -3
- package/dist/chunks/{search-bar.RGL70u_Y.js.map → search-bar.CvAi2t3-.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Dtw_Dm_X.js → secondary-nav.yntS8-u5.js} +3 -3
- package/dist/chunks/{secondary-nav.Dtw_Dm_X.js.map → secondary-nav.yntS8-u5.js.map} +1 -1
- package/dist/chunks/{segmented-control.C6QyN2jS.js → segmented-control.CRSdIvha.js} +3 -3
- package/dist/chunks/{segmented-control.C6QyN2jS.js.map → segmented-control.CRSdIvha.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DpogJSo0.js → selection-card-group.Cu3V8h4R.js} +6 -6
- package/dist/chunks/{selection-card-group.DpogJSo0.js.map → selection-card-group.Cu3V8h4R.js.map} +1 -1
- package/dist/chunks/{sidepanel.BqRWoCd3.js → sidepanel.z18XSO3M.js} +6 -6
- package/dist/chunks/{sidepanel.BqRWoCd3.js.map → sidepanel.z18XSO3M.js.map} +1 -1
- package/dist/chunks/{status.types.B7vJ-_oJ.js → status.types.-l2qJxLn.js} +2 -2
- package/dist/chunks/{status.types.B7vJ-_oJ.js.map → status.types.-l2qJxLn.js.map} +1 -1
- package/dist/chunks/{step.BdZrreHU.js → step.BMSjltwl.js} +3 -3
- package/dist/chunks/{step.BdZrreHU.js.map → step.BMSjltwl.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DIwkcIMT.js → structured-list-item.CD1nMqzH.js} +6 -6
- package/dist/chunks/{structured-list-item.DIwkcIMT.js.map → structured-list-item.CD1nMqzH.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.DHUnTXI-.js → summary-grid.types.BHuDlPDw.js} +6 -6
- package/dist/chunks/{summary-grid.types.DHUnTXI-.js.map → summary-grid.types.BHuDlPDw.js.map} +1 -1
- package/dist/chunks/{tab.jIG8-7-Q.js → tab.C3R_VoJL.js} +3 -3
- package/dist/chunks/{tab.jIG8-7-Q.js.map → tab.C3R_VoJL.js.map} +1 -1
- package/dist/chunks/{tag.BP8fBCx-.js → tag.B6AmSws9.js} +7 -7
- package/dist/chunks/{tag.BP8fBCx-.js.map → tag.B6AmSws9.js.map} +1 -1
- package/dist/chunks/{textarea.CtfRoIUw.js → textarea.DfQLxj_w.js} +4 -4
- package/dist/chunks/{textarea.CtfRoIUw.js.map → textarea.DfQLxj_w.js.map} +1 -1
- package/dist/chunks/timeline-item.25y9USE-.js +568 -0
- package/dist/chunks/timeline-item.25y9USE-.js.map +1 -0
- package/dist/chunks/{toast.w_FD0zQA.js → toast.DIhABAW8.js} +4 -4
- package/dist/chunks/{toast.w_FD0zQA.js.map → toast.DIhABAW8.js.map} +1 -1
- package/dist/chunks/{toggle-button.ByyLw0Yf.js → toggle-button.CQl9HneO.js} +194 -188
- package/dist/chunks/toggle-button.CQl9HneO.js.map +1 -0
- package/dist/chunks/{toggle.CjEL1ko8.js → toggle.C8k7NQ7y.js} +2 -2
- package/dist/chunks/{toggle.CjEL1ko8.js.map → toggle.C8k7NQ7y.js.map} +1 -1
- package/dist/chunks/{tooltip.Dww8NiUR.js → tooltip.lBnko9QV.js} +4 -4
- package/dist/chunks/tooltip.lBnko9QV.js.map +1 -0
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.rY33hqQQ.js → tutorial.vue_vue_type_script_setup_true_lang.BProZFmI.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.rY33hqQQ.js.map → tutorial.vue_vue_type_script_setup_true_lang.BProZFmI.js.map} +1 -1
- package/dist/chunks/{typography.CFHvBR7L.js → typography.yBEME_Gu.js} +2 -2
- package/dist/chunks/{typography.CFHvBR7L.js.map → typography.yBEME_Gu.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.BzKbXZPO.js → use-bento-toast-controller.Kri_h7jS.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.BzKbXZPO.js.map → use-bento-toast-controller.Kri_h7jS.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BcNRo4mZ.js → use-cached-selected-values.CELe-MsT.js} +7 -7
- package/dist/chunks/use-cached-selected-values.CELe-MsT.js.map +1 -0
- package/dist/chunks/{use-country-items.Duh4bMqW.js → use-country-items.D_kamcYy.js} +2 -2
- package/dist/chunks/{use-country-items.Duh4bMqW.js.map → use-country-items.D_kamcYy.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.BOaJ9PDl.js → use-country-phon-code.Bui3zD6W.js} +5 -3
- package/dist/chunks/{use-country-phon-code.BOaJ9PDl.js.map → use-country-phon-code.Bui3zD6W.js.map} +1 -1
- package/dist/chunks/warning-filled.BMGD0G-_.js +29 -0
- package/dist/chunks/warning-filled.BMGD0G-_.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +2 -2
- 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/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +136 -136
- 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 +12 -12
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.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/payment-method.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +2 -2
- 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/status.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/alert.DFSdD4jX.js +0 -169
- package/dist/chunks/alert.DFSdD4jX.js.map +0 -1
- package/dist/chunks/bin.CiGG2V4b.js +0 -37
- package/dist/chunks/bin.CiGG2V4b.js.map +0 -1
- package/dist/chunks/controls-group.2xftPPd7.js.map +0 -1
- package/dist/chunks/data-grid.aEQt05d9.js.map +0 -1
- package/dist/chunks/dropdown-tag.CnqIUH1X.js +0 -263
- package/dist/chunks/dropdown-tag.CnqIUH1X.js.map +0 -1
- package/dist/chunks/file-uploader.09149Fx8.js.map +0 -1
- package/dist/chunks/filter-bar.D6n7Srr5.js.map +0 -1
- package/dist/chunks/header-with-views.Drzq84zs.js.map +0 -1
- package/dist/chunks/info.DcTs-Bzp.js +0 -44
- package/dist/chunks/info.DcTs-Bzp.js.map +0 -1
- package/dist/chunks/popover.types.BQILgzhs.js +0 -6
- package/dist/chunks/radio-group.BG8W9epW.js.map +0 -1
- package/dist/chunks/timeline-item.DthjD14m.js +0 -566
- package/dist/chunks/timeline-item.DthjD14m.js.map +0 -1
- package/dist/chunks/toggle-button.ByyLw0Yf.js.map +0 -1
- package/dist/chunks/tooltip.Dww8NiUR.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.BcNRo4mZ.js.map +0 -1
- package/dist/chunks/warning-filled.AiUbXzzg.js +0 -29
- package/dist/chunks/warning-filled.AiUbXzzg.js.map +0 -1
- package/dist/styles/legacy.css +0 -2239
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as J, useSlots as q, ref as L, watch as A, computed as o, createElementBlock as i, openBlock as l, withKeys as _, normalizeClass as c, createCommentVNode as d, createVNode as E, unref as n, renderSlot as b, createElementVNode as y, createBlock as h, mergeProps as G, withCtx as C, Transition as Q, normalizeStyle as X } from "vue";
|
|
2
|
-
import { B as T, d as Z } from "./typography.
|
|
2
|
+
import { B as T, d as Z } from "./typography.yBEME_Gu.js";
|
|
3
3
|
import { C as ee } from "./chevron-down.DCQ6ZLaq.js";
|
|
4
4
|
import { C as ae } from "./chevron-up.kfuLRpZb.js";
|
|
5
5
|
import { u as te } from "./use-expandable-content-height.GkjjbmPy.js";
|
|
@@ -8,7 +8,7 @@ import { g as ne } from "./generate-uid.NJ8tVoha.js";
|
|
|
8
8
|
import { u as le } from "./i18n.B6g5VX0q.js";
|
|
9
9
|
import { o as de } from "./resize.Bqks3WUm.js";
|
|
10
10
|
import { B as se } from "./button-actions.types.BptAXjD8.js";
|
|
11
|
-
import { B as re } from "./toggle-button.
|
|
11
|
+
import { B as re } from "./toggle-button.CQl9HneO.js";
|
|
12
12
|
import { _ as ie } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
13
|
import "../assets/card.css";
|
|
14
14
|
var D = /* @__PURE__ */ ((s) => (s.PRIMARY = "primary", s.SECONDARY = "secondary", s))(D || {}), p = /* @__PURE__ */ ((s) => (s.DEFAULT = "default", s.SMALL = "small", s))(p || {});
|
|
@@ -219,10 +219,10 @@ const I = {
|
|
|
219
219
|
})
|
|
220
220
|
], 42, ce));
|
|
221
221
|
}
|
|
222
|
-
}), De = /* @__PURE__ */ ie(me, [["__scopeId", "data-v-
|
|
222
|
+
}), De = /* @__PURE__ */ ie(me, [["__scopeId", "data-v-f292325a"]]);
|
|
223
223
|
export {
|
|
224
224
|
D as B,
|
|
225
225
|
p as a,
|
|
226
226
|
De as c
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=card.
|
|
228
|
+
//# sourceMappingURL=card.BspLDcas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.CNYYIpQW.js","sources":["../../../vue2/src/components/card/card.types.ts","../../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div\n class=\"b-card\"\n :class=\"cardConditionalClasses\"\n :tabindex=\"tabIndex\"\n data-testid=\"card\"\n @click=\"onClick\"\n @keydown.enter=\"onKeyDown\"\n @keydown.space=\"onKeyDown\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"headerTabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, useSlots, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, type BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\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 // Composables\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(\n defineProps<{\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions?: BentoButtonActionsList;\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout?: BentoButtonActionsLayout | `${BentoButtonActionsLayout}`;\n\n /**\n * Defines the color of card background\n */\n background?: BentoCardBackground | `${BentoCardBackground}`;\n\n /**\n * Makes the whole card clickable\n */\n clickable?: boolean;\n\n /**\n * Sets the expandable card in a closed state\n */\n closed?: boolean;\n\n /**\n * Disables the expandable card\n */\n disabled?: boolean;\n\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable?: boolean;\n\n /**\n * Defines the title size of the card header\n */\n titleSize?: BentoCardTitleSize | `${BentoCardTitleSize}`;\n }>(),\n {\n actions: null,\n actionsLayout: BentoButtonActionsLayout.BUTTONS_END,\n background: BentoCardBackground.PRIMARY,\n clickable: false,\n closed: false,\n disabled: false,\n expandable: false,\n titleSize: BentoCardTitleSize.DEFAULT,\n }\n );\n\n const emit = defineEmits<{\n (e: 'click');\n (e: 'expanded', isExpanded: boolean);\n }>();\n\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.clickable && !props.disabled ? 0 : -1));\n const headerTabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--clickable': props.clickable,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': (props.clickable || props.expandable) && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header': isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n }) as InstanceType<typeof BentoTypography>['$props']\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\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 const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n\n if (!props.clickable) {\n deprecate(\n 'BentoCard \"@click\" property',\n `Use the BentoCard \"@click\" with the \"clickable\" property to enable accessible styles.`,\n '2.0.0'\n );\n }\n }\n };\n\n const onKeyDown = () => {\n if (props.clickable && !props.disabled) {\n emit('click');\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default {\n i18n: { messages },\n name: 'bento-card',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/card/card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","__default__","messages","t","useI18n","slots","useSlots","hasSlot","useHasSlot","props","__props","emit","__emit","contentDiv","ref","cardId","generateUid","showContent","watch","value","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","headerTabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","toggleExpansion","onClick","deprecate","onKeyDown"],"mappings":";;;;;;;;;;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AA,MAAA,IAAA,CAAA;AAAA,IAC8D;AAGvF,IAAAnB;AAAA,MAAA,MAAAL,EAAA;AAAA,MACqB,MAAA;AAEb,YAAA2B,IAAA;AACA,QAAA,CAAAA,KAAA3B,EAAA,UACI2B,IAAAC,GAAA5B,EAAA,OAAA,MAAA;AACI,UAAAA,EAAA,SACIuB,EAAA;AAAA,QACJ,CAAA;AAAA,MAER;AAAA,IACJ;AAGJ,UAAAM,IAAA,MAAA;AACI,MAAA,CAAAjC,EAAA,YAAAA,EAAA,eACIQ,EAAA,QAAA,CAAAA,EAAA,OACAN,EAAA,YAAAM,EAAA,KAAA,GACAmB,EAAA;AAAA,IACJ,GAGJO,IAAA,MAAA;AACI,MAAAlC,EAAA,aACIE,EAAA,OAAA,GAEAF,EAAA,aACImC;AAAA,QAAA;AAAA,QACI;AAAA,QACA;AAAA,MACA;AAAA,IAGZ,GAGJC,IAAA,MAAA;AACI,MAAApC,EAAA,aAAA,CAAAA,EAAA,YACIE,EAAA,OAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"card.BspLDcas.js","sources":["../../../vue2/src/components/card/card.types.ts","../../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div\n class=\"b-card\"\n :class=\"cardConditionalClasses\"\n :tabindex=\"tabIndex\"\n data-testid=\"card\"\n @click=\"onClick\"\n @keydown.enter=\"onKeyDown\"\n @keydown.space=\"onKeyDown\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"headerTabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, useSlots, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, type BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\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 // Composables\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(\n defineProps<{\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions?: BentoButtonActionsList;\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout?: BentoButtonActionsLayout | `${BentoButtonActionsLayout}`;\n\n /**\n * Defines the color of card background\n */\n background?: BentoCardBackground | `${BentoCardBackground}`;\n\n /**\n * Makes the whole card clickable\n */\n clickable?: boolean;\n\n /**\n * Sets the expandable card in a closed state\n */\n closed?: boolean;\n\n /**\n * Disables the expandable card\n */\n disabled?: boolean;\n\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable?: boolean;\n\n /**\n * Defines the title size of the card header\n */\n titleSize?: BentoCardTitleSize | `${BentoCardTitleSize}`;\n }>(),\n {\n actions: null,\n actionsLayout: BentoButtonActionsLayout.BUTTONS_END,\n background: BentoCardBackground.PRIMARY,\n clickable: false,\n closed: false,\n disabled: false,\n expandable: false,\n titleSize: BentoCardTitleSize.DEFAULT,\n }\n );\n\n const emit = defineEmits<{\n (e: 'click');\n (e: 'expanded', isExpanded: boolean);\n }>();\n\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.clickable && !props.disabled ? 0 : -1));\n const headerTabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--clickable': props.clickable,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': (props.clickable || props.expandable) && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header': isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n }) as InstanceType<typeof BentoTypography>['$props']\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\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 const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n\n if (!props.clickable) {\n deprecate(\n 'BentoCard \"@click\" property',\n `Use the BentoCard \"@click\" with the \"clickable\" property to enable accessible styles.`,\n '2.0.0'\n );\n }\n }\n };\n\n const onKeyDown = () => {\n if (props.clickable && !props.disabled) {\n emit('click');\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default {\n i18n: { messages },\n name: 'bento-card',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","__default__","messages","t","useI18n","slots","useSlots","hasSlot","useHasSlot","props","__props","emit","__emit","contentDiv","ref","cardId","generateUid","showContent","watch","value","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","headerTabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","toggleExpansion","onClick","deprecate","onKeyDown"],"mappings":";;;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;gBCuTRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;AAxOA,UAAA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,EAAA,GACAC,IAAAC,GAAAH,CAAA,GAEAI,IAAAC,GAmFAC,IAAAC,GAKAC,IAAAC,EAAA,IAAA,GAEAC,IAAAC,GAAA,MAAA,GACAC,IAAAH,EAAA,CAAAL,EAAA,MAAA;AACA,IAAAS;AAAA,MAAA,MAAAT,EAAA;AAAA,MACgB,CAAAU,MAAA;AAER,QAAAF,EAAA,QAAA,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as B, toRef as I, computed as l, watch as y, ref as T, resolveComponent as m, createElementBlock as v, openBlock as n, createVNode as N, createBlock as E, createCommentVNode as V, normalizeClass as w, withCtx as s, Fragment as O, renderList as A, createSlots as G, createTextVNode as k, toDisplayString as S, renderSlot as L, mergeProps as _ } from "vue";
|
|
2
|
-
import { a as d, B as U } from "./checkbox.
|
|
2
|
+
import { a as d, B as U } from "./checkbox.M6lKj2hQ.js";
|
|
3
3
|
import { g as P } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
-
import { d as R } from "./typography.
|
|
4
|
+
import { d as R } from "./typography.yBEME_Gu.js";
|
|
5
5
|
import { u as q } from "./use-form-layout-loading.D3lALhtC.js";
|
|
6
|
-
import { E as $ } from "./error-message.
|
|
7
|
-
import { C as z } from "./controls-group.
|
|
6
|
+
import { E as $ } from "./error-message.B1P5ictH.js";
|
|
7
|
+
import { C as z } from "./controls-group.CXVHTaYp.js";
|
|
8
8
|
import { _ as D } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
9
9
|
import "../assets/checkbox-group.css";
|
|
10
10
|
var i = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(i || {});
|
|
@@ -184,9 +184,9 @@ function Z(e, u, b, f, a, g) {
|
|
|
184
184
|
}, null, 8, ["id", "error-message"])) : V("", !0)
|
|
185
185
|
]);
|
|
186
186
|
}
|
|
187
|
-
const ee = /* @__PURE__ */ D(F, [["render", Z], ["__scopeId", "data-v-
|
|
187
|
+
const ee = /* @__PURE__ */ D(F, [["render", Z], ["__scopeId", "data-v-8aebecb2"]]);
|
|
188
188
|
export {
|
|
189
189
|
i as B,
|
|
190
190
|
ee as c
|
|
191
191
|
};
|
|
192
|
-
//# sourceMappingURL=checkbox-group.
|
|
192
|
+
//# sourceMappingURL=checkbox-group.DIXgr1WQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-group.fX5_d3XZ.js","sources":["../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["import type { BentoCheckboxTag } from '../../checkbox.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\ninterface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n tag?: BentoCheckboxTag;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n :tag=\"item.tag\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { type BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox-group/checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","_ctx","hideLabel","label","optional","required","Fragment","renderList","item","createBlock","_component_bento_checkbox","disabled","createSlots","withCtx","createTextVNode","toDisplayString","renderSlot","mergeProps","_component_error_message","createCommentVNode"],"mappings":";;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACqDR,MAAAE,IAAA,wBAqBAC,IAAAC,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EAAA,MAAA;AAAA,cAAAC,EAAAC,EAAAP,EAAA,WAAA,GAAA,CAAA;AAAA,YAAA,CAAA;AAAA,YAAA,KAAA;AAAA,UAAA,IAAA;AAAA;YA+BoB,MAAA;AAAA,YAAA,IAAAK,EAAA,MAAA;AAAA,cA/BpBG,EAAAf,EAAA,QAAA,WAAAgB,EAAA,EAAA,SAAA,GAAA,GAAAT,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA,CAAA;AAAA,YAAA,KAAA;AAAA,UAAA,IAAA;AAAA,gIAAA,GAAA,GAAA;AAAA,MAAA,CAAA;AAAA,MAoCkBrB,GAAAA;AAAAA,IAAAA,GAAAA,GAAAA,CAAAA,oBAAAA,kBAAAA,SAAAA,eAAAA,YAAAA,QAAAA,cAAAA,SAAAA,YAAAA,YAAAA,cAAAA,CAAAA;AAAAA,IAIRc,EAAA,+BAAAH,EAAA,GAAAW,EAAAS,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAjB,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA,MAvClB,OAAA;AAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAkB,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox-group.DIXgr1WQ.js","sources":["../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["import type { BentoCheckboxTag } from '../../checkbox.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\ninterface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n tag?: BentoCheckboxTag;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n :tag=\"item.tag\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { type BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","_ctx","hideLabel","label","optional","required","Fragment","renderList","item","createBlock","_component_bento_checkbox","disabled","createSlots","withCtx","createTextVNode","toDisplayString","renderSlot","mergeProps","_component_error_message","createCommentVNode"],"mappings":";;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACqDR,MAAAE,IAAA,wBAqBAC,IAAAC,EAAA;AAAA,EAA+B,MAAAF;AAAA,EACrB,YAAA,EAAA,eAAAG,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACmD,OAAA,EAAA,MAAA,aAAA;AAAA,EAC7B,OAAA;AAAA;AAAA;AAAA;AAAA,IACrB,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIwC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKD,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAOI,WAAA,EAAA,MAAA,SAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,OAAA,U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A;AAAA,MACK,iBAAAA,EAAA;AAAA,MAvClB,OAAA;AAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAkB,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -137,8 +137,8 @@ const G = ["id", "aria-label", "aria-checked", "aria-describedby", "aria-invalid
|
|
|
137
137
|
}), null, 48, G)
|
|
138
138
|
], 2));
|
|
139
139
|
}
|
|
140
|
-
}), Q = /* @__PURE__ */ z(M, [["__scopeId", "data-v-
|
|
140
|
+
}), Q = /* @__PURE__ */ z(M, [["__scopeId", "data-v-115c9ca3"]]);
|
|
141
141
|
export {
|
|
142
142
|
Q as C
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=checkbox-input.
|
|
144
|
+
//# sourceMappingURL=checkbox-input.BXNGT9U0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-input.
|
|
1
|
+
{"version":3,"file":"checkbox-input.BXNGT9U0.js","sources":["../../../vue2/src/components/internal/checkbox-input/checkbox-input.vue"],"sourcesContent":["<template>\n <div class=\"b-checkbox-input\" :class=\"conditionalClasses\">\n <!-- Don't change order because it matters for CSS. Icons first -->\n <minus-small-icon v-if=\"indeterminate\" class=\"b-checkbox-input__icon\" svg-title=\"\" aria-hidden=\"true\" />\n <checkmark-small-icon v-else-if=\"isChecked\" class=\"b-checkbox-input__icon\" svg-title=\"\" aria-hidden=\"true\" />\n <input\n :id=\"id\"\n ref=\"inputRef\"\n v-bind=\"attrs\"\n type=\"checkbox\"\n class=\"b-checkbox-input__outline\"\n :class=\"outlineConditionalClasses\"\n :aria-label=\"ariaLabel\"\n :aria-checked=\"ariaChecked\"\n :aria-describedby=\"ariaDescribedby\"\n :aria-invalid=\"ariaInvalid\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :indeterminate.prop=\"indeterminate\"\n :value=\"value\"\n :aria-readonly=\"readonly\"\n @click=\"onClick\"\n @change=\"onChange\"\n @keydown.space.prevent=\"inputRef?.click()\"\n @keydown.enter.prevent=\"inputRef?.click()\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type HTMLAttributes, type PropType, ref, toRefs, useAttrs } from 'vue';\n import {\n CheckboxInputEvent,\n type CheckboxInputGroupItems,\n CheckboxInputState,\n type CheckboxInputType,\n type MultiCheckboxInputType,\n } from '@/internal/checkbox-input/checkbox-input.types';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import MinusSmallIcon from '@adyen/ui-assets-icons-16/vue/minus-small';\n import { isVue3 } from 'vue-demi';\n\n const props = defineProps({\n /**\n * The aria label associated to the input checkbox.\n */\n ariaLabel: { type: String, default: '' },\n\n /**\n * An additional string that serves as description for the input checkbox (useful if the component shows a description).\n */\n ariaDescribedby: { type: String, default: '' },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Sets the id of the checkbox. Required for accessibility purposes\n */\n id: { type: String, default: null },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<CheckboxInputType | CheckboxInputGroupItems>,\n default: false,\n },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n });\n\n const emit = defineEmits<{\n /**\n * Emit that emits the input value\n */\n (e: 'update:model-value', value: boolean | Array<string | number>): void;\n }>();\n\n const inputRef = ref<HTMLInputElement | null>(null);\n\n // filter out style classes because in vue3 they are also part of attrs\n const attrs = computed(() => {\n if (isVue3) {\n const { class: _class, style: _style, ...rest } = useAttrs();\n return rest;\n } else {\n return useAttrs();\n }\n });\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const conditionalClasses = computed(() => ({\n [`b-checkbox-input--${CheckboxInputState.DISABLED}`]: props.disabled,\n [`b-checkbox-input--${CheckboxInputState.READONLY}`]: props.readonly,\n }));\n\n const outlineConditionalClasses = computed(() => ({\n [`b-checkbox-input__outline--${CheckboxInputState.UNCHECKED}`]: !isChecked.value && !props.indeterminate,\n [`b-checkbox-input__outline--${CheckboxInputState.ERROR}`]: props.hasError,\n [`b-checkbox-input__outline--${CheckboxInputState.READONLY}`]: props.readonly,\n }));\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as MultiCheckboxInputType).some(item => item === value.value);\n });\n\n // ARIA fields\n const ariaChecked = computed<HTMLAttributes['aria-checked']>(() =>\n props.indeterminate ? 'mixed' : `${!!isChecked.value}`\n );\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(\n () => props.hasError && !props.disabled && !props.readonly\n );\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (readonly.value) {\n event.preventDefault();\n return;\n }\n };\n const onChange = (event: Event) => {\n if (disabled.value) {\n return;\n }\n\n const newValue: boolean = (event.target as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(modelValue.value as MultiCheckboxInputType)];\n const index = newCheckedList.indexOf(value.value);\n\n if (index === -1) {\n newCheckedList.push(value.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n emit(CheckboxInputEvent.UPDATE, newCheckedList);\n } else {\n emit(CheckboxInputEvent.UPDATE, newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component that renders a checkbox input (without label)\n *\n * @example\n * import { BentoCheckboxInput } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckboxInput },\n * template: `\n * <label for=\"checkbox-id\">Your label</label>\n * <span id=\"description-id\">Description</span>\n * <bento-checkbox-input id=\"checkbox-id\" aria=label=\"Your label\" aria-describedby=\"description-id\" />\n * `\n * }\n */\n export default {\n name: 'checkbox-input',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-input.scss\" />\n"],"names":["__default__","props","__props","emit","__emit","inputRef","ref","attrs","computed","_class","_style","rest","useAttrs","disabled","indeterminate","modelValue","readonly","value","toRefs","conditionalClasses","CheckboxInputState","outlineConditionalClasses","isChecked","isCheckboxGroup","item","ariaChecked","ariaInvalid","onClick","event","onChange","newValue","newCheckedList","index","CheckboxInputEvent"],"mappings":";;;;;uJAsMIA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/JA,UAAAC,IAAAC,GA4DAC,IAAAC,GAOAC,IAAAC,EAAA,IAAA,GAGAC,IAAAC,EAAA,MAAA;AACI;AACI,cAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA;AACA,eAAAD;AAAA,MAAO;AAAA,IAGX,CAAA,GAGJ,EAAA,UAAAE,GAAA,eAAAC,GAAA,YAAAC,GAAA,UAAAC,GAAA,OAAAC,EAAA,IAAAC,EAAAjB,CAAA,GAEAkB,IAAAX,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAY,EAAA,QAAA,EAAA,GAAAnB,EAAA;AAAA,MACqB,CAAA,qBAAAmB,EAAA,QAAA,EAAA,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|
import { defineComponent as Z, toRefs as D, computed as a, ref as U, onMounted as G, useAttrs as x, resolveComponent as f, createElementBlock as q, openBlock as t, mergeProps as B, createVNode as ee, createCommentVNode as n, createBlock as s, withCtx as d, createElementVNode as ae, renderSlot as E, createTextVNode as L, toDisplayString as M } from "vue";
|
|
2
|
-
import { B as oe } from "./typography.
|
|
2
|
+
import { B as oe } from "./typography.yBEME_Gu.js";
|
|
3
3
|
import { u as re } from "./use-default-slot-validator.O02rzsob.js";
|
|
4
4
|
import { u as te } from "./use-has-slot.B7eQSabc.js";
|
|
5
5
|
import { g as N } from "./generate-uid.NJ8tVoha.js";
|
|
6
6
|
import { g as _ } from "./get-slot-text.DQlZEsId.js";
|
|
7
7
|
import { u as le } from "./i18n.B6g5VX0q.js";
|
|
8
8
|
import { u as ne } from "./aria-label.CaUURpnB.js";
|
|
9
|
-
import { B as se } from "./tag.
|
|
10
|
-
import { E as de } from "./error-message.
|
|
11
|
-
import { C as ie } from "./checkbox-input.
|
|
9
|
+
import { B as se } from "./tag.B6AmSws9.js";
|
|
10
|
+
import { E as de } from "./error-message.B1P5ictH.js";
|
|
11
|
+
import { C as ie } from "./checkbox-input.BXNGT9U0.js";
|
|
12
12
|
import { C as P } from "./minus-small.DYIyF5XW.js";
|
|
13
13
|
import { _ as ue } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
14
14
|
import "../assets/checkbox.css";
|
|
@@ -249,9 +249,9 @@ function me(e, $, h, l, y, g) {
|
|
|
249
249
|
])) : n("", !0)
|
|
250
250
|
], 16, be);
|
|
251
251
|
}
|
|
252
|
-
const Ie = /* @__PURE__ */ ue(ce, [["render", me], ["__scopeId", "data-v-
|
|
252
|
+
const Ie = /* @__PURE__ */ ue(ce, [["render", me], ["__scopeId", "data-v-1d08bc84"]]);
|
|
253
253
|
export {
|
|
254
254
|
Ie as B,
|
|
255
255
|
i as a
|
|
256
256
|
};
|
|
257
|
-
//# sourceMappingURL=checkbox.
|
|
257
|
+
//# sourceMappingURL=checkbox.M6lKj2hQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.C62ek8A8.js","sources":["../../../vue2/src/components/checkbox/checkbox.types.ts","../../../vue2/src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox/checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue","_hoisted_1","_ctx","$attrs","createVNode","_component_checkbox_input","mergeProps","openBlock","createElementBlock","_hoisted_2","createBlock","_component_bento_typography","createElementVNode","createTextVNode","toDisplayString","required","createCommentVNode","_component_bento_tag","tag","renderSlot","_component_error_message"],"mappings":";;;;;;;;;;;;;;AASY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GCoFRE,KAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,MAAA,EAAA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SAAA;AAAA,MAAA,GAAA;AAAA;UAAAQ,EAAAjB,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA,CAAA;AAAA,QAAA,GAAA;AAAA,MAAA,CAAA,KAAAc,EAAA,IAAA,EAAA;AAAA,IAAA,CAAA,KAAAA,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox.M6lKj2hQ.js","sources":["../../../vue2/src/components/checkbox/checkbox.types.ts","../../../vue2/src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue","_hoisted_1","_ctx","$attrs","createVNode","_component_checkbox_input","mergeProps","openBlock","createElementBlock","_hoisted_2","createBlock","_component_bento_typography","createElementVNode","createTextVNode","toDisplayString","required","createCommentVNode","_component_bento_tag","tag","renderSlot","_component_error_message"],"mappings":";;;;;;;;;;;;;;AASY,IAAAA,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AA,eAAA,CAAA,KAAAc,EAAA,IAAA,EAAA;AAAA,MAuC+Bd,EAAA,wBAAAK,EAAA,GAAAG,EAAAC,GAAA;AAAA,QAFsD,KAAA;AAAA,QAAI,OAAA;AAAA,QAAc,IAAA;AAAA,QArCvG,SAAA;AAAA,MAAA,GAAA;AAAA;UAAAQ,EAAAjB,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA,CAAA;AAAA,QAAA,GAAA;AAAA,MAAA,CAAA,KAAAc,EAAA,IAAA,EAAA;AAAA,IAAA,CAAA,KAAAA,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as _, computed as t, createBlock as b, openBlock as v, unref as o, normalizeClass as h, withCtx as a, createVNode as r, createTextVNode as B, toDisplayString as y } from "vue";
|
|
2
|
-
import { B as C } from "./base-button.
|
|
3
|
-
import { B as g } from "./typography.
|
|
2
|
+
import { B as C } from "./base-button.CjYb5Y8k.js";
|
|
3
|
+
import { B as g } from "./typography.yBEME_Gu.js";
|
|
4
4
|
import { C as k } from "./cross-small.n1UO5wNB.js";
|
|
5
5
|
import { u as x } from "./i18n.B6g5VX0q.js";
|
|
6
6
|
import { t as L } from "./truncate.BfIl_-71.js";
|
|
@@ -68,4 +68,4 @@ const n = {
|
|
|
68
68
|
export {
|
|
69
69
|
P as B
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=chip.
|
|
71
|
+
//# sourceMappingURL=chip.DcpP3zb6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.
|
|
1
|
+
{"version":3,"file":"chip.DcpP3zb6.js","sources":["../../../vue2/src/components/chip/chip.vue"],"sourcesContent":["<template>\n <base-button class=\"b-chip\" :disabled=\"disabled\" :class=\"conditionalClasses\" @click=\"emit('click')\">\n <bento-typography el=\"span\" :variant=\"computedTypographyVariant\" class=\"b-chip__text\">\n {{ computedLabel }}\n </bento-typography>\n <template #iconRight><cross-small-icon :svg-title=\"t('remove')\" class=\"b-chip__icon\" /></template>\n </base-button>\n</template>\n\n<script setup lang=\"ts\">\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import CrossSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { truncate } from '@/utils/ts/truncate';\n\n import type { BentoChipProps } from './chip.types';\n\n import messages from './messages.json';\n import { computed } from 'vue';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoChipProps>(), {\n disabled: false,\n readonly: false,\n error: false,\n condensed: false,\n characterLimit: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits when chip is clicked\n */\n (e: 'click'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const computedLabel = computed(() =>\n props.characterLimit ? truncate(props.label, props.characterLimit) : props.label\n );\n\n const computedTypographyVariant = computed<`${BentoTypographyVariant}`>(() =>\n props.condensed ? 'caption' : 'body'\n );\n\n const conditionalClasses = computed(() => ({\n 'b-chip--condensed': props.condensed,\n 'b-chip--readonly': props.readonly && !props.disabled,\n 'b-chip--error': props.error,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Chip is a dismissible tag-like component that can be used to display selected items, which may need to be removed by the user.\n *\n * @example\n * import { BentoChip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoChip },\n * template: `\n * <bento-chip\n * label=\"Label\"\n * :character-limit=\"20\"\n * condensed\n * @click=\"removeChip()\"\n *\n * />\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./chip.scss\" />\n"],"names":["__default__","messages","props","__props","emit","__emit","t","useI18n","computedLabel","computed","truncate","computedTypographyVariant","conditionalClasses"],"mappings":";;;;;;;;;;;;;;;;;;GA4EIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;AApDA,UAAAC,IAAAC,GAQAC,IAAAC,GAOA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAN,EAAA,CAAA,GAEAO,IAAAC;AAAA,MAAsB,MAAAP,EAAA,iBAAAQ,EAAAR,EAAA,OAAAA,EAAA,cAAA,IAAAA,EAAA;AAAA,IACyD,GAG/ES,IAAAF;AAAA,MAAkC,MAAAP,EAAA,YAAA,YAAA;AAAA,IACA,GAGlCU,IAAAH,EAAA,OAAA;AAAA,MAA2C,qBAAAP,EAAA;AAAA,MACZ,oBAAAA,EAAA,YAAA,CAAAA,EAAA;AAAA,MACkB,iBAAAA,EAAA;AAAA,IACtB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as K, ref as y, computed as f, shallowRef as V, onMounted as q, watch as ee, watchEffect as te, resolveComponent as ae, createElementBlock as _, openBlock as s, normalizeClass as $, createCommentVNode as p, createBlock as g, createElementVNode as S, createVNode as C, unref as l, mergeProps as ne, withCtx as h, createTextVNode as B, toDisplayString as E, renderSlot as oe, normalizeProps as se, guardReactiveProps as le } from "vue";
|
|
2
2
|
import { s as re, H as ie, t as e, L as ce, a as de, b as pe, c as ue, p as ge, j as me, d as fe, x as he, e as Oe, E as be, h as ve, k as ye, C as x, f as w, i as _e, g as Q, l as Se, m as Ce } from "./codemirror.Zv80n3Z2.js";
|
|
3
3
|
import { c as Ne, d as Pe, e as Te, f as Le } from "./es6.MoTTyETW.js";
|
|
4
|
-
import { B as ke } from "./dropdown.
|
|
5
|
-
import { B as Y } from "./button.
|
|
6
|
-
import { B as H } from "./typography.
|
|
7
|
-
import { B as Ee } from "./loading-indicator.
|
|
4
|
+
import { B as ke } from "./dropdown.agfzvJZE.js";
|
|
5
|
+
import { B as Y } from "./button.C-MAa6ut.js";
|
|
6
|
+
import { B as H } from "./typography.yBEME_Gu.js";
|
|
7
|
+
import { B as Ee } from "./loading-indicator.VHi5tbZa.js";
|
|
8
8
|
import { u as xe } from "./i18n.B6g5VX0q.js";
|
|
9
9
|
import { E as Ie } from "./expand.C9IAqYYL.js";
|
|
10
|
-
import { h as Ae } from "./base-modal.
|
|
11
|
-
import { C as Re } from "./copy
|
|
10
|
+
import { h as Ae } from "./base-modal.BrBcILSe.js";
|
|
11
|
+
import { C as Re } from "./copy.C4DAAiPw.js";
|
|
12
12
|
import { _ as Ve } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
13
|
import "../assets/code-snippet.css";
|
|
14
14
|
const $e = {
|
|
@@ -331,4 +331,4 @@ export {
|
|
|
331
331
|
O as b,
|
|
332
332
|
pt as c
|
|
333
333
|
};
|
|
334
|
-
//# sourceMappingURL=code-snippet.
|
|
334
|
+
//# sourceMappingURL=code-snippet.CKrxKjkQ.js.map
|