@adyen/bento-vue3 2.0.0-rc.6 → 2.0.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 +47 -89
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/ai-tag.css +1 -1
- package/dist/assets/anchor-scroller.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.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.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.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-with-popover.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/progress-bar.css +1 -1
- package/dist/assets/promo-banner.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/table-of-contents.css +1 -1
- package/dist/assets/tag.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.CDqXAJ_o.js → accordion-item.l88yjGPT.js} +2 -2
- package/dist/chunks/accordion-item.l88yjGPT.js.map +1 -0
- package/dist/chunks/{action-bar.Y0-Y1Lxb.js → action-bar.CWjLoeOU.js} +166 -149
- package/dist/chunks/action-bar.CWjLoeOU.js.map +1 -0
- package/dist/chunks/{ai-button.HyFL1Urc.js → ai-button.CYaCMWFk.js} +2 -2
- package/dist/chunks/{ai-button.HyFL1Urc.js.map → ai-button.CYaCMWFk.js.map} +1 -1
- package/dist/chunks/{ai-tag.BQQA6de2.js → ai-tag.CjrOE5yl.js} +3 -3
- package/dist/chunks/ai-tag.CjrOE5yl.js.map +1 -0
- package/dist/chunks/{alert.DPb3_p0K.js → alert.C8Pe1-OO.js} +2 -2
- package/dist/chunks/{alert.DPb3_p0K.js.map → alert.C8Pe1-OO.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.B2TgWdCo.js → anchor-scroller.C3zkcfPH.js} +13 -13
- package/dist/chunks/anchor-scroller.C3zkcfPH.js.map +1 -0
- package/dist/chunks/{base-button.C8hw-h9-.js → base-button.Bi5JR_6k.js} +2 -2
- package/dist/chunks/{base-button.C8hw-h9-.js.map → base-button.Bi5JR_6k.js.map} +1 -1
- package/dist/chunks/base-modal.Bn4ZXwv6.js +441 -0
- package/dist/chunks/base-modal.Bn4ZXwv6.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.LF1NNScj.js → button-actions-with-menu.CrbF2BSQ.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.LF1NNScj.js.map → button-actions-with-menu.CrbF2BSQ.js.map} +1 -1
- package/dist/chunks/{button-actions.BjSTWgNC.js → button-actions.uIjzze43.js} +5 -5
- package/dist/chunks/{button-actions.BjSTWgNC.js.map → button-actions.uIjzze43.js.map} +1 -1
- package/dist/chunks/{button.D6d4P8nC.js → button.Ciflfide.js} +2 -2
- package/dist/chunks/{button.D6d4P8nC.js.map → button.Ciflfide.js.map} +1 -1
- package/dist/chunks/{calendar.Dndck6oT.js → calendar.Dtba7fcs.js} +5 -5
- package/dist/chunks/calendar.Dtba7fcs.js.map +1 -0
- package/dist/chunks/card.ID7LqObu.js +254 -0
- package/dist/chunks/card.ID7LqObu.js.map +1 -0
- package/dist/chunks/{checkbox-group.BqLVduAB.js → checkbox-group.BCzNXT1-.js} +8 -8
- package/dist/chunks/checkbox-group.BCzNXT1-.js.map +1 -0
- package/dist/chunks/{checkbox.OqIysGJA.js → checkbox.0RmIkniU.js} +15 -15
- package/dist/chunks/checkbox.0RmIkniU.js.map +1 -0
- package/dist/chunks/{chip.REcSE76u.js → chip.Bv6IGch0.js} +2 -2
- package/dist/chunks/{chip.REcSE76u.js.map → chip.Bv6IGch0.js.map} +1 -1
- package/dist/chunks/{code-snippet.B9poUCAs.js → code-snippet.BbswO6TU.js} +5 -5
- package/dist/chunks/{code-snippet.B9poUCAs.js.map → code-snippet.BbswO6TU.js.map} +1 -1
- package/dist/chunks/{copy.BqYryk37.js → copy.C92qFRaR.js} +2 -2
- package/dist/chunks/{copy.BqYryk37.js.map → copy.C92qFRaR.js.map} +1 -1
- package/dist/chunks/{cross-circle-fill-small.ganKvfe0.js → cross-circle-fill-small.C87G_8OX.js} +2 -2
- package/dist/chunks/cross-circle-fill-small.C87G_8OX.js.map +1 -0
- package/dist/chunks/{dashboard-section.D1GPmEU2.js → dashboard-section.Bv-SveGN.js} +3 -3
- package/dist/chunks/{dashboard-section.D1GPmEU2.js.map → dashboard-section.Bv-SveGN.js.map} +1 -1
- package/dist/chunks/{dashed-underline.E65uUWYF.js → dashed-underline.C3lSC1_R.js} +2 -2
- package/dist/chunks/{dashed-underline.E65uUWYF.js.map → dashed-underline.C3lSC1_R.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DsZI-ISc.js → data-grid-template.DqZmPeze.js} +4 -4
- package/dist/chunks/{data-grid-template.DsZI-ISc.js.map → data-grid-template.DqZmPeze.js.map} +1 -1
- package/dist/chunks/{data-grid.oiH-QM7_.js → data-grid.Ca27H24r.js} +20 -20
- package/dist/chunks/data-grid.Ca27H24r.js.map +1 -0
- package/dist/chunks/{date-picker.94wdYFML.js → date-picker.Dnr2HuxA.js} +7 -7
- package/dist/chunks/date-picker.Dnr2HuxA.js.map +1 -0
- package/dist/chunks/{date-range-picker.D45JX1VD.js → date-range-picker.CuBygd3O.js} +10 -10
- package/dist/chunks/{date-range-picker.D45JX1VD.js.map → date-range-picker.CuBygd3O.js.map} +1 -1
- package/dist/chunks/{dialog-page.yakmJ6Bc.js → dialog-page.D60pjDsQ.js} +2 -2
- package/dist/chunks/{dialog-page.yakmJ6Bc.js.map → dialog-page.D60pjDsQ.js.map} +1 -1
- package/dist/chunks/{draggable-handle.DnvrxRxK.js → draggable-handle.Cvc8gHzx.js} +2 -2
- package/dist/chunks/{draggable-handle.DnvrxRxK.js.map → draggable-handle.Cvc8gHzx.js.map} +1 -1
- package/dist/chunks/{draggable.Cp2Qnooa.js → draggable.BZsgR26I.js} +2 -2
- package/dist/chunks/{draggable.Cp2Qnooa.js.map → draggable.BZsgR26I.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.C3ybYQxd.js → dropdown-tag.Bn5FPeEL.js} +3 -3
- package/dist/chunks/{dropdown-tag.C3ybYQxd.js.map → dropdown-tag.Bn5FPeEL.js.map} +1 -1
- package/dist/chunks/{dropdown.DivEbn7p.js → dropdown.D_jkFrMd.js} +194 -194
- package/dist/chunks/dropdown.D_jkFrMd.js.map +1 -0
- package/dist/chunks/{empty-state.Bto2psKu.js → empty-state.DpUC-3wv.js} +3 -3
- package/dist/chunks/{empty-state.Bto2psKu.js.map → empty-state.DpUC-3wv.js.map} +1 -1
- package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
- package/dist/chunks/{file-uploader.BuOQRa-V.js → file-uploader.BglImnqw.js} +6 -6
- package/dist/chunks/file-uploader.BglImnqw.js.map +1 -0
- package/dist/chunks/{filter-bar.B14faBNI.js → filter-bar.DG4GTi8L.js} +514 -533
- package/dist/chunks/filter-bar.DG4GTi8L.js.map +1 -0
- package/dist/chunks/{fixed-scroller.B3kEBipG.js → fixed-scroller.DoOR83iH.js} +2 -2
- package/dist/chunks/{fixed-scroller.B3kEBipG.js.map → fixed-scroller.DoOR83iH.js.map} +1 -1
- package/dist/chunks/{footer-actions.NpAByudT.js → footer-actions.Dl20Q1WX.js} +3 -3
- package/dist/chunks/{footer-actions.NpAByudT.js.map → footer-actions.Dl20Q1WX.js.map} +1 -1
- package/dist/chunks/{form-layout-title.Dh45kd1K.js → form-layout-title.BZFh_nGD.js} +2 -2
- package/dist/chunks/{form-layout-title.Dh45kd1K.js.map → form-layout-title.BZFh_nGD.js.map} +1 -1
- package/dist/chunks/generate-uid.DBWe4g6T.js.map +1 -1
- package/dist/chunks/{header-with-views.DufmtnZ2.js → header-with-views.WJlXgGI5.js} +875 -849
- package/dist/chunks/{header-with-views.DufmtnZ2.js.map → header-with-views.WJlXgGI5.js.map} +1 -1
- package/dist/chunks/{header.Jtie5-7g.js → header.Bi3MPZKE.js} +4 -4
- package/dist/chunks/{header.Jtie5-7g.js.map → header.Bi3MPZKE.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.CLGZteKS.js → info-icon-with-popover.uSr6-jzR.js} +3 -3
- package/dist/chunks/info-icon-with-popover.uSr6-jzR.js.map +1 -0
- package/dist/chunks/{input-field-password.BPjmZ2vh.js → input-field-password.CJZxudne.js} +5 -5
- package/dist/chunks/input-field-password.CJZxudne.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.BViae6Ex.js → input-field-phone-number.OJ4MG9Gf.js} +2 -2
- package/dist/chunks/{input-field-phone-number.BViae6Ex.js.map → input-field-phone-number.OJ4MG9Gf.js.map} +1 -1
- package/dist/chunks/{input-field.DgQG5TCW.js → input-field.IyNujUZt.js} +3 -3
- package/dist/chunks/input-field.IyNujUZt.js.map +1 -0
- package/dist/chunks/{input-time.DYbJUHP5.js → input-time.BJ6YqkFi.js} +3 -3
- package/dist/chunks/{input-time.DYbJUHP5.js.map → input-time.BJ6YqkFi.js.map} +1 -1
- package/dist/chunks/{inspector-page.BdfORbVT.js → inspector-page.D42_PXHM.js} +3 -3
- package/dist/chunks/{inspector-page.BdfORbVT.js.map → inspector-page.D42_PXHM.js.map} +1 -1
- package/dist/chunks/{inspector.CEiwH5Pt.js → inspector.BBgrupfO.js} +3 -3
- package/dist/chunks/inspector.BBgrupfO.js.map +1 -0
- package/dist/chunks/{link.DHhC2vrX.js → link.types.BGj7apK3.js} +36 -36
- package/dist/chunks/link.types.BGj7apK3.js.map +1 -0
- package/dist/chunks/{list-item.QB0YYGW9.js → list-item.CT7dyMQH.js} +3 -3
- package/dist/chunks/{list-item.QB0YYGW9.js.map → list-item.CT7dyMQH.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.DCuA8MoL.js → listbox-option-tag.CwrFdsY1.js} +2 -2
- package/dist/chunks/{listbox-option-tag.DCuA8MoL.js.map → listbox-option-tag.CwrFdsY1.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DtG6vHhq.js → modal-fullscreen.I5bjqzfd.js} +6 -6
- package/dist/chunks/modal-fullscreen.I5bjqzfd.js.map +1 -0
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CKWzgLgL.js → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js} +5 -5
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CKWzgLgL.js.map → modal.vue_vue_type_script_setup_true_lang.CrsIyU7A.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.E-24hOWI.js → navigation-menu-group.BSGdcUDN.js} +6 -6
- package/dist/chunks/navigation-menu-group.BSGdcUDN.js.map +1 -0
- package/dist/chunks/{pagination.B2Kgh-MF.js → pagination.C5gZxtZY.js} +5 -5
- package/dist/chunks/pagination.C5gZxtZY.js.map +1 -0
- package/dist/chunks/{promo-banner.DuottTum.js → promo-banner.kE1-WkzI.js} +9 -9
- package/dist/chunks/{promo-banner.DuottTum.js.map → promo-banner.kE1-WkzI.js.map} +1 -1
- package/dist/chunks/{radio-group.BANaG-Fa.js → radio-group.XmRPh03c.js} +4 -4
- package/dist/chunks/radio-group.XmRPh03c.js.map +1 -0
- package/dist/chunks/{rich-text-editor.Dbc9Y2YC.js → rich-text-editor.Cv_Vwt-6.js} +6 -6
- package/dist/chunks/{rich-text-editor.Dbc9Y2YC.js.map → rich-text-editor.Cv_Vwt-6.js.map} +1 -1
- package/dist/chunks/{search-bar.CAsAh02R.js → search-bar.5tObtLfW.js} +3 -3
- package/dist/chunks/{search-bar.CAsAh02R.js.map → search-bar.5tObtLfW.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DOgZJUTd.js → secondary-nav.Bhn5bVYI.js} +5 -5
- package/dist/chunks/secondary-nav.Bhn5bVYI.js.map +1 -0
- package/dist/chunks/{segmented-control.6XApEjVS.js → segmented-control.CEt2dz4n.js} +2 -2
- package/dist/chunks/segmented-control.CEt2dz4n.js.map +1 -0
- package/dist/chunks/{selection-card-group.emQVruZd.js → selection-card-group.DHXtJpoB.js} +11 -11
- package/dist/chunks/selection-card-group.DHXtJpoB.js.map +1 -0
- package/dist/chunks/{sidepanel.DcrakBM9.js → sidepanel._30g8POM.js} +6 -6
- package/dist/chunks/sidepanel._30g8POM.js.map +1 -0
- package/dist/chunks/{step.Ch6oovwT.js → step.5_ZukVqJ.js} +2 -2
- package/dist/chunks/{step.Ch6oovwT.js.map → step.5_ZukVqJ.js.map} +1 -1
- package/dist/chunks/{structured-list-item.exe4zQXe.js → structured-list-item.CBzznwcF.js} +3 -3
- package/dist/chunks/{structured-list-item.exe4zQXe.js.map → structured-list-item.CBzznwcF.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BYqz5zdo.js → summary-grid.types.BR_EGvRg.js} +4 -4
- package/dist/chunks/{summary-grid.types.BYqz5zdo.js.map → summary-grid.types.BR_EGvRg.js.map} +1 -1
- package/dist/chunks/{tab.Bat55rEc.js → tab.D_k5AVHk.js} +4 -4
- package/dist/chunks/tab.D_k5AVHk.js.map +1 -0
- package/dist/chunks/{table-of-contents.DIDNJXqh.js → table-of-contents.CJ2yMbAG.js} +15 -15
- package/dist/chunks/table-of-contents.CJ2yMbAG.js.map +1 -0
- package/dist/chunks/tag.BE1j0Oid.js +69 -0
- package/dist/chunks/tag.BE1j0Oid.js.map +1 -0
- package/dist/chunks/{textarea.-owTWdhj.js → textarea.BYshPd98.js} +4 -4
- package/dist/chunks/textarea.BYshPd98.js.map +1 -0
- package/dist/chunks/{timeline-item.DvlhZ_-D.js → timeline-item.Sy_DSw6p.js} +9 -9
- package/dist/chunks/{timeline-item.DvlhZ_-D.js.map → timeline-item.Sy_DSw6p.js.map} +1 -1
- package/dist/chunks/title-details.C4ZvxPMu.js +144 -0
- package/dist/chunks/title-details.C4ZvxPMu.js.map +1 -0
- package/dist/chunks/{toast.N4m58lr8.js → toast.u5Y_CGe_.js} +2 -2
- package/dist/chunks/{toast.N4m58lr8.js.map → toast.u5Y_CGe_.js.map} +1 -1
- package/dist/chunks/{toggle.BqQ7NGMb.js → toggle.BW8ww0Ih.js} +2 -2
- package/dist/chunks/toggle.BW8ww0Ih.js.map +1 -0
- package/dist/chunks/tooltip.TFOGHOO0.js.map +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CMkHWnq2.js → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js} +2 -2
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CMkHWnq2.js.map → tutorial.vue_vue_type_script_setup_true_lang.BIP-heAH.js.map} +1 -1
- package/dist/chunks/use-bento-toast-controller.BAoPbtq7.js.map +1 -1
- package/dist/chunks/{use-date-input-formatter.DTQ7YmPb.js → use-date-input-formatter._ik1DYYV.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.DTQ7YmPb.js.map → use-date-input-formatter._ik1DYYV.js.map} +1 -1
- package/dist/chunks/use-dynamic-date-fns-locale.BMO9rsEh.js +39 -0
- package/dist/chunks/use-dynamic-date-fns-locale.BMO9rsEh.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +4 -4
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +62 -62
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +2 -2
- package/dist/internal.js +10 -10
- package/dist/link.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress-bar.js +6 -6
- package/dist/progress-bar.js.map +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +3 -3
- package/dist/styles/bento-light.css +4 -4
- package/dist/styles/bento.css +4 -4
- package/dist/styles/legacy.css +4 -4
- package/dist/styles/styleguide.css +4 -4
- package/dist/styles/utility.css +4 -4
- package/dist/summary-grid.js +1 -1
- package/dist/table-of-contents.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/web-types.json +2 -2
- package/package.json +6 -6
- package/dist/chunks/accordion-item.CDqXAJ_o.js.map +0 -1
- package/dist/chunks/action-bar.Y0-Y1Lxb.js.map +0 -1
- package/dist/chunks/ai-tag.BQQA6de2.js.map +0 -1
- package/dist/chunks/anchor-scroller.B2TgWdCo.js.map +0 -1
- package/dist/chunks/base-modal.CD51pnsZ.js +0 -433
- package/dist/chunks/base-modal.CD51pnsZ.js.map +0 -1
- package/dist/chunks/calendar.Dndck6oT.js.map +0 -1
- package/dist/chunks/card.DKvGbswE.js +0 -224
- package/dist/chunks/card.DKvGbswE.js.map +0 -1
- package/dist/chunks/checkbox-group.BqLVduAB.js.map +0 -1
- package/dist/chunks/checkbox.OqIysGJA.js.map +0 -1
- package/dist/chunks/cross-circle-fill-small.ganKvfe0.js.map +0 -1
- package/dist/chunks/data-grid.oiH-QM7_.js.map +0 -1
- package/dist/chunks/date-picker.94wdYFML.js.map +0 -1
- package/dist/chunks/dropdown.DivEbn7p.js.map +0 -1
- package/dist/chunks/file-uploader.BuOQRa-V.js.map +0 -1
- package/dist/chunks/filter-bar.B14faBNI.js.map +0 -1
- package/dist/chunks/info-icon-with-popover.CLGZteKS.js.map +0 -1
- package/dist/chunks/input-field-password.BPjmZ2vh.js.map +0 -1
- package/dist/chunks/input-field.DgQG5TCW.js.map +0 -1
- package/dist/chunks/inspector.CEiwH5Pt.js.map +0 -1
- package/dist/chunks/link.DHhC2vrX.js.map +0 -1
- package/dist/chunks/modal-fullscreen.DtG6vHhq.js.map +0 -1
- package/dist/chunks/navigation-menu-group.E-24hOWI.js.map +0 -1
- package/dist/chunks/pagination.B2Kgh-MF.js.map +0 -1
- package/dist/chunks/radio-group.BANaG-Fa.js.map +0 -1
- package/dist/chunks/secondary-nav.DOgZJUTd.js.map +0 -1
- package/dist/chunks/segmented-control.6XApEjVS.js.map +0 -1
- package/dist/chunks/selection-card-group.emQVruZd.js.map +0 -1
- package/dist/chunks/sidepanel.DcrakBM9.js.map +0 -1
- package/dist/chunks/tab.Bat55rEc.js.map +0 -1
- package/dist/chunks/table-of-contents.DIDNJXqh.js.map +0 -1
- package/dist/chunks/tag.DmGI_QZ-.js +0 -63
- package/dist/chunks/tag.DmGI_QZ-.js.map +0 -1
- package/dist/chunks/textarea.-owTWdhj.js.map +0 -1
- package/dist/chunks/title-details.DoGThvsa.js +0 -176
- package/dist/chunks/title-details.DoGThvsa.js.map +0 -1
- package/dist/chunks/toggle.BqQ7NGMb.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.BYshPd98.js","sources":["../../../vue2/src/components/textarea/textarea.types.ts","../../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :required=\"required\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/utils/ts/generate-uid';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BBorderWidthAttention } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = withDefaults(defineProps<BentoTextareaProps>(), {\n ariaLabel: undefined,\n characterLimit: undefined,\n description: '',\n disabled: false,\n clearable: false,\n errorMessage: '',\n height: null,\n label: '',\n optional: false,\n placeholder: '',\n readonly: false,\n resizable: 'both',\n required: false,\n tooltipText: null,\n modelValue: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.BLUR): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.UPDATE_MODEL_VALUE, value: string): void;\n\n /**\n * Emitted when the text area keydown event is fired\n */\n (e: BentoTextareaEvent.KEYDOWN, event: KeyboardEvent): void;\n\n /**\n * Emitted when the text area keyup event is fired\n */\n (e: BentoTextareaEvent.KEYUP, event: KeyboardEvent): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.modelValue);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.modelValue,\n () => {\n textareaValue.value = props.modelValue;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: isDynamicHeight.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emitValue('');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event update:model-value\n * @property {String} inputValue - the updated textarea value\n */\n emitValue(textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BBorderWidthAttention);\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BBorderWidthAttention","__default__","messages","attrs","useAttrs","props","__props","emit","__emit","height","toRefs","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","counter","computed","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","__expose","onMounted","observeSizeOfElement","onUnmounted"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,qBAAA,sBACAA,EAAA,UAAA,WACAA,EAAA,QAAA,SATQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;GCkYRE,KAAA,WAAAC,EAAA,GACAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAAA,EACX,OAAA,EAAA,MAAA,cAAA,OAAA,qBAAA;AAEV;;;;;;;;;;;;;;;;;;;;AAnTA,UAAAC,IAAAC,GAAA,GAEAC,IAAAC,GAkBAC,IAAAC,GA0CA,EAAA,QAAAC,EAAA,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAT,EAAA,UAAA,GACAY,IAAA,IACAC,IAAAJ,EAAAT,EAAA,UAAA,GAAAY,CAAA,IAAA,GACAE,IAAAL,EAAA,CAAA,GACAM,IAAAN,EAA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AA,MAAA;AACI,MAAA9C,IAAA+C,EAAAxD,EAAA,OAAA,MAAA;AACI,QAAAkD,EAAA,EAAA;AAAA,MAA0B,CAAA,GAG9BxC,IAAA8C,EAAAtD,EAAA,OAAA,MAAA;AACI,QAAAgD,EAAA;AAAA,MAAsB,CAAA,GAG1B7B,EAAA,SACIE,EAAA;AAAA,IACJ,CAAA,GAGJkC,GAAA,MAAA;AACI,MAAAhD,GAAA,WAAA,GACAC,GAAA,WAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as Y, computed as l, ref as $, toRefs as pe, watch as ve, provide as P, openBlock as i, createElementBlock as u, createBlock as M, unref as a, withCtx as p, createTextVNode as N, toDisplayString as v, createCommentVNode as c, createVNode as C, createElementVNode as g, renderSlot as q, nextTick as fe, getCurrentInstance as he, mergeProps as F, useSlots as _e, inject as x, onUnmounted as ge, normalizeClass as G, normalizeProps as W, Fragment as K, renderList as we } from "vue";
|
|
2
|
-
import { B as ne } from "./button.
|
|
3
|
-
import { B as be } from "./textarea
|
|
2
|
+
import { B as ne } from "./button.Ciflfide.js";
|
|
3
|
+
import { B as be } from "./textarea.BYshPd98.js";
|
|
4
4
|
import { u as oe } from "./index.B875RXHM.js";
|
|
5
|
-
import { B as ye } from "./button-actions.
|
|
5
|
+
import { B as ye } from "./button-actions.uIjzze43.js";
|
|
6
6
|
import { _ as le } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
-
import { B as X } from "./dashed-underline.
|
|
7
|
+
import { B as X } from "./dashed-underline.C3lSC1_R.js";
|
|
8
8
|
import { B as Z } from "./date.ojGAujAt.js";
|
|
9
|
-
import { B as Me } from "./link.
|
|
10
|
-
import { B as Ee } from "./tag.
|
|
9
|
+
import { B as Me } from "./link.types.BGj7apK3.js";
|
|
10
|
+
import { B as Ee } from "./tag.BE1j0Oid.js";
|
|
11
11
|
import { B } from "./typography.wIM07Hbl.js";
|
|
12
|
-
import { S as Ne, B as Ie, a as Te } from "./structured-list-item.
|
|
12
|
+
import { S as Ne, B as Ie, a as Te } from "./structured-list-item.CBzznwcF.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
import { g as ke } from "./generate-uid.DBWe4g6T.js";
|
|
15
15
|
import { u as Ce } from "./use-has-slot.CyMiImRQ.js";
|
|
@@ -411,7 +411,7 @@ const re = /* @__PURE__ */ Symbol("timeline register entry injection key"), me =
|
|
|
411
411
|
])) : c("", !0)
|
|
412
412
|
], 2)) : c("", !0);
|
|
413
413
|
}
|
|
414
|
-
}), Et = /* @__PURE__ */ le(it, [["__scopeId", "data-v-
|
|
414
|
+
}), Et = /* @__PURE__ */ le(it, [["__scopeId", "data-v-6d1fc320"]]);
|
|
415
415
|
export {
|
|
416
416
|
Be as B,
|
|
417
417
|
Et as a,
|
|
@@ -420,4 +420,4 @@ export {
|
|
|
420
420
|
$e as d,
|
|
421
421
|
Mt as t
|
|
422
422
|
};
|
|
423
|
-
//# sourceMappingURL=timeline-item.
|
|
423
|
+
//# sourceMappingURL=timeline-item.Sy_DSw6p.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item.DvlhZ_-D.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../../vue2/src/components/timeline/timeline.types.ts","../../../vue2/src/components/timeline/timeline.keys.ts","../../../vue2/src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../vue2/src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { type BentoDashedUnderlineProps } from '@/components/dashed-underline/dashed-underline.types';\nimport { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated Since v3.0.0. Do not use. Use the `status` prop instead.\n */\nexport enum BentoTimelineItemVariant {\n DEFAULT = 'SquareSmallIcon',\n SUCCESS = 'CheckedCircleIcon',\n CRITICAL = 'CrossCircleIcon',\n}\n\nexport enum BentoTimelineStatus {\n BLACK = 'black',\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoTimelineItemTitle extends RouterLinkProps {\n /**\n * Link label.\n */\n title: string;\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n // This has been added to allow users to add HTML and Aria attribute\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [name: string]: any;\n}\n\nexport interface BentoTimelineTimestamp {\n date: Date | number;\n format?: BentoDateFormat;\n value?: string;\n description?: BentoDashedUnderlineProps;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n\nexport interface BentoTimelineProps {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote?: boolean;\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore?: BentoTimelineShowMoreObject;\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit?: BentoTimelineGapObject;\n}\n\nexport interface BentoTimelineItemProps {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp?: BentoTimelineTimestamp;\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList?: BentoTimelineDataList;\n /**\n * Description of the event\n */\n description?: string;\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status?: string;\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag?: BentoTimelineTagProps;\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: BentoTimelineTimestamp;\n /**\n * Title of the event\n */\n title?: BentoTimelineItemTitle | string;\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type?: string;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @update:model-value=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import { type BentoInternalTimelineRegisterEntry } from './timeline.internal.types';\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineProps,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineProps>(), {\n addNote: false,\n showMore: null,\n timegapLimit: null,\n });\n\n const emit = defineEmits(['add-timeline-note']);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n</script>\n<script lang=\"ts\">\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n\n <bento-dashed-underline v-if=\"timestamp.description\" v-bind=\"timestamp.description\">\n {{ timestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>{{ timestamp.value }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n\n <bento-dashed-underline\n v-if=\"additionalTimestamp.description\"\n v-bind=\"additionalTimestamp.description\"\n >\n {{ additionalTimestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>\n {{ additionalTimestamp.value }}\n </span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"listEntry in dataList\"\n :key=\"generateUid(listEntry.label)\"\n :label=\"listEntry.label\"\n >\n <bento-typography variant=\"caption\">{{ listEntry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, useSlots } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineItemProps,\n type BentoTimelineItemTitle,\n } from '../../timeline.types';\n import { type BentoTimelineRegisterEntry } from '../../timeline.internal.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineItemProps>(), {\n additionalTimestamp: null,\n dataList: null,\n description: null,\n status: 'black',\n tag: undefined,\n title: null,\n type: 'milestone',\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const isNoteType = computed(() => props.type === 'note');\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${props.status}`]: props.status && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)));\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n i18n: { messages },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","props","__props","emit","__emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","instance","getCurrentInstance","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAmGO,SAAAA,GAAAC,GAAAC,GAAAC,GAAA;AACP,QAAAC,IAAAC,GAAA,GACAC,IAAAH,GAAA,UAAAC,EAAA,UAAAG,IAEAC,IAAAC,GAAAR,GAAAC,CAAA;AAEA,MAAA,MAAAM,CAAA;AACA,UAAA,IAAA,WAAA,oBAAA;AAGA,QAAAE,IAAA,OAAA,OAAA,CAAA,GAAAP,GAAA;AAAA,I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A,GACA4B,KAAA;AAAA,QAA8B1G,GAAAuG,GAAAE,GAAA,EAAA,MAAArC,EAAA,MAAA,KAAA,CAAA;AAAA,QACgD;AAAA,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAsC,KAAA1G,GAAAuG,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAAtD,EAAA,MAAAiD,EAAA,QAAApD,EAAA,WAAA,EAAA,SAAAoD,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAAvD,EAAA,MAAAa,EAAA,SAAAM,EAAA,UAAAM,EAAA,KAAA,GACA+B,IAAAxD,EAAA,MAEIyB,EAAA,UAAA,MAAAA,EAAA,UAAAb,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"timeline-item.Sy_DSw6p.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../../vue2/src/components/timeline/timeline.types.ts","../../../vue2/src/components/timeline/timeline.keys.ts","../../../vue2/src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../vue2/src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { type BentoDashedUnderlineProps } from '@/components/dashed-underline/dashed-underline.types';\nimport { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated Since v3.0.0. Do not use. Use the `status` prop instead.\n */\nexport enum BentoTimelineItemVariant {\n DEFAULT = 'SquareSmallIcon',\n SUCCESS = 'CheckedCircleIcon',\n CRITICAL = 'CrossCircleIcon',\n}\n\nexport enum BentoTimelineStatus {\n BLACK = 'black',\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoTimelineItemTitle extends RouterLinkProps {\n /**\n * Link label.\n */\n title: string;\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n // This has been added to allow users to add HTML and Aria attribute\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [name: string]: any;\n}\n\nexport interface BentoTimelineTimestamp {\n date: Date | number;\n format?: BentoDateFormat;\n value?: string;\n description?: BentoDashedUnderlineProps;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n\nexport interface BentoTimelineProps {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote?: boolean;\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore?: BentoTimelineShowMoreObject;\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit?: BentoTimelineGapObject;\n}\n\nexport interface BentoTimelineItemProps {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp?: BentoTimelineTimestamp;\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList?: BentoTimelineDataList;\n /**\n * Description of the event\n */\n description?: string;\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status?: string;\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag?: BentoTimelineTagProps;\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: BentoTimelineTimestamp;\n /**\n * Title of the event\n */\n title?: BentoTimelineItemTitle | string;\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type?: string;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @update:model-value=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import { type BentoInternalTimelineRegisterEntry } from './timeline.internal.types';\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineProps,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineProps>(), {\n addNote: false,\n showMore: null,\n timegapLimit: null,\n });\n\n const emit = defineEmits(['add-timeline-note']);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n</script>\n<script lang=\"ts\">\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n\n <bento-dashed-underline v-if=\"timestamp.description\" v-bind=\"timestamp.description\">\n {{ timestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>{{ timestamp.value }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n\n <bento-dashed-underline\n v-if=\"additionalTimestamp.description\"\n v-bind=\"additionalTimestamp.description\"\n >\n {{ additionalTimestamp.value }}\n </bento-dashed-underline>\n\n <span v-else>\n {{ additionalTimestamp.value }}\n </span>\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"listEntry in dataList\"\n :key=\"generateUid(listEntry.label)\"\n :label=\"listEntry.label\"\n >\n <bento-typography variant=\"caption\">{{ listEntry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, useSlots } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineItemProps,\n type BentoTimelineItemTitle,\n } from '../../timeline.types';\n import { type BentoTimelineRegisterEntry } from '../../timeline.internal.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoTimelineItemProps>(), {\n additionalTimestamp: null,\n dataList: null,\n description: null,\n status: 'black',\n tag: undefined,\n title: null,\n type: 'milestone',\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const isNoteType = computed(() => props.type === 'note');\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${props.status}`]: props.status && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() => (allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)));\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n i18n: { messages },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","__default__$1","defineComponent","messages$1","props","__props","emit","__emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","instance","getCurrentInstance","__default__","messages","slots","useSlots","hasSlot","useHasSlot","isNoteType","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem"],"mappings":";;;;;;;;;;;;;;;;;;AAmGO,SAAAA,GAAAC,GAAAC,GAAAC,GAAA;AACP,QAAAC,IAAAC,GAAA,GACAC,IAAAH,GAAA,UAAAC,EAAA,UAAAG,IAEAC,IAAAC,GAAAR,GAAAC,CAAA;AAEA,MAAA,MAAAM,CAAA;AACA,UAAA,IAAA,WAAA,oBAAA;AAGA,QAAAE,IAAA,OAAA,OAAA,CAAA,GAAAP,GAAA;AAAA,IACA,WAAAA,GAAA;AAAA,IACA,YAAAK;AAAA,EACA,CAAA,GAEA,CAAAG,GAAAC,CAAA,IAAAC;AAAA,IACAV,GAAA;AA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A,MAC1E;AAEJ,aAAAA,EAAA,MAAA,SAAAsC,KAAA1G,GAAAuG,GAAAE,GAAA,EAAA,gBAAA,QAAA,CAAA,IAAA;AAAA,IAEM,CAAA,GAEVE,IAAAtD,EAAA,MAAAiD,EAAA,QAAApD,EAAA,WAAA,EAAA,SAAAoD,EAAA,MAAA,CAAA,IAAA,EAAA,GACAM,IAAAvD,EAAA,MAAAa,EAAA,SAAAM,EAAA,UAAAM,EAAA,KAAA,GACA+B,IAAAxD,EAAA,MAEIyB,EAAA,UAAA,MAAAA,EAAA,UAAAb,EAAA,MAAA,SAAA,CAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { defineComponent as L, computed as D, useSlots as w, openBlock as h, createElementBlock as T, unref as p, createBlock as y, withCtx as _, renderSlot as x, createTextVNode as B, toDisplayString as v, createCommentVNode as g, createVNode as I, createElementVNode as O } from "vue";
|
|
2
|
+
import { u as C } from "./use-has-slot.CyMiImRQ.js";
|
|
3
|
+
import { c as E } from "./constructNow.Dl44Mvpp.js";
|
|
4
|
+
import { t as N, d as j, n as A, j as X, k as R, o as b, p as M, g as V } from "./en-US.C412g-7U.js";
|
|
5
|
+
import { d as Y } from "./differenceInMonths.CPDkGea3.js";
|
|
6
|
+
import { g as H } from "./getRoundingMethod.C3eaeGLR.js";
|
|
7
|
+
import { B as k } from "./typography.wIM07Hbl.js";
|
|
8
|
+
import { _ as F } from "./refresh.DjN1EulV.js";
|
|
9
|
+
import { u as $ } from "./index.B875RXHM.js";
|
|
10
|
+
import { u as G } from "./use-dynamic-date-fns-locale.BMO9rsEh.js";
|
|
11
|
+
import { a as J } from "./button-actions.uIjzze43.js";
|
|
12
|
+
import { _ as P } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
|
+
import "../assets/title-details.css";
|
|
14
|
+
function q(s, o) {
|
|
15
|
+
return +N(s) - +N(o);
|
|
16
|
+
}
|
|
17
|
+
function K(s, o, i) {
|
|
18
|
+
const r = q(s, o) / 1e3;
|
|
19
|
+
return H(i?.roundingMethod)(r);
|
|
20
|
+
}
|
|
21
|
+
function Q(s, o, i) {
|
|
22
|
+
const r = V(), t = i?.locale ?? r.locale ?? R, U = 2520, u = j(s, o);
|
|
23
|
+
if (isNaN(u)) throw new RangeError("Invalid time value");
|
|
24
|
+
const e = Object.assign({}, i, {
|
|
25
|
+
addSuffix: i?.addSuffix,
|
|
26
|
+
comparison: u
|
|
27
|
+
}), [f, m] = A(
|
|
28
|
+
i?.in,
|
|
29
|
+
...u > 0 ? [o, s] : [s, o]
|
|
30
|
+
), l = K(m, f), n = (X(m) - X(f)) / 1e3, a = Math.round((l - n) / 60);
|
|
31
|
+
let c;
|
|
32
|
+
if (a < 2)
|
|
33
|
+
return i?.includeSeconds ? l < 5 ? t.formatDistance("lessThanXSeconds", 5, e) : l < 10 ? t.formatDistance("lessThanXSeconds", 10, e) : l < 20 ? t.formatDistance("lessThanXSeconds", 20, e) : l < 40 ? t.formatDistance("halfAMinute", 0, e) : l < 60 ? t.formatDistance("lessThanXMinutes", 1, e) : t.formatDistance("xMinutes", 1, e) : a === 0 ? t.formatDistance("lessThanXMinutes", 1, e) : t.formatDistance("xMinutes", a, e);
|
|
34
|
+
if (a < 45)
|
|
35
|
+
return t.formatDistance("xMinutes", a, e);
|
|
36
|
+
if (a < 90)
|
|
37
|
+
return t.formatDistance("aboutXHours", 1, e);
|
|
38
|
+
if (a < b) {
|
|
39
|
+
const d = Math.round(a / 60);
|
|
40
|
+
return t.formatDistance("aboutXHours", d, e);
|
|
41
|
+
} else {
|
|
42
|
+
if (a < U)
|
|
43
|
+
return t.formatDistance("xDays", 1, e);
|
|
44
|
+
if (a < M) {
|
|
45
|
+
const d = Math.round(a / b);
|
|
46
|
+
return t.formatDistance("xDays", d, e);
|
|
47
|
+
} else if (a < M * 2)
|
|
48
|
+
return c = Math.round(a / M), t.formatDistance("aboutXMonths", c, e);
|
|
49
|
+
}
|
|
50
|
+
if (c = Y(m, f), c < 12) {
|
|
51
|
+
const d = Math.round(a / M);
|
|
52
|
+
return t.formatDistance("xMonths", d, e);
|
|
53
|
+
} else {
|
|
54
|
+
const d = c % 12, S = Math.trunc(c / 12);
|
|
55
|
+
return d < 3 ? t.formatDistance("aboutXYears", S, e) : d < 9 ? t.formatDistance("overXYears", S, e) : t.formatDistance("almostXYears", S + 1, e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function W(s, o) {
|
|
59
|
+
return Q(s, E(s), o);
|
|
60
|
+
}
|
|
61
|
+
const z = {
|
|
62
|
+
"de-DE": { lastUpdated: "Letzte Aktualisierung: {date}" },
|
|
63
|
+
"en-GB": { lastUpdated: "Last updated: {date}" },
|
|
64
|
+
"en-US": { lastUpdated: "Last updated: {date}" },
|
|
65
|
+
"es-419": { lastUpdated: "Última actualización: {date}" },
|
|
66
|
+
"es-ES": { lastUpdated: "Última actualización: {date}" },
|
|
67
|
+
"es-MX": { lastUpdated: "Última actualización: {date}" },
|
|
68
|
+
"fr-FR": { lastUpdated: "Dernière mise à jour : le {date}" },
|
|
69
|
+
"it-IT": { lastUpdated: "Ultimo aggiornamento: {date}" },
|
|
70
|
+
"ja-JP": { lastUpdated: "最終更新日: {date}" },
|
|
71
|
+
"pt-BR": { lastUpdated: "Última atualização: {date}" },
|
|
72
|
+
"zh-CN": { lastUpdated: "最后更新时间:{date}" }
|
|
73
|
+
}, Z = { class: "b-title-details__container" }, tt = {
|
|
74
|
+
key: 1,
|
|
75
|
+
class: "b-title-details__timestamp-section"
|
|
76
|
+
}, et = ["datetime"], at = {
|
|
77
|
+
i18n: { messages: z }
|
|
78
|
+
}, st = /* @__PURE__ */ L({
|
|
79
|
+
...at,
|
|
80
|
+
__name: "title-details",
|
|
81
|
+
props: {
|
|
82
|
+
description: { default: null },
|
|
83
|
+
lastUpdated: { default: null },
|
|
84
|
+
reloadButton: { default: null }
|
|
85
|
+
},
|
|
86
|
+
setup(s) {
|
|
87
|
+
const { t: o, locale: i } = $({ messages: z }), r = s, t = D(() => {
|
|
88
|
+
if (!r.lastUpdated)
|
|
89
|
+
return null;
|
|
90
|
+
const n = r.lastUpdated instanceof Date ? r.lastUpdated : new Date(r.lastUpdated);
|
|
91
|
+
return Number.isNaN(n.getTime()) ? null : n;
|
|
92
|
+
}), U = D(() => t.value ? i.value : ""), u = G(U), e = D(() => t.value?.toISOString()), f = D(
|
|
93
|
+
() => t.value ? o("lastUpdated", {
|
|
94
|
+
date: W(t.value, {
|
|
95
|
+
locale: u.value,
|
|
96
|
+
addSuffix: !0
|
|
97
|
+
})
|
|
98
|
+
}) : null
|
|
99
|
+
), m = w(), l = C(m);
|
|
100
|
+
return (n, a) => (h(), T("div", Z, [
|
|
101
|
+
n.description || p(l)("description") ? (h(), y(p(k), {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: "b-title-details__description",
|
|
104
|
+
el: "div"
|
|
105
|
+
}, {
|
|
106
|
+
default: _(() => [
|
|
107
|
+
x(n.$slots, "description", {}, () => [
|
|
108
|
+
B(v(n.description), 1)
|
|
109
|
+
], !0)
|
|
110
|
+
]),
|
|
111
|
+
_: 3
|
|
112
|
+
})) : g("", !0),
|
|
113
|
+
t.value ? (h(), T("div", tt, [
|
|
114
|
+
I(p(k), {
|
|
115
|
+
class: "b-title-details__timestamp",
|
|
116
|
+
el: "div"
|
|
117
|
+
}, {
|
|
118
|
+
default: _(() => [
|
|
119
|
+
O("time", { datetime: e.value }, v(f.value), 9, et)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}),
|
|
123
|
+
n.reloadButton ? (h(), y(p(J), {
|
|
124
|
+
key: 0,
|
|
125
|
+
variant: "tertiary",
|
|
126
|
+
state: n.reloadButton.state,
|
|
127
|
+
onClick: n.reloadButton.event
|
|
128
|
+
}, {
|
|
129
|
+
iconLeft: _(() => [
|
|
130
|
+
I(p(F), { "aria-hidden": "true" })
|
|
131
|
+
]),
|
|
132
|
+
default: _(() => [
|
|
133
|
+
B(v(n.reloadButton.title), 1)
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["state", "onClick"])) : g("", !0)
|
|
137
|
+
])) : g("", !0)
|
|
138
|
+
]));
|
|
139
|
+
}
|
|
140
|
+
}), ht = /* @__PURE__ */ P(st, [["__scopeId", "data-v-b07c9f53"]]);
|
|
141
|
+
export {
|
|
142
|
+
ht as T
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=title-details.C4ZvxPMu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title-details.C4ZvxPMu.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js","../../../vue2/src/components/internal/title-details/title-details.vue"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { minutesInDay, minutesInMonth } from \"./constants.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistance(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) throw new RangeError(\"Invalid time value\");\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const seconds = differenceInSeconds(earlierDate_, laterDate_);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(earlierDate_, laterDate_);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistance } from \"./formatDistance.js\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","<template>\n <div class=\"b-title-details__container\">\n <bento-typography v-if=\"description || hasSlot('description')\" class=\"b-title-details__description\" el=\"div\">\n <slot name=\"description\">{{ description }}</slot>\n </bento-typography>\n <div v-if=\"lastUpdatedDate\" class=\"b-title-details__timestamp-section\">\n <bento-typography class=\"b-title-details__timestamp\" el=\"div\">\n <time :datetime=\"lastUpdatedDateTime\">{{ timestamp }}</time>\n </bento-typography>\n <bento-loading-button\n v-if=\"reloadButton\"\n variant=\"tertiary\"\n :state=\"reloadButton.state\"\n @click=\"reloadButton.event\"\n ><template #iconLeft><reload-icon aria-hidden=\"true\" /></template\n >{{ reloadButton.title }}</bento-loading-button\n >\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { useDynamicDateFnsLocale, useHasSlot } from '@/composables';\n import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingButton } from '@/components/button';\n import ReloadIcon from '@adyen/ui-assets-icons-16/vue/refresh';\n import { useI18n } from '@/utils/ts/i18n';\n import type { TitleDetailsProps } from './title-details.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, locale } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<TitleDetailsProps>(), {\n description: null,\n lastUpdated: null,\n reloadButton: null,\n });\n\n const lastUpdatedDate = computed(() => {\n if (!props.lastUpdated) {\n return null;\n }\n\n const date = props.lastUpdated instanceof Date ? props.lastUpdated : new Date(props.lastUpdated);\n return Number.isNaN(date.getTime()) ? null : date;\n });\n\n const activeLocale = computed(() => (lastUpdatedDate.value ? locale.value : ''));\n const dateLocale = useDynamicDateFnsLocale(activeLocale);\n const lastUpdatedDateTime = computed(() => lastUpdatedDate.value?.toISOString());\n\n const timestamp = computed(() =>\n lastUpdatedDate.value\n ? t('lastUpdated', {\n date: formatDistanceToNow(lastUpdatedDate.value, {\n locale: dateLocale.value,\n addSuffix: true,\n }),\n })\n : null\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal component for descriptions and last-updated metadata.\n *\n * @example\n * import { TitleDetails } from '@/internal';\n *\n * export default {\n * components: { TitleDetails },\n * template: `\n * <title-details description=\"content description\" :last-updated=\"new Date()\" />\n * `\n * }\n * @slot description - The description content. Overrides the `description` prop.\n * @property description - Text showed under the title.\n * @property lastUpdated - JavaScript \"Date\" object for when the content was last updated.\n * @property reloadButton - Reload button which shows next to the header's timestamp.\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./title-details.scss\" />\n"],"names":["differenceInMilliseconds","laterDate","earlierDate","toDate","differenceInSeconds","options","diff","getRoundingMethod","formatDistance","defaultOptions","getDefaultOptions","locale","enUS","minutesInAlmostTwoDays","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","seconds","offsetInSeconds","getTimezoneOffsetInMilliseconds","minutes","months","minutesInDay","hours","minutesInMonth","days","differenceInMonths","nearestMonth","monthsSinceStartOfYear","years","formatDistanceToNow","date","constructNow","__default__","messages","t","useI18n","props","__props","lastUpdatedDate","computed","activeLocale","dateLocale","useDynamicDateFnsLocale","lastUpdatedDateTime","timestamp","slots","useSlots","hasSlot","useHasSlot"],"mappings":";;;;;;;;;;;;;AAwBO,SAAAA,EAAAC,GAAAC,GAAA;AACP,SAAA,CAAAC,EAAAF,CAAA,IAAA,CAAAE,EAAAD,CAAA;AACA;ACIO,SAAAE,EAAAH,GAAAC,GAAAG,GAAA;AACP,QAAAC,IAAAN,EAAAC,GAAAC,CAAA,IAAA;AACA,SAAAK,EAAAF,GAAA,cAAA,EAAAC,CAAA;AACA;AC0DO,SAAAE,EAAAP,GAAAC,GAAAG,GAAA;AACP,QAAAI,IAAAC,EAAA,GACAC,IAAAN,GAAA,UAAAI,EAAA,UAAAG,GACAC,IAAA,MAEAC,IAAAC,EAAAd,GAAAC,CAAA;AAEA,MAAA,MAAAY,CAAA,EAAA,OAAA,IAAA,WAAA,oBAAA;AAEA,QAAAE,IAAA,OAAA,OAAA,CAAA,GAAAX,GAAA;AAAA,IACA,WAAAA,GAAA;AAAA,IACA,YAAAS;AAAA,EACA,CAAA,GAEA,CAAAG,GAAAC,CAAA,IAAAC;AAAA,IACAd,GAAA;AAAA,IACA,GAAAS,IAAA,IAAA,CAAAZ,GAAAD,CAAA,IAAA,CAAAA,GAAAC,CAAA;AAAA,EACA,GAEAkB,IAAAhB,EAAAc,GAAAD,CAAA,GACAI,KACAC,EAAAJ,CAAA,IACAI,EAAAL,CAAA,KACA,KACAM,IAAA,KAAA,OAAAH,IAAAC,KAAA,EAAA;AACA,MAAAG;AAGA,MAAAD,IAAA;AACA,WAAAlB,GAAA,iBACAe,IAAA,IACAT,EAAA,eAAA,oBAAA,GAAAK,CAAA,IACAI,IAAA,KACAT,EAAA,eAAA,oBAAA,IAAAK,CAAA,IACAI,IAAA,KACAT,EAAA,eAAA,oBAA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1GO,SAAAiB,EAAAC,GAAA7B,GAAA;AACP,SAAAG,EAAA0B,GAAAC,EAAAD,CAAA,GAAA7B,CAAA;AACA;;;;;;;;;;;;;;;;sBCHI+B,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;AAxDA,UAAA,EAAA,GAAAC,GAAA,QAAA3B,EAAA,IAAA4B,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GAMAC,IAAAC,EAAA,MAAA;AACI,UAAA,CAAAH,EAAA;AACI,eAAA;AAGJ,YAAAN,IAAAM,EAAA,uBAAA,OAAAA,EAAA,cAAA,IAAA,KAAAA,EAAA,WAAA;AACA,aAAA,OAAA,MAAAN,EAAA,QAAA,CAAA,IAAA,OAAAA;AAAA,IAA6C,CAAA,GAGjDU,IAAAD,EAAA,MAAAD,EAAA,QAAA/B,EAAA,QAAA,EAAA,GACAkC,IAAAC,EAAAF,CAAA,GACAG,IAAAJ,EAAA,MAAAD,EAAA,OAAA,YAAA,CAAA,GAEAM,IAAAL;AAAA,MAAkB,MAAAD,EAAA,QAAAJ,EAAA,eAAA;AAAA,QAES,MAAAL,EAAAS,EAAA,OAAA;AAAA,UACoC,QAAAG,EAAA;AAAA,UAC1B,WAAA;AAAA,QACR,CAAA;AAAA,MACd,CAAA,IAAA;AAAA,IAEL,GAGVI,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3]}
|
|
@@ -2,7 +2,7 @@ import { defineComponent as N, openBlock as r, createElementBlock as w, createEl
|
|
|
2
2
|
import { u as j } from "./use-bento-toast-controller.BAoPbtq7.js";
|
|
3
3
|
import { _ as et } from "./cross-small.B6P0qFHF.js";
|
|
4
4
|
import { u as st } from "./index.B875RXHM.js";
|
|
5
|
-
import { B as H } from "./button.
|
|
5
|
+
import { B as H } from "./button.Ciflfide.js";
|
|
6
6
|
import { B as at } from "./typography.wIM07Hbl.js";
|
|
7
7
|
import { _ as R } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
8
|
import "../assets/toast.css";
|
|
@@ -220,4 +220,4 @@ const O = {
|
|
|
220
220
|
export {
|
|
221
221
|
Tt as B
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=toast.
|
|
223
|
+
//# sourceMappingURL=toast.u5Y_CGe_.js.map
|