@adyen/bento-vue3 1.1.0 → 1.2.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/packages/vue2/src/components/accordion/accordion.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/accordion/components/accordion-item.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +24 -20
- package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/badge/badge.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +43 -43
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/button/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +36 -32
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +14 -14
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/click-outside/click-outside.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +23 -19
- package/dist/@types/packages/vue2/src/components/code-snippet/composables/useLanguage.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/country/composables/useCountryCapital/useCountryCapital.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/country/composables/useCountryFlag.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/country/composables/useCountryName/useCountryName.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/country/composables/useCountryPhoneCode/useCountryPhoneCode.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +15 -13
- package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +12 -12
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/components/data-grid-config-settings-column-row/data-grid-config-settings-column-row.vue.d.ts +11 -11
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +12 -12
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateBodyFitContentDynamicStyles/useCalculateBodyFitContentDynamicStyles.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useKeyboardNavigator/useKeyboardNavigator.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useResizer.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useSelector.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useSorter.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +30 -30
- package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +11 -9
- package/dist/@types/packages/vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/date-range-picker/composables/use-date-range-picker-calendar-text.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/composables/use-date-range-picker-calendar-text.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/divider/divider.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/useDropdownOptionsListbox.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +100 -98
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/useCountryItems.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useKeyboardNavigation.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +27 -25
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +41 -41
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/components/all-filters-modal-button/all-filters-modal-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/components/filter-bar-filter-button/filter-bar-filter-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/composables/use-base-filter.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +18 -18
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +14 -14
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +12 -12
- package/dist/@types/packages/vue2/src/components/focus-trap/focus-trap.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +11 -9
- package/dist/@types/packages/vue2/src/components/input-field/input-field.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +36 -28
- package/dist/@types/packages/vue2/src/components/internal/avatar/avatar.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/calendar-month.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/components/calendar-month-day/__test__/calendar-month-day-stub.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/move-calendar-date.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/internal/error-message/error-message.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/footer-actions/footer-actions.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +11 -11
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option/listbox-option.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +24 -22
- package/dist/@types/packages/vue2/src/components/link/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/loading-indicator/loading-indicator.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item-list/menu-item-list.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/menu/components/menu-list-container/menu-list-container.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +11 -11
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +28 -20
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-context/pagination-context.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-controls/pagination-controls.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/payment-method/composables/usePaymentIcon.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +11 -9
- package/dist/@types/packages/vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/popover/components/popover-image/popover-image.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/popover/components/popover-title/popover-title.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +19 -19
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.utils.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +97 -85
- package/dist/@types/packages/vue2/src/components/search-bar/useSearchBarDataFilter.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/segmented-control/segmented-control.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +47 -39
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +19 -13
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +19 -13
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +19 -13
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +25 -23
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +30 -30
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/toast/components/toast-item/toast-item.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/toast/toast.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/toggle/toggle.types.d.ts +4 -0
- package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +16 -16
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +37 -37
- package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +10 -10
- package/dist/@types/packages/vue2/src/composables/initials.d.ts +2 -2
- package/dist/@types/packages/vue2/src/composables/use-checkbox-select-all/use-checkbox-select-all.d.ts +3 -3
- package/dist/@types/packages/vue2/src/composables/use-has-slot/use-has-slot.d.ts +1 -1
- package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +2 -2
- package/dist/@types/packages/vue2/src/directives/click-outside/directive.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/click-outside/on-click-outside.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/click-outside/types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/click-outside/useEventListener/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/click-outside/utils.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/keyboard-navigation/keyboard-navigation.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/keyboard-navigation/keyboard-navigation.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/directives/tooltip/tooltip.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/install.d.ts +1 -1
- package/dist/@types/packages/vue2/src/plugins/toastController.d.ts +1 -1
- package/dist/@types/packages/vue2/src/types/elements.d.ts +1 -1
- package/dist/@types/packages/vue2/src/types/index.d.ts +0 -1
- package/dist/@types/packages/vue2/src/types/listbox.d.ts +1 -1
- package/dist/@types/packages/vue2/src/types/maybe-ref.d.ts +1 -1
- package/dist/@types/packages/vue2/src/types/refs.d.ts +1 -1
- package/dist/@types/packages/vue2/src/utils/ts/aria-label.d.ts +2 -2
- package/dist/@types/packages/vue2/src/utils/ts/events.d.ts +1 -1
- package/dist/@types/packages/vue2/src/utils/ts/focus-trap.utils.d.ts +1 -1
- package/dist/@types/packages/vue2/src/utils/ts/get-slot-text/get-slot-text.d.ts +1 -1
- package/dist/@types/packages/vue2/src/utils/ts/i18n.d.ts +1 -1
- package/dist/alert.js +49 -47
- package/dist/alert.js.map +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- 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/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/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- 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/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +77 -68
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +16 -16
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.fe807878.js → base-button.4a56c2fb.js} +2 -2
- package/dist/chunks/{base-button.fe807878.js.map → base-button.4a56c2fb.js.map} +1 -1
- package/dist/chunks/{button-actions.59449cda.js → button-actions.a6e541ad.js} +7 -7
- package/dist/chunks/{button-actions.59449cda.js.map → button-actions.a6e541ad.js.map} +1 -1
- package/dist/chunks/{button.4ccc3a72.js → button.1f630b6e.js} +10 -10
- package/dist/chunks/button.1f630b6e.js.map +1 -0
- package/dist/chunks/{calendar.1fb0d5b2.js → calendar.08885a56.js} +4 -4
- package/dist/chunks/{calendar.1fb0d5b2.js.map → calendar.08885a56.js.map} +1 -1
- package/dist/chunks/{checkbox.39fa87c7.js → checkbox.cfb8b8df.js} +3 -3
- package/dist/chunks/{checkbox.39fa87c7.js.map → checkbox.cfb8b8df.js.map} +1 -1
- package/dist/chunks/{controls-group.0126679a.js → controls-group.806da9bd.js} +2 -2
- package/dist/chunks/{controls-group.0126679a.js.map → controls-group.806da9bd.js.map} +1 -1
- package/dist/chunks/{copy.012e43f2.js → copy.1ce0203e.js} +3 -3
- package/dist/chunks/{copy.012e43f2.js.map → copy.1ce0203e.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.2ac50ee2.js → dropdown-default-textbox.dd77bb42.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.2ac50ee2.js.map → dropdown-default-textbox.dd77bb42.js.map} +1 -1
- package/dist/chunks/{dropdown.374481a8.js → dropdown.f9997464.js} +84 -82
- package/dist/chunks/dropdown.f9997464.js.map +1 -0
- package/dist/chunks/{error-message.a65a9abf.js → error-message.b88bb75a.js} +2 -2
- package/dist/chunks/{error-message.a65a9abf.js.map → error-message.b88bb75a.js.map} +1 -1
- package/dist/chunks/{index.0f958a0c.js → index.361c61d3.js} +2 -2
- package/dist/chunks/{index.0f958a0c.js.map → index.361c61d3.js.map} +1 -1
- package/dist/chunks/{index.05d4c01b.js → index.64b7b3cc.js} +6 -6
- package/dist/chunks/{index.05d4c01b.js.map → index.64b7b3cc.js.map} +1 -1
- package/dist/chunks/{index.c25bbcc8.js → index.7dd953ea.js} +53 -52
- package/dist/chunks/{index.c25bbcc8.js.map → index.7dd953ea.js.map} +1 -1
- package/dist/chunks/{index.1e002876.js → index.96001b1d.js} +3 -3
- package/dist/chunks/{index.1e002876.js.map → index.96001b1d.js.map} +1 -1
- package/dist/chunks/{index.b2d970f6.js → index.b46a5047.js} +20 -20
- package/dist/chunks/{index.b2d970f6.js.map → index.b46a5047.js.map} +1 -1
- package/dist/chunks/index.ebf5f6cf.js +119 -0
- package/dist/chunks/index.ebf5f6cf.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.caa1ceba.js → listbox-option-tag.73661a5d.js} +3 -3
- package/dist/chunks/{listbox-option-tag.caa1ceba.js.map → listbox-option-tag.73661a5d.js.map} +1 -1
- package/dist/chunks/{listbox.ceacb0ca.js → listbox.7b5e0eee.js} +42 -41
- package/dist/chunks/{listbox.ceacb0ca.js.map → listbox.7b5e0eee.js.map} +1 -1
- package/dist/chunks/{loading-button.5b8db3dc.js → loading-button.426d89b9.js} +2 -2
- package/dist/chunks/{loading-button.5b8db3dc.js.map → loading-button.426d89b9.js.map} +1 -1
- package/dist/chunks/{tooltip.ca53a83a.js → tooltip.53290a34.js} +2 -2
- package/dist/chunks/{tooltip.ca53a83a.js.map → tooltip.53290a34.js.map} +1 -1
- package/dist/chunks/useCountryItems.e83ef8f0.js.map +1 -1
- package/dist/code-snippet.js +71 -69
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +25 -24
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/currency.js.map +1 -1
- package/dist/data-grid.js +204 -204
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +21 -21
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/dropdown.js.map +1 -1
- package/dist/filter-bar.js +13 -13
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header.js +61 -61
- package/dist/header.js.map +1 -1
- package/dist/index.js +65 -65
- package/dist/info-icon.js +20 -19
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +81 -77
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +6 -6
- package/dist/link.js +15 -15
- package/dist/link.js.map +1 -1
- package/dist/menu.js +5 -5
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +113 -109
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +15 -14
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +21 -21
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +17 -17
- package/dist/popper-container.js.map +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +4 -4
- package/dist/status.js +6 -6
- package/dist/status.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +155 -142
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +2 -2
- package/dist/tag.js +8 -8
- package/dist/tag.js.map +1 -1
- package/dist/textarea.js +25 -21
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +31 -31
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +157 -3
- package/dist/toggle.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -4
- package/dist/@types/packages/vue2/src/types/label-position.d.ts +0 -4
- package/dist/chunks/button.4ccc3a72.js.map +0 -1
- package/dist/chunks/dropdown.374481a8.js.map +0 -1
- package/dist/chunks/index.0b6c7187.js +0 -160
- package/dist/chunks/index.0b6c7187.js.map +0 -1
- package/dist/chunks/index.92f7d550.js +0 -119
- package/dist/chunks/index.92f7d550.js.map +0 -1
package/dist/popover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../vue2/src/components/popover/popover.types.ts","../../vue2/src/components/popover/components/popover-title/popover-title.vue","../../vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue","../../vue2/src/components/popover/popover.vue"],"sourcesContent":["import { PopperContainerPosition } from '../popper-container';\n\nexport const BentoPopoverPositions = { ...PopperContainerPosition };\nexport type BentoPopoverPositions = PopperContainerPosition;\n","<template>\n <bento-typography :strongest=\"isStrongest\" :variant=\"titleVariant\" :el=\"BentoTypographyElement.SPAN\">\n {{ title }}\n </bento-typography>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n\n export default defineComponent({\n components: { BentoTypography },\n props: {\n /**\n * Indicates if the popover contains an image.\n */\n isImageTitle: { type: Boolean, default: false },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: { type: String, default: null },\n },\n setup(props) {\n // Use strongest only when it has no image\n const isStrongest = computed(() => !props.isImageTitle);\n\n // If an image is present, change the variant from BODY to SUBTITLE and remove the \"strongest\" property of the title\n const titleVariant = computed(() =>\n props.isImageTitle ? BentoTypographyVariant.SUBTITLE : BentoTypographyVariant.BODY\n );\n\n return {\n // Values\n isStrongest,\n titleVariant,\n\n // Enums\n BentoTypographyElement,\n };\n },\n });\n</script>\n","<template>\n <bento-button :class=\"conditionalClass\" :variant=\"BentoButtonVariant.TERTIARY\" @click=\"$emit('click')\">\n <template #iconLeft>\n <cross-icon svg-title=\"dismiss\" />\n </template>\n </bento-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoButton, BentoButtonVariant } from '@/components/button';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n export default defineComponent({\n name: 'bento-popover-dismiss-button',\n components: { BentoButton, CrossIcon },\n props: {\n onImage: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({ 'b-popover-dismiss-button--on-image': props.onImage }));\n\n return {\n // Values\n conditionalClass,\n\n // Enums\n BentoButtonVariant,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover-dismiss-button.scss\" />\n","<template>\n <Transition name=\"b-appear\">\n <popper-container\n v-if=\"open\"\n :id=\"computedAttributes['id']\"\n class=\"b-popover\"\n :aria-role=\"PopperContainerAriaRole.POPOVER\"\n :aria-label=\"computedAriaLabel\"\n :target-element=\"targetElement\"\n :position=\"position\"\n :offset=\"[0, 2]\"\n :modifiers=\"modifiers\"\n :fixed-positioning=\"fixedPositioning\"\n :disabled-focus-trap=\"disableFocusTrap\"\n :class=\"conditionalClasses\"\n :arrow=\"{ classes: ['b-popover__arrow'] }\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-popover__image\">\n <div v-if=\"dismissible\" class=\"b-popover__image-dismiss-button\">\n <bento-popover-dismiss-button on-image @click=\"dismissPopover\" />\n </div>\n <slot name=\"image\"></slot>\n </div>\n <div v-if=\"title\" class=\"b-popover__header\">\n <div class=\"b-popover__header-title\">\n <slot v-if=\"hasSlot('headerIcon')\" name=\"headerIcon\"></slot>\n <bento-popover-title :title=\"title\" :is-image-title=\"!!hasSlot('image')\" />\n </div>\n <div v-if=\"dismissible && !hasSlot('image')\">\n <bento-popover-dismiss-button @click=\"dismissPopover\" />\n </div>\n </div>\n\n <div v-if=\"hasSlot('default')\" class=\"b-popover__content\" :class=\"contentConditionalClasses\">\n <slot></slot>\n </div>\n\n <div v-if=\"actions\" class=\"b-popover__footer\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </popper-container>\n </Transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRefs } from 'vue';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoPopoverPositions } from './popover.types';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import BentoPopoverTitle from './components/popover-title/popover-title.vue';\n import BentoPopoverDismissButton from './components/popover-dismiss-button/popover-dismiss-button.vue';\n import { useHasSlot } from '@/composables';\n\n /**\n * Example description of the component...\n *\n * @example\n * import { BentoPopover } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoPopover },\n * template: `\n * <bento-popover id=\"your-popover-id\">\n * ...Example code of the component\n * </bento-popover>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-popover',\n components: {\n BentoButtonActions,\n BentoPopoverDismissButton,\n BentoPopoverTitle,\n PopperContainer,\n },\n inheritAttrs: true, // Have to do this to be able to add class for data picker\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`: 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 /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\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>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n\n /**\n * Defines a string value that provides an accessible name for the popover.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Adds a divider line to the actions section, reduces the top/bottom paddings and removes all padding in the \"default\" slot.\n */\n divider: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Supports disabling focus trap functionality to avoid scroll into view behavior when we don't need it.\n * */\n disableFocusTrap: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds a \"dismiss\" icon that triggers the \"dismiss\" event. Requires the `title` prop to be set.\n */\n dismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the container to fit its content\n */\n fitContent: { type: Boolean, default: false },\n\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Toggles the popover open and closed\n */\n open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays the popover in a large size.\n */\n large: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n\n /**\n * Popover's position relative to the target element.\n * Possible values are:\n * 'auto', 'auto-start', 'auto-end',\n * 'top', 'top-start', 'top-end'\n * 'right', 'right-start', 'right-end'\n * 'bottom', 'bottom-start', 'bottom-end'\n * 'left', 'left-start', 'left-end'\n */\n position: {\n type: String as PropType<BentoPopoverPositions>,\n default: BentoPopoverPositions.TOP,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Displays the popover in a small size.\n */\n small: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * Popover's target element.\n * The popover will position itself relatively to target element, in specified position.\n */\n targetElement: {\n type: PopperContainer.props?.targetElement.type,\n required: true,\n },\n /**\n * Displays the popover without padding.\n */\n withoutSpace: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['dismiss'],\n setup(props, { emit, attrs, slots }) {\n const { ariaLabel, title } = toRefs(props);\n\n const computedAttributes = computed(() => ({\n id: attrs.id?.toString() as string,\n }));\n\n const computedAriaLabel = useAriaLabel({ ariaLabel, label: title });\n\n const conditionalClasses = computed(() => ({\n 'b-popover--small': props.small && !props.large,\n 'b-popover--with-divider': !!props.divider,\n 'b-popover--large': props.large && !props.small,\n 'b-popover--fit-content': props.fitContent,\n 'b-popover--without-space': props.withoutSpace,\n }));\n\n const contentConditionalClasses = computed(() => ({\n 'b-popover__content--with-title': !!props.title,\n }));\n\n const dismissPopover = () => emit('dismiss');\n\n return {\n // Values\n conditionalClasses,\n contentConditionalClasses,\n computedAttributes,\n computedAriaLabel,\n\n // Enums\n PopperContainerAriaRole,\n\n // Events\n dismissPopover,\n\n // Methods\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover.scss\" />\n"],"names":["BentoPopoverPositions","PopperContainerPosition","_sfc_main$2","defineComponent","BentoTypography","props","isStrongest","computed","titleVariant","BentoTypographyVariant","BentoTypographyElement","_component_bento_typography","resolveComponent","openBlock","createBlock","_ctx","_sfc_main$1","BentoButton","CrossIcon","BentoButtonVariant","_component_bento_button","normalizeClass","_cache","$event","_sfc_main","BentoButtonActions","BentoPopoverDismissButton","BentoPopoverTitle","PopperContainer","BentoButtonActionsLayout","value","_a","emit","attrs","slots","ariaLabel","title","toRefs","computedAttributes","computedAriaLabel","useAriaLabel","conditionalClasses","contentConditionalClasses","PopperContainerAriaRole","useHasSlot","_component_popper_container","withCtx","createElementBlock","_hoisted_1","_hoisted_2","createVNode","_component_bento_popover_dismiss_button","createCommentVNode","_hoisted_3","createElementVNode","_hoisted_4","renderSlot","_component_bento_popover_title","_hoisted_6","_component_bento_button_actions"],"mappings":";;;;;;;;;;AAEa,MAAAA,IAAA,EAAA,GAAAC,EAAA,GCQTC,IAAAC,EAAA;AAAA,EAA+B,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACG,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,cAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAI2C,OAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA,EAKT;AAAA,EACzC,MAAAC,GAAA;AAGI,UAAAC,IAAAC,EAAA,MAAA,CAAAF,EAAA,YAAA,GAGAG,IAAAD;AAAA,MAAqB,MAAAF,EAAA,eAAAI,EAAA,WAAAA,EAAA;AAAA,IAC6D;AAGlF,WAAA;AAAA;AAAA,MAAO,aAAAH;AAAA,MAEH,cAAAE;AAAA;AAAA,MACA,wBAAAE;AAAA,IAGA;AAAA,EACJ;AAER,CAAA;;AAtCmB,QAAAC,IAAAC,EAAA,kBAAA;AAFyB,SAAAC,EAAA,GAAAC,EAAAH,GAAA;AAAA,IAAqB,WAAAI,EAAA;AAAA,IAAO,SAAAA,EAAA;AAAA,IACzD,IAAAA,EAAA,uBAAA;AAAA,EAAA,GAAA;AAAA;;;;;;iDCWfC,IAAAb,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,aAAAc,GAAA,WAAAC,EAAA;AAAA,EAC+B,OAAA;AAAA,IAC9B,SAAA;AAAA,MACM,MAAA;AAAA,MACC,SAAA;AAAA,IACG;AAAA,EACb;AAAA,EACJ,MAAAb,GAAA;AAII,WAAA;AAAA;AAAA,MAAO,kBAFPE,EAAA,OAAA,EAAA,sCAAAF,EAAA,QAAA,EAAA;AAAA;AAAA,MAII,oBAAAc;AAAA,IAGA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AAF,EAAA,GAAAkC,EAAA,OAAAC,GAAA;AAAA,YACIjC,EAAA,eAAAF,EAAA,GAAAkC,EAAA,OAAAE,GAAA;AAAA,cAC0CC,EAAAC,GAAA;AAAA,gBAAuB,YAAA;AAAA;;YAEjE,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA;;UAEJrC,EAAA,SAAAF,EAAA,GAAAkC,EAAA,OAAAM,GAAA;AAAA,YAE2BC,EAAA,OAAAC,GAAA;AAAA,cAAyCxC,EAAA,QAAA,YAAA,IAAAyC,EAAAzC,EAAA,QAAA,cAAA,EAAA,KAAA,EAAA,GAAA,QAAA,EAAA,IAAAqC,EAAA,IAAA,EAAA;AAAA,cAC1BF,EAAAO,GAAA;AAAA,gBAA4B,OAAA1C,EAAA;AAAA;cAEvD,GAAA,MAAA,GAAA,CAAA,SAAA,gBAAA,CAAA;AAAA,YAAuB,CAAA;AAAA;;;;UAKtCA,EAAA,QAAA,SAAA,KAAAF,EAAA,GAAAkC,EAAA,OAAA;AAAA,YAAqC,KAAA;AAAA;UACpB,GAAA;AAAA;;UAGjBhC,EAAA,WAAAF,EAAA,GAAAkC,EAAA,OAAAW,IAAA;AAAA,YAC2CR,EAAAS,GAAA;AAAA,cAAwB,SAAA5C,EAAA;AAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../vue2/src/components/popover/popover.types.ts","../../vue2/src/components/popover/components/popover-title/popover-title.vue","../../vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue","../../vue2/src/components/popover/popover.vue"],"sourcesContent":["import { PopperContainerPosition } from '../popper-container';\n\nexport const BentoPopoverPositions = { ...PopperContainerPosition };\nexport type BentoPopoverPositions = PopperContainerPosition;\n","<template>\n <bento-typography :strongest=\"isStrongest\" :variant=\"titleVariant\" :el=\"BentoTypographyElement.SPAN\">\n {{ title }}\n </bento-typography>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n\n export default defineComponent({\n components: { BentoTypography },\n props: {\n /**\n * Indicates if the popover contains an image.\n */\n isImageTitle: { type: Boolean, default: false },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: { type: String, default: null },\n },\n setup(props) {\n // Use strongest only when it has no image\n const isStrongest = computed(() => !props.isImageTitle);\n\n // If an image is present, change the variant from BODY to SUBTITLE and remove the \"strongest\" property of the title\n const titleVariant = computed(() =>\n props.isImageTitle ? BentoTypographyVariant.SUBTITLE : BentoTypographyVariant.BODY\n );\n\n return {\n // Values\n isStrongest,\n titleVariant,\n\n // Enums\n BentoTypographyElement,\n };\n },\n });\n</script>\n","<template>\n <bento-button :class=\"conditionalClass\" :variant=\"BentoButtonVariant.TERTIARY\" @click=\"$emit('click')\">\n <template #iconLeft>\n <cross-icon svg-title=\"dismiss\" />\n </template>\n </bento-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoButton, BentoButtonVariant } from '@/components/button';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n export default defineComponent({\n name: 'bento-popover-dismiss-button',\n components: { BentoButton, CrossIcon },\n props: {\n onImage: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({ 'b-popover-dismiss-button--on-image': props.onImage }));\n\n return {\n // Values\n conditionalClass,\n\n // Enums\n BentoButtonVariant,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover-dismiss-button.scss\" />\n","<template>\n <Transition name=\"b-appear\">\n <popper-container\n v-if=\"open\"\n :id=\"computedAttributes['id']\"\n class=\"b-popover\"\n :aria-role=\"PopperContainerAriaRole.POPOVER\"\n :aria-label=\"computedAriaLabel\"\n :target-element=\"targetElement\"\n :position=\"position\"\n :offset=\"[0, 2]\"\n :modifiers=\"modifiers\"\n :fixed-positioning=\"fixedPositioning\"\n :disabled-focus-trap=\"disableFocusTrap\"\n :class=\"conditionalClasses\"\n :arrow=\"{ classes: ['b-popover__arrow'] }\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-popover__image\">\n <div v-if=\"dismissible\" class=\"b-popover__image-dismiss-button\">\n <bento-popover-dismiss-button on-image @click=\"dismissPopover\" />\n </div>\n <slot name=\"image\"></slot>\n </div>\n <div v-if=\"title\" class=\"b-popover__header\">\n <div class=\"b-popover__header-title\">\n <slot v-if=\"hasSlot('headerIcon')\" name=\"headerIcon\"></slot>\n <bento-popover-title :title=\"title\" :is-image-title=\"!!hasSlot('image')\" />\n </div>\n <div v-if=\"dismissible && !hasSlot('image')\">\n <bento-popover-dismiss-button @click=\"dismissPopover\" />\n </div>\n </div>\n\n <div v-if=\"hasSlot('default')\" class=\"b-popover__content\" :class=\"contentConditionalClasses\">\n <slot></slot>\n </div>\n\n <div v-if=\"actions\" class=\"b-popover__footer\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </popper-container>\n </Transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRefs } from 'vue';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoPopoverPositions } from './popover.types';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import BentoPopoverTitle from './components/popover-title/popover-title.vue';\n import BentoPopoverDismissButton from './components/popover-dismiss-button/popover-dismiss-button.vue';\n import { useHasSlot } from '@/composables';\n\n /**\n * Example description of the component...\n *\n * @example\n * import { BentoPopover } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoPopover },\n * template: `\n * <bento-popover id=\"your-popover-id\">\n * ...Example code of the component\n * </bento-popover>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-popover',\n components: {\n BentoButtonActions,\n BentoPopoverDismissButton,\n BentoPopoverTitle,\n PopperContainer,\n },\n inheritAttrs: true, // Have to do this to be able to add class for data picker\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`: 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 /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\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 /**\n * Defines a string value that provides an accessible name for the popover.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Adds a divider line to the actions section, reduces the top/bottom paddings and removes all padding in the \"default\" slot.\n */\n divider: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Supports disabling focus trap functionality to avoid scroll into view behavior when we don't need it.\n * */\n disableFocusTrap: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds a \"dismiss\" icon that triggers the \"dismiss\" event. Requires the `title` prop to be set.\n */\n dismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the container to fit its content\n */\n fitContent: { type: Boolean, default: false },\n\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Toggles the popover open and closed\n */\n open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays the popover in a large size.\n */\n large: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n\n /**\n * Popover's position relative to the target element.\n * Possible values are:\n * 'auto', 'auto-start', 'auto-end',\n * 'top', 'top-start', 'top-end'\n * 'right', 'right-start', 'right-end'\n * 'bottom', 'bottom-start', 'bottom-end'\n * 'left', 'left-start', 'left-end'\n */\n position: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.TOP,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Displays the popover in a small size.\n */\n small: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * Popover's target element.\n * The popover will position itself relatively to target element, in specified position.\n */\n targetElement: {\n type: PopperContainer.props?.targetElement.type,\n required: true,\n },\n /**\n * Displays the popover without padding.\n */\n withoutSpace: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['dismiss'],\n setup(props, { emit, attrs, slots }) {\n const { ariaLabel, title } = toRefs(props);\n\n const computedAttributes = computed(() => ({\n id: attrs.id?.toString() as string,\n }));\n\n const computedAriaLabel = useAriaLabel({ ariaLabel, label: title });\n\n const conditionalClasses = computed(() => ({\n 'b-popover--small': props.small && !props.large,\n 'b-popover--with-divider': !!props.divider,\n 'b-popover--large': props.large && !props.small,\n 'b-popover--fit-content': props.fitContent,\n 'b-popover--without-space': props.withoutSpace,\n }));\n\n const contentConditionalClasses = computed(() => ({\n 'b-popover__content--with-title': !!props.title,\n }));\n\n const dismissPopover = () => emit('dismiss');\n\n return {\n // Values\n conditionalClasses,\n contentConditionalClasses,\n computedAttributes,\n computedAriaLabel,\n\n // Enums\n PopperContainerAriaRole,\n\n // Events\n dismissPopover,\n\n // Methods\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover.scss\" />\n"],"names":["BentoPopoverPositions","PopperContainerPosition","_sfc_main$2","defineComponent","BentoTypography","props","isStrongest","computed","titleVariant","BentoTypographyVariant","BentoTypographyElement","_component_bento_typography","resolveComponent","openBlock","createBlock","_ctx","_sfc_main$1","BentoButton","CrossIcon","BentoButtonVariant","_component_bento_button","normalizeClass","_cache","$event","_sfc_main","BentoButtonActions","BentoPopoverDismissButton","BentoPopoverTitle","PopperContainer","BentoButtonActionsLayout","value","_a","emit","attrs","slots","ariaLabel","title","toRefs","computedAttributes","computedAriaLabel","useAriaLabel","conditionalClasses","contentConditionalClasses","PopperContainerAriaRole","useHasSlot","_component_popper_container","withCtx","createElementBlock","_hoisted_1","_hoisted_2","createVNode","_component_bento_popover_dismiss_button","createCommentVNode","_hoisted_3","createElementVNode","_hoisted_4","renderSlot","_component_bento_popover_title","_hoisted_6","_component_bento_button_actions"],"mappings":";;;;;;;;;;AAEa,MAAAA,IAAA,EAAA,GAAAC,EAAA,GCQTC,IAAAC,EAAA;AAAA,EAA+B,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACG,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,cAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAI2C,OAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA,EAKT;AAAA,EACzC,MAAAC,GAAA;AAGI,UAAAC,IAAAC,EAAA,MAAA,CAAAF,EAAA,YAAA,GAGAG,IAAAD;AAAA,MAAqB,MAAAF,EAAA,eAAAI,EAAA,WAAAA,EAAA;AAAA,IAC6D;AAGlF,WAAA;AAAA;AAAA,MAAO,aAAAH;AAAA,MAEH,cAAAE;AAAA;AAAA,MACA,wBAAAE;AAAA,IAGA;AAAA,EACJ;AAER,CAAA;;AAtCmB,QAAAC,IAAAC,EAAA,kBAAA;AAFyB,SAAAC,EAAA,GAAAC,EAAAH,GAAA;AAA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;;;"}
|
package/dist/popper-container.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createPopper as n } from "@popperjs/core";
|
|
2
|
-
import { defineComponent as d, resolveComponent as f, openBlock as i, createBlock as
|
|
3
|
-
import { B as
|
|
4
|
-
import { _ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
-
import "./assets/
|
|
6
|
-
var
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as d, resolveComponent as f, openBlock as i, createBlock as m, withCtx as u, renderSlot as h, createElementBlock as c, normalizeClass as T, createCommentVNode as y } from "vue";
|
|
3
|
+
import { B as _ } from "./chunks/index.361c61d3.js";
|
|
4
|
+
import { _ as b } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
+
import "./assets/index24.css";
|
|
6
|
+
var a = /* @__PURE__ */ ((e) => (e.TOP = "top", e.RIGHT = "right", e.BOTTOM = "bottom", e.LEFT = "left", e))(a || {}), o = /* @__PURE__ */ ((e) => (e.AUTO = "auto", e.AUTO_START = "auto-start", e.AUTO_END = "auto-end", e.TOP_START = "top-start", e.TOP_END = "top-end", e.RIGHT_START = "right-start", e.RIGHT_END = "right-end", e.BOTTOM_START = "bottom-start", e.BOTTOM_END = "bottom-end", e.LEFT_START = "left-start", e.LEFT_END = "left-end", e))(o || {}), p = /* @__PURE__ */ ((e) => (e.TOOLTIP = "tooltip", e.POPOVER = "dialog", e))(p || {});
|
|
7
|
+
const s = { ...a, ...o }, O = (e, t) => ({
|
|
8
8
|
name: "arrow",
|
|
9
9
|
options: {
|
|
10
10
|
element: e,
|
|
@@ -38,7 +38,7 @@ const a = { ...s, ...o }, O = (e, t) => ({
|
|
|
38
38
|
e.elements.popper.style.width = `${e.elements.reference.offsetWidth}px`;
|
|
39
39
|
}
|
|
40
40
|
}, $ = d({
|
|
41
|
-
components: { BentoFocusTrap:
|
|
41
|
+
components: { BentoFocusTrap: _ },
|
|
42
42
|
props: {
|
|
43
43
|
/**
|
|
44
44
|
* The id to be set on the component. Use it for accessibility purposes.
|
|
@@ -58,8 +58,8 @@ const a = { ...s, ...o }, O = (e, t) => ({
|
|
|
58
58
|
*/
|
|
59
59
|
position: {
|
|
60
60
|
type: String,
|
|
61
|
-
default:
|
|
62
|
-
validator: (e) => Object.values(
|
|
61
|
+
default: s.AUTO,
|
|
62
|
+
validator: (e) => Object.values(s).includes(e)
|
|
63
63
|
},
|
|
64
64
|
/**
|
|
65
65
|
* Instructs popover to be visible outside of the containing container.
|
|
@@ -207,7 +207,7 @@ const a = { ...s, ...o }, O = (e, t) => ({
|
|
|
207
207
|
});
|
|
208
208
|
function R(e, t, r, S, v, k) {
|
|
209
209
|
const l = f("bento-focus-trap");
|
|
210
|
-
return i(),
|
|
210
|
+
return i(), m(l, {
|
|
211
211
|
id: e.id,
|
|
212
212
|
ref: "popperContainerRef",
|
|
213
213
|
disabled: e.disabledFocusTrap,
|
|
@@ -215,24 +215,24 @@ function R(e, t, r, S, v, k) {
|
|
|
215
215
|
role: e.ariaRole,
|
|
216
216
|
"aria-label": e.ariaLabel
|
|
217
217
|
}, {
|
|
218
|
-
default:
|
|
219
|
-
|
|
220
|
-
e.arrow ? (i(),
|
|
218
|
+
default: u(() => [
|
|
219
|
+
h(e.$slots, "default", {}, void 0, !0),
|
|
220
|
+
e.arrow ? (i(), c("span", {
|
|
221
221
|
key: 0,
|
|
222
222
|
ref: "arrow",
|
|
223
223
|
class: T([e.arrowClasses, "b-popper-container__arrow"]),
|
|
224
224
|
"data-testid": "arrow"
|
|
225
|
-
}, null, 2)) :
|
|
225
|
+
}, null, 2)) : y("", !0)
|
|
226
226
|
]),
|
|
227
227
|
_: 3
|
|
228
228
|
}, 8, ["id", "disabled", "role", "aria-label"]);
|
|
229
229
|
}
|
|
230
|
-
const F = /* @__PURE__ */
|
|
230
|
+
const F = /* @__PURE__ */ b($, [["render", R], ["__scopeId", "data-v-067ee4a9"]]);
|
|
231
231
|
export {
|
|
232
232
|
F as PopperContainer,
|
|
233
233
|
p as PopperContainerAriaRole,
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
s as PopperContainerPosition,
|
|
235
|
+
a as PopperContainerPositionBasic,
|
|
236
236
|
o as PopperContainerPositionExtended
|
|
237
237
|
};
|
|
238
238
|
//# sourceMappingURL=popper-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popper-container.js","sources":["../../vue2/src/components/popper-container/popper-container.types.ts","../../vue2/src/components/popper-container/popper-container.utils.ts","../../vue2/src/components/popper-container/popper-container.vue"],"sourcesContent":["import type { Modifier, StrictModifiers } from '@popperjs/core';\n\ntype ArrowModifier = Modifier<'arrow', unknown>;\ntype ApplyArrowHideModifier = Modifier<'applyArrowHide', unknown>;\ntype SameWidthModifier = Modifier<'sameWidth', unknown>;\ntype TrackPositionModifer = Modifier<'trackPosition', unknown>;\ntype FlipModifer = Modifier<'flip', unknown>;\nexport type ExtendedModifiers =\n | StrictModifiers\n | ArrowModifier\n | ApplyArrowHideModifier\n | SameWidthModifier\n | TrackPositionModifer\n | FlipModifer;\n\nexport interface PopperContainerArrowProp {\n classes?: string[];\n padding?: string;\n}\n\nexport enum PopperContainerPositionBasic {\n TOP = 'top',\n RIGHT = 'right',\n BOTTOM = 'bottom',\n LEFT = 'left',\n}\n\nexport enum PopperContainerPositionExtended {\n AUTO = 'auto',\n AUTO_START = 'auto-start',\n AUTO_END = 'auto-end',\n TOP_START = 'top-start',\n TOP_END = 'top-end',\n RIGHT_START = 'right-start',\n RIGHT_END = 'right-end',\n BOTTOM_START = 'bottom-start',\n BOTTOM_END = 'bottom-end',\n LEFT_START = 'left-start',\n LEFT_END = 'left-end',\n}\n\n// TODO: add more roles as we figure them out\nexport enum PopperContainerAriaRole {\n TOOLTIP = 'tooltip',\n POPOVER = 'dialog',\n}\n\nexport const PopperContainerPosition = { ...PopperContainerPositionBasic, ...PopperContainerPositionExtended };\nexport type PopperContainerPosition = PopperContainerPositionBasic | PopperContainerPositionExtended;\n\nexport type FallbackPositionProp = PopperContainerPosition[] | PopperContainerPosition;\n","import type { VueNodeElement } from '@/types';\nimport { ExtendedModifiers, FallbackPositionProp, PopperContainerArrowProp } from './popper-container.types';\n\n/**\n * Creates an arrow modifier for popper container.\n * If padding is set in arrow props, then implement in modifier.\n * @param arrow arrow element\n * @param arrowProps arrow props\n * @returns ArrowModifier\n */\nexport const getArrowModifier = (arrow: VueNodeElement, arrowProps: PopperContainerArrowProp) => ({\n name: 'arrow',\n options: {\n element: arrow,\n padding: arrowProps.padding || 0,\n },\n});\n\n/**\n * Created an offset modifier for the popper.\n * If an arrow is set (i.e. an arrow is present in popper) then adjust offset accordingly.\n * See popper docs for more info: https://popper.js.org/docs/v2/modifiers/offset/\n * @param arrow arrow props\n * @param offset offset numbered array\n * @returns OffsetModifier\n */\nexport const getOffsetModifier = (arrowProps: PopperContainerArrowProp, offset: number[]) => ({\n name: 'offset',\n options: { offset: arrowProps ? [offset[0], offset[1] + 7] : offset },\n});\n\n/**\n * Creates popover fallback position for popper if it's scheduled to overflow a given boundary.\n * See docs for more info: https://popper.js.org/docs/v2/modifiers/flip/\n * @param fallbackPosition fallbackPosition\n * @returns FlipModifier\n */\nexport const getFlipModifier = (fallbackPosition: FallbackPositionProp) => ({\n name: 'flip',\n options: {\n fallbackPlacements: Array.isArray(fallbackPosition) ? fallbackPosition : [fallbackPosition],\n },\n});\n\n/**\n * Applies a data-hide attribute to arrow element depending on center offset.\n */\nexport const arrowDataHideAttributeModifier: ExtendedModifiers = {\n name: 'applyArrowHide',\n enabled: true,\n phase: 'write',\n fn({ state }) {\n const { arrow } = state.elements;\n\n if (arrow) {\n if (state.modifiersData.arrow.centerOffset !== 0) {\n arrow.setAttribute('data-hide', '');\n } else {\n arrow.removeAttribute('data-hide');\n }\n }\n },\n};\n\nexport const sameWidthModifier: ExtendedModifiers = {\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: ({ state }) => {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n effect: ({ state }) => {\n state.elements.popper.style.width = `${(state.elements.reference as HTMLElement).offsetWidth}px`;\n },\n};\n","<template>\n <bento-focus-trap\n :id=\"id\"\n ref=\"popperContainerRef\"\n :disabled=\"disabledFocusTrap\"\n class=\"b-popper-container\"\n :role=\"ariaRole\"\n :aria-label=\"ariaLabel\"\n >\n <slot></slot>\n <span\n v-if=\"arrow\"\n ref=\"arrow\"\n :class=\"arrowClasses\"\n class=\"b-popper-container__arrow\"\n data-testid=\"arrow\"\n ></span>\n </bento-focus-trap>\n</template>\n\n<script lang=\"ts\">\n import { createPopper } from '@popperjs/core';\n import type { Instance, PositioningStrategy } from '@popperjs/core';\n import { defineComponent, PropType } from 'vue';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import {\n ExtendedModifiers,\n FallbackPositionProp,\n PopperContainerAriaRole,\n PopperContainerArrowProp,\n PopperContainerPosition,\n PopperContainerPositionBasic,\n } from './popper-container.types';\n import {\n arrowDataHideAttributeModifier,\n getArrowModifier,\n getFlipModifier,\n getOffsetModifier,\n sameWidthModifier,\n } from './popper-container.utils';\n import type { VueNodeElement } from '@/types';\n\n /**\n * A wrapper for the 'popper/core' package that overlays a small piece of content near a target element.\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * e.g. Tooltip\n * More info here on the package: https://popper.js.org/docs/v2/\n *\n * * @usage\n * import { PopperContainer } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { PopperContainer },\n * computed: {\n * targetElement() {\n * return this.$refs.tooltipTarget;\n * },\n * },\n * template: `\n * <popper-container\n * :target-element=\"targetElement\"\n * :position=\"position\"\n * >\n * {{ content }}\n * </popper-container>`,\n * }\n */\n export default defineComponent({\n components: { BentoFocusTrap },\n props: {\n /**\n * The id to be set on the component. Use it for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Defines a string value that provides an accessible name for the popper-container.\n */\n ariaLabel: { type: String, default: null },\n /**\n * Reference to the DOM element or Vue component for positioning\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Position relative to the target element\n * @see {@link https://popper.js.org/docs/v2/constructors/#placement}\n */\n position: {\n type: String as PropType<PopperContainerPosition>,\n default: PopperContainerPosition.AUTO,\n validator: value =>\n Object.values(PopperContainerPosition).includes(value as PopperContainerPositionBasic),\n },\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: { type: Boolean, default: false },\n /**\n * Indicates if container should have additional arrow, pointing at target element\n * Can be just a boolean flag, or an object with additional configuration:\n * @property {Array<string>} arrow.classes – apply any additional classes to the arrow element.\n * @property {string} arrow.padding – useful when content has rounded corners, https://popper.js.org/docs/v2/modifiers/arrow/#padding\n */\n arrow: { type: Object as PropType<PopperContainerArrowProp | boolean>, default: undefined },\n /**\n * Allows to displace a popper container from its target element.\n * @see {@link https://popper.js.org/docs/v2/modifiers/offset/}\n */\n offset: {\n type: Array as PropType<number[]>,\n default: () => [0, 0],\n validator: (value: number[]) => value?.length === 2,\n },\n /**\n * Instructs popper container to have the same width as target element.\n */\n matchWidth: { type: Boolean, default: false },\n /**\n * Disables wrapping focus-trap component.\n * Mostly useful for the storybook demo.\n */\n disabledFocusTrap: { type: Boolean, default: false },\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n /**\n * Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].\n * Useful when not using auto as starting placement.\n * https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\n */\n fallbackPosition: {\n type: [Array, String] as PropType<FallbackPositionProp>,\n default: null,\n },\n /**\n * The aria role assigned to the container. Defaults to null, which means it's not set if nothing is passed.\n */\n ariaRole: {\n type: String as PropType<PopperContainerAriaRole>,\n default: null,\n validator: value => Object.values(PopperContainerAriaRole).includes(value as PopperContainerAriaRole),\n },\n },\n data: () => ({\n popper: null,\n emittedPosition: null,\n }),\n computed: {\n strategy(): PositioningStrategy {\n return this.fixedPositioning ? 'fixed' : 'absolute';\n },\n /**\n * Retrieves all the popper modifiers to be applied to popover.\n * Read utils file for more info on each modifier.\n */\n allModifiers(): ExtendedModifiers[] {\n const currentModifiers: ExtendedModifiers[] = this.modifiers || [];\n const allModifiers = [\n // Create arrow modifier if arrow props are set\n ...(this.arrow ? [getArrowModifier(this.$refs.arrow as VueNodeElement, this.arrow)] : []),\n // Create offset modifier\n getOffsetModifier(this.arrow, this.offset),\n // Apply data-hide attribute to arrow element depnding on center offset.\n arrowDataHideAttributeModifier,\n // If matchWidth set to true, set the width of popover to same as target element.\n ...(this.matchWidth ? [sameWidthModifier] : []),\n // Emits position of popover when position is updated.\n {\n name: 'trackPosition',\n enabled: true,\n phase: 'afterWrite',\n fn: ({ state }) => {\n // Add conditional to make sure that event is only emitted for new placement values\n if (this.emittedPosition !== state.placement) {\n this.emittedPosition = state.placement;\n this.$emit('position', this.emittedPosition);\n }\n },\n },\n // Sets Flip modifier if fallbackPosition is set\n ...(this.fallbackPosition ? [getFlipModifier(this.fallbackPosition)] : []),\n ...(currentModifiers || []),\n ];\n return allModifiers as ExtendedModifiers[];\n },\n /**\n * Sets default arrow classes if none have been set.\n */\n arrowClasses(): string[] {\n return this?.arrow?.classes ?? [];\n },\n },\n watch: {\n targetElement(element: VueNodeElement) {\n this.destroyPopper();\n if ((this.$refs.popperContainerRef as any).$el && element) {\n this.initPopper();\n }\n },\n position(position: PopperContainerPosition) {\n this.updatePopperOptions({ placement: position });\n },\n strategy(strategy: PositioningStrategy) {\n this.updatePopperOptions({ strategy });\n },\n async arrow(arrow: PopperContainerArrowProp | boolean) {\n if (arrow) {\n // Wait for the next rendering cycle to make sure that arrow element is rendered, but only when it is displayed\n await this.$nextTick();\n }\n this.updateModifiers();\n },\n offset: 'updateModifiers',\n matchWidth: 'updateModifiers',\n },\n mounted() {\n this.initPopper();\n },\n beforeUnmount() {\n this.destroyPopper();\n },\n methods: {\n initPopper() {\n const popperElement = (this.targetElement as any).$el\n ? ((this.targetElement as any).$el as Element)\n : (this.targetElement as Element);\n this.popper = createPopper<ExtendedModifiers>(\n popperElement,\n (this.$refs.popperContainerRef as any).$el as HTMLElement,\n {\n placement: this.position,\n strategy: this.strategy,\n modifiers: this.allModifiers as ExtendedModifiers[],\n }\n );\n },\n destroyPopper() {\n // Add some time before destroy to run fade-out animation\n if (this.popper) {\n (this.popper as Instance).destroy();\n }\n },\n updatePopperOptions(options) {\n if (this.popper) {\n (this.popper as Instance).setOptions(options);\n }\n },\n updateModifiers() {\n this.updatePopperOptions({ modifiers: this.allModifiers });\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popper-container.scss\" />\n"],"names":["PopperContainerPositionBasic","PopperContainerPositionBasic2","PopperContainerPositionExtended","PopperContainerPositionExtended2","PopperContainerAriaRole","PopperContainerAriaRole2","PopperContainerPosition","getArrowModifier","arrow","arrowProps","getOffsetModifier","offset","getFlipModifier","fallbackPosition","arrowDataHideAttributeModifier","state","sameWidthModifier","_sfc_main","defineComponent","BentoFocusTrap","value","currentModifiers","_a","element","position","strategy","popperElement","createPopper","options","_component_bento_focus_trap","resolveComponent","_ctx","renderSlot","openBlock","createElementBlock","normalizeClass"],"mappings":";;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,MAAA,OACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WACAA,EAAA,cAAA,eACAA,EAAA,YAAA,aACAA,EAAA,eAAA,gBACAA,EAAA,aAAA,cACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YAXQA,IAAAD,KAAA,CAAA,CAAA,GAeAE,IAAA,kBAAAC,OACRA,EAAA,UAA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;;;;;;"}
|
|
1
|
+
{"version":3,"file":"popper-container.js","sources":["../../vue2/src/components/popper-container/popper-container.types.ts","../../vue2/src/components/popper-container/popper-container.utils.ts","../../vue2/src/components/popper-container/popper-container.vue"],"sourcesContent":["import type { Modifier, StrictModifiers } from '@popperjs/core';\n\ntype ArrowModifier = Modifier<'arrow', unknown>;\ntype ApplyArrowHideModifier = Modifier<'applyArrowHide', unknown>;\ntype SameWidthModifier = Modifier<'sameWidth', unknown>;\ntype TrackPositionModifer = Modifier<'trackPosition', unknown>;\ntype FlipModifer = Modifier<'flip', unknown>;\nexport type ExtendedModifiers =\n | StrictModifiers\n | ArrowModifier\n | ApplyArrowHideModifier\n | SameWidthModifier\n | TrackPositionModifer\n | FlipModifer;\n\nexport interface PopperContainerArrowProp {\n classes?: string[];\n padding?: string;\n}\n\nexport enum PopperContainerPositionBasic {\n TOP = 'top',\n RIGHT = 'right',\n BOTTOM = 'bottom',\n LEFT = 'left',\n}\n\nexport enum PopperContainerPositionExtended {\n AUTO = 'auto',\n AUTO_START = 'auto-start',\n AUTO_END = 'auto-end',\n TOP_START = 'top-start',\n TOP_END = 'top-end',\n RIGHT_START = 'right-start',\n RIGHT_END = 'right-end',\n BOTTOM_START = 'bottom-start',\n BOTTOM_END = 'bottom-end',\n LEFT_START = 'left-start',\n LEFT_END = 'left-end',\n}\n\n// TODO: add more roles as we figure them out\nexport enum PopperContainerAriaRole {\n TOOLTIP = 'tooltip',\n POPOVER = 'dialog',\n}\n\nexport const PopperContainerPosition = { ...PopperContainerPositionBasic, ...PopperContainerPositionExtended };\nexport type PopperContainerPosition = PopperContainerPositionBasic | PopperContainerPositionExtended;\n\nexport type FallbackPositionProp = PopperContainerPosition[] | PopperContainerPosition;\n","import type { VueNodeElement } from '@/types';\nimport { ExtendedModifiers, FallbackPositionProp, PopperContainerArrowProp } from './popper-container.types';\n\n/**\n * Creates an arrow modifier for popper container.\n * If padding is set in arrow props, then implement in modifier.\n * @param arrow arrow element\n * @param arrowProps arrow props\n * @returns ArrowModifier\n */\nexport const getArrowModifier = (arrow: VueNodeElement, arrowProps: PopperContainerArrowProp) => ({\n name: 'arrow',\n options: {\n element: arrow,\n padding: arrowProps.padding || 0,\n },\n});\n\n/**\n * Created an offset modifier for the popper.\n * If an arrow is set (i.e. an arrow is present in popper) then adjust offset accordingly.\n * See popper docs for more info: https://popper.js.org/docs/v2/modifiers/offset/\n * @param arrow arrow props\n * @param offset offset numbered array\n * @returns OffsetModifier\n */\nexport const getOffsetModifier = (arrowProps: PopperContainerArrowProp, offset: number[]) => ({\n name: 'offset',\n options: { offset: arrowProps ? [offset[0], offset[1] + 7] : offset },\n});\n\n/**\n * Creates popover fallback position for popper if it's scheduled to overflow a given boundary.\n * See docs for more info: https://popper.js.org/docs/v2/modifiers/flip/\n * @param fallbackPosition fallbackPosition\n * @returns FlipModifier\n */\nexport const getFlipModifier = (fallbackPosition: FallbackPositionProp) => ({\n name: 'flip',\n options: {\n fallbackPlacements: Array.isArray(fallbackPosition) ? fallbackPosition : [fallbackPosition],\n },\n});\n\n/**\n * Applies a data-hide attribute to arrow element depending on center offset.\n */\nexport const arrowDataHideAttributeModifier: ExtendedModifiers = {\n name: 'applyArrowHide',\n enabled: true,\n phase: 'write',\n fn({ state }) {\n const { arrow } = state.elements;\n\n if (arrow) {\n if (state.modifiersData.arrow.centerOffset !== 0) {\n arrow.setAttribute('data-hide', '');\n } else {\n arrow.removeAttribute('data-hide');\n }\n }\n },\n};\n\nexport const sameWidthModifier: ExtendedModifiers = {\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: ({ state }) => {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n effect: ({ state }) => {\n state.elements.popper.style.width = `${(state.elements.reference as HTMLElement).offsetWidth}px`;\n },\n};\n","<template>\n <bento-focus-trap\n :id=\"id\"\n ref=\"popperContainerRef\"\n :disabled=\"disabledFocusTrap\"\n class=\"b-popper-container\"\n :role=\"ariaRole\"\n :aria-label=\"ariaLabel\"\n >\n <slot></slot>\n <span\n v-if=\"arrow\"\n ref=\"arrow\"\n :class=\"arrowClasses\"\n class=\"b-popper-container__arrow\"\n data-testid=\"arrow\"\n ></span>\n </bento-focus-trap>\n</template>\n\n<script lang=\"ts\">\n import { createPopper } from '@popperjs/core';\n import type { Instance, PositioningStrategy } from '@popperjs/core';\n import { defineComponent, PropType } from 'vue';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import {\n ExtendedModifiers,\n FallbackPositionProp,\n PopperContainerAriaRole,\n PopperContainerArrowProp,\n PopperContainerPosition,\n PopperContainerPositionBasic,\n } from './popper-container.types';\n import {\n arrowDataHideAttributeModifier,\n getArrowModifier,\n getFlipModifier,\n getOffsetModifier,\n sameWidthModifier,\n } from './popper-container.utils';\n import type { VueNodeElement } from '@/types';\n\n /**\n * A wrapper for the 'popper/core' package that overlays a small piece of content near a target element.\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * e.g. Tooltip\n * More info here on the package: https://popper.js.org/docs/v2/\n *\n * * @usage\n * import { PopperContainer } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { PopperContainer },\n * computed: {\n * targetElement() {\n * return this.$refs.tooltipTarget;\n * },\n * },\n * template: `\n * <popper-container\n * :target-element=\"targetElement\"\n * :position=\"position\"\n * >\n * {{ content }}\n * </popper-container>`,\n * }\n */\n export default defineComponent({\n components: { BentoFocusTrap },\n props: {\n /**\n * The id to be set on the component. Use it for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Defines a string value that provides an accessible name for the popper-container.\n */\n ariaLabel: { type: String, default: null },\n /**\n * Reference to the DOM element or Vue component for positioning\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Position relative to the target element\n * @see {@link https://popper.js.org/docs/v2/constructors/#placement}\n */\n position: {\n type: String as PropType<PopperContainerPosition | `${PopperContainerPosition}`>,\n default: PopperContainerPosition.AUTO,\n validator: value =>\n Object.values(PopperContainerPosition).includes(value as PopperContainerPositionBasic),\n },\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: { type: Boolean, default: false },\n /**\n * Indicates if container should have additional arrow, pointing at target element\n * Can be just a boolean flag, or an object with additional configuration:\n * @property {Array<string>} arrow.classes – apply any additional classes to the arrow element.\n * @property {string} arrow.padding – useful when content has rounded corners, https://popper.js.org/docs/v2/modifiers/arrow/#padding\n */\n arrow: { type: Object as PropType<PopperContainerArrowProp | boolean>, default: undefined },\n /**\n * Allows to displace a popper container from its target element.\n * @see {@link https://popper.js.org/docs/v2/modifiers/offset/}\n */\n offset: {\n type: Array as PropType<number[]>,\n default: () => [0, 0],\n validator: (value: number[]) => value?.length === 2,\n },\n /**\n * Instructs popper container to have the same width as target element.\n */\n matchWidth: { type: Boolean, default: false },\n /**\n * Disables wrapping focus-trap component.\n * Mostly useful for the storybook demo.\n */\n disabledFocusTrap: { type: Boolean, default: false },\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n /**\n * Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].\n * Useful when not using auto as starting placement.\n * https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\n */\n fallbackPosition: {\n type: [Array, String] as PropType<FallbackPositionProp>,\n default: null,\n },\n /**\n * The aria role assigned to the container. Defaults to null, which means it's not set if nothing is passed.\n */\n ariaRole: {\n type: String as PropType<PopperContainerAriaRole>,\n default: null,\n validator: value => Object.values(PopperContainerAriaRole).includes(value as PopperContainerAriaRole),\n },\n },\n data: () => ({\n popper: null,\n emittedPosition: null,\n }),\n computed: {\n strategy(): PositioningStrategy {\n return this.fixedPositioning ? 'fixed' : 'absolute';\n },\n /**\n * Retrieves all the popper modifiers to be applied to popover.\n * Read utils file for more info on each modifier.\n */\n allModifiers(): ExtendedModifiers[] {\n const currentModifiers: ExtendedModifiers[] = this.modifiers || [];\n const allModifiers = [\n // Create arrow modifier if arrow props are set\n ...(this.arrow ? [getArrowModifier(this.$refs.arrow as VueNodeElement, this.arrow)] : []),\n // Create offset modifier\n getOffsetModifier(this.arrow, this.offset),\n // Apply data-hide attribute to arrow element depnding on center offset.\n arrowDataHideAttributeModifier,\n // If matchWidth set to true, set the width of popover to same as target element.\n ...(this.matchWidth ? [sameWidthModifier] : []),\n // Emits position of popover when position is updated.\n {\n name: 'trackPosition',\n enabled: true,\n phase: 'afterWrite',\n fn: ({ state }) => {\n // Add conditional to make sure that event is only emitted for new placement values\n if (this.emittedPosition !== state.placement) {\n this.emittedPosition = state.placement;\n this.$emit('position', this.emittedPosition);\n }\n },\n },\n // Sets Flip modifier if fallbackPosition is set\n ...(this.fallbackPosition ? [getFlipModifier(this.fallbackPosition)] : []),\n ...(currentModifiers || []),\n ];\n return allModifiers as ExtendedModifiers[];\n },\n /**\n * Sets default arrow classes if none have been set.\n */\n arrowClasses(): string[] {\n return this?.arrow?.classes ?? [];\n },\n },\n watch: {\n targetElement(element: VueNodeElement) {\n this.destroyPopper();\n if ((this.$refs.popperContainerRef as any).$el && element) {\n this.initPopper();\n }\n },\n position(position: PopperContainerPosition) {\n this.updatePopperOptions({ placement: position });\n },\n strategy(strategy: PositioningStrategy) {\n this.updatePopperOptions({ strategy });\n },\n async arrow(arrow: PopperContainerArrowProp | boolean) {\n if (arrow) {\n // Wait for the next rendering cycle to make sure that arrow element is rendered, but only when it is displayed\n await this.$nextTick();\n }\n this.updateModifiers();\n },\n offset: 'updateModifiers',\n matchWidth: 'updateModifiers',\n },\n mounted() {\n this.initPopper();\n },\n beforeUnmount() {\n this.destroyPopper();\n },\n methods: {\n initPopper() {\n const popperElement = (this.targetElement as any).$el\n ? ((this.targetElement as any).$el as Element)\n : (this.targetElement as Element);\n this.popper = createPopper<ExtendedModifiers>(\n popperElement,\n (this.$refs.popperContainerRef as any).$el as HTMLElement,\n {\n placement: this.position,\n strategy: this.strategy,\n modifiers: this.allModifiers as ExtendedModifiers[],\n }\n );\n },\n destroyPopper() {\n // Add some time before destroy to run fade-out animation\n if (this.popper) {\n (this.popper as Instance).destroy();\n }\n },\n updatePopperOptions(options) {\n if (this.popper) {\n (this.popper as Instance).setOptions(options);\n }\n },\n updateModifiers() {\n this.updatePopperOptions({ modifiers: this.allModifiers });\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popper-container.scss\" />\n"],"names":["PopperContainerPositionBasic","PopperContainerPositionBasic2","PopperContainerPositionExtended","PopperContainerPositionExtended2","PopperContainerAriaRole","PopperContainerAriaRole2","PopperContainerPosition","getArrowModifier","arrow","arrowProps","getOffsetModifier","offset","getFlipModifier","fallbackPosition","arrowDataHideAttributeModifier","state","sameWidthModifier","_sfc_main","defineComponent","BentoFocusTrap","value","currentModifiers","_a","element","position","strategy","popperElement","createPopper","options","_component_bento_focus_trap","resolveComponent","_ctx","renderSlot","openBlock","createElementBlock","normalizeClass"],"mappings":";;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,MAAA,OACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WACAA,EAAA,cAAA,eACAA,EAAA,YAAA,aACAA,EAAA,eAAA,gBACAA,EAAA,aAAA,cACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YAXQA,IAAAD,KAAA,CAAA,CAAA,GAeAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,UAAA,UAFQA,IAAAD,KAAA,CAAA,CAAA;AAKL,MAAAE,IAAA,EAAA,GAAAN,GAAA,GAAAE,EAAA,GCrCMK,IAAA,CAAAC,GAAAC,OAAA;AAAA,EAAqF,MAAA;AAAA,EACxF,SAAA;AA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A;AAAA,EACI;AAAA,EAChB,UAAA;AAEI,SAAA,WAAA;AAAA,EAAgB;AAAA,EACpB,gBAAA;AAEI,SAAA,cAAA;AAAA,EAAmB;AAAA,EACvB,SAAA;AAAA,IACS,aAAA;AAED,YAAAkB,IAAA,KAAA,cAAA,MAAA,KAAA,cAAA,MAAA,KAAA;AAGA,WAAA,SAAAC;AAAA,QAAcD;AAAA,QACV,KAAA,MAAA,mBAAA;AAAA,QACuC;AAAA,UACvC,WAAA,KAAA;AAAA,UACoB,UAAA,KAAA;AAAA,UACD,WAAA,KAAA;AAAA,QACC;AAAA,MACpB;AAAA,IACJ;AAAA,IACJ,gBAAA;AAGI,MAAA,KAAA,UACI,KAAA,OAAA,QAAA;AAAA,IACJ;AAAA,IACJ,oBAAAE,GAAA;AAEI,MAAA,KAAA,UACI,KAAA,OAAA,WAAAA,CAAA;AAAA,IACJ;AAAA,IACJ,kBAAA;AAEI,WAAA,oBAAA,EAAA,WAAA,KAAA,aAAA,CAAA;AAAA,IAAyD;AAAA,EAC7D;AAER,CAAA;;AA7OmB,QAAAC,IAAAC,EAAA,kBAAA;;IAdS,IAAAC,EAAA;AAAA,IACf,KAAA;AAAA,IACJ,UAAAA,EAAA;AAAA,IACE,OAAA;AAAA,IACN,MAAAA,EAAA;AAAA,IAEY,cAAAA,EAAA;AAAA,EAAA,GAAA;AAAA;MAEEC,EAAAD,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAKPA,EAAA,SAAAE,EAAA,GAAAC,EAAA,QAAA;AAAA,QAJO,KAAA;AAAA,QACL,KAAA;AAAA,QAEN,OAAAC,EAAA,CAAAJ,EAAA,cAAA,2BAAA,CAAA;AAAA;;;;;;;"}
|
package/dist/radio-group.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as B, toRefs as R, computed as l, resolveComponent as f, openBlock as n, createElementBlock as h, normalizeClass as E, createElementVNode as L, createBlock as v, withCtx as p, renderSlot as C, createCommentVNode as y, toRef as N, createVNode as O, Fragment as M, renderList as U, createSlots as w, createTextVNode as S, toDisplayString as I } from "vue";
|
|
2
|
-
import { B as P, b as G, a as H, d as Y } from "./chunks/index.
|
|
2
|
+
import { B as P, b as G, a as H, d as Y } from "./chunks/index.ebf5f6cf.js";
|
|
3
3
|
import { u as q } from "./chunks/aria-label.ac9651a5.js";
|
|
4
4
|
import { g as _ } from "./chunks/unique-id.a2a2b458.js";
|
|
5
5
|
import { u as z } from "./chunks/use-has-slot.068222e6.js";
|
|
6
6
|
import { u as Z } from "./chunks/use-default-slot-validator.83d977a1.js";
|
|
7
7
|
import { g as j } from "./chunks/get-slot-text.2db867f8.js";
|
|
8
8
|
import { _ as V } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
9
|
-
import { C as F } from "./chunks/controls-group.
|
|
10
|
-
import { E as J } from "./chunks/error-message.
|
|
11
|
-
import "./assets/
|
|
9
|
+
import { C as F } from "./chunks/controls-group.806da9bd.js";
|
|
10
|
+
import { E as J } from "./chunks/error-message.b88bb75a.js";
|
|
11
|
+
import "./assets/index19.css";
|
|
12
12
|
var m = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e))(m || {}), g = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(g || {}), c = /* @__PURE__ */ ((e) => (e.UPDATE = "update:model-value", e))(c || {});
|
|
13
13
|
const K = B({
|
|
14
14
|
name: "radio-button",
|
|
@@ -286,7 +286,7 @@ function ae(e, o, i, d, u, b) {
|
|
|
286
286
|
}, null, 8, ["id", "error-message"])) : y("", !0)
|
|
287
287
|
]);
|
|
288
288
|
}
|
|
289
|
-
const ye = /* @__PURE__ */ V(ee, [["render", ae], ["__scopeId", "data-v-
|
|
289
|
+
const ye = /* @__PURE__ */ V(ee, [["render", ae], ["__scopeId", "data-v-ee6a8007"]]);
|
|
290
290
|
export {
|
|
291
291
|
ye as BentoRadioGroup,
|
|
292
292
|
g as BentoRadioGroupVariant
|
package/dist/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sources":["../../vue2/src/components/radio-group/components/radio-button/radio-button.types.ts","../../vue2/src/components/radio-group/radio-group.types.ts","../../vue2/src/components/radio-group/components/radio-button/radio-button.vue","../../vue2/src/components/radio-group/radio-group.vue"],"sourcesContent":["export enum BentoRadioButtonStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","export enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoRadioGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport enum BentoRadioGroupEvent {\n UPDATE = 'update:model-value',\n}\n","<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <input\n :id=\"radioButtonId\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"descriptionSlotValue ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n :value=\"value\"\n type=\"radio\"\n class=\"b-radio-button__input\"\n :class=\"conditionalClassInput\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n <label v-if=\"defaultSlotValue\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-radio-button__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/unique-id';\n import { computed, ComputedRef, defineComponent, toRefs } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass } from './radio-button.types';\n import { BentoRadioGroupEvent } from '../../radio-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @usage\n * import { RadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { RadioButton },\n * template: `\n * <radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * </radio-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'radio-button',\n components: { BentoTypography },\n props: {\n /**\n * Disable the radio button (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows radio-button in error state (optional)\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number],\n default: null,\n },\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number],\n required: true,\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { slots, emit }) {\n const hasSlot = useHasSlot(slots);\n const { value } = toRefs(props);\n const radioButtonId = generateUid('radio-button');\n const descriptionId = generateUid('description');\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('radio-button', defaultSlotValue, descriptionSlotValue);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n const conditionalClassInput = computed(() => ({\n [`b-radio-button__input--${BentoRadioButtonStateClass.ERROR}`]: props.hasError,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit(BentoRadioGroupEvent.UPDATE, props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n return {\n // Values\n ariaLabel,\n ariaInvalid,\n isChecked,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClassContainer,\n conditionalClassInput,\n radioButtonId,\n descriptionId,\n\n // Events\n onChange,\n onClick,\n\n // Enums\n BentoTypographyVariant,\n BentoTypographyElement,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :class=\"conditionalClasses\"\n :form=\"formId\"\n :disabled=\"disabled\"\n :label=\"label\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n >\n <radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRef } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import RadioButton from './components/radio-button/radio-button.vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupEvent, BentoRadioGroupItems, BentoRadioGroupVariant } from './radio-group.types';\n\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup, BentoRadioGroupVariant } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * :variant=\"BentoRadioGroupVariant.HORIZONTAL\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-radio-group',\n components: { ControlsGroup, ErrorMessage, RadioButton },\n props: {\n /**\n * If set to true, renders all radio-buttons in the group in a disabled state.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * If string is passed, all radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: {\n type: String,\n default: null,\n },\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: {\n type: String,\n default: null,\n },\n /**\n * If set to true, renders all radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * If set to true, renders all radio-buttons in the group in a readonly state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String, null],\n default: null,\n },\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { emit }) {\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n const onInput = value => {\n emit(BentoRadioGroupEvent.UPDATE, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n inputValue,\n errorId,\n shouldShowError,\n shouldShowErrorMessage,\n conditionalClasses,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["BentoRadioButtonStateClass","BentoRadioButtonStateClass2","BentoRadioGroupVariant","BentoRadioGroupVariant2","BentoRadioGroupEvent","BentoRadioGroupEvent2","_sfc_main$1","defineComponent","BentoTypography","props","slots","emit","hasSlot","useHasSlot","value","toRefs","radioButtonId","generateUid","descriptionId","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","conditionalClassContainer","computed","conditionalClassInput","ariaLabel","useAriaLabel","getSlotText","ariaInvalid","isChecked","event","BentoTypographyVariant","BentoTypographyElement","openBlock","createElementBlock","normalizeClass","_ctx","createElementVNode","_cache","args","_hoisted_1$1","createCommentVNode","createBlock","_component_bento_typography","_sfc_main","ControlsGroup","ErrorMessage","RadioButton","inputValue","toRef","errorId","shouldShowError","shouldShowErrorMessage","conditionalClasses","onInput","deprecate","_hoisted_1","createVNode","_component_controls_group","Fragment","renderList","item","_component_radio_button","createSlots","_component_error_message"],"mappings":";;;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GCAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAgBAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBADQA,IAAAD,KAAA,CAAA,CAAA;AC0DR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACwB,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,UAAA;AAAA,MAIO,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,UAAA;AAAA,MAIU,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA;AAAA,IACb,YAAA;AAAA,MAKY,MAAA,CAAA,QAAA,MAAA;AAAA,MACa,SAAA;AAAA,IACZ;AAAA;AAAA;AAAA;AAAA,IACb,UAAA;AAAA,MAIU,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,OAAA;AAAA,MAIO,MAAA,CAAA,QAAA,MAAA;AAAA,MACkB,UAAA;AAAA,IACX;AAAA,EACd;AAAA,EACJ,OAAA,CAAAJ,EAAA,MAAA;AAAA,EACmC,MAAAK,GAAA,EAAA,OAAAC,GA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A,SAAA,QAAA,YAAA,SAAA,kBAAA,CAAA;AAAA,IAIR3B,EAAA,0BAAAH,EAAA,GAAAS,EAAAsB,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAA5B,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio-group.js","sources":["../../vue2/src/components/radio-group/components/radio-button/radio-button.types.ts","../../vue2/src/components/radio-group/radio-group.types.ts","../../vue2/src/components/radio-group/components/radio-button/radio-button.vue","../../vue2/src/components/radio-group/radio-group.vue"],"sourcesContent":["export enum BentoRadioButtonStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","export enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoRadioGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport enum BentoRadioGroupEvent {\n UPDATE = 'update:model-value',\n}\n","<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <input\n :id=\"radioButtonId\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"descriptionSlotValue ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n :value=\"value\"\n type=\"radio\"\n class=\"b-radio-button__input\"\n :class=\"conditionalClassInput\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n <label v-if=\"defaultSlotValue\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-radio-button__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/unique-id';\n import { computed, ComputedRef, defineComponent, toRefs } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass } from './radio-button.types';\n import { BentoRadioGroupEvent } from '../../radio-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @usage\n * import { RadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { RadioButton },\n * template: `\n * <radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * </radio-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'radio-button',\n components: { BentoTypography },\n props: {\n /**\n * Disable the radio button (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows radio-button in error state (optional)\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number],\n default: null,\n },\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number],\n required: true,\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { slots, emit }) {\n const hasSlot = useHasSlot(slots);\n const { value } = toRefs(props);\n const radioButtonId = generateUid('radio-button');\n const descriptionId = generateUid('description');\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('radio-button', defaultSlotValue, descriptionSlotValue);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n const conditionalClassInput = computed(() => ({\n [`b-radio-button__input--${BentoRadioButtonStateClass.ERROR}`]: props.hasError,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit(BentoRadioGroupEvent.UPDATE, props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n return {\n // Values\n ariaLabel,\n ariaInvalid,\n isChecked,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClassContainer,\n conditionalClassInput,\n radioButtonId,\n descriptionId,\n\n // Events\n onChange,\n onClick,\n\n // Enums\n BentoTypographyVariant,\n BentoTypographyElement,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :class=\"conditionalClasses\"\n :form=\"formId\"\n :disabled=\"disabled\"\n :label=\"label\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n >\n <radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRef } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import RadioButton from './components/radio-button/radio-button.vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupEvent, BentoRadioGroupItems, BentoRadioGroupVariant } from './radio-group.types';\n\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup, BentoRadioGroupVariant } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * :variant=\"BentoRadioGroupVariant.HORIZONTAL\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-radio-group',\n components: { ControlsGroup, ErrorMessage, RadioButton },\n props: {\n /**\n * If set to true, renders all radio-buttons in the group in a disabled state.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * If string is passed, all radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: {\n type: String,\n default: null,\n },\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: {\n type: String,\n default: null,\n },\n /**\n * If set to true, renders all radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * If set to true, renders all radio-buttons in the group in a readonly state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String, null],\n default: null,\n },\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { emit }) {\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n const onInput = value => {\n emit(BentoRadioGroupEvent.UPDATE, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n inputValue,\n errorId,\n shouldShowError,\n shouldShowErrorMessage,\n conditionalClasses,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["BentoRadioButtonStateClass","BentoRadioButtonStateClass2","BentoRadioGroupVariant","BentoRadioGroupVariant2","BentoRadioGroupEvent","BentoRadioGroupEvent2","_sfc_main$1","defineComponent","BentoTypography","props","slots","emit","hasSlot","useHasSlot","value","toRefs","radioButtonId","generateUid","descriptionId","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","conditionalClassContainer","computed","conditionalClassInput","ariaLabel","useAriaLabel","getSlotText","ariaInvalid","isChecked","event","BentoTypographyVariant","BentoTypographyElement","openBlock","createElementBlock","normalizeClass","_ctx","createElementVNode","_cache","args","_hoisted_1$1","createCommentVNode","createBlock","_component_bento_typography","_sfc_main","ControlsGroup","ErrorMessage","RadioButton","inputValue","toRef","errorId","shouldShowError","shouldShowErrorMessage","conditionalClasses","onInput","deprecate","_hoisted_1","createVNode","_component_controls_group","Fragment","renderList","item","_component_radio_button","createSlots","_component_error_message"],"mappings":";;;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GCAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAgBAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBADQA,IAAAD,KAAA,CAAA,CAAA;AC0DR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACwB,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,UAAA;AAAA,MAIO,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,UAAA;AAAA,MAIU,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA;AAAA,IACb,YAAA;AAAA,MAKY,MAAA,CAAA,QAAA,MAAA;AAAA,MACa,SAAA;AAAA,IACZ;AAAA;AAAA;AAAA;AAAA,IACb,UAAA;AAAA,MAIU,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,OAAA;AAAA,MAIO,MAAA,CAAA,QAAA,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,EAAA;AAAA,QAAA,GAAA2B,EAAA;AAAA;;;UACA,GAAA;AAAA,QAAA,GAAA;AAAA;;;;;;;;;MAId,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,SAAA,QAAA,YAAA,SAAA,kBAAA,CAAA;AAAA,IAIR3B,EAAA,0BAAAH,EAAA,GAAAS,EAAAsB,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAA5B,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
|
package/dist/search-bar.js
CHANGED
|
@@ -4,8 +4,8 @@ import { d as T } from "./chunks/debounce.f8d92e44.js";
|
|
|
4
4
|
import { S as A } from "./chunks/search.d18f9657.js";
|
|
5
5
|
import { C as P } from "./chunks/cross-circle-fill.0feb37b3.js";
|
|
6
6
|
import { _ as g } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
7
|
-
import { u as z } from "./chunks/dropdown.
|
|
8
|
-
import "./assets/
|
|
7
|
+
import { u as z } from "./chunks/dropdown.f9997464.js";
|
|
8
|
+
import "./assets/index27.css";
|
|
9
9
|
var n = /* @__PURE__ */ ((e) => (e.CLEAR = "clear", e.ESCAPE = "escape-pressed", e.INPUT = "input", e.UPDATE = "update:search-term", e))(n || {}), F = /* @__PURE__ */ ((e) => (e.CLEAR = "search-clear", e.INPUT = "search-input", e.UPDATE = "update:search-term", e))(F || {});
|
|
10
10
|
const N = {
|
|
11
11
|
"en-US": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as C, computed as u, resolveComponent as c, openBlock as a, createElementBlock as m, normalizeClass as y, createElementVNode as k, createBlock as b, createCommentVNode as g, createVNode as I, withCtx as S, createTextVNode as $, toDisplayString as w, toRef as T, ref as v, onMounted as N, onUnmounted as E, Fragment as U, renderList as D } from "vue";
|
|
2
|
-
import { B as W, a as q, b as A } from "./chunks/index.
|
|
2
|
+
import { B as W, a as q, b as A } from "./chunks/index.ebf5f6cf.js";
|
|
3
3
|
import { g as B } from "./chunks/unique-id.a2a2b458.js";
|
|
4
|
-
import { C as P } from "./chunks/listbox.
|
|
4
|
+
import { C as P } from "./chunks/listbox.7b5e0eee.js";
|
|
5
5
|
import { _ as V } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
|
-
import { B as H } from "./chunks/dropdown.
|
|
7
|
-
import "./assets/
|
|
6
|
+
import { B as H } from "./chunks/dropdown.f9997464.js";
|
|
7
|
+
import "./assets/index28.css";
|
|
8
8
|
const L = C({
|
|
9
9
|
name: "bento-segmented-control-button",
|
|
10
10
|
components: { BentoTypography: W, CheckmarkIcon: P },
|
package/dist/status.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as n, computed as r, resolveComponent as a, openBlock as p, createElementBlock as l, createElementVNode as c, normalizeClass as i, createVNode as _, withCtx as d, renderSlot as u } from "vue";
|
|
2
|
-
import { B as m, a as y, b
|
|
3
|
-
import { _ as
|
|
4
|
-
import "./assets/
|
|
2
|
+
import { B as m, a as y, b } from "./chunks/index.ebf5f6cf.js";
|
|
3
|
+
import { _ as g } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
4
|
+
import "./assets/index40.css";
|
|
5
5
|
var t = /* @__PURE__ */ ((e) => (e.BLUE = "blue", e.GREEN = "green", e.GREY = "grey", e.ORANGE = "orange", e.RED = "red", e.YELLOW = "yellow", e))(t || {});
|
|
6
|
-
const
|
|
6
|
+
const v = n({
|
|
7
7
|
name: "bento-status",
|
|
8
8
|
components: { BentoTypography: m },
|
|
9
9
|
props: {
|
|
@@ -21,7 +21,7 @@ const b = n({
|
|
|
21
21
|
})),
|
|
22
22
|
// Enums
|
|
23
23
|
BentoTypographyElement: y,
|
|
24
|
-
BentoTypographyVariant:
|
|
24
|
+
BentoTypographyVariant: b
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -48,7 +48,7 @@ function f(e, o, h, C, B, $) {
|
|
|
48
48
|
}, 8, ["el", "variant"])
|
|
49
49
|
]);
|
|
50
50
|
}
|
|
51
|
-
const R = /* @__PURE__ */ v
|
|
51
|
+
const R = /* @__PURE__ */ g(v, [["render", f], ["__scopeId", "data-v-92b179e3"]]);
|
|
52
52
|
export {
|
|
53
53
|
R as BentoStatus,
|
|
54
54
|
t as BentoStatusVariant
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sources":["../../vue2/src/components/status/status.types.ts","../../vue2/src/components/status/status.vue"],"sourcesContent":["export enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-status\" role=\"status\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n <bento-typography\n class=\"b-status__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoStatusVariant } from './status.types';\n\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus, BentoStatusVariant } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status :variant=\"BentoStatusVariant.RED\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-status',\n components: { BentoTypography },\n props: {\n variant: {\n type: String as PropType<BentoStatusVariant
|
|
1
|
+
{"version":3,"file":"status.js","sources":["../../vue2/src/components/status/status.types.ts","../../vue2/src/components/status/status.vue"],"sourcesContent":["export enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-status\" role=\"status\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n <bento-typography\n class=\"b-status__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoStatusVariant } from './status.types';\n\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus, BentoStatusVariant } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status :variant=\"BentoStatusVariant.RED\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-status',\n components: { BentoTypography },\n props: {\n variant: {\n type: String as PropType<BentoStatusVariant | `${BentoStatusVariant}`>,\n required: true,\n validator: (type: BentoStatusVariant) => Object.values(BentoStatusVariant).includes(type),\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({\n [`b-status__indicator--${props.variant}`]: true,\n }));\n\n return {\n // Values\n conditionalClass,\n\n // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./status.scss\" />\n"],"names":["BentoStatusVariant","BentoStatusVariant2","_sfc_main","defineComponent","BentoTypography","type","props","computed","BentoTypographyElement","BentoTypographyVariant","createElementVNode","normalizeClass","_ctx","createVNode","_component_bento_typography"],"mappings":";;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UANQA,IAAAD,KAAA,CAAA,CAAA;ACkCR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACwB,OAAA;AAAA,IACvB,SAAA;AAAA,MACM,MAAA;AAAA,MACC,UAAA;AAAA,MACI,WAAA,CAAAC,MAAA,OAAA,OAAAL,CAAA,EAAA,SAAAK,CAAA;AAAA,IAC8E;AAAA,EAC5F;AAAA,EACJ,MAAAC,GAAA;AAMI,WAAA;AAAA;AAAA,MAAO,kBAJPC,EAAA,OAAA;AAAA,QAAyC,CAAA,wBAAAD,EAAA,SAAA,GAAA;AAAA,MACM,EAAA;AAAA;AAAA,MAK3C,wBAAAE;AAAA,MAGA,wBAAAC;AAAA,IACA;AAAA,EACJ;AAER,CAAA;;EAzDmC,OAAA;AAAA;;;;;IACWC,EAAA,QAAA;AAAA,MAAqC,OAAAC,EAAA,CAAA,uBAAAC,EAAA,gBAAA,CAAA;AAAA,MAC/E,MAAA;AAAA,IAAA,GAAA,MAAA,CAAA;AAAA,IACUC,EAAAC,GAAA;AAAA,MAC0B,OAAA;AAAA,MACxB,IAAAF,EAAA,uBAAA;AAAA,MAEK,SAAAA,EAAA,uBAAA;AAAA,IAAA,GAAA;AAAA;;;;;;;;"}
|
package/dist/structured-list.js
CHANGED