@adyen/bento-vue2 1.12.0 → 1.13.1

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 (216) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +10 -22
  3. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +23 -0
  4. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +2 -1
  5. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +3 -1
  6. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +9 -0
  7. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +520 -0
  8. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +1 -0
  9. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +4 -1
  10. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/index.d.ts +1 -0
  11. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/listbox-multi-select-chips.vue.d.ts +28 -0
  12. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +3 -4
  13. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +2 -2
  14. package/dist/@types/packages/vue2/src/components/internal/listbox/composables/useListboxKeyboardNavigation.d.ts +2 -2
  15. package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +3 -2
  16. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.keys.d.ts +1 -0
  17. package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/index.d.ts +2 -0
  18. package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.types.d.ts +1 -0
  19. package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +22 -26
  20. package/dist/@types/packages/vue2/src/components/radio-group/index.d.ts +2 -1
  21. package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.keys.d.ts +1 -0
  22. package/dist/accordion.js +2 -2
  23. package/dist/action-bar.js +5 -5
  24. package/dist/alert.js +17 -16
  25. package/dist/alert.js.map +1 -1
  26. package/dist/assets/base-modal.css +1 -1
  27. package/dist/assets/button.css +1 -1
  28. package/dist/assets/checkbox.css +1 -1
  29. package/dist/assets/controls-group.css +1 -1
  30. package/dist/assets/index.css +1 -1
  31. package/dist/assets/index10.css +1 -1
  32. package/dist/assets/index11.css +1 -1
  33. package/dist/assets/index12.css +1 -1
  34. package/dist/assets/index13.css +1 -1
  35. package/dist/assets/index14.css +1 -1
  36. package/dist/assets/index15.css +1 -1
  37. package/dist/assets/index16.css +1 -1
  38. package/dist/assets/index17.css +1 -1
  39. package/dist/assets/index18.css +1 -1
  40. package/dist/assets/index19.css +1 -1
  41. package/dist/assets/index2.css +1 -1
  42. package/dist/assets/index20.css +1 -1
  43. package/dist/assets/index21.css +1 -1
  44. package/dist/assets/index22.css +1 -1
  45. package/dist/assets/index23.css +1 -1
  46. package/dist/assets/index24.css +1 -1
  47. package/dist/assets/index25.css +1 -1
  48. package/dist/assets/index26.css +1 -1
  49. package/dist/assets/index28.css +1 -1
  50. package/dist/assets/index29.css +1 -1
  51. package/dist/assets/index3.css +1 -1
  52. package/dist/assets/index30.css +1 -1
  53. package/dist/assets/index31.css +1 -1
  54. package/dist/assets/index32.css +1 -1
  55. package/dist/assets/index33.css +1 -1
  56. package/dist/assets/index34.css +1 -1
  57. package/dist/assets/index35.css +1 -1
  58. package/dist/assets/index36.css +1 -1
  59. package/dist/assets/index37.css +1 -1
  60. package/dist/assets/index39.css +1 -1
  61. package/dist/assets/index4.css +1 -1
  62. package/dist/assets/index40.css +1 -1
  63. package/dist/assets/index41.css +1 -1
  64. package/dist/assets/index42.css +1 -1
  65. package/dist/assets/index43.css +1 -1
  66. package/dist/assets/index44.css +1 -1
  67. package/dist/assets/index45.css +1 -1
  68. package/dist/assets/index46.css +1 -1
  69. package/dist/assets/index5.css +1 -1
  70. package/dist/assets/index6.css +1 -1
  71. package/dist/assets/index7.css +1 -1
  72. package/dist/assets/index8.css +1 -1
  73. package/dist/assets/index9.css +1 -1
  74. package/dist/assets/listbox.css +1 -1
  75. package/dist/avatar-image.js +1 -1
  76. package/dist/badge.js +1 -1
  77. package/dist/button.js +45 -52
  78. package/dist/button.js.map +1 -1
  79. package/dist/card.js +2 -2
  80. package/dist/checkbox.js +6 -6
  81. package/dist/chunks/arrow-left.2db60716.js.map +1 -1
  82. package/dist/chunks/{base-button.1f07b7c1.js → base-button.f9080a52.js} +2 -2
  83. package/dist/chunks/{base-button.1f07b7c1.js.map → base-button.f9080a52.js.map} +1 -1
  84. package/dist/chunks/{base-modal.9d63bdaf.js → base-modal.a580438d.js} +42 -40
  85. package/dist/chunks/base-modal.a580438d.js.map +1 -0
  86. package/dist/chunks/{button-actions-with-menu.4c5091f4.js → button-actions-with-menu.a9087340.js} +3 -3
  87. package/dist/chunks/{button-actions-with-menu.4c5091f4.js.map → button-actions-with-menu.a9087340.js.map} +1 -1
  88. package/dist/chunks/{button.133f145e.js → button.bb0d7584.js} +7 -7
  89. package/dist/chunks/{button.133f145e.js.map → button.bb0d7584.js.map} +1 -1
  90. package/dist/chunks/{calendar.9a8605d1.js → calendar.17ab99de.js} +66 -66
  91. package/dist/chunks/{calendar.9a8605d1.js.map → calendar.17ab99de.js.map} +1 -1
  92. package/dist/chunks/{checkbox.d8b810c7.js → checkbox.51cdb397.js} +3 -3
  93. package/dist/chunks/checkbox.51cdb397.js.map +1 -0
  94. package/dist/chunks/checkmark-circle-fill.345311d2.js.map +1 -1
  95. package/dist/chunks/checkmark-small.520f01b1.js.map +1 -1
  96. package/dist/chunks/checkmark.a6ed8f47.js.map +1 -1
  97. package/dist/chunks/chevron-left.5edf02ac.js.map +1 -1
  98. package/dist/chunks/chevron-up.81185563.js.map +1 -1
  99. package/dist/chunks/{controls-group.bf152dea.js → controls-group.3716f4b4.js} +4 -4
  100. package/dist/chunks/{controls-group.bf152dea.js.map → controls-group.3716f4b4.js.map} +1 -1
  101. package/dist/chunks/{copy.68a7d416.js → copy.54cc3ab4.js} +4 -4
  102. package/dist/chunks/copy.54cc3ab4.js.map +1 -0
  103. package/dist/chunks/cross-circle-fill.27580c4b.js.map +1 -1
  104. package/dist/chunks/cross-small.e851e0de.js +26 -0
  105. package/dist/chunks/cross-small.e851e0de.js.map +1 -0
  106. package/dist/chunks/cross.04678d81.js.map +1 -1
  107. package/dist/chunks/{dropdown-default-textbox.c595fd31.js → dropdown-default-textbox.13b5054e.js} +2 -2
  108. package/dist/chunks/{dropdown-default-textbox.c595fd31.js.map → dropdown-default-textbox.13b5054e.js.map} +1 -1
  109. package/dist/chunks/{dropdown.eaee22a3.js → dropdown.4d800c61.js} +14 -14
  110. package/dist/chunks/dropdown.4d800c61.js.map +1 -0
  111. package/dist/chunks/{field-label.66f52c8f.js → field-label.7328b82b.js} +2 -2
  112. package/dist/chunks/{field-label.66f52c8f.js.map → field-label.7328b82b.js.map} +1 -1
  113. package/dist/chunks/{fixed-scroller.01fc96f7.js → fixed-scroller.d6c11166.js} +2 -2
  114. package/dist/chunks/{fixed-scroller.01fc96f7.js.map → fixed-scroller.d6c11166.js.map} +1 -1
  115. package/dist/chunks/{footer-actions.38e99891.js → footer-actions.bc0cb7e0.js} +3 -3
  116. package/dist/chunks/{footer-actions.38e99891.js.map → footer-actions.bc0cb7e0.js.map} +1 -1
  117. package/dist/chunks/{index.d90c5838.js → index.170ac16b.js} +3 -3
  118. package/dist/chunks/{index.d90c5838.js.map → index.170ac16b.js.map} +1 -1
  119. package/dist/chunks/{index.18773b0b.js → index.339f15c4.js} +26 -26
  120. package/dist/chunks/{index.18773b0b.js.map → index.339f15c4.js.map} +1 -1
  121. package/dist/chunks/{index.3b7d40b7.js → index.541cce1c.js} +2 -2
  122. package/dist/chunks/{index.3b7d40b7.js.map → index.541cce1c.js.map} +1 -1
  123. package/dist/chunks/{index.9b669c12.js → index.5742fba4.js} +7 -7
  124. package/dist/chunks/index.5742fba4.js.map +1 -0
  125. package/dist/chunks/{index.99a2184a.js → index.6ac01113.js} +2 -2
  126. package/dist/chunks/{index.99a2184a.js.map → index.6ac01113.js.map} +1 -1
  127. package/dist/chunks/{index.b38a191d.js → index.772a5595.js} +2 -2
  128. package/dist/chunks/{index.b38a191d.js.map → index.772a5595.js.map} +1 -1
  129. package/dist/chunks/{index.14758ff7.js → index.82ff40be.js} +3 -3
  130. package/dist/chunks/{index.14758ff7.js.map → index.82ff40be.js.map} +1 -1
  131. package/dist/chunks/{index.eb527b75.js → index.a4a820fd.js} +6 -6
  132. package/dist/chunks/{index.eb527b75.js.map → index.a4a820fd.js.map} +1 -1
  133. package/dist/chunks/{index.2cfe4a09.js → index.af238ed6.js} +2 -2
  134. package/dist/chunks/{index.2cfe4a09.js.map → index.af238ed6.js.map} +1 -1
  135. package/dist/chunks/index.d1f65246.js +80 -0
  136. package/dist/chunks/index.d1f65246.js.map +1 -0
  137. package/dist/chunks/{index.45aa17fc.js → index.ec0743da.js} +5 -5
  138. package/dist/chunks/{index.45aa17fc.js.map → index.ec0743da.js.map} +1 -1
  139. package/dist/chunks/{info-filled.27bd4bfb.js → info-filled.c37e091d.js} +12 -33
  140. package/dist/chunks/{info-filled.27bd4bfb.js.map → info-filled.c37e091d.js.map} +1 -1
  141. package/dist/chunks/{listbox-option-tag.168c794c.js → listbox-option-tag.6f3e922c.js} +3 -3
  142. package/dist/chunks/{listbox-option-tag.168c794c.js.map → listbox-option-tag.6f3e922c.js.map} +1 -1
  143. package/dist/chunks/{listbox.23c6b393.js → listbox.e5d70b9b.js} +471 -422
  144. package/dist/chunks/listbox.e5d70b9b.js.map +1 -0
  145. package/dist/chunks/{loading-button.44d698b9.js → loading-button.7301cc2e.js} +2 -2
  146. package/dist/chunks/{loading-button.44d698b9.js.map → loading-button.7301cc2e.js.map} +1 -1
  147. package/dist/chunks/refresh.71a03998.js.map +1 -1
  148. package/dist/chunks/search.471270fe.js.map +1 -1
  149. package/dist/chunks/sidepanel.keys.3f8d69c1.js +7 -0
  150. package/dist/chunks/sidepanel.keys.3f8d69c1.js.map +1 -0
  151. package/dist/chunks/{tooltip.f91b2040.js → tooltip.46858ae6.js} +3 -3
  152. package/dist/chunks/{tooltip.f91b2040.js.map → tooltip.46858ae6.js.map} +1 -1
  153. package/dist/code-snippet.js +7 -7
  154. package/dist/code-snippet.js.map +1 -1
  155. package/dist/country.js +2 -2
  156. package/dist/currency.js +1 -1
  157. package/dist/data-grid.js +692 -683
  158. package/dist/data-grid.js.map +1 -1
  159. package/dist/date-picker.js +18 -18
  160. package/dist/date-range-picker.js +2 -2
  161. package/dist/date.js +1 -1
  162. package/dist/divider.js +1 -1
  163. package/dist/dropdown.js +6 -6
  164. package/dist/empty-state.js +3 -3
  165. package/dist/filter-bar.js +477 -471
  166. package/dist/filter-bar.js.map +1 -1
  167. package/dist/focus-trap.js +1 -1
  168. package/dist/form-layout.js +2 -2
  169. package/dist/header.js +3 -3
  170. package/dist/index.js +208 -205
  171. package/dist/info-icon.js +3 -3
  172. package/dist/info-icon.js.map +1 -1
  173. package/dist/input-field.js +4 -4
  174. package/dist/internal.js +7 -7
  175. package/dist/link.js +3 -56
  176. package/dist/link.js.map +1 -1
  177. package/dist/loading-indicator.js +1 -1
  178. package/dist/menu.js +1 -1
  179. package/dist/modal.js +4 -4
  180. package/dist/pagination.js +4 -4
  181. package/dist/pagination.js.map +1 -1
  182. package/dist/payment-method.js +2 -2
  183. package/dist/popover.js +1 -1
  184. package/dist/popper-container.js +1 -1
  185. package/dist/radio-group.js +84 -101
  186. package/dist/radio-group.js.map +1 -1
  187. package/dist/search-bar.js +1 -1
  188. package/dist/secondary-nav.js +2 -2
  189. package/dist/segmented-control.js +3 -3
  190. package/dist/sidepanel.js +73 -71
  191. package/dist/sidepanel.js.map +1 -1
  192. package/dist/status.js +2 -2
  193. package/dist/stepper.js +3 -3
  194. package/dist/stepper.js.map +1 -1
  195. package/dist/structured-list.js +1 -1
  196. package/dist/summary-grid.js +3 -3
  197. package/dist/tabs.js +3 -3
  198. package/dist/tag.js +3 -3
  199. package/dist/textarea.js +91 -87
  200. package/dist/textarea.js.map +1 -1
  201. package/dist/timeline.js +6 -6
  202. package/dist/timeline.js.map +1 -1
  203. package/dist/toast.js +8 -7
  204. package/dist/toast.js.map +1 -1
  205. package/dist/toggle.js +2 -2
  206. package/dist/tutorial.js +4 -4
  207. package/dist/tutorial.js.map +1 -1
  208. package/dist/typography.js +1 -1
  209. package/dist/web-types.json +139 -55
  210. package/package.json +2 -2
  211. package/dist/chunks/base-modal.9d63bdaf.js.map +0 -1
  212. package/dist/chunks/checkbox.d8b810c7.js.map +0 -1
  213. package/dist/chunks/copy.68a7d416.js.map +0 -1
  214. package/dist/chunks/dropdown.eaee22a3.js.map +0 -1
  215. package/dist/chunks/index.9b669c12.js.map +0 -1
  216. package/dist/chunks/listbox.23c6b393.js.map +0 -1
@@ -1,25 +1,26 @@
1
- import { defineComponent as S, useSlots as R, useAttrs as k, ref as h, computed as i, watch as A, onMounted as P } from "vue";
2
- import { B as F } from "./index.99a2184a.js";
3
- import { a as N } from "./button.133f145e.js";
4
- import { B as x } from "./index.3b7d40b7.js";
5
- import { B as U } from "./index.2cfe4a09.js";
6
- import { u as z } from "./use-has-slot.fbeb19ec.js";
7
- import { u as q } from "./i18n.eb5b985b.js";
8
- import { C as W } from "./cross.04678d81.js";
9
- import { G as H, a as K } from "./grid-layout.e0025286.js";
1
+ import { defineComponent as O, useSlots as k, useAttrs as P, ref as h, computed as i, watch as S, onMounted as F, provide as N } from "vue";
2
+ import { B as x } from "./index.6ac01113.js";
3
+ import { a as U } from "./button.bb0d7584.js";
4
+ import { B as z } from "./index.541cce1c.js";
5
+ import { B as q } from "./index.af238ed6.js";
6
+ import { u as W } from "./use-has-slot.fbeb19ec.js";
7
+ import { u as K } from "./i18n.eb5b985b.js";
8
+ import { g as Y } from "./unique-id.a2a2b458.js";
9
+ import { C as j } from "./cross.04678d81.js";
10
+ import { G as H, a as J } from "./grid-layout.e0025286.js";
10
11
  import { n as Q } from "./_plugin-vue2_normalizer.71e2aa87.js";
11
12
  import "../assets/base-modal.css";
12
- var Y = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(Y || {}), C = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(C || {}), m = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(m || {}), _ = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(_ || {}), j = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(j || {}), J = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(J || {});
13
- const V = {
13
+ var V = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(V || {}), C = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(C || {}), m = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(m || {}), _ = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(_ || {}), X = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(X || {}), Z = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(Z || {});
14
+ const $ = Symbol("modal injection key"), tt = {
14
15
  "en-US": {
15
16
  ariaLabelFallback: "modal",
16
17
  close: "Close"
17
18
  }
18
- }, X = S({
19
- i18n: { messages: V },
19
+ }, et = O({
20
+ i18n: { messages: tt },
20
21
  name: "base-modal"
21
- }), Z = /* @__PURE__ */ S({
22
- ...X,
22
+ }), at = /* @__PURE__ */ O({
23
+ ...et,
23
24
  props: {
24
25
  /**
25
26
  * List of actions that will be used to render the buttons.
@@ -102,7 +103,7 @@ const V = {
102
103
  },
103
104
  emits: ["close-modal"],
104
105
  setup(e, { expose: a, emit: o }) {
105
- const t = e, n = 500, { t: y } = q(), g = R(), v = k(), d = z(g), r = h(null), c = h(!1), B = i(() => t.isDismissible && !t.hideCloseButton), O = i(() => {
106
+ const t = e, n = 500, { t: y } = K(), g = k(), v = P(), d = W(g), r = h(null), c = h(!1), L = Y("modal"), B = i(() => t.isDismissible && !t.hideCloseButton), E = i(() => {
106
107
  if (!t.customPadding)
107
108
  return {};
108
109
  const s = {
@@ -114,12 +115,12 @@ const V = {
114
115
  content: l,
115
116
  actions: { ...s, paddingBottom: t.customPadding }
116
117
  };
117
- }), E = i(() => v["aria-label"] ?? y("ariaLabelFallback")), p = i(() => t.withColumnLayout && t.size === C.LARGE), f = () => {
118
+ }), I = i(() => v["aria-label"] ?? y("ariaLabelFallback")), p = i(() => t.withColumnLayout && t.size === C.LARGE), f = () => {
118
119
  r.value.showModal();
119
- }, L = () => {
120
+ }, A = () => {
120
121
  o("close-modal");
121
122
  }, D = () => {
122
- c.value && (r.value.close(), L(), c.value = !1);
123
+ c.value && (r.value.close(), A(), c.value = !1);
123
124
  }, u = () => {
124
125
  r.value.open && (c.value = !0);
125
126
  }, b = (s) => {
@@ -131,11 +132,11 @@ const V = {
131
132
  "b-modal-base__container--hide": c.value,
132
133
  "b-modal-base__container--overflow-visible": t.overflowVisible,
133
134
  "b-modal-base__container--column-layout": p.value
134
- })), I = i(() => ({
135
+ })), T = i(() => ({
135
136
  "b-modal-base__content--column-layout": p.value,
136
137
  "b-modal-base__content--with-header": d("default"),
137
138
  "b-modal-base__content--with-actions": d("actions")
138
- })), T = i(() => t.columnsSize === m.SMALLER ? [
139
+ })), w = i(() => t.columnsSize === m.SMALLER ? [
139
140
  { small: 4, medium: 4, large: 4 },
140
141
  { small: 8, medium: 8, large: 8 }
141
142
  ] : t.columnsSize === m.BIGGER ? [
@@ -145,30 +146,30 @@ const V = {
145
146
  { small: 6, medium: 6, large: 6 },
146
147
  { small: 6, medium: 6, large: 6 }
147
148
  ]);
148
- return A(
149
+ return S(
149
150
  () => [t.isOpen, r.value],
150
- ([s, l], [, w]) => {
151
+ ([s, l], [, R]) => {
151
152
  if (!l)
152
153
  return;
153
- s ? f() : !w || u();
154
+ s ? f() : !R || u();
154
155
  }
155
- ), A(
156
+ ), S(
156
157
  () => t.actions,
157
158
  () => {
158
159
  var s, l;
159
160
  ((l = (s = t.actions) == null ? void 0 : s[0]) == null ? void 0 : l.state) === "success" && setTimeout(u, n);
160
161
  },
161
162
  { deep: !0 }
162
- ), P(() => {
163
+ ), F(() => {
163
164
  t.isOpen && r.value && f();
164
165
  }), a({
165
166
  internalModalActionClose: b
166
- }), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: n, t: y, slots: g, attrs: v, hasSlot: d, modal: r, isClosing: c, emit: o, props: t, showCloseButton: B, customPaddingStyles: O, computedAriaLabel: E, hasColumnLayout: p, openModal: f, emitCloseEvent: L, closeModalAfterAnimation: D, startCloseModalAnimation: u, internalModalActionClose: b, closeModalOnClickOutside: M, modalConditionalClasses: G, modalContentConditionalClasses: I, computedColumnWidth: T, BentoTypography: F, BentoButton: N, BentoDivider: x, BentoFocusTrap: U, GridLayout: H, GridLayoutContainerType: K, CrossIcon: W };
167
+ }), N($, L), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: n, t: y, slots: g, attrs: v, hasSlot: d, modal: r, isClosing: c, modalId: L, emit: o, props: t, showCloseButton: B, customPaddingStyles: E, computedAriaLabel: I, hasColumnLayout: p, openModal: f, emitCloseEvent: A, closeModalAfterAnimation: D, startCloseModalAnimation: u, internalModalActionClose: b, closeModalOnClickOutside: M, modalConditionalClasses: G, modalContentConditionalClasses: T, computedColumnWidth: w, BentoTypography: x, BentoButton: U, BentoDivider: z, BentoFocusTrap: q, GridLayout: H, GridLayoutContainerType: J, CrossIcon: j };
167
168
  }
168
169
  });
169
- var $ = function() {
170
+ var ot = function() {
170
171
  var a = this, o = a._self._c, t = a._self._setupProxy;
171
- return o("div", { staticClass: "b-modal-base" }, [o("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: t.modalConditionalClasses, attrs: { role: a.modalRole, "aria-label": t.computedAriaLabel, open: a.initiallyOpen }, on: { animationend: t.closeModalAfterAnimation, click: function(n) {
172
+ return o("div", { staticClass: "b-modal-base" }, [o("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: t.modalConditionalClasses, attrs: { id: t.modalId, role: a.modalRole, "aria-label": t.computedAriaLabel, open: a.initiallyOpen }, on: { animationend: t.closeModalAfterAnimation, click: function(n) {
172
173
  a.isDismissible && t.closeModalOnClickOutside(n);
173
174
  }, keydown: function(n) {
174
175
  return !n.type.indexOf("key") && a._k(n.keyCode, "esc", 27, n.key, ["Esc", "Escape"]) ? null : t.internalModalActionClose.apply(null, arguments);
@@ -177,24 +178,25 @@ var $ = function() {
177
178
  }, proxy: !0 }, { key: "col-2", fn: function() {
178
179
  return [a._t("content-col-2")];
179
180
  }, proxy: !0 }], null, !0) }) : a._t("content")], 2) : a._e()], 1), t.hasSlot("actions") ? o("div", { staticClass: "b-modal-base__actions-container", style: t.customPaddingStyles.actions }, [t.hasColumnLayout ? o(t.BentoDivider, { staticClass: "b-modal-base__divider" }) : a._e(), o("div", { staticClass: "b-modal-base__actions", attrs: { "aria-label": "modal actions" } }, [a._t("actions")], 2)], 1) : a._e()])]) : a._e()], 1)]);
180
- }, tt = [], et = /* @__PURE__ */ Q(
181
- Z,
182
- $,
183
- tt,
181
+ }, st = [], nt = /* @__PURE__ */ Q(
182
+ at,
183
+ ot,
184
+ st,
184
185
  !1,
185
186
  null,
186
- "3c74866f",
187
+ "34479b51",
187
188
  null,
188
189
  null
189
190
  );
190
- const _t = et.exports;
191
+ const yt = nt.exports;
191
192
  export {
192
- Y as B,
193
+ V as B,
194
+ $ as M,
193
195
  C as a,
194
196
  m as b,
195
197
  _ as c,
196
- j as d,
197
- J as e,
198
- _t as f
198
+ X as d,
199
+ Z as e,
200
+ yt as f
199
201
  };
200
- //# sourceMappingURL=base-modal.9d63bdaf.js.map
202
+ //# sourceMappingURL=base-modal.a580438d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.a580438d.js","sources":["../../src/components/modal/modal.types.ts","../../src/components/modal/components/base-modal/base-modal.keys.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","export const MODAL_DIALOG_ID_INJECTION_KEY = Symbol('modal injection key');\n","<template>\n <div class=\"b-modal-base\">\n <dialog\n :id=\"modalId\"\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 setup lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, provide, ref, useAttrs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\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 { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/unique-id';\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 const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits<{\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\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 * 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\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(() => (attrs['aria-label'] as string) ?? (t('ariaLabelFallback') as string));\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('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 /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\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","MODAL_DIALOG_ID_INJECTION_KEY","__default__","defineComponent","messages","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","t","useI18n","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","modal","ref","isClosing","modalId","generateUid","showCloseButton","computed","props","customPaddingStyles","xPadding","content","computedAriaLabel","hasColumnLayout","openModal","emitCloseEvent","emit","closeModalAfterAnimation","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","target","modalConditionalClasses","modalContentConditionalClasses","computedColumnWidth","watch","newIsOpen","newModalValue","oldModalValue","_b","_a","onMounted","expose","provide"],"mappings":"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"}
@@ -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.9b669c12.js";
3
- import { B as _ } from "./index.45aa17fc.js";
2
+ import { M as d, B as p } from "./index.5742fba4.js";
3
+ import { B as _ } from "./index.ec0743da.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.4c5091f4.js.map
105
+ //# sourceMappingURL=button-actions-with-menu.a9087340.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.4c5091f4.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.a9087340.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,7 +1,7 @@
1
1
  import { defineComponent as y, useAttrs as m, useSlots as v, computed as i } from "vue";
2
- import { B as S } from "./index.99a2184a.js";
2
+ import { B as S } from "./index.6ac01113.js";
3
3
  import { u as E } from "./use-has-slot.fbeb19ec.js";
4
- import { BentoLink as g, BentoLinkVariant as C } from "../link.js";
4
+ import { B as g, a as C } from "./index.d1f65246.js";
5
5
  import { n as R } from "./_plugin-vue2_normalizer.71e2aa87.js";
6
6
  import "../assets/button.css";
7
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 || {});
@@ -61,7 +61,7 @@ const D = {
61
61
  ...u.value,
62
62
  disabled: t.disabled,
63
63
  type: t.type
64
- } : { ...t.link, disableTypography: !0, variant: C.DEFAULT }
64
+ } : { ...t.link, disableTypography: !0, variant: C.DEFAULT, isButton: !0 }
65
65
  ), d = i(() => ({
66
66
  [`b-button--${t.variant}${t.critical ? `-${s.DESTRUCTIVE}` : ""}`]: !0
67
67
  })), f = i(() => ({
@@ -87,14 +87,14 @@ var k = function() {
87
87
  T,
88
88
  !1,
89
89
  null,
90
- "8bf52b83",
90
+ "b9424855",
91
91
  null,
92
92
  null
93
93
  );
94
- const Y = I.exports;
94
+ const x = I.exports;
95
95
  export {
96
96
  l as B,
97
- Y as a,
97
+ x as a,
98
98
  s as b
99
99
  };
100
- //# sourceMappingURL=button.133f145e.js.map
100
+ //# sourceMappingURL=button.bb0d7584.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.133f145e.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
+ {"version":3,"file":"button.bb0d7584.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, isButton: true }\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,SAAA,UAAA,GAAA;AAAA,IAE4E,GAGtGC,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;;;;;;;;;;;;;;;;;;;"}