@adyen/bento-vue3 1.6.1 → 1.7.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/components.d.ts +2 -0
- package/dist/@types/packages/core/src/components/button/button.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +45 -0
- package/dist/@types/packages/vue2/src/components/action-bar/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +229 -220
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +4 -3
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +44 -46
- package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +8 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +6 -0
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +8 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +46 -28
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +22 -4
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +5 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +802 -52
- package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +12 -5
- package/dist/@types/packages/vue2/src/components/filter-bar/components/filter-bar-button/filter-bar-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +12 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue.d.ts +21 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +6 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/calendar-month.vue.d.ts +19 -0
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/fixed-scroller.vue.d.ts +22 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +64 -7
- package/dist/@types/packages/vue2/src/components/internal/teleport/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/teleport/teleport.vue.d.ts +50 -0
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/menu.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +15 -11
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-context/pagination-context.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +10 -1
- package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +10 -5
- package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +21 -0
- package/dist/@types/packages/vue2/src/components/segmented-control/segmented-control.vue.d.ts +21 -5
- package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +1 -2
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +7 -4
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +9 -2
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/components/tutorial-indicator/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/components/tutorial-indicator/tutorial-indicator.vue.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +173 -0
- package/dist/@types/packages/vue2/src/components/tutorial/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/tutorial/tutorial.types.d.ts +13 -0
- package/dist/@types/packages/vue2/src/components/tutorial/tutorial.vue.d.ts +16 -0
- package/dist/@types/packages/vue2/src/composables/index.d.ts +5 -2
- package/dist/@types/packages/vue2/src/composables/use-click-outside/use-click-outside.d.ts +3 -0
- package/dist/@types/packages/vue2/src/composables/use-form-validate/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/composables/use-form-validate/use-form.d.ts +12 -0
- package/dist/@types/packages/vue2/src/composables/use-form-validate/use-form.types.d.ts +5 -0
- package/dist/@types/packages/vue2/src/composables/use-virtual-list/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/composables/use-virtual-list/use-virtual-list.d.ts +15 -0
- package/dist/@types/packages/vue2/src/composables/use-virtual-list/use-virtual-list.types.d.ts +20 -0
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/types/listbox.d.ts +12 -0
- package/dist/accordion.js +52 -43
- package/dist/accordion.js.map +1 -1
- package/dist/action-bar.js +210 -0
- package/dist/action-bar.js.map +1 -0
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions-with-menu.css +1 -0
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/checkmark.css +1 -0
- package/dist/assets/chevron-left.css +1 -0
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/fixed-scroller.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/listbox.css +1 -1
- package/dist/assets/refresh.css +1 -0
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +30 -22
- package/dist/button.js.map +1 -1
- package/dist/card.js +84 -84
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.4b5ab17e.js → base-button.7897a95e.js} +2 -2
- package/dist/chunks/{base-button.4b5ab17e.js.map → base-button.7897a95e.js.map} +1 -1
- package/dist/chunks/{base-modal.53a229ac.js → base-modal.0c85e7cb.js} +4 -4
- package/dist/chunks/{base-modal.53a229ac.js.map → base-modal.0c85e7cb.js.map} +1 -1
- package/dist/chunks/button-actions-with-menu.fa35390c.js +107 -0
- package/dist/chunks/button-actions-with-menu.fa35390c.js.map +1 -0
- package/dist/chunks/{button.975d0bb8.js → button.e5177388.js} +44 -36
- package/dist/chunks/button.e5177388.js.map +1 -0
- package/dist/chunks/{calendar.cc37ac1f.js → calendar.c83d4e99.js} +274 -250
- package/dist/chunks/calendar.c83d4e99.js.map +1 -0
- package/dist/chunks/{checkbox.67ceb148.js → checkbox.3cdbdd52.js} +7 -7
- package/dist/chunks/{checkbox.67ceb148.js.map → checkbox.3cdbdd52.js.map} +1 -1
- package/dist/chunks/checkmark.83e4f1e0.js +30 -0
- package/dist/chunks/checkmark.83e4f1e0.js.map +1 -0
- package/dist/chunks/{chevron-right.aef416c6.js → chevron-left.2fd6b083.js} +10 -10
- package/dist/chunks/chevron-left.2fd6b083.js.map +1 -0
- package/dist/chunks/{controls-group.7214dc7f.js → controls-group.38b436f6.js} +2 -2
- package/dist/chunks/{controls-group.7214dc7f.js.map → controls-group.38b436f6.js.map} +1 -1
- package/dist/chunks/{copy.7a73d1fd.js → copy.86236c8d.js} +4 -4
- package/dist/chunks/{copy.7a73d1fd.js.map → copy.86236c8d.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.0f878a8d.js → dropdown-default-textbox.0b38fac3.js} +4 -4
- package/dist/chunks/dropdown-default-textbox.0b38fac3.js.map +1 -0
- package/dist/chunks/{dropdown.7a104ce3.js → dropdown.afff433b.js} +144 -110
- package/dist/chunks/dropdown.afff433b.js.map +1 -0
- package/dist/chunks/{error-message.b91afffc.js → error-message.64e1964b.js} +2 -2
- package/dist/chunks/{error-message.b91afffc.js.map → error-message.64e1964b.js.map} +1 -1
- package/dist/chunks/fixed-scroller.e5aa7b00.js +148 -0
- package/dist/chunks/fixed-scroller.e5aa7b00.js.map +1 -0
- package/dist/chunks/{footer-actions.13f19a22.js → footer-actions.1ce44374.js} +3 -3
- package/dist/chunks/{footer-actions.13f19a22.js.map → footer-actions.1ce44374.js.map} +1 -1
- package/dist/chunks/{index.7f24db66.js → index.2bd3812b.js} +2 -2
- package/dist/chunks/{index.7f24db66.js.map → index.2bd3812b.js.map} +1 -1
- package/dist/chunks/{index.1dc4ebae.js → index.369b0e66.js} +112 -92
- package/dist/chunks/index.369b0e66.js.map +1 -0
- package/dist/chunks/{index.536bcb56.js → index.6a665ade.js} +3 -3
- package/dist/chunks/{index.536bcb56.js.map → index.6a665ade.js.map} +1 -1
- package/dist/chunks/{index.4c951e0d.js → index.77f35162.js} +6 -6
- package/dist/chunks/{index.4c951e0d.js.map → index.77f35162.js.map} +1 -1
- package/dist/chunks/index.bcc58fdd.js +1334 -0
- package/dist/chunks/index.bcc58fdd.js.map +1 -0
- package/dist/chunks/index.c207e9ab.js +602 -0
- package/dist/chunks/index.c207e9ab.js.map +1 -0
- package/dist/chunks/{index.6700224a.js → index.e579bc02.js} +2 -2
- package/dist/chunks/{index.6700224a.js.map → index.e579bc02.js.map} +1 -1
- package/dist/chunks/{index.d68847b0.js → index.fa7b44f1.js} +2 -2
- package/dist/chunks/{index.d68847b0.js.map → index.fa7b44f1.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.0f31ecb2.js → listbox-option-tag.809ec40e.js} +3 -3
- package/dist/chunks/{listbox-option-tag.0f31ecb2.js.map → listbox-option-tag.809ec40e.js.map} +1 -1
- package/dist/chunks/listbox.f6e5a11d.js +1306 -0
- package/dist/chunks/listbox.f6e5a11d.js.map +1 -0
- package/dist/chunks/{loading-button.6523a015.js → loading-button.746b7fa1.js} +2 -2
- package/dist/chunks/{loading-button.6523a015.js.map → loading-button.746b7fa1.js.map} +1 -1
- package/dist/chunks/refresh.c38c9eee.js +30 -0
- package/dist/chunks/refresh.c38c9eee.js.map +1 -0
- package/dist/chunks/summary-grid.keys.1d1028c2.js +5 -0
- package/dist/chunks/summary-grid.keys.1d1028c2.js.map +1 -0
- package/dist/chunks/{tooltip.b5391514.js → tooltip.f769eb14.js} +54 -51
- package/dist/chunks/{tooltip.b5391514.js.map → tooltip.f769eb14.js.map} +1 -1
- package/dist/code-snippet.js +6 -6
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +553 -541
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +10 -10
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +129 -118
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +44 -42
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +696 -683
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +3 -3
- package/dist/header.js +121 -198
- package/dist/header.js.map +1 -1
- package/dist/image.js +4 -4
- package/dist/index.js +164 -158
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +8 -8
- package/dist/input-field.js +7 -7
- package/dist/internal.js +20 -144
- package/dist/internal.js.map +1 -1
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +3 -592
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +3 -3
- package/dist/pagination.js +37 -21
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +50 -40
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +16 -16
- package/dist/popper-container.js +6 -1276
- package/dist/popper-container.js.map +1 -1
- package/dist/radio-group.js +128 -97
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +130 -106
- package/dist/segmented-control.js.map +1 -1
- package/dist/sidepanel.js +94 -91
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +146 -163
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +128 -99
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +216 -203
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +6 -6
- package/dist/tutorial.js +375 -0
- package/dist/tutorial.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -2
- package/dist/assets/chevron-right.css +0 -1
- package/dist/chunks/button.975d0bb8.js.map +0 -1
- package/dist/chunks/calendar.cc37ac1f.js.map +0 -1
- package/dist/chunks/chevron-right.aef416c6.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.0f878a8d.js.map +0 -1
- package/dist/chunks/dropdown.7a104ce3.js.map +0 -1
- package/dist/chunks/index.1dc4ebae.js.map +0 -1
- package/dist/chunks/listbox.0f25778d.js +0 -1213
- package/dist/chunks/listbox.0f25778d.js.map +0 -1
package/dist/button.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as y, B as _ } from "./chunks/button.
|
|
2
|
-
import { b as q } from "./chunks/button.
|
|
3
|
-
import { defineComponent as T, computed as p, resolveComponent as u, openBlock as n, createElementBlock as a, createElementVNode as A, normalizeClass as E, Fragment as N, renderList as S, createBlock as s, withCtx as r, createTextVNode as
|
|
4
|
-
import { B as V } from "./chunks/loading-button.
|
|
5
|
-
import { a as K } from "./chunks/loading-button.
|
|
6
|
-
import { _ as
|
|
1
|
+
import { a as y, B as _ } from "./chunks/button.e5177388.js";
|
|
2
|
+
import { b as q } from "./chunks/button.e5177388.js";
|
|
3
|
+
import { defineComponent as T, computed as p, resolveComponent as u, openBlock as n, createElementBlock as a, createElementVNode as A, normalizeClass as E, Fragment as N, renderList as S, createBlock as s, withCtx as r, createTextVNode as v, toDisplayString as m, createSlots as I, resolveDynamicComponent as L } from "vue";
|
|
4
|
+
import { B as V } from "./chunks/loading-button.746b7fa1.js";
|
|
5
|
+
import { a as K } from "./chunks/loading-button.746b7fa1.js";
|
|
6
|
+
import { _ as O } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
7
7
|
import "./assets/index3.css";
|
|
8
|
-
var f = /* @__PURE__ */ ((e) => (e.BUTTONS_END = "buttons-end", e.FILL_CONTAINER = "fill-container", e.SPACE_BETWEEN = "space-between", e.VERTICAL_STACK = "vertical-stack", e))(f || {}),
|
|
9
|
-
const
|
|
8
|
+
var f = /* @__PURE__ */ ((e) => (e.BUTTONS_END = "buttons-end", e.FILL_CONTAINER = "fill-container", e.SPACE_BETWEEN = "space-between", e.VERTICAL_STACK = "vertical-stack", e))(f || {}), C = /* @__PURE__ */ ((e) => (e.BUTTONS_START = "buttons-start", e))(C || {});
|
|
9
|
+
const B = { ...f, ...C }, R = T({
|
|
10
10
|
name: "bento-button-actions",
|
|
11
11
|
components: { BentoButton: y, BentoLoadingButton: V },
|
|
12
12
|
props: {
|
|
@@ -61,14 +61,21 @@ const b = { ...f, ...B }, O = T({
|
|
|
61
61
|
*/
|
|
62
62
|
layout: {
|
|
63
63
|
type: String,
|
|
64
|
-
default:
|
|
65
|
-
validator: (e) => Object.values(
|
|
64
|
+
default: B.BUTTONS_END,
|
|
65
|
+
validator: (e) => Object.values(B).includes(e)
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Sets the Button Actions to color scheme inverse
|
|
69
|
+
*/
|
|
70
|
+
inverse: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !1
|
|
66
73
|
}
|
|
67
74
|
},
|
|
68
75
|
setup(e) {
|
|
69
|
-
const i = p(() => e.actions.slice().reverse()),
|
|
76
|
+
const i = p(() => e.actions.slice().reverse()), l = (c) => {
|
|
70
77
|
const d = e.actions.length - 1;
|
|
71
|
-
return
|
|
78
|
+
return c === d ? _.PRIMARY : _.SECONDARY;
|
|
72
79
|
};
|
|
73
80
|
return {
|
|
74
81
|
// Values
|
|
@@ -77,14 +84,14 @@ const b = { ...f, ...B }, O = T({
|
|
|
77
84
|
})),
|
|
78
85
|
reversedActionsList: i,
|
|
79
86
|
// Methods
|
|
80
|
-
generateButtonVariantByIndex:
|
|
87
|
+
generateButtonVariantByIndex: l
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
90
|
});
|
|
84
|
-
const
|
|
85
|
-
function D(e, i,
|
|
91
|
+
const x = { class: "b-button-actions" };
|
|
92
|
+
function D(e, i, l, b, c, d) {
|
|
86
93
|
const g = u("bento-loading-button"), k = u("bento-button");
|
|
87
|
-
return n(), a("div",
|
|
94
|
+
return n(), a("div", x, [
|
|
88
95
|
A("div", {
|
|
89
96
|
class: E(["b-button-actions__container-wrapper", e.conditionalClasses]),
|
|
90
97
|
role: "group"
|
|
@@ -101,19 +108,20 @@ function D(e, i, c, C, l, d) {
|
|
|
101
108
|
onClick: t.event
|
|
102
109
|
}, {
|
|
103
110
|
default: r(() => [
|
|
104
|
-
m(
|
|
111
|
+
v(m(t.title), 1)
|
|
105
112
|
]),
|
|
106
113
|
_: 2
|
|
107
114
|
}, 1032, ["state", "disabled", "variant", "onClick"])) : (n(), s(k, {
|
|
108
115
|
key: 1,
|
|
109
116
|
critical: t.critical,
|
|
110
117
|
disabled: t.disabled,
|
|
118
|
+
inverse: e.inverse,
|
|
111
119
|
variant: t.variant || e.generateButtonVariantByIndex(o),
|
|
112
120
|
link: t.link,
|
|
113
121
|
onClick: t.event
|
|
114
122
|
}, I({
|
|
115
123
|
default: r(() => [
|
|
116
|
-
|
|
124
|
+
v(" " + m(t.title), 1)
|
|
117
125
|
]),
|
|
118
126
|
_: 2
|
|
119
127
|
}, [
|
|
@@ -126,18 +134,18 @@ function D(e, i, c, C, l, d) {
|
|
|
126
134
|
]),
|
|
127
135
|
key: "0"
|
|
128
136
|
} : void 0
|
|
129
|
-
]), 1032, ["critical", "disabled", "variant", "link", "onClick"]))
|
|
137
|
+
]), 1032, ["critical", "disabled", "inverse", "variant", "link", "onClick"]))
|
|
130
138
|
]))), 128))
|
|
131
139
|
], 2)
|
|
132
140
|
]);
|
|
133
141
|
}
|
|
134
|
-
const U = /* @__PURE__ */
|
|
142
|
+
const U = /* @__PURE__ */ O(R, [["render", D], ["__scopeId", "data-v-38813600"]]);
|
|
135
143
|
export {
|
|
136
144
|
y as BentoButton,
|
|
137
145
|
U as BentoButtonActions,
|
|
138
|
-
|
|
146
|
+
B as BentoButtonActionsLayout,
|
|
139
147
|
f as BentoButtonActionsLayoutBasic,
|
|
140
|
-
|
|
148
|
+
C as BentoButtonActionsLayoutExtended,
|
|
141
149
|
q as BentoButtonPropClass,
|
|
142
150
|
_ as BentoButtonVariant,
|
|
143
151
|
V as BentoLoadingButton,
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../vue2/src/components/button/components/button-actions/button-actions.types.ts","../../vue2/src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { VueNodeElement } from '@/types';\nimport type { BentoButtonProps, BentoLoadingButtonState } from '@/components/button';\n\nexport interface BentoButtonActionObject extends BentoButtonProps {\n title: string;\n event: (event: Event) => void;\n icon?: VueNodeElement;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n}\n\nexport type BentoButtonActionsList = Array<BentoButtonActionObject>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","<template>\n <div class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div v-for=\"(button, index) in reversedActionsList\" :key=\"index\" class=\"b-button-actions__button-wrapper\">\n <bento-loading-button\n v-if=\"button.state\"\n :state=\"button.state\"\n :disabled=\"button.disabled\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n @click=\"button.event\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n :link=\"button.link\"\n @click=\"button.event\"\n >\n <template v-if=\"button.icon\" #iconLeft>\n <component :is=\"button.icon\" :svg-title=\"button.title\"></component>\n </template>\n {{ button.title }}\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import BentoButton from '../../button.vue';\n import { BentoButtonActionsLayout, BentoButtonActionsList } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n\n export default defineComponent({\n name: 'bento-button-actions',\n components: { BentoButton, BentoLoadingButton },\n props: {\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n layout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (layout: BentoButtonActionsLayout) =>\n Object.values(BentoButtonActionsLayout).includes(layout),\n },\n },\n setup(props) {\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? BentoButtonVariant.PRIMARY : BentoButtonVariant.SECONDARY;\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n }));\n\n return {\n // Values\n conditionalClasses,\n reversedActionsList,\n\n // Methods\n generateButtonVariantByIndex,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","_sfc_main","defineComponent","BentoButton","BentoLoadingButton","layout","props","reversedActionsList","computed","generateButtonVariantByIndex","actionIndex","lastActionIndex","BentoButtonVariant","openBlock","createElementBlock","_hoisted_1","createElementVNode","normalizeClass","_ctx","index","button","createBlock","_component_bento_loading_button","resolveDynamicComponent"],"mappings":";;;;;;;AAYY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA,IAAAD,KAAA,CAAA,CAAA;AAOL,MAAAE,IAAA,EAAA,GAAAJ,GAAA,GAAAE,EAAA,
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../vue2/src/components/button/components/button-actions/button-actions.types.ts","../../vue2/src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { VueNodeElement } from '@/types';\nimport type { BentoButtonProps, BentoLoadingButtonState } from '@/components/button';\n\nexport interface BentoButtonActionObject extends BentoButtonProps {\n title: string;\n event: (event: Event) => void;\n icon?: VueNodeElement;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n}\n\nexport type BentoButtonActionsList = Array<BentoButtonActionObject>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","<template>\n <div class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div v-for=\"(button, index) in reversedActionsList\" :key=\"index\" class=\"b-button-actions__button-wrapper\">\n <bento-loading-button\n v-if=\"button.state\"\n :state=\"button.state\"\n :disabled=\"button.disabled\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n @click=\"button.event\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n :link=\"button.link\"\n @click=\"button.event\"\n >\n <template v-if=\"button.icon\" #iconLeft>\n <component :is=\"button.icon\" :svg-title=\"button.title\"></component>\n </template>\n {{ button.title }}\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import BentoButton from '../../button.vue';\n import { BentoButtonActionsLayout, BentoButtonActionsList } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n\n export default defineComponent({\n name: 'bento-button-actions',\n components: { BentoButton, BentoLoadingButton },\n props: {\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n layout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (layout: BentoButtonActionsLayout) =>\n Object.values(BentoButtonActionsLayout).includes(layout),\n },\n\n /**\n * Sets the Button Actions to color scheme inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? BentoButtonVariant.PRIMARY : BentoButtonVariant.SECONDARY;\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n }));\n\n return {\n // Values\n conditionalClasses,\n reversedActionsList,\n\n // Methods\n generateButtonVariantByIndex,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","_sfc_main","defineComponent","BentoButton","BentoLoadingButton","layout","props","reversedActionsList","computed","generateButtonVariantByIndex","actionIndex","lastActionIndex","BentoButtonVariant","openBlock","createElementBlock","_hoisted_1","createElementVNode","normalizeClass","_ctx","index","button","createBlock","_component_bento_loading_button","resolveDynamicComponent"],"mappings":";;;;;;;AAYY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA,IAAAD,KAAA,CAAA,CAAA;AAOL,MAAAE,IAAA,EAAA,GAAAJ,GAAA,GAAAE,EAAA,GCcHG,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,aAAAC,GAAA,oBAAAC,EAAA;AAAA,EACwC,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAC,GAAA;AAAA,UAAY,KAAA;AAAA,UACnB,OAAAF,EAAA;AAAA,UACS,UAAAA,EAAA;AAAA,UACK,SAAAA,EAAA,WAAAF,EAAA,6BAAAC,CAAA;AAAA;;;;;;;UAMW,KAAA;AAAA,UACzB,UAAAC,EAAA;AAAA,UACS,UAAAA,EAAA;AAAA,UACO,SAAAF,EAAA;AAAA,UACH,SAAAE,EAAA,WAAAF,EAAA,6BAAAC,CAAA;AAAA,UACM,MAAAC,EAAA;AAAA;;;;;UAEJ,GAAA;AAAA,QAAA,GAAA;AAAA;;;eAC6BP,EAAA,GAAAQ,EAAAE,EAAAH,EAAA,IAAA,GAAA;AAAA;;;;;;;;;;;"}
|
package/dist/card.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { defineComponent as j, ref as A, watch as B, computed as a, resolveComponent as
|
|
2
|
-
import { B as Y } from "./chunks/index.
|
|
1
|
+
import { defineComponent as j, ref as A, watch as B, computed as a, resolveComponent as v, openBlock as t, createElementBlock as r, normalizeClass as b, renderSlot as p, createCommentVNode as s, withKeys as L, createElementVNode as m, createBlock as C, mergeProps as F, withCtx as f, createVNode as T, Transition as P, normalizeStyle as V } from "vue";
|
|
2
|
+
import { B as Y } from "./chunks/index.2bd3812b.js";
|
|
3
3
|
import { a as K, C as q } from "./chunks/chevron-up.9bf21068.js";
|
|
4
4
|
import { u as G } from "./chunks/use-has-slot.4d98bf29.js";
|
|
5
5
|
import { g as J } from "./chunks/unique-id.a2a2b458.js";
|
|
6
6
|
import { u as Q } from "./chunks/i18n.6c402773.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./
|
|
11
|
-
|
|
7
|
+
import { o as X } from "./chunks/resize.a041304d.js";
|
|
8
|
+
import { u as Z } from "./chunks/use-expandable-content-height.62fc84e5.js";
|
|
9
|
+
import { BentoButtonActions as ee, BentoButtonActionsLayout as H } from "./button.js";
|
|
10
|
+
import { _ as ae } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
11
|
+
import "./assets/index.css";
|
|
12
|
+
var _ = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e))(_ || {}), h = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.SMALL = "small", e))(h || {});
|
|
12
13
|
const I = {
|
|
13
14
|
"en-US": {
|
|
14
15
|
showCardContent: "Show card content",
|
|
15
16
|
hideCardContent: "Hide card content"
|
|
16
17
|
}
|
|
17
|
-
},
|
|
18
|
+
}, te = j({
|
|
18
19
|
i18n: { messages: I },
|
|
19
20
|
name: "bento-card",
|
|
20
|
-
components: { ChevronUpIcon: K, ChevronDownIcon: q, BentoTypography: Y, BentoButtonActions:
|
|
21
|
+
components: { ChevronUpIcon: K, ChevronDownIcon: q, BentoTypography: Y, BentoButtonActions: ee },
|
|
21
22
|
props: {
|
|
22
23
|
/**
|
|
23
24
|
* Defines the color of card background
|
|
24
25
|
*/
|
|
25
26
|
background: {
|
|
26
27
|
type: String,
|
|
27
|
-
default:
|
|
28
|
-
validator: (e) => Object.values(
|
|
28
|
+
default: _.PRIMARY,
|
|
29
|
+
validator: (e) => Object.values(_).includes(e)
|
|
29
30
|
},
|
|
30
31
|
/**
|
|
31
32
|
* Defines the title size of the card header
|
|
32
33
|
*/
|
|
33
34
|
titleSize: {
|
|
34
35
|
type: String,
|
|
35
|
-
default:
|
|
36
|
-
validator: (e) => Object.values(
|
|
36
|
+
default: h.DEFAULT,
|
|
37
|
+
validator: (e) => Object.values(h).includes(e)
|
|
37
38
|
},
|
|
38
39
|
/**
|
|
39
40
|
* The whole content of the card will be expandable in accordion manner
|
|
@@ -102,18 +103,18 @@ const I = {
|
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
105
|
emits: ["click", "expanded"],
|
|
105
|
-
setup(e, { emit: n, slots:
|
|
106
|
-
const { t: k } = Q({ messages: I }), o = G(
|
|
106
|
+
setup(e, { emit: n, slots: w }) {
|
|
107
|
+
const { t: k } = Q({ messages: I }), o = G(w), c = A(null), g = J("card"), i = A(!e.closed);
|
|
107
108
|
B(
|
|
108
109
|
() => e.closed,
|
|
109
110
|
(l) => {
|
|
110
|
-
|
|
111
|
+
i.value = !l;
|
|
111
112
|
}
|
|
112
113
|
);
|
|
113
|
-
const
|
|
114
|
+
const u = a(() => o("default") || o("description") || o("header")), y = a(() => o("default") || o("header")), d = a(
|
|
114
115
|
() => {
|
|
115
116
|
var l;
|
|
116
|
-
return (o("content") || ((l = e.actions) == null ? void 0 : l.length)) && (!e.expandable || e.expandable &&
|
|
117
|
+
return (o("content") || ((l = e.actions) == null ? void 0 : l.length)) && (!e.expandable || e.expandable && i.value);
|
|
117
118
|
}
|
|
118
119
|
), $ = a(() => e.expandable && !e.disabled ? 0 : -1), D = a(() => ({
|
|
119
120
|
[`b-card--${e.background}`]: e.background,
|
|
@@ -122,59 +123,58 @@ const I = {
|
|
|
122
123
|
})), M = a(() => ({
|
|
123
124
|
"b-card__header--expandable": e.expandable,
|
|
124
125
|
"b-card__header--without-body": !e.expandable && !d.value
|
|
125
|
-
})),
|
|
126
|
-
"b-card__toggle--small-text": e.titleSize ===
|
|
126
|
+
})), z = a(() => ({
|
|
127
|
+
"b-card__toggle--small-text": e.titleSize === h.SMALL
|
|
127
128
|
})), N = a(() => ({
|
|
128
129
|
"b-card__body--expandable": e.expandable && o("content"),
|
|
129
|
-
"b-card__body--without-header": !e.expandable && !
|
|
130
|
+
"b-card__body--without-header": !e.expandable && !u.value
|
|
130
131
|
})), U = a(() => ({
|
|
131
|
-
"b-card__content--without-header": !e.expandable && !
|
|
132
|
+
"b-card__content--without-header": !e.expandable && !u.value,
|
|
132
133
|
"b-card__content--expandable": e.expandable
|
|
133
|
-
})),
|
|
134
|
+
})), x = a(() => {
|
|
134
135
|
const l = !e.expandable && e.actions && !o("content");
|
|
135
136
|
return {
|
|
136
137
|
"b-card__actions--without-content": l,
|
|
137
|
-
"b-card__actions--without-content-and-with-header": l &&
|
|
138
|
+
"b-card__actions--without-content-and-with-header": l && u.value
|
|
138
139
|
};
|
|
139
140
|
}), O = a(() => ({
|
|
140
141
|
"b-card__title-wrapper--truncated": o("header")
|
|
141
142
|
})), R = a(
|
|
142
143
|
() => ({
|
|
143
144
|
el: "div",
|
|
144
|
-
variant: e.titleSize ===
|
|
145
|
-
strongest: e.titleSize ===
|
|
146
|
-
wide: e.titleSize ===
|
|
145
|
+
variant: e.titleSize === h.DEFAULT ? "title" : "body",
|
|
146
|
+
strongest: e.titleSize === h.SMALL,
|
|
147
|
+
wide: e.titleSize === h.SMALL
|
|
147
148
|
})
|
|
148
|
-
), { updateContentHeight: S, contentHeight: E } =
|
|
149
|
+
), { updateContentHeight: S, contentHeight: E } = Z(c, i), W = a(
|
|
149
150
|
() => e.expandable && E.value ? { "max-height": E.value } : {}
|
|
150
151
|
);
|
|
151
152
|
return B(
|
|
153
|
+
() => c.value,
|
|
152
154
|
() => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
{ immediate: !0 }
|
|
155
|
+
let l = null;
|
|
156
|
+
!l && c.value && (l = X(c.value, () => {
|
|
157
|
+
c.value && S();
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
160
|
), {
|
|
161
161
|
// Values
|
|
162
|
-
cardId:
|
|
162
|
+
cardId: g,
|
|
163
163
|
cardConditionalClasses: D,
|
|
164
164
|
cardBodyConditionalClasses: N,
|
|
165
165
|
cardHeaderConditionalClasses: M,
|
|
166
166
|
cardContentConditionalClasses: U,
|
|
167
|
-
cardActionsConditionalClasses:
|
|
167
|
+
cardActionsConditionalClasses: x,
|
|
168
168
|
cardTitleWrapperConditionalClasses: O,
|
|
169
|
-
cardToggleConditionalClasses:
|
|
169
|
+
cardToggleConditionalClasses: z,
|
|
170
170
|
showCardBody: d,
|
|
171
|
-
showContent:
|
|
171
|
+
showContent: i,
|
|
172
172
|
tabIndex: $,
|
|
173
|
-
showHeader:
|
|
174
|
-
showTitleWrapper:
|
|
173
|
+
showHeader: u,
|
|
174
|
+
showTitleWrapper: y,
|
|
175
175
|
typography: R,
|
|
176
176
|
// Expand animation
|
|
177
|
-
contentDiv:
|
|
177
|
+
contentDiv: c,
|
|
178
178
|
contentMaxHeight: W,
|
|
179
179
|
// Methods
|
|
180
180
|
hasSlot: o,
|
|
@@ -183,31 +183,31 @@ const I = {
|
|
|
183
183
|
},
|
|
184
184
|
t: k,
|
|
185
185
|
toggleExpansion: () => {
|
|
186
|
-
!e.disabled && e.expandable && (
|
|
186
|
+
!e.disabled && e.expandable && (i.value = !i.value, n("expanded", i.value), S());
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
|
-
const
|
|
191
|
+
const ne = {
|
|
192
192
|
key: 0,
|
|
193
193
|
class: "b-card__image"
|
|
194
|
-
},
|
|
194
|
+
}, oe = ["tabindex", "aria-controls", "aria-expanded", "role"], de = { class: "b-card__header-wrapper" }, le = {
|
|
195
195
|
key: 0,
|
|
196
196
|
class: "b-card__header-slot-wrapper"
|
|
197
|
-
},
|
|
198
|
-
function ie(e, n,
|
|
199
|
-
const
|
|
197
|
+
}, se = ["id"];
|
|
198
|
+
function ie(e, n, w, k, o, c) {
|
|
199
|
+
const g = v("chevron-up-icon"), i = v("chevron-down-icon"), u = v("bento-typography"), y = v("bento-button-actions");
|
|
200
200
|
return t(), r("div", {
|
|
201
|
-
class:
|
|
201
|
+
class: b(["b-card", e.cardConditionalClasses]),
|
|
202
202
|
"data-testid": "card",
|
|
203
203
|
onClick: n[3] || (n[3] = (...d) => e.onClick && e.onClick(...d))
|
|
204
204
|
}, [
|
|
205
|
-
e.hasSlot("image") ? (t(), r("div",
|
|
206
|
-
|
|
207
|
-
])) :
|
|
205
|
+
e.hasSlot("image") ? (t(), r("div", ne, [
|
|
206
|
+
p(e.$slots, "image", {}, void 0, !0)
|
|
207
|
+
])) : s("", !0),
|
|
208
208
|
e.showHeader ? (t(), r("div", {
|
|
209
209
|
key: 1,
|
|
210
|
-
class:
|
|
210
|
+
class: b(["b-card__header", e.cardHeaderConditionalClasses]),
|
|
211
211
|
tabindex: e.tabIndex,
|
|
212
212
|
"aria-controls": e.expandable ? e.cardId : null,
|
|
213
213
|
"aria-expanded": e.expandable ? `${e.showContent}` : null,
|
|
@@ -218,87 +218,87 @@ function ie(e, n, h, k, o, v) {
|
|
|
218
218
|
n[2] || (n[2] = L((...d) => e.toggleExpansion && e.toggleExpansion(...d), ["space"]))
|
|
219
219
|
]
|
|
220
220
|
}, [
|
|
221
|
-
|
|
222
|
-
e.showTitleWrapper ? (t(), r("div",
|
|
223
|
-
|
|
224
|
-
class:
|
|
221
|
+
m("div", de, [
|
|
222
|
+
e.showTitleWrapper ? (t(), r("div", le, [
|
|
223
|
+
m("div", {
|
|
224
|
+
class: b(["b-card__title-wrapper", e.cardTitleWrapperConditionalClasses])
|
|
225
225
|
}, [
|
|
226
226
|
e.expandable ? (t(), r("div", {
|
|
227
227
|
key: 0,
|
|
228
|
-
class:
|
|
228
|
+
class: b(["b-card__toggle", e.cardToggleConditionalClasses])
|
|
229
229
|
}, [
|
|
230
|
-
e.showContent ? (t(), g
|
|
230
|
+
e.showContent ? (t(), C(g, {
|
|
231
231
|
key: 0,
|
|
232
232
|
"svg-title": e.t("hideCardContent"),
|
|
233
233
|
"aria-hidden": "true"
|
|
234
|
-
}, null, 8, ["svg-title"])) : (t(),
|
|
234
|
+
}, null, 8, ["svg-title"])) : (t(), C(i, {
|
|
235
235
|
key: 1,
|
|
236
236
|
"svg-title": e.t("showCardContent"),
|
|
237
237
|
"aria-hidden": "true"
|
|
238
238
|
}, null, 8, ["svg-title"]))
|
|
239
|
-
], 2)) :
|
|
240
|
-
e.hasSlot("default") ? (t(),
|
|
239
|
+
], 2)) : s("", !0),
|
|
240
|
+
e.hasSlot("default") ? (t(), C(u, F({
|
|
241
241
|
key: 1,
|
|
242
242
|
class: "b-card__title"
|
|
243
243
|
}, e.typography), {
|
|
244
244
|
default: f(() => [
|
|
245
|
-
|
|
245
|
+
p(e.$slots, "default", {}, void 0, !0)
|
|
246
246
|
]),
|
|
247
247
|
_: 3
|
|
248
|
-
}, 16)) :
|
|
248
|
+
}, 16)) : s("", !0)
|
|
249
249
|
], 2),
|
|
250
|
-
e.hasSlot("header") ?
|
|
251
|
-
])) :
|
|
252
|
-
e.hasSlot("description") ? (t(),
|
|
250
|
+
e.hasSlot("header") ? p(e.$slots, "header", { key: 0 }, void 0, !0) : s("", !0)
|
|
251
|
+
])) : s("", !0),
|
|
252
|
+
e.hasSlot("description") ? (t(), C(u, {
|
|
253
253
|
key: 1,
|
|
254
254
|
class: "b-card__description",
|
|
255
255
|
el: "div",
|
|
256
256
|
variant: "body"
|
|
257
257
|
}, {
|
|
258
258
|
default: f(() => [
|
|
259
|
-
|
|
259
|
+
p(e.$slots, "description", {}, void 0, !0)
|
|
260
260
|
]),
|
|
261
261
|
_: 3
|
|
262
|
-
})) :
|
|
262
|
+
})) : s("", !0)
|
|
263
263
|
])
|
|
264
|
-
], 42,
|
|
264
|
+
], 42, oe)) : s("", !0),
|
|
265
265
|
T(P, { name: "b-card__animation" }, {
|
|
266
266
|
default: f(() => [
|
|
267
267
|
e.showCardBody ? (t(), r("div", {
|
|
268
268
|
key: 0,
|
|
269
269
|
style: V(e.contentMaxHeight)
|
|
270
270
|
}, [
|
|
271
|
-
|
|
271
|
+
m("div", {
|
|
272
272
|
id: e.expandable ? e.cardId : null,
|
|
273
273
|
ref: "contentDiv",
|
|
274
|
-
class:
|
|
274
|
+
class: b(["b-card__body", e.cardBodyConditionalClasses])
|
|
275
275
|
}, [
|
|
276
276
|
e.hasSlot("content") ? (t(), r("div", {
|
|
277
277
|
key: 0,
|
|
278
|
-
class:
|
|
278
|
+
class: b(["b-card__content", e.cardContentConditionalClasses])
|
|
279
279
|
}, [
|
|
280
|
-
|
|
281
|
-
], 2)) :
|
|
280
|
+
p(e.$slots, "content", {}, void 0, !0)
|
|
281
|
+
], 2)) : s("", !0),
|
|
282
282
|
e.actions ? (t(), r("div", {
|
|
283
283
|
key: 1,
|
|
284
|
-
class:
|
|
284
|
+
class: b(["b-card__actions", e.cardActionsConditionalClasses])
|
|
285
285
|
}, [
|
|
286
|
-
T(
|
|
286
|
+
T(y, {
|
|
287
287
|
actions: e.actions,
|
|
288
288
|
layout: e.actionsLayout
|
|
289
289
|
}, null, 8, ["actions", "layout"])
|
|
290
|
-
], 2)) :
|
|
291
|
-
], 10,
|
|
292
|
-
], 4)) :
|
|
290
|
+
], 2)) : s("", !0)
|
|
291
|
+
], 10, se)
|
|
292
|
+
], 4)) : s("", !0)
|
|
293
293
|
]),
|
|
294
294
|
_: 3
|
|
295
295
|
})
|
|
296
296
|
], 2);
|
|
297
297
|
}
|
|
298
|
-
const
|
|
298
|
+
const _e = /* @__PURE__ */ ae(te, [["render", ie], ["__scopeId", "data-v-f302d0dd"]]);
|
|
299
299
|
export {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
_e as BentoCard,
|
|
301
|
+
_ as BentoCardBackground,
|
|
302
|
+
h as BentoCardTitleSize
|
|
303
303
|
};
|
|
304
304
|
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => slots.content?.(),\n () => {\n if (props.expandable) {\n updateContentHeight();\n }\n },\n { immediate: true }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Expand animation\n contentDiv,\n contentMaxHeight,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createElementVNode","_hoisted_3","_hoisted_4","createBlock","_component_chevron_up_icon","_component_chevron_down_icon","createCommentVNode","_component_bento_typography","mergeProps","withCtx","renderSlot","_hoisted_2","createVNode","Transition"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;GCsFRE,KAAAC,EAAA;AAAA,EAA+B,MAAA,EAAA,UAAAC,EAAA;AAAA,EACV,MAAA;AAAA,EACX,YAAA,EAAA,eAAAC,GAAA,iBAAAC,GAAA,iBAAAC,GAAA,oBAAAC,EAAA;AAAA,EAC4E,OAAA;AAAA;AAAA;AAAA;AAAA,IAC3E,YAAA;AAAA,MAIS,MAAA;AAAA,MACF,SAAAV,EAAA;AAAA,MACuB,WAAA,CAAAW,MAAA,OAAA,OAAAX,CAAA,EAAA,SAA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AAR,EAAA,EAAA,iBAAA;AAAA;;YAExC,GAAA,CAAA,KAAAS,EAAA,IAAA,EAAA;AAAA,YAELT,EAAA,QAAA,SAAA,KAAAH,EAAA,GAAAS,EAAAI,GAAAC,EAAA;AAAA,cAF8C,KAAA;AAAA,cAAS,OAAA;AAAA;cAC9D,SAAAC,EAAA,MAAA;AAAA;;;;UAIO,GAAA,CAAA;AAAA,UACnBZ,EAAA,QAAA,QAAA,IAAAa,EAAAb,EAAA,QAAA,UAAA,EAAA,KAAA,EAAA,GAAA,QAAA,EAAA,IAAAS,EAAA,IAAA,EAAA;AAAA,QAIgB,CAAA,KAAAA,EAAA,IAAA,EAAA;AAAA,QAELT,EAAA,QAAA,aAAA,KAAAH,EAAA,GAAAS,EAAAI,GAAA;AAAA,UAFwD,KAAA;AAAA,UAAI,OAAA;AAAA,UAAa,IAAA;AAAA;;;;;;;;IAMpG,GAAA,IAAAI,EAAA,KAAAL,EAAA,IAAA,EAAA;AAAA,IAgBUM,EAAAC,GAAA,EAAA,MAAA,oBAAA,GAAA;AAAA,MAfiB,SAAAJ,EAAA,MAAA;AAAA,QAAvBZ,EAAA,gBAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,UAAiC,KAAA;AAAA;QAcvB,GAAA;AAAA,UAXcK,EAAA,OAAA;AAAA,YAAA,IAAAH,EAAA,aAAAA,EAAA,SAAA;AAAA,YACV,KAAA;AAAA;UAGY,GAAA;AAAA;cAAmB,KAAA;AAAA;YACV,GAAA;AAAA;;YAG3BA,EAAA,WAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,cAA0B,KAAA;AAAA;YACkE,GAAA;AAAA;gBAAzB,SAAAE,EAAA;AAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Expand animation\n contentDiv,\n contentMaxHeight,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createElementVNode","_hoisted_3","_hoisted_4","createBlock","_component_chevron_up_icon","_component_chevron_down_icon","createCommentVNode","_component_bento_typography","mergeProps","withCtx","renderSlot","_hoisted_2","createVNode","Transition"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,E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AA,aAAAA,EAAA,SAAA;AAAA,YACV,KAAA;AAAA;UAGY,GAAA;AAAA;cAAmB,KAAA;AAAA;YACV,GAAA;AAAA;;YAG3BA,EAAA,WAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,cAA0B,KAAA;AAAA;YACkE,GAAA;AAAA;gBAAzB,SAAAE,EAAA;AAAA;;;;;;;;;;;"}
|
package/dist/checkbox.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as v, b as l } from "./chunks/checkbox.
|
|
2
|
-
import { a as X } from "./chunks/checkbox.
|
|
1
|
+
import { B as v, b as l } from "./chunks/checkbox.3cdbdd52.js";
|
|
2
|
+
import { a as X } from "./chunks/checkbox.3cdbdd52.js";
|
|
3
3
|
import { defineComponent as E, toRef as _, computed as u, ref as C, watch as B, resolveComponent as p, openBlock as t, createElementBlock as f, createVNode as S, normalizeClass as I, withCtx as c, Fragment as V, renderList as G, createBlock as g, createSlots as M, createTextVNode as y, toDisplayString as k, createCommentVNode as T } from "vue";
|
|
4
4
|
import { g as w } from "./chunks/unique-id.a2a2b458.js";
|
|
5
|
-
import { d as L } from "./chunks/index.
|
|
5
|
+
import { d as L } from "./chunks/index.2bd3812b.js";
|
|
6
6
|
import { u as x } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
7
|
-
import { C as A } from "./chunks/controls-group.
|
|
8
|
-
import { E as U } from "./chunks/error-message.
|
|
7
|
+
import { C as A } from "./chunks/controls-group.38b436f6.js";
|
|
8
|
+
import { E as U } from "./chunks/error-message.64e1964b.js";
|
|
9
9
|
import { _ as N } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
10
|
-
import "./assets/
|
|
10
|
+
import "./assets/index2.css";
|
|
11
11
|
var s = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(s || {});
|
|
12
12
|
const O = E({
|
|
13
13
|
name: "bento-checkbox-group",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as B, computed as C, ref as y, resolveComponent as _, openBlock as r, createElementBlock as l, normalizeClass as m, renderSlot as u, createCommentVNode as d, createBlock as S, withCtx as k } from "vue";
|
|
2
|
-
import { B as g } from "./index.
|
|
2
|
+
import { B as g } from "./index.2bd3812b.js";
|
|
3
3
|
import { u as h } from "./use-has-slot.4d98bf29.js";
|
|
4
4
|
import { _ as L } from "./_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import "../assets/base-button.css";
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
T as B,
|
|
114
114
|
n as a
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=base-button.
|
|
116
|
+
//# sourceMappingURL=base-button.7897a95e.js.map
|