@adyen/bento-vue2 1.9.0 → 1.10.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.
Files changed (253) hide show
  1. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +19 -3580
  2. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -0
  3. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
  4. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +2 -0
  5. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -0
  6. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +14 -0
  7. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +33 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns-types.d.ts +1 -0
  9. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +20 -4
  10. package/dist/@types/packages/vue2/src/components/data-grid/components/index.d.ts +1 -0
  11. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +1 -0
  12. package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +54 -0
  13. package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +81 -0
  14. package/dist/@types/packages/vue2/src/components/data-grid/composables/useSelector.d.ts +1 -1
  15. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +5 -2
  16. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +16 -7
  17. package/dist/@types/packages/vue2/src/components/divider/divider.keys.d.ts +1 -0
  18. package/dist/@types/packages/vue2/src/components/divider/divider.vue.d.ts +1 -1
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
  20. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +3 -3
  21. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +3 -3
  22. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +9 -0
  23. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +3 -3
  24. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
  25. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
  26. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
  27. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
  28. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
  29. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -0
  30. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +11 -1
  31. package/dist/@types/packages/vue2/src/components/empty-state/empty-state.types.d.ts +1 -0
  32. package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +3 -3
  33. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +84 -12
  34. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +2 -0
  35. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +2 -0
  36. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +3 -1
  37. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +8 -0
  38. package/dist/@types/packages/vue2/src/components/internal/copy/copy.types.d.ts +8 -0
  39. package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +20 -0
  40. package/dist/@types/packages/vue2/src/components/internal/copy/index.d.ts +1 -0
  41. 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.types.d.ts +2 -1
  42. 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 +82 -0
  43. 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 +10 -0
  44. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +9 -0
  45. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/index.d.ts +1 -0
  46. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue.d.ts +12 -0
  47. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -0
  48. package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-multi-level-items/use-multi-level-items.d.ts +6 -0
  49. package/dist/@types/packages/vue2/src/components/internal/listbox/index.d.ts +1 -0
  50. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +12 -3
  51. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -0
  52. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +1 -1
  53. package/dist/@types/packages/vue2/src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue.d.ts +2 -0
  54. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +1 -0
  55. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +1 -1
  56. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +251 -3
  57. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +1 -0
  58. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +3 -4
  59. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.types.d.ts +2 -0
  60. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +16 -3
  61. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +15 -10
  62. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +9 -0
  63. package/dist/@types/packages/vue2/src/types/elements.d.ts +2 -1
  64. package/dist/accordion.js +2 -2
  65. package/dist/action-bar.js +5 -5
  66. package/dist/alert.js +8 -8
  67. package/dist/alert.js.map +1 -1
  68. package/dist/assets/base-modal.css +1 -1
  69. package/dist/assets/button.css +1 -1
  70. package/dist/assets/checkbox.css +1 -1
  71. package/dist/assets/controls-group.css +1 -1
  72. package/dist/assets/copy.css +1 -1
  73. package/dist/assets/dropdown-default-textbox.css +1 -1
  74. package/dist/assets/dropdown.css +1 -1
  75. package/dist/assets/index.css +1 -1
  76. package/dist/assets/index10.css +1 -1
  77. package/dist/assets/index11.css +1 -1
  78. package/dist/assets/index12.css +1 -1
  79. package/dist/assets/index13.css +1 -1
  80. package/dist/assets/index14.css +1 -1
  81. package/dist/assets/index15.css +1 -1
  82. package/dist/assets/index16.css +1 -1
  83. package/dist/assets/index17.css +1 -1
  84. package/dist/assets/index18.css +1 -1
  85. package/dist/assets/index19.css +1 -1
  86. package/dist/assets/index2.css +1 -1
  87. package/dist/assets/index20.css +1 -1
  88. package/dist/assets/index21.css +1 -1
  89. package/dist/assets/index22.css +1 -1
  90. package/dist/assets/index23.css +1 -1
  91. package/dist/assets/index24.css +1 -1
  92. package/dist/assets/index25.css +1 -1
  93. package/dist/assets/index26.css +1 -1
  94. package/dist/assets/index27.css +1 -1
  95. package/dist/assets/index28.css +1 -1
  96. package/dist/assets/index29.css +1 -1
  97. package/dist/assets/index3.css +1 -1
  98. package/dist/assets/index30.css +1 -1
  99. package/dist/assets/index31.css +1 -1
  100. package/dist/assets/index32.css +1 -1
  101. package/dist/assets/index33.css +1 -1
  102. package/dist/assets/index34.css +1 -1
  103. package/dist/assets/index35.css +1 -1
  104. package/dist/assets/index36.css +1 -1
  105. package/dist/assets/index37.css +1 -1
  106. package/dist/assets/index38.css +1 -1
  107. package/dist/assets/index39.css +1 -1
  108. package/dist/assets/index4.css +1 -1
  109. package/dist/assets/index40.css +1 -1
  110. package/dist/assets/index41.css +1 -1
  111. package/dist/assets/index42.css +1 -1
  112. package/dist/assets/index43.css +1 -1
  113. package/dist/assets/index44.css +1 -1
  114. package/dist/assets/index45.css +1 -1
  115. package/dist/assets/index5.css +1 -1
  116. package/dist/assets/index6.css +1 -1
  117. package/dist/assets/index7.css +1 -1
  118. package/dist/assets/index8.css +1 -1
  119. package/dist/assets/index9.css +1 -1
  120. package/dist/assets/listbox.css +1 -1
  121. package/dist/assets/loading-button.css +1 -1
  122. package/dist/avatar-image.js +1 -1
  123. package/dist/badge.js +1 -1
  124. package/dist/button.js +20 -18
  125. package/dist/button.js.map +1 -1
  126. package/dist/card.js +2 -2
  127. package/dist/checkbox.js +61 -48
  128. package/dist/checkbox.js.map +1 -1
  129. package/dist/chunks/{base-button.df9a9bea.js → base-button.46843461.js} +2 -2
  130. package/dist/chunks/{base-button.df9a9bea.js.map → base-button.46843461.js.map} +1 -1
  131. package/dist/chunks/{base-modal.75319f4e.js → base-modal.193ce866.js} +33 -33
  132. package/dist/chunks/base-modal.193ce866.js.map +1 -0
  133. package/dist/chunks/{button-actions-with-menu.32770485.js → button-actions-with-menu.11988565.js} +3 -3
  134. package/dist/chunks/{button-actions-with-menu.32770485.js.map → button-actions-with-menu.11988565.js.map} +1 -1
  135. package/dist/chunks/button.f3f05408.js +100 -0
  136. package/dist/chunks/button.f3f05408.js.map +1 -0
  137. package/dist/chunks/{calendar.a885d8fc.js → calendar.7dbac3b8.js} +4 -4
  138. package/dist/chunks/{calendar.a885d8fc.js.map → calendar.7dbac3b8.js.map} +1 -1
  139. package/dist/chunks/checkbox.f6f6ce39.js +188 -0
  140. package/dist/chunks/checkbox.f6f6ce39.js.map +1 -0
  141. package/dist/chunks/{controls-group.dd967ccf.js → controls-group.24a9efb1.js} +15 -11
  142. package/dist/chunks/controls-group.24a9efb1.js.map +1 -0
  143. package/dist/chunks/copy.f4019f8d.js +122 -0
  144. package/dist/chunks/copy.f4019f8d.js.map +1 -0
  145. package/dist/chunks/{cross-circle-fill.7c07d16a.js → cross-circle-fill.27580c4b.js} +5 -5
  146. package/dist/chunks/{cross-circle-fill.7c07d16a.js.map → cross-circle-fill.27580c4b.js.map} +1 -1
  147. package/dist/chunks/{dropdown-default-textbox.465db4d4.js → dropdown-default-textbox.a1240b9d.js} +11 -11
  148. package/dist/chunks/dropdown-default-textbox.a1240b9d.js.map +1 -0
  149. package/dist/chunks/{dropdown.6461dbe3.js → dropdown.f784ac67.js} +258 -221
  150. package/dist/chunks/dropdown.f784ac67.js.map +1 -0
  151. package/dist/chunks/{field-label.01df3cba.js → field-label.bdf22f47.js} +5 -5
  152. package/dist/chunks/{field-label.01df3cba.js.map → field-label.bdf22f47.js.map} +1 -1
  153. package/dist/chunks/{fixed-scroller.42354ccc.js → fixed-scroller.28158c25.js} +2 -2
  154. package/dist/chunks/{fixed-scroller.42354ccc.js.map → fixed-scroller.28158c25.js.map} +1 -1
  155. package/dist/chunks/{footer-actions.2cd9079e.js → footer-actions.08a8323b.js} +3 -3
  156. package/dist/chunks/{footer-actions.2cd9079e.js.map → footer-actions.08a8323b.js.map} +1 -1
  157. package/dist/chunks/{index.02da8d63.js → index.1036f656.js} +3 -3
  158. package/dist/chunks/{index.02da8d63.js.map → index.1036f656.js.map} +1 -1
  159. package/dist/chunks/{index.322692c8.js → index.158c522b.js} +2 -2
  160. package/dist/chunks/{index.322692c8.js.map → index.158c522b.js.map} +1 -1
  161. package/dist/chunks/{index.f358c4bd.js → index.4824eab5.js} +163 -155
  162. package/dist/chunks/index.4824eab5.js.map +1 -0
  163. package/dist/chunks/{index.6cef7328.js → index.6c299479.js} +2 -2
  164. package/dist/chunks/{index.6cef7328.js.map → index.6c299479.js.map} +1 -1
  165. package/dist/chunks/{index.152b2b16.js → index.7039d901.js} +3 -3
  166. package/dist/chunks/{index.152b2b16.js.map → index.7039d901.js.map} +1 -1
  167. package/dist/chunks/{index.b201e81d.js → index.858b0720.js} +2 -2
  168. package/dist/chunks/{index.b201e81d.js.map → index.858b0720.js.map} +1 -1
  169. package/dist/chunks/{index.16914bb1.js → index.9051abfc.js} +9 -9
  170. package/dist/chunks/{index.16914bb1.js.map → index.9051abfc.js.map} +1 -1
  171. package/dist/chunks/index.9bdf4d78.js +147 -0
  172. package/dist/chunks/index.9bdf4d78.js.map +1 -0
  173. package/dist/chunks/{index.d1beb704.js → index.ad4b770b.js} +5 -5
  174. package/dist/chunks/{index.d1beb704.js.map → index.ad4b770b.js.map} +1 -1
  175. package/dist/chunks/index.f651209d.js +32 -0
  176. package/dist/chunks/index.f651209d.js.map +1 -0
  177. package/dist/chunks/{listbox-option-tag.55cd9c16.js → listbox-option-tag.60c0beca.js} +3 -3
  178. package/dist/chunks/{listbox-option-tag.55cd9c16.js.map → listbox-option-tag.60c0beca.js.map} +1 -1
  179. package/dist/chunks/{listbox.a117e6d4.js → listbox.163433c5.js} +475 -392
  180. package/dist/chunks/listbox.163433c5.js.map +1 -0
  181. package/dist/chunks/{loading-button.459b9ab4.js → loading-button.7b5d0c22.js} +20 -20
  182. package/dist/chunks/{loading-button.459b9ab4.js.map → loading-button.7b5d0c22.js.map} +1 -1
  183. package/dist/chunks/{tooltip.b8929659.js → tooltip.4a1300d5.js} +22 -22
  184. package/dist/chunks/tooltip.4a1300d5.js.map +1 -0
  185. package/dist/chunks/use-has-slot.fbeb19ec.js.map +1 -1
  186. package/dist/code-snippet.js +7 -7
  187. package/dist/code-snippet.js.map +1 -1
  188. package/dist/country.js +2 -2
  189. package/dist/currency.js +1 -1
  190. package/dist/data-grid.js +858 -668
  191. package/dist/data-grid.js.map +1 -1
  192. package/dist/date-picker.js +8 -8
  193. package/dist/date-range-picker.js +2 -2
  194. package/dist/date.js +1 -1
  195. package/dist/divider.js +2 -18
  196. package/dist/divider.js.map +1 -1
  197. package/dist/dropdown.js +4 -4
  198. package/dist/empty-state.js +18 -18
  199. package/dist/empty-state.js.map +1 -1
  200. package/dist/filter-bar.js +408 -399
  201. package/dist/filter-bar.js.map +1 -1
  202. package/dist/focus-trap.js +1 -1
  203. package/dist/form-layout.js +2 -2
  204. package/dist/header.js +3 -3
  205. package/dist/index.js +66 -65
  206. package/dist/info-icon.js +3 -3
  207. package/dist/input-field.js +4 -4
  208. package/dist/internal.js +17 -15
  209. package/dist/link.js +2 -2
  210. package/dist/loading-indicator.js +1 -1
  211. package/dist/menu.js +1 -1
  212. package/dist/modal.js +62 -60
  213. package/dist/modal.js.map +1 -1
  214. package/dist/pagination.js +4 -4
  215. package/dist/payment-method.js +2 -2
  216. package/dist/popover.js +1 -1
  217. package/dist/popper-container.js +1 -1
  218. package/dist/radio-group.js +46 -45
  219. package/dist/radio-group.js.map +1 -1
  220. package/dist/search-bar.js +10 -10
  221. package/dist/segmented-control.js +3 -3
  222. package/dist/sidepanel.js +5 -5
  223. package/dist/status.js +2 -2
  224. package/dist/stepper.js +3 -3
  225. package/dist/structured-list.js +1 -1
  226. package/dist/summary-grid.js +3 -3
  227. package/dist/tabs.js +3 -3
  228. package/dist/tag.js +3 -3
  229. package/dist/textarea.js +95 -88
  230. package/dist/textarea.js.map +1 -1
  231. package/dist/timeline.js +198 -191
  232. package/dist/timeline.js.map +1 -1
  233. package/dist/toast.js +3 -3
  234. package/dist/toggle.js +2 -2
  235. package/dist/tutorial.js +5 -5
  236. package/dist/typography.js +1 -1
  237. package/dist/web-types.json +646 -361
  238. package/package.json +2 -2
  239. package/dist/chunks/base-modal.75319f4e.js.map +0 -1
  240. package/dist/chunks/button.7dd8d4de.js +0 -125
  241. package/dist/chunks/button.7dd8d4de.js.map +0 -1
  242. package/dist/chunks/checkbox.65743b08.js +0 -184
  243. package/dist/chunks/checkbox.65743b08.js.map +0 -1
  244. package/dist/chunks/controls-group.dd967ccf.js.map +0 -1
  245. package/dist/chunks/copy.e12b418e.js +0 -103
  246. package/dist/chunks/copy.e12b418e.js.map +0 -1
  247. package/dist/chunks/dropdown-default-textbox.465db4d4.js.map +0 -1
  248. package/dist/chunks/dropdown.6461dbe3.js.map +0 -1
  249. package/dist/chunks/index.0890dc99.js +0 -130
  250. package/dist/chunks/index.0890dc99.js.map +0 -1
  251. package/dist/chunks/index.f358c4bd.js.map +0 -1
  252. package/dist/chunks/listbox.a117e6d4.js.map +0 -1
  253. package/dist/chunks/tooltip.b8929659.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-checkbox-group',\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","inputValue","ref","watch","onInput","deprecate"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACkEZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,eAAAC,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACA,OAAA,EAAA,MAAA,aAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,aAAA,EAAA,MAAA,QAAA,SAAA,KA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EAAA,YAAA,CAAAI,EAAA,UAAA,CAAA,CAAAJ,EAAA,gBAAAA,EAAA;AAAA,IACA,GAEAS,IAAAD;AAAA,MAAA,MAAA,CAAAR,EAAA,YAAA,CAAAI,EAAA,SAAA,CAAA,CAAAJ,EAAA;AAAA,IACA,GAGAU,IAAAF,EAAA,OAAA;AAAA,MAAA,4CAAAR,EAAA,YAAAT,EAAA;AAAA,IACA,EAAA,GAGAoB,IAAAC,EAAAZ,EAAA,UAAA;AACA,IAAAa;AAAA,MAAA,MAAAb,EAAA;AAAA,MACA,MAAA;AAEA,QAAAW,EAAA,QAAAX,EAAA;AAAA,MAAA;AAAA,IACA;AAGA,UAAAc,IAAA,CAAAhB,MAAA;AACA,MAAAa,EAAA,QAAAb,GACAG,EAAAF,EAAA,QAAAD,CAAA,GACAG,EAAAF,EAAA,OAAAD,CAAA;AAAA,IAAA;AAGA,WAAAE,EAAA,YACAe;AAAA,MAAA;AAAA,MACA;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIA;AAAA;AAAA,MAAA,SAAAb;AAAA,MAEA,YAAAE;AAAA,MACA,sBAAAG;AAAA,MACA,6BAAAE;AAAA,MACA,oBAAAC;AAAA,MACA,YAAAC;AAAA;AAAA,MACA,SAAAG;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACwDZ,MAAAE,IAAA,wBAqBAC,IAAAC,EAAA;AAAA,EAAA,MAAAF;AAAA,EACA,YAAA,EAAA,eAAAG,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACA,OAAA,EAAA,MAAA,aAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIA,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAOA,WAAA,EAAA,MAAA,SAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,OAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA,EAAA,MAAA,OAAA,SAAA,MAAA,CAAA,EAAA;AAAA;AAAA;A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UAAA;AACA,IAAAe;AAAA,MAAA,MAAAf,EAAA;AAAA,MACA,MAAA;AAEA,QAAAiB,EAAA,QAAAjB,EAAA;AAAA,MAAA;AAAA,IACA;AAGA,UAAAmB,IAAA,CAAArB,MAAA;AACA,MAAAmB,EAAA,QAAAnB,GACAG,EAAAF,EAAA,QAAAD,CAAA,GACAG,EAAAF,EAAA,OAAAD,CAAA;AAAA,IAAA;AAGA,WAAAE,EAAA,YACAoB;AAAA,MAAA;AAAA,MACA;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIA;AAAA;AAAA,MAAA,gBAAA5B;AAAA,MAEA,SAAAW;AAAA,MACA,YAAAE;AAAA,MACA,sBAAAG;AAAA,MACA,6BAAAE;AAAA,MACA,oBAAAC;AAAA,MACA,YAAAM;AAAA,MACA,gBAAAL;AAAA;AAAA,MACA,SAAAO;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as b, computed as r, ref as _ } from "vue";
2
- import { B as d } from "./index.b201e81d.js";
2
+ import { B as d } from "./index.858b0720.js";
3
3
  import { u as f } from "./use-has-slot.fbeb19ec.js";
4
4
  import { n as p } from "./_plugin-vue2_normalizer.71e2aa87.js";
5
5
  import "../assets/base-button.css";
@@ -85,4 +85,4 @@ export {
85
85
  U as B,
86
86
  s as a
87
87
  };
88
- //# sourceMappingURL=base-button.df9a9bea.js.map
88
+ //# sourceMappingURL=base-button.46843461.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.df9a9bea.js","sources":["../../src/components/internal/base-button/base-button.types.ts","../../src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CA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e,CAAA;AAAA,MAAA;AAAA,MAcA,cAXA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,MAAAe,CAAA;AAAA,MAAA;AAAA,MAWA,SAAAC,EAAAV,CAAA;AAAA;AAAA,MACA,oBAAAM;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-button.46843461.js","sources":["../../src/components/internal/base-button/base-button.types.ts","../../src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,cAAA,eAJQA,IAAAD,KAAA,CAAA,CAAA;ACwDZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACAJ,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,EACA;AAAA,EACA,MAAAK,GAAA,EAAA,OAAAC,GAAA,MAAAC,GAAA,OAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAA,kBAAAC,IAAAH,EAAA,eAAA,MAAA,gBAAAG,EAAA;AAAA,MACA;AAAA,KAAA,GAGAC,IAAAC,EAAA,IAAA,GAEAC,IAAAJ,EAAA,OAAA;AAAA,MAAA,CAAA,kBAAAZ,EAAA,aAAA,GAAAO,EAAA;AAAA,MACA,CAAA,kBAAAP,EAAA,WAAA,GAAA,CAAAQ,EAAA;AAAA,IACA,EAAA;AAoBA,WAAA;AAAA;AAAA,MAAA,gBAAAG;AAAA,MAEA,oBAAAK;AAAA;AAAA,MACA,eApBA,CAAAC,MAAA;AACA,QAAAV,EAAA,YAGAU,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAIA;AAAA,MAiBA,eAdA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAAA;AAAA,MAcA,cAXA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,MAAAe,CAAA;AAAA,MAAA;AAAA,MAWA,SAAAC,EAAAV,CAAA;AAAA;AAAA,MACA,oBAAAM;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
@@ -1,21 +1,21 @@
1
- import { defineComponent as w, useAttrs as I, ref as v, computed as l, watch as L, onMounted as R } from "vue";
2
- import { B as k } from "./index.b201e81d.js";
3
- import { a as P } from "./button.7dd8d4de.js";
4
- import { BentoDivider as T } from "../divider.js";
5
- import { B as F } from "./index.6cef7328.js";
1
+ import { defineComponent as I, useAttrs as w, ref as v, computed as l, watch as L, onMounted as R } from "vue";
2
+ import { B as k } from "./index.858b0720.js";
3
+ import { a as P } from "./button.f3f05408.js";
4
+ import { B as T } from "./index.f651209d.js";
5
+ import { B as F } from "./index.6c299479.js";
6
6
  import { u as N } from "./use-has-slot.fbeb19ec.js";
7
7
  import { u as x } from "./i18n.eb5b985b.js";
8
8
  import { C as U } from "./cross.04678d81.js";
9
9
  import { G as z, a as q } from "./grid-layout.e0025286.js";
10
10
  import { n as W } from "./_plugin-vue2_normalizer.71e2aa87.js";
11
11
  import "../assets/base-modal.css";
12
- var H = /* @__PURE__ */ ((t) => (t.DEFAULT = "BentoModalDefault", t.DIALOG = "BentoModalDialog", t))(H || {}), b = /* @__PURE__ */ ((t) => (t.SMALL = "small", t.MEDIUM = "medium", t.LARGE = "large", t))(b || {}), u = /* @__PURE__ */ ((t) => (t.SMALLER = "smaller", t.EQUAL = "equal", t.BIGGER = "bigger", t))(u || {}), f = /* @__PURE__ */ ((t) => (t.DIALOG = "dialog", t.ALERT_DIALOG = "alertdialog", t))(f || {}), K = /* @__PURE__ */ ((t) => (t.CONFIRMATION = "confirmation", t.DESTRUCTIVE = "destructive", t.INFO = "info", t.ACKNOWLEDGEMENT = "acknowledgement", t))(K || {}), C = /* @__PURE__ */ ((t) => (t.CLOSE_MODAL = "close-modal", t))(C || {});
12
+ var H = /* @__PURE__ */ ((t) => (t.DEFAULT = "BentoModalDefault", t.DIALOG = "BentoModalDialog", t))(H || {}), b = /* @__PURE__ */ ((t) => (t.SMALL = "small", t.MEDIUM = "medium", t.LARGE = "large", t))(b || {}), u = /* @__PURE__ */ ((t) => (t.SMALLER = "smaller", t.EQUAL = "equal", t.BIGGER = "bigger", t))(u || {}), m = /* @__PURE__ */ ((t) => (t.DIALOG = "dialog", t.ALERT_DIALOG = "alertdialog", t))(m || {}), K = /* @__PURE__ */ ((t) => (t.CONFIRMATION = "confirmation", t.DESTRUCTIVE = "destructive", t.INFO = "info", t.ACKNOWLEDGEMENT = "acknowledgement", t))(K || {}), C = /* @__PURE__ */ ((t) => (t.CLOSE_MODAL = "close-modal", t))(C || {});
13
13
  const Q = {
14
14
  "en-US": {
15
15
  ariaLabelFallback: "modal",
16
16
  close: "Close"
17
17
  }
18
- }, Y = 500, j = w({
18
+ }, Y = 500, j = I({
19
19
  i18n: { messages: Q },
20
20
  name: "base-modal",
21
21
  components: { CrossIcon: U, BentoTypography: k, BentoButton: P, BentoDivider: T, BentoFocusTrap: F, GridLayout: z },
@@ -82,7 +82,7 @@ const Q = {
82
82
  /**
83
83
  * Defines whether the modal will be an alert modal
84
84
  */
85
- modalRole: { type: String, default: f.DIALOG },
85
+ modalRole: { type: String, default: m.DIALOG },
86
86
  /**
87
87
  * Allows the inner elments to overflow the dialog
88
88
  */
@@ -100,8 +100,8 @@ const Q = {
100
100
  withColumnLayout: { type: Boolean, default: !1 }
101
101
  },
102
102
  emits: [C.CLOSE_MODAL],
103
- setup(t, { slots: a, emit: e }) {
104
- const { t: s } = x(), p = I(), d = N(a), i = v(null), r = v(!1), h = l(() => t.isDismissible && !t.hideCloseButton), A = l(() => {
103
+ setup(t, { slots: e, emit: a }) {
104
+ const { t: s } = x(), p = w(), d = N(e), i = v(null), r = v(!1), A = l(() => t.isDismissible && !t.hideCloseButton), h = l(() => {
105
105
  if (!t.customPadding)
106
106
  return {};
107
107
  const o = {
@@ -115,25 +115,25 @@ const Q = {
115
115
  };
116
116
  }), S = l(
117
117
  () => p["aria-label"] ?? s("ariaLabelFallback")
118
- ), m = l(() => t.withColumnLayout && t.size === b.LARGE), _ = () => {
118
+ ), _ = l(() => t.withColumnLayout && t.size === b.LARGE), f = () => {
119
119
  i.value.showModal();
120
120
  }, y = () => {
121
- e(C.CLOSE_MODAL);
121
+ a(C.CLOSE_MODAL);
122
122
  }, O = () => {
123
123
  r.value && (i.value.close(), y(), r.value = !1);
124
124
  }, c = () => {
125
125
  i.value.open && (r.value = !0);
126
126
  }, g = (o) => {
127
- o && o.preventDefault(), t.isDismissible && c();
127
+ o && o.preventDefault(), !(!t.isDismissible && t.modalRole === m.DIALOG) && c();
128
128
  }, E = ({ target: o }) => {
129
- o && o.tagName === f.DIALOG.toUpperCase() && g();
129
+ o && o.tagName === m.DIALOG.toUpperCase() && g();
130
130
  }, M = l(() => ({
131
131
  [`b-modal-base__container--${t.size}`]: t.size,
132
132
  "b-modal-base__container--hide": r.value,
133
133
  "b-modal-base__container--overflow-visible": t.overflowVisible,
134
- "b-modal-base__container--column-layout": m.value
134
+ "b-modal-base__container--column-layout": _.value
135
135
  })), B = l(() => ({
136
- "b-modal-base__content--column-layout": m.value,
136
+ "b-modal-base__content--column-layout": _.value,
137
137
  "b-modal-base__content--with-header": d("default"),
138
138
  "b-modal-base__content--with-actions": d("actions")
139
139
  })), D = l(() => t.columnsSize === u.SMALLER ? [
@@ -151,7 +151,7 @@ const Q = {
151
151
  ([o, n], [, G]) => {
152
152
  if (!n)
153
153
  return;
154
- o ? _() : !G || c();
154
+ o ? f() : !G || c();
155
155
  }
156
156
  ), L(
157
157
  () => t.actions,
@@ -161,14 +161,14 @@ const Q = {
161
161
  },
162
162
  { deep: !0 }
163
163
  ), R(() => {
164
- t.isOpen && i.value && _();
164
+ t.isOpen && i.value && f();
165
165
  }), {
166
166
  // Refs
167
167
  modal: i,
168
168
  computedAriaLabel: S,
169
- showCloseButton: h,
169
+ showCloseButton: A,
170
170
  // Handling the state
171
- openModal: _,
171
+ openModal: f,
172
172
  closeModalOnClickOutside: E,
173
173
  closeModalAfterAnimation: O,
174
174
  startCloseModalAnimation: c,
@@ -180,8 +180,8 @@ const Q = {
180
180
  // Styles
181
181
  modalConditionalClasses: M,
182
182
  modalContentConditionalClasses: B,
183
- customPaddingStyles: A,
184
- hasColumnLayout: m,
183
+ customPaddingStyles: h,
184
+ hasColumnLayout: _,
185
185
  computedColumnWidth: D,
186
186
  // Enums
187
187
  GridLayoutContainerType: q
@@ -189,23 +189,23 @@ const Q = {
189
189
  }
190
190
  });
191
191
  var J = function() {
192
- var a = this, e = a._self._c;
193
- return a._self._setupProxy, e("div", { staticClass: "b-modal-base" }, [e("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: a.modalConditionalClasses, attrs: { role: a.modalRole, "aria-label": a.computedAriaLabel, open: a.initiallyOpen }, on: { animationend: a.closeModalAfterAnimation, click: function(s) {
194
- a.isDismissible && a.closeModalOnClickOutside(s);
192
+ var e = this, a = e._self._c;
193
+ return e._self._setupProxy, a("div", { staticClass: "b-modal-base" }, [a("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: e.modalConditionalClasses, attrs: { role: e.modalRole, "aria-label": e.computedAriaLabel, open: e.initiallyOpen }, on: { animationend: e.closeModalAfterAnimation, click: function(s) {
194
+ e.isDismissible && e.closeModalOnClickOutside(s);
195
195
  }, keydown: function(s) {
196
- return !s.type.indexOf("key") && a._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : a.internalModalActionClose.apply(null, arguments);
197
- } } }, [e("bento-focus-trap", [e("div", { staticClass: "b-modal-base__wrapper" }, [a.hasSlot("default") || a.showCloseButton ? e("div", { staticClass: "b-modal-base__header-container", style: a.customPaddingStyles.header }, [e("div", { staticClass: "b-modal-base__header" }, [e("bento-typography", { staticClass: "b-modal-base__title", attrs: { "aria-label": "base modal title", el: "span", variant: "title", stronger: "" } }, [a.hasSlot("default") ? a._t("default") : a._e()], 2), a.showCloseButton ? e("bento-button", { staticClass: "b-modal-base__close-button", attrs: { variant: "tertiary", type: "button" }, on: { click: a.internalModalActionClose } }, [e("cross-icon", { attrs: { "svg-title": a.t("close") } })], 1) : a._e()], 1), a.hasColumnLayout ? e("bento-divider", { staticClass: "b-modal-base__divider" }) : a._e()], 1) : a._e(), e("div", { staticClass: "b-modal-base__content", class: a.modalContentConditionalClasses, style: a.customPaddingStyles.content }, [a.hasSlot("content") || a.hasSlot("content-col-1") && a.hasSlot("content-col-2") ? e("bento-typography", { attrs: { "aria-label": "base modal content", el: "div", variant: "body", stronger: "" } }, [a.hasColumnLayout ? e("grid-layout", { staticClass: "b-modal-base__grid", attrs: { "column-width": a.computedColumnWidth, "container-type": a.GridLayoutContainerType.NORMAL, "no-gap": "" }, scopedSlots: a._u([{ key: "col-1", fn: function() {
198
- return [a._t("content-col-1")];
196
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : e.internalModalActionClose.apply(null, arguments);
197
+ } } }, [e.isOpen || e.initiallyOpen ? a("bento-focus-trap", [a("div", { staticClass: "b-modal-base__wrapper" }, [e.hasSlot("default") || e.showCloseButton ? a("div", { staticClass: "b-modal-base__header-container", style: e.customPaddingStyles.header }, [a("div", { staticClass: "b-modal-base__header" }, [a("bento-typography", { staticClass: "b-modal-base__title", attrs: { "aria-label": "base modal title", el: "span", variant: "title", stronger: "" } }, [e.hasSlot("default") ? e._t("default") : e._e()], 2), e.showCloseButton ? a("bento-button", { staticClass: "b-modal-base__close-button", attrs: { variant: "tertiary", type: "button" }, on: { click: e.internalModalActionClose } }, [a("cross-icon", { attrs: { "svg-title": e.t("close") } })], 1) : e._e()], 1), e.hasColumnLayout ? a("bento-divider", { staticClass: "b-modal-base__divider" }) : e._e()], 1) : e._e(), a("div", { staticClass: "b-modal-base__content", class: e.modalContentConditionalClasses, style: e.customPaddingStyles.content }, [e.hasSlot("content") || e.hasSlot("content-col-1") && e.hasSlot("content-col-2") ? a("bento-typography", { attrs: { "aria-label": "base modal content", el: "div", variant: "body", stronger: "" } }, [e.hasColumnLayout ? a("grid-layout", { staticClass: "b-modal-base__grid", attrs: { "column-width": e.computedColumnWidth, "container-type": e.GridLayoutContainerType.NORMAL, "no-gap": "" }, scopedSlots: e._u([{ key: "col-1", fn: function() {
198
+ return [e._t("content-col-1")];
199
199
  }, proxy: !0 }, { key: "col-2", fn: function() {
200
- return [a._t("content-col-2")];
201
- }, proxy: !0 }], null, !0) }) : a._t("content")], 2) : a._e()], 1), a.hasSlot("actions") ? e("div", { staticClass: "b-modal-base__actions-container", style: a.customPaddingStyles.actions }, [a.hasColumnLayout ? e("bento-divider", { staticClass: "b-modal-base__divider" }) : a._e(), e("div", { staticClass: "b-modal-base__actions", attrs: { "aria-label": "modal actions" } }, [a._t("actions")], 2)], 1) : a._e()])])], 1)]);
200
+ return [e._t("content-col-2")];
201
+ }, proxy: !0 }], null, !0) }) : e._t("content")], 2) : e._e()], 1), e.hasSlot("actions") ? a("div", { staticClass: "b-modal-base__actions-container", style: e.customPaddingStyles.actions }, [e.hasColumnLayout ? a("bento-divider", { staticClass: "b-modal-base__divider" }) : e._e(), a("div", { staticClass: "b-modal-base__actions", attrs: { "aria-label": "modal actions" } }, [e._t("actions")], 2)], 1) : e._e()])]) : e._e()], 1)]);
202
202
  }, V = [], X = /* @__PURE__ */ W(
203
203
  j,
204
204
  J,
205
205
  V,
206
206
  !1,
207
207
  null,
208
- "03e95a66",
208
+ "c54fedd1",
209
209
  null,
210
210
  null
211
211
  );
@@ -214,9 +214,9 @@ export {
214
214
  H as B,
215
215
  b as a,
216
216
  u as b,
217
- f as c,
217
+ m as c,
218
218
  K as d,
219
219
  C as e,
220
220
  rt as f
221
221
  };
222
- //# sourceMappingURL=base-modal.75319f4e.js.map
222
+ //# sourceMappingURL=base-modal.193ce866.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.193ce866.js","sources":["../../src/components/modal/modal.types.ts","../../src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","<template>\n <div class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"computedAriaLabel\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @click=\"isDismissible && closeModalOnClickOutside($event)\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap v-if=\"isOpen || initiallyOpen\">\n <div class=\"b-modal-base__wrapper\">\n <div\n v-if=\"hasSlot('default') || showCloseButton\"\n class=\"b-modal-base__header-container\"\n :style=\"customPaddingStyles.header\"\n >\n <div class=\"b-modal-base__header\">\n <bento-typography\n class=\"b-modal-base__title\"\n aria-label=\"base modal title\"\n el=\"span\"\n variant=\"title\"\n stronger\n >\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n\n <bento-divider v-if=\"hasColumnLayout\" class=\"b-modal-base__divider\" />\n </div>\n\n <div\n class=\"b-modal-base__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n aria-label=\"base modal content\"\n el=\"div\"\n variant=\"body\"\n stronger\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-base__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n\n <div\n v-if=\"hasSlot('actions')\"\n class=\"b-modal-base__actions-container\"\n :style=\"customPaddingStyles.actions\"\n >\n <bento-divider v-if=\"hasColumnLayout\" class=\"b-modal-base__divider\" />\n\n <div aria-label=\"modal actions\" class=\"b-modal-base__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref, useAttrs, watch } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalEvent,\n BentoModalRole,\n BentoModalSize,\n } from '@/components/modal/modal.types';\n\n import { BentoTypography } from '@/components/typography';\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoDivider } from '@/components/divider';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n components: { CrossIcon, BentoTypography, BentoButton, BentoDivider, BentoFocusTrap, GridLayout },\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 * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\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',2\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 * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Allows the inner elments to overflow the dialog\n */\n overflowVisible: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n },\n emits: [BentoModalEvent.CLOSE_MODAL],\n setup(props, { slots, emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: { ...xPadding, paddingTop: props.customPadding },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n };\n });\n\n const computedAriaLabel = computed(\n () => (attrs['aria-label'] as string) ?? (t('ariaLabelFallback') as string)\n );\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit(BentoModalEvent.CLOSE_MODAL);\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value) {\n modal.value.close();\n emitCloseEvent();\n isClosing.value = false;\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeModalOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === BentoModalRole.DIALOG.toUpperCase()) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--overflow-visible': props.overflowVisible,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-base__content--column-layout': hasColumnLayout.value,\n 'b-modal-base__content--with-header': hasSlot('default'),\n 'b-modal-base__content--with-actions': hasSlot('actions'),\n }));\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n return {\n // Refs\n modal,\n computedAriaLabel,\n showCloseButton,\n\n // Handling the state\n openModal,\n closeModalOnClickOutside,\n closeModalAfterAnimation,\n startCloseModalAnimation,\n\n // Methods\n internalModalActionClose,\n hasSlot,\n emitCloseEvent,\n t,\n\n // Styles\n modalConditionalClasses,\n modalContentConditionalClasses,\n customPaddingStyles,\n hasColumnLayout,\n computedColumnWidth,\n\n // Enums\n GridLayoutContainerType,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["BentoModalVariant","BentoModalVariant2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","_sfc_main","defineComponent","messages","CrossIcon","BentoTypography","BentoButton","BentoDivider","BentoFocusTrap","GridLayout","props","slots","emit","t","useI18n","attrs","useAttrs","hasSlot","useHasSlot","modal","ref","isClosing","showCloseButton","computed","customPaddingStyles","xPadding","content","computedAriaLabel","hasColumnLayout","openModal","emitCloseEvent","closeModalAfterAnimation","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","target","modalConditionalClasses","modalContentConditionalClasses","computedColumnWidth","watch","newIsOpen","newModalValue","oldModalValue","_b","_a","onMounted","GridLayoutContainerType"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,qBACAA,EAAA,SAAA,oBAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GASAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,eAAA,eAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,eAAA,gBACAA,EAAA,cAAA,eACAA,EAAA,OAAA,QACAA,EAAA,kBAAA,mBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA;;;;;;GCkEZE,IAAA,KAEAC,IAAAC,EAAA;AAAA,EAAA,MAAA,EAAA,UAAAC,EAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA,EAAA,WAAAC,GAAA,iBAAAC,GAAA,aAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,YAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA,MAGA,0BAAAM;AAAA,MACA,0BAAAJ;AAAA,MACA,0BAAAC;AAAA;AAAA,MACA,0BAAAC;AAAA,MAGA,SAAAhB;AAAA,MACA,gBAAAa;AAAA,MACA,GAAAjB;AAAA;AAAA,MACA,yBAAAwB;AAAA,MAGA,gCAAAC;AAAA,MACA,qBAAAd;AAAA,MACA,iBAAAI;AAAA,MACA,qBAAAW;AAAA;AAAA,MACA,yBAAAQ;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as a, computed as i, toRef as r, provide as u } from "vue";
2
- import { M as d, B as p } from "./index.f358c4bd.js";
3
- import { B as _ } from "./index.d1beb704.js";
2
+ import { M as d, B as p } from "./index.4824eab5.js";
3
+ import { B as _ } from "./index.ad4b770b.js";
4
4
  import { BentoButtonActions as l } from "../button.js";
5
5
  import { n as m } from "./_plugin-vue2_normalizer.71e2aa87.js";
6
6
  import "../assets/button-actions-with-menu.css";
@@ -102,4 +102,4 @@ const C = B.exports;
102
102
  export {
103
103
  C as B
104
104
  };
105
- //# sourceMappingURL=button-actions-with-menu.32770485.js.map
105
+ //# sourceMappingURL=button-actions-with-menu.11988565.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.32770485.js","sources":["../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["<template>\n <div class=\"b-button-actions-with-menu\">\n <div role=\"group\" class=\"b-button-actions-with-menu__container-wrapper\">\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" />\n <bento-menu v-if=\"computedMenuActions.length\" :data=\"computedMenuActions\" :menu-position=\"menuPosition\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, toRef } from 'vue';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import { BentoPopoverPositions } from '@/components/popover';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const computedActions = computed(() => props.actions.slice(0, props.displayedActions));\n const inverseRef = toRef(props, 'inverse');\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n const computedMenuActions = computed(() =>\n props.displayedActions !== undefined && props.displayedActions < props.actions.length\n ? (props.actions.slice(props.displayedActions, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["__default__","computedActions","computed","props","inverseRef","toRef","provide","MENU_INVERSE_INJECTION_KEY","computedMenuActions","el"],"mappings":";;;;;;AAwJI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,GAAAA,EAAA,gBAAA,CAAA,GACAC,IAAAC,EAAAF,GAAA,SAAA;AAEA,IAAAG,EAAAC,GAAAH,CAAA;AAEA,UAAAI,IAAAN;AAAA,MAA4B,MAAAC,EAAA,qBAAA,UAAAA,EAAA,mBAAAA,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAA,EAAA,kBAAAA,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAM,OAAA;AAAA,QAE4D,MAAAA,EAAA;AAAA,QACjE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-actions-with-menu.11988565.js","sources":["../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["<template>\n <div class=\"b-button-actions-with-menu\">\n <div role=\"group\" class=\"b-button-actions-with-menu__container-wrapper\">\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" />\n <bento-menu v-if=\"computedMenuActions.length\" :data=\"computedMenuActions\" :menu-position=\"menuPosition\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, toRef } from 'vue';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import { BentoPopoverPositions } from '@/components/popover';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const computedActions = computed(() => props.actions.slice(0, props.displayedActions));\n const inverseRef = toRef(props, 'inverse');\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n const computedMenuActions = computed(() =>\n props.displayedActions !== undefined && props.displayedActions < props.actions.length\n ? (props.actions.slice(props.displayedActions, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["__default__","computedActions","computed","props","inverseRef","toRef","provide","MENU_INVERSE_INJECTION_KEY","computedMenuActions","el"],"mappings":";;;;;;AAwJI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,GAAAA,EAAA,gBAAA,CAAA,GACAC,IAAAC,EAAAF,GAAA,SAAA;AAEA,IAAAG,EAAAC,GAAAH,CAAA;AAEA,UAAAI,IAAAN;AAAA,MAA4B,MAAAC,EAAA,qBAAA,UAAAA,EAAA,mBAAAA,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAA,EAAA,kBAAAA,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAM,OAAA;AAAA,QAE4D,MAAAA,EAAA;AAAA,QACjE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,100 @@
1
+ import { defineComponent as y, useAttrs as m, useSlots as v, computed as i } from "vue";
2
+ import { B as S } from "./index.858b0720.js";
3
+ import { u as E } from "./use-has-slot.fbeb19ec.js";
4
+ import { BentoLink as g, BentoLinkVariant as C } from "../link.js";
5
+ import { n as R } from "./_plugin-vue2_normalizer.71e2aa87.js";
6
+ import "../assets/button.css";
7
+ var l = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.TERTIARY = "tertiary", e))(l || {}), s = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DESTRUCTIVE = "critical", e.DISABLED = "disabled", e.ICON_ONLY = "icon-only", e.INVERSE = "inverse", e))(s || {});
8
+ const D = {
9
+ name: "bento-button"
10
+ }, h = /* @__PURE__ */ y({
11
+ ...D,
12
+ props: {
13
+ /**
14
+ * Reduces sizing of button
15
+ */
16
+ condensed: { type: Boolean, default: !1 },
17
+ /**
18
+ * Displays button as critical
19
+ */
20
+ critical: { type: Boolean, default: !1 },
21
+ /**
22
+ * Disables button functionality
23
+ */
24
+ disabled: { type: Boolean, default: !1 },
25
+ /**
26
+ * Sets color set to inverse
27
+ */
28
+ inverse: { type: Boolean, default: !1 },
29
+ /**
30
+ * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.
31
+ */
32
+ link: { type: Object, default: void 0 },
33
+ /**
34
+ * The default behavior of the button.
35
+ * Possible values are: 'button', 'reset', 'submit'
36
+ */
37
+ type: {
38
+ type: String,
39
+ default: "button"
40
+ },
41
+ /**
42
+ * Types of flavour of Button
43
+ * @values primary, secondary, tertiary
44
+ */
45
+ variant: {
46
+ type: String,
47
+ default: l.PRIMARY,
48
+ validator: (e) => Object.values(l).includes(e)
49
+ }
50
+ },
51
+ emits: ["blur", "click", "focus", "keydown.esc"],
52
+ setup(e, { emit: n }) {
53
+ const t = e, o = m(), r = v(), _ = E(r), c = i(() => (t == null ? void 0 : t.link) !== void 0 ? g : "button"), u = i(() => {
54
+ var a, p;
55
+ return {
56
+ "aria-controls": (a = o["aria-controls"]) == null ? void 0 : a.toString(),
57
+ "aria-expanded": (p = o["aria-expanded"]) == null ? void 0 : p.toString()
58
+ };
59
+ }), b = i(
60
+ () => c.value === "button" ? {
61
+ ...u.value,
62
+ disabled: t.disabled,
63
+ type: t.type
64
+ } : { ...t.link, disableTypography: !0, variant: C.DEFAULT }
65
+ ), d = i(() => ({
66
+ [`b-button--${t.variant}${t.critical ? `-${s.DESTRUCTIVE}` : ""}`]: !0
67
+ })), f = i(() => ({
68
+ ...d.value,
69
+ [`b-button--${s.CONDENSED}`]: t.condensed,
70
+ [`b-button--${s.DISABLED}`]: t.disabled,
71
+ [`b-button--${s.ICON_ONLY}`]: !r.default,
72
+ [`b-button--${s.INVERSE}`]: t.inverse
73
+ }));
74
+ return { __sfc: !0, props: t, emit: n, attrs: o, slots: r, hasSlot: _, componentType: c, ariaAttributes: u, componentProps: b, variantClass: d, conditionalClasses: f, onClickButton: (a) => {
75
+ t.disabled ? (a.preventDefault(), a.stopPropagation()) : n("click", a);
76
+ }, BentoTypography: S };
77
+ }
78
+ });
79
+ var k = function() {
80
+ var n = this, t = n._self._c, o = n._self._setupProxy;
81
+ return t(o.componentType, n._b({ tag: "component", staticClass: "b-button", class: o.conditionalClasses, on: { "!click": function(r) {
82
+ return o.onClickButton.apply(null, arguments);
83
+ } } }, "component", o.componentProps, !1), [o.hasSlot("iconLeft") ? t("span", { staticClass: "b-button__icon-left", attrs: { "data-testid": "icon-button-left" } }, [n._t("iconLeft")], 2) : n._e(), o.hasSlot("default") ? t(o.BentoTypography, { staticClass: "b-button__label", attrs: { el: "span", variant: "body", stronger: "" } }, [n._t("default")], 2) : n._e(), o.hasSlot("iconRight") ? t("span", { staticClass: "b-button__icon-right", attrs: { "data-testid": "icon-button-right" } }, [n._t("iconRight")], 2) : n._e()], 1);
84
+ }, T = [], I = /* @__PURE__ */ R(
85
+ h,
86
+ k,
87
+ T,
88
+ !1,
89
+ null,
90
+ "8bf52b83",
91
+ null,
92
+ null
93
+ );
94
+ const Y = I.exports;
95
+ export {
96
+ l as B,
97
+ Y as a,
98
+ s as b
99
+ };
100
+ //# sourceMappingURL=button.f3f05408.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.f3f05408.js","sources":["../../../core/src/components/button/button.types.ts","../../src/components/button/button.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n TERTIARY = 'tertiary',\n}\n\nexport enum BentoButtonPropClass {\n CONDENSED = 'condensed',\n DESTRUCTIVE = 'critical',\n DISABLED = 'disabled',\n ICON_ONLY = 'icon-only',\n INVERSE = 'inverse',\n}\n\nexport interface BentoButtonProps {\n condensed?: boolean;\n critical?: boolean;\n disabled?: boolean;\n inverse?: boolean;\n variant?: BentoButtonVariant | `${BentoButtonVariant}`;\n type?: string;\n link?: object;\n}\n","<template>\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-button\"\n :class=\"conditionalClasses\"\n @click.capture=\"onClickButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useAttrs, useSlots } from 'vue';\n import { BentoButtonPropClass, BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { Booleanish } from '@/types/prop-types';\n import type { RouterLinkProps } from 'vue-router/types/router';\n import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoLink, BentoLinkVariant } from '@/components/link';\n\n // TODO: replace all this code when migrated to Vue 3 is complete as this is the only\n // current way to extend the `router-link` component in Vue 2 and Vue Router 3\n export interface LinkProps extends RouterLinkProps, AnchorHTMLAttributes {\n // eslint-disable-next-line vue/require-default-prop\n args?: { props: RouterLinkProps };\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external: boolean;\n }\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Displays button as critical\n */\n critical: { type: Boolean, default: false },\n\n /**\n * Disables button functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Sets color set to inverse\n */\n inverse: { type: Boolean, default: false },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: { type: Object, default: undefined },\n\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: String as PropType<BentoButtonVariant | `${BentoButtonVariant}`>,\n default: BentoButtonVariant.PRIMARY,\n validator: (value: BentoButtonVariant) => Object.values(BentoButtonVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur');\n\n /**\n * Emitted when the button is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus');\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'keydown.esc');\n }>();\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => {\n if (props?.link !== undefined) {\n return BentoLink;\n }\n return 'button';\n });\n const ariaAttributes = computed(() => ({\n 'aria-controls': attrs['aria-controls']?.toString() as string,\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const componentProps = computed(() =>\n componentType.value === 'button'\n ? {\n ...ariaAttributes.value,\n disabled: props.disabled,\n type: props.type,\n }\n : { ...props.link, disableTypography: true, variant: BentoLinkVariant.DEFAULT }\n );\n\n const variantClass = computed(() => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(() => ({\n ...variantClass.value,\n [`b-button--${BentoButtonPropClass.CONDENSED}`]: props.condensed,\n [`b-button--${BentoButtonPropClass.DISABLED}`]: props.disabled,\n [`b-button--${BentoButtonPropClass.ICON_ONLY}`]: !slots.default,\n [`b-button--${BentoButtonPropClass.INVERSE}`]: props.inverse,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Button component for all the various types of bento buttons.\n *\n * @example\n * import { BentoButton } from '@adyen/bento-vue2';\n * import { CheckMarkIcon } from '@adyen/ui-assets-icons-16';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * variant=\"secondary\"\n * >\n * <template #iconLeft>\n * <check-mark svg-title=\"checked\" />\n * </template>\n *\n * Button text\n *\n * <template #iconRight>\n * <check-mark svg-title=\"checked\" />\n * </template>\n * </bento-button>\n * `,\n * }\n */\n export default {\n name: 'bento-button',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","__default__","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","componentType","computed","props","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","e","emit"],"mappings":";;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aACAA,EAAA,WAAA,YAHQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,cAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WALQA,IAAAD,KAAA,CAAA,CAAA;ACgLR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7EAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,OACIC,KAAA,gBAAAA,EAAA,UAAA,SACIC,IAEJ,QAAO,GAEXC,IAAAH,EAAA,MAAA;;AAAA;AAAA,QAAuC,kBAAAI,IAAAX,EAAA,eAAA,MAAA,gBAAAW,EAAA;AAAA,QACe,kBAAAC,IAAAZ,EAAA,eAAA,MAAA,gBAAAY,EAAA;AAAA,MACA;AAAA,KAAA,GAGtDC,IAAAN;AAAA,MAAuB,MAAAD,EAAA,UAAA,WAAA;AAAA,QAEb,GAAAI,EAAA;AAAA,QACsB,UAAAF,EAAA;AAAA,QACF,MAAAA,EAAA;AAAA,MACJ,IAAA,EAAA,GAAAA,EAAA,MAAA,mBAAA,IAAA,SAAAM,EAAA,QAAA;AAAA,IAE4D,GAGtFC,IAAAR,EAAA,OAAA;AAAA,MAAqC,CAAA,aAAAC,EAAA,UAAAA,EAAA,WAAA,IAAAX,EAAA,gBAAA,IAAA,GAAA;AAAA,IAC8D,EAAA,GAGnGmB,IAAAT,EAAA,OAAA;AAAA,MAA2C,GAAAQ,EAAA;AAAA,MACvB,CAAA,aAAAlB,EAAA,WAAA,GAAAW,EAAA;AAAA,MACuC,CAAA,aAAAX,EAAA,UAAA,GAAAW,EAAA;AAAA,MACD,CAAA,aAAAX,EAAA,WAAA,GAAA,CAAAK,EAAA;AAAA,MACE,CAAA,aAAAL,EAAA,SAAA,GAAAW,EAAA;AAAA,IACH,EAAA;0LAGzD,CAAAS,MAAA;AACI,MAAAT,EAAA,YAGIS,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAC,EAAA,SAAAD,CAAA;AAAA,IAIJ;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as le, computed as I, ref as $, watch as j, nextTick as Ne, toRef as F, reactive as ie, toRaw as Te } from "vue";
2
2
  import { r as E, t as S, g as fe, e as oe, d as Ee, f as Se } from "./index.f55fdc32.js";
3
- import { t as O, B as we, a as be, f as ve } from "./index.322692c8.js";
3
+ import { t as O, B as we, a as be, f as ve } from "./index.158c522b.js";
4
4
  import { e as De } from "./index.d80206ed.js";
5
- import { a as Me } from "./button.7dd8d4de.js";
6
- import { B as Oe } from "./index.b201e81d.js";
5
+ import { a as Me } from "./button.f3f05408.js";
6
+ import { B as Oe } from "./index.858b0720.js";
7
7
  import { u as Ie } from "./i18n.eb5b985b.js";
8
8
  import { g as pe } from "./unique-id.a2a2b458.js";
9
9
  import { C as xe, a as Re } from "./chevron-left.5edf02ac.js";
@@ -956,4 +956,4 @@ export {
956
956
  C as s,
957
957
  ot as u
958
958
  };
959
- //# sourceMappingURL=calendar.a885d8fc.js.map
959
+ //# sourceMappingURL=calendar.7dbac3b8.js.map