@adyen/bento-vue2 1.7.0 → 1.8.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 (223) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/packages/core/src/components/button/button.types.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +11 -0
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +7 -2
  6. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +28 -18
  7. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +25 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +13 -1
  9. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +9 -0
  10. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +6 -2
  11. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +153 -12
  12. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +1 -1
  13. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +18 -0
  14. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +320 -21
  15. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
  16. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
  17. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
  18. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
  20. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +12 -3
  21. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +30 -24
  22. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
  23. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +9 -0
  24. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +12 -0
  25. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +11 -1
  26. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.d.ts +2 -0
  27. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.types.d.ts +13 -0
  28. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.d.ts +2 -0
  29. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +14 -0
  30. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.d.ts +2 -0
  31. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.types.d.ts +22 -0
  32. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  33. package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +48 -0
  34. package/dist/@types/packages/vue2/src/components/internal/field-label/index.d.ts +1 -0
  35. package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +11 -0
  36. package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
  37. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +2 -1
  38. package/dist/@types/packages/vue2/src/components/popover/popover.keys.d.ts +1 -0
  39. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +16 -22
  40. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -0
  41. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.keys.d.ts +1 -0
  42. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +20 -1
  43. package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +4 -4
  44. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +9 -0
  45. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +19 -2
  46. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +4 -2
  47. package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +18 -2
  48. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  49. package/dist/accordion.js +1 -1
  50. package/dist/action-bar.js +112 -93
  51. package/dist/action-bar.js.map +1 -1
  52. package/dist/alert.js +1 -1
  53. package/dist/assets/base-modal.css +1 -1
  54. package/dist/assets/calendar.css +1 -1
  55. package/dist/assets/checkbox.css +1 -1
  56. package/dist/assets/controls-group.css +1 -1
  57. package/dist/assets/dropdown.css +1 -1
  58. package/dist/assets/field-label.css +1 -0
  59. package/dist/assets/grid-layout.css +1 -1
  60. package/dist/assets/index.css +1 -1
  61. package/dist/assets/index11.css +1 -1
  62. package/dist/assets/index12.css +1 -1
  63. package/dist/assets/index13.css +1 -1
  64. package/dist/assets/index14.css +1 -1
  65. package/dist/assets/index15.css +1 -1
  66. package/dist/assets/index16.css +1 -1
  67. package/dist/assets/index17.css +1 -1
  68. package/dist/assets/index18.css +1 -1
  69. package/dist/assets/index19.css +1 -1
  70. package/dist/assets/index2.css +1 -1
  71. package/dist/assets/index20.css +1 -1
  72. package/dist/assets/index21.css +1 -1
  73. package/dist/assets/index22.css +1 -1
  74. package/dist/assets/index23.css +1 -1
  75. package/dist/assets/index24.css +1 -1
  76. package/dist/assets/index25.css +1 -1
  77. package/dist/assets/index26.css +1 -1
  78. package/dist/assets/index27.css +1 -1
  79. package/dist/assets/index28.css +1 -1
  80. package/dist/assets/index29.css +1 -1
  81. package/dist/assets/index3.css +1 -1
  82. package/dist/assets/index30.css +1 -1
  83. package/dist/assets/index32.css +1 -1
  84. package/dist/assets/index33.css +1 -1
  85. package/dist/assets/index34.css +1 -1
  86. package/dist/assets/index35.css +1 -1
  87. package/dist/assets/index36.css +1 -1
  88. package/dist/assets/index37.css +1 -1
  89. package/dist/assets/index38.css +1 -1
  90. package/dist/assets/index39.css +1 -1
  91. package/dist/assets/index4.css +1 -1
  92. package/dist/assets/index40.css +1 -1
  93. package/dist/assets/index41.css +1 -1
  94. package/dist/assets/index42.css +1 -1
  95. package/dist/assets/index43.css +1 -1
  96. package/dist/assets/index44.css +1 -1
  97. package/dist/assets/index45.css +1 -1
  98. package/dist/assets/index5.css +1 -1
  99. package/dist/assets/index6.css +1 -1
  100. package/dist/assets/index7.css +1 -1
  101. package/dist/assets/index8.css +1 -1
  102. package/dist/assets/index9.css +1 -1
  103. package/dist/assets/loading-button.css +1 -1
  104. package/dist/avatar-image.js +1 -1
  105. package/dist/badge.js +1 -1
  106. package/dist/button.js +38 -35
  107. package/dist/button.js.map +1 -1
  108. package/dist/card.js +1 -1
  109. package/dist/checkbox.js +5 -5
  110. package/dist/chunks/{base-modal.88e7b9d4.js → base-modal.31634fe8.js} +60 -49
  111. package/dist/chunks/base-modal.31634fe8.js.map +1 -0
  112. package/dist/chunks/{button-actions-with-menu.a5413243.js → button-actions-with-menu.5faea13e.js} +5 -5
  113. package/dist/chunks/{button-actions-with-menu.a5413243.js.map → button-actions-with-menu.5faea13e.js.map} +1 -1
  114. package/dist/chunks/button.e09d5980.js.map +1 -1
  115. package/dist/chunks/calendar.47e9e755.js +959 -0
  116. package/dist/chunks/calendar.47e9e755.js.map +1 -0
  117. package/dist/chunks/{checkbox.5343e28e.js → checkbox.2277450e.js} +67 -56
  118. package/dist/chunks/checkbox.2277450e.js.map +1 -0
  119. package/dist/chunks/controls-group.6c5bfccd.js +79 -0
  120. package/dist/chunks/controls-group.6c5bfccd.js.map +1 -0
  121. package/dist/chunks/{copy.346eadb1.js → copy.a85c2e9f.js} +3 -3
  122. package/dist/chunks/{copy.346eadb1.js.map → copy.a85c2e9f.js.map} +1 -1
  123. package/dist/chunks/{dropdown.f1253a54.js → dropdown.ce937989.js} +200 -196
  124. package/dist/chunks/dropdown.ce937989.js.map +1 -0
  125. package/dist/chunks/field-label.330edb60.js +107 -0
  126. package/dist/chunks/field-label.330edb60.js.map +1 -0
  127. package/dist/chunks/{grid-layout.b7e0d964.js → grid-layout.a806acb2.js} +36 -27
  128. package/dist/chunks/grid-layout.a806acb2.js.map +1 -0
  129. package/dist/chunks/index.210d2169.js +290 -0
  130. package/dist/chunks/index.210d2169.js.map +1 -0
  131. package/dist/chunks/{index.8ac70774.js → index.66503760.js} +3 -3
  132. package/dist/chunks/{index.8ac70774.js.map → index.66503760.js.map} +1 -1
  133. package/dist/chunks/{index.2625175a.js → index.86fc63ca.js} +30 -28
  134. package/dist/chunks/{index.2625175a.js.map → index.86fc63ca.js.map} +1 -1
  135. package/dist/chunks/{index.a201f750.js → index.89942d3a.js} +4 -5
  136. package/dist/chunks/{index.a201f750.js.map → index.89942d3a.js.map} +1 -1
  137. package/dist/chunks/index.a5de5242.js +130 -0
  138. package/dist/chunks/index.a5de5242.js.map +1 -0
  139. package/dist/chunks/index.a99ffd48.js +634 -0
  140. package/dist/chunks/index.a99ffd48.js.map +1 -0
  141. package/dist/chunks/index.d80206ed.js +10 -0
  142. package/dist/chunks/index.d80206ed.js.map +1 -0
  143. package/dist/chunks/{index.37283390.js → index.d8bd7596.js} +96 -99
  144. package/dist/chunks/{index.37283390.js.map → index.d8bd7596.js.map} +1 -1
  145. package/dist/chunks/{listbox-option-tag.6a09e8e2.js → listbox-option-tag.97af47fc.js} +6 -7
  146. package/dist/chunks/{listbox-option-tag.6a09e8e2.js.map → listbox-option-tag.97af47fc.js.map} +1 -1
  147. package/dist/chunks/{listbox.73c38f38.js → listbox.d039b178.js} +5 -6
  148. package/dist/chunks/{listbox.73c38f38.js.map → listbox.d039b178.js.map} +1 -1
  149. package/dist/chunks/loading-button.9a9cbbad.js +89 -0
  150. package/dist/chunks/loading-button.9a9cbbad.js.map +1 -0
  151. package/dist/chunks/{tooltip.104e5fac.js → tooltip.ecd0f707.js} +2 -2
  152. package/dist/chunks/{tooltip.104e5fac.js.map → tooltip.ecd0f707.js.map} +1 -1
  153. package/dist/code-snippet.js +4 -4
  154. package/dist/code-snippet.js.map +1 -1
  155. package/dist/country.js +1 -1
  156. package/dist/data-grid.js +563 -541
  157. package/dist/data-grid.js.map +1 -1
  158. package/dist/date-picker.js +83 -80
  159. package/dist/date-picker.js.map +1 -1
  160. package/dist/date-range-picker.js +2 -2
  161. package/dist/divider.js +1 -1
  162. package/dist/dropdown.js +3 -3
  163. package/dist/empty-state.js +1 -1
  164. package/dist/filter-bar.js +13 -12
  165. package/dist/filter-bar.js.map +1 -1
  166. package/dist/focus-trap.js +1 -1
  167. package/dist/form-layout.js +1 -1
  168. package/dist/header.js +63 -67
  169. package/dist/header.js.map +1 -1
  170. package/dist/index.js +211 -209
  171. package/dist/index.js.map +1 -1
  172. package/dist/info-icon.js +3 -3
  173. package/dist/input-field.js +57 -55
  174. package/dist/input-field.js.map +1 -1
  175. package/dist/internal.js +13 -12
  176. package/dist/link.js +1 -1
  177. package/dist/loading-indicator.js +1 -1
  178. package/dist/menu.js +1 -1
  179. package/dist/modal.js +2 -2
  180. package/dist/modal.js.map +1 -1
  181. package/dist/pagination.js +2 -2
  182. package/dist/payment-method.js +1 -1
  183. package/dist/popover.js +3 -305
  184. package/dist/popover.js.map +1 -1
  185. package/dist/popper-container.js +1 -1
  186. package/dist/radio-group.js +3 -3
  187. package/dist/search-bar.js +2 -2
  188. package/dist/segmented-control.js +2 -2
  189. package/dist/sidepanel.js +2 -2
  190. package/dist/status.js +1 -1
  191. package/dist/stepper.js +1 -1
  192. package/dist/structured-list.js +1 -1
  193. package/dist/summary-grid.js +3 -3
  194. package/dist/summary-grid.js.map +1 -1
  195. package/dist/tabs.js +1 -1
  196. package/dist/tag.js +2 -2
  197. package/dist/textarea.js +59 -56
  198. package/dist/textarea.js.map +1 -1
  199. package/dist/timeline.js +226 -173
  200. package/dist/timeline.js.map +1 -1
  201. package/dist/toast.js +1 -1
  202. package/dist/toggle.js +1 -1
  203. package/dist/tutorial.js +7 -7
  204. package/dist/web-types.json +519 -393
  205. package/package.json +3 -3
  206. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -118
  207. package/dist/assets/error-message.css +0 -1
  208. package/dist/chunks/base-modal.88e7b9d4.js.map +0 -1
  209. package/dist/chunks/calendar.24d0ac04.js +0 -821
  210. package/dist/chunks/calendar.24d0ac04.js.map +0 -1
  211. package/dist/chunks/checkbox.5343e28e.js.map +0 -1
  212. package/dist/chunks/controls-group.2a21bd83.js +0 -87
  213. package/dist/chunks/controls-group.2a21bd83.js.map +0 -1
  214. package/dist/chunks/dropdown.f1253a54.js.map +0 -1
  215. package/dist/chunks/error-message.8302a46c.js +0 -47
  216. package/dist/chunks/error-message.8302a46c.js.map +0 -1
  217. package/dist/chunks/grid-layout.b7e0d964.js.map +0 -1
  218. package/dist/chunks/index.d6b5f5e1.js +0 -112
  219. package/dist/chunks/index.d6b5f5e1.js.map +0 -1
  220. package/dist/chunks/index.e566354f.js +0 -532
  221. package/dist/chunks/index.e566354f.js.map +0 -1
  222. package/dist/chunks/loading-button.c65682d6.js +0 -86
  223. package/dist/chunks/loading-button.c65682d6.js.map +0 -1
@@ -1,23 +1,24 @@
1
- import { defineComponent as G, useAttrs as I, ref as v, computed as i, watch as p, onMounted as R } from "vue";
1
+ import { defineComponent as w, useAttrs as I, ref as v, computed as l, watch as L, onMounted as R } from "vue";
2
2
  import { B as k } from "./index.965ac1af.js";
3
3
  import { a as P } from "./button.e09d5980.js";
4
4
  import { BentoDivider as T } from "../divider.js";
5
- import { B as w } from "./index.2625175a.js";
6
- import { u as F } from "./use-has-slot.6052d56a.js";
7
- import { u as N } from "./i18n.155748d6.js";
8
- import { C as x } from "./cross.a2cadac5.js";
9
- import { G as U, a as z } from "./grid-layout.b7e0d964.js";
10
- import { n as q } from "./_plugin-vue2_normalizer.71e2aa87.js";
5
+ import { B as F } from "./index.86fc63ca.js";
6
+ import { u as N } from "./use-has-slot.6052d56a.js";
7
+ import { u as x } from "./i18n.155748d6.js";
8
+ import { C as U } from "./cross.a2cadac5.js";
9
+ import { G as z, a as q } from "./grid-layout.a806acb2.js";
10
+ import { n as W } from "./_plugin-vue2_normalizer.71e2aa87.js";
11
11
  import "../assets/base-modal.css";
12
- var W = /* @__PURE__ */ ((t) => (t.DEFAULT = "BentoModalDefault", t.DIALOG = "BentoModalDialog", t))(W || {}), 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 || {}), H = /* @__PURE__ */ ((t) => (t.CONFIRMATION = "confirmation", t.DESTRUCTIVE = "destructive", t.INFO = "info", t.ACKNOWLEDGEMENT = "acknowledgement", t))(H || {}), C = /* @__PURE__ */ ((t) => (t.CLOSE_MODAL = "close-modal", t))(C || {});
13
- const K = {
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 || {});
13
+ const Q = {
14
14
  "en-US": {
15
- ariaLabelFallback: "modal"
15
+ ariaLabelFallback: "modal",
16
+ close: "Close"
16
17
  }
17
- }, Q = 500, Y = G({
18
- i18n: { messages: K },
18
+ }, Y = 500, j = w({
19
+ i18n: { messages: Q },
19
20
  name: "base-modal",
20
- components: { CrossIcon: x, BentoTypography: k, BentoButton: P, BentoDivider: T, BentoFocusTrap: w, GridLayout: U },
21
+ components: { CrossIcon: U, BentoTypography: k, BentoButton: P, BentoDivider: T, BentoFocusTrap: F, GridLayout: z },
21
22
  props: {
22
23
  /**
23
24
  * List of actions that will be used to render the buttons.
@@ -100,7 +101,7 @@ const K = {
100
101
  },
101
102
  emits: [C.CLOSE_MODAL],
102
103
  setup(t, { slots: a, emit: e }) {
103
- const { t: s } = N(), L = I(), d = F(a), l = v(null), r = v(!1), A = i(() => {
104
+ const { t: s } = x(), p = I(), d = N(a), i = v(null), r = v(!1), h = l(() => t.isDismissible && !t.hideCloseButton), A = l(() => {
104
105
  if (!t.customPadding)
105
106
  return {};
106
107
  const o = {
@@ -112,54 +113,64 @@ const K = {
112
113
  content: n,
113
114
  actions: { ...o, paddingBottom: t.customPadding }
114
115
  };
115
- }), h = i(
116
- () => L["aria-label"] ?? s("ariaLabelFallback")
117
- ), m = i(() => t.withColumnLayout && t.size === b.LARGE), _ = () => {
118
- l.value.showModal();
116
+ }), S = l(
117
+ () => p["aria-label"] ?? s("ariaLabelFallback")
118
+ ), m = l(() => t.withColumnLayout && t.size === b.LARGE), _ = () => {
119
+ i.value.showModal();
119
120
  }, y = () => {
120
121
  e(C.CLOSE_MODAL);
121
- }, S = () => {
122
- r.value && (l.value.close(), y(), r.value = !1);
122
+ }, O = () => {
123
+ r.value && (i.value.close(), y(), r.value = !1);
123
124
  }, c = () => {
124
- l.value.open && (r.value = !0);
125
+ i.value.open && (r.value = !0);
125
126
  }, g = (o) => {
126
127
  o && o.preventDefault(), t.isDismissible && c();
127
- }, O = ({ target: o }) => {
128
+ }, E = ({ target: o }) => {
128
129
  o && o.tagName === f.DIALOG.toUpperCase() && g();
129
- }, E = i(() => ({
130
+ }, M = l(() => ({
130
131
  [`b-modal-base__container--${t.size}`]: t.size,
131
132
  "b-modal-base__container--hide": r.value,
132
133
  "b-modal-base__container--overflow-visible": t.overflowVisible,
133
134
  "b-modal-base__container--column-layout": m.value
134
- })), M = i(() => ({
135
+ })), B = l(() => ({
135
136
  "b-modal-base__content--column-layout": m.value,
136
137
  "b-modal-base__content--with-header": d("default"),
137
138
  "b-modal-base__content--with-actions": d("actions")
138
- })), D = i(() => t.columnsSize === u.SMALLER ? [{ small: 4, medium: 4, large: 4 }] : t.columnsSize === u.BIGGER ? [{ small: 8, medium: 8, large: 8 }] : [{ small: 6, medium: 6, large: 6 }]);
139
- return p(
140
- () => [t.isOpen, l.value],
141
- ([o, n], [, B]) => {
139
+ })), D = l(() => t.columnsSize === u.SMALLER ? [
140
+ { small: 4, medium: 4, large: 4 },
141
+ { small: 8, medium: 8, large: 8 }
142
+ ] : t.columnsSize === u.BIGGER ? [
143
+ { small: 8, medium: 8, large: 8 },
144
+ { small: 4, medium: 4, large: 4 }
145
+ ] : [
146
+ { small: 6, medium: 6, large: 6 },
147
+ { small: 6, medium: 6, large: 6 }
148
+ ]);
149
+ return L(
150
+ () => [t.isOpen, i.value],
151
+ ([o, n], [, G]) => {
142
152
  if (!n)
143
153
  return;
144
- o ? _() : !B || c();
154
+ o ? _() : !G || c();
145
155
  }
146
- ), p(
156
+ ), L(
147
157
  () => t.actions,
148
158
  () => {
149
159
  var o, n;
150
- ((n = (o = t.actions) == null ? void 0 : o[0]) == null ? void 0 : n.state) === "success" && setTimeout(c, Q);
160
+ ((n = (o = t.actions) == null ? void 0 : o[0]) == null ? void 0 : n.state) === "success" && setTimeout(c, Y);
151
161
  },
152
162
  { deep: !0 }
153
163
  ), R(() => {
154
- t.isOpen && l.value && _();
164
+ t.isOpen && i.value && _();
155
165
  }), {
156
166
  // Refs
157
- modal: l,
158
- computedAriaLabel: h,
167
+ modal: i,
168
+ computedAriaLabel: S,
169
+ showCloseButton: h,
159
170
  // Handling the state
160
171
  openModal: _,
161
- closeModalOnClickOutside: O,
162
- closeModalAfterAnimation: S,
172
+ closeModalOnClickOutside: E,
173
+ closeModalAfterAnimation: O,
163
174
  startCloseModalAnimation: c,
164
175
  // Methods
165
176
  internalModalActionClose: g,
@@ -167,45 +178,45 @@ const K = {
167
178
  emitCloseEvent: y,
168
179
  t: s,
169
180
  // Styles
170
- modalConditionalClasses: E,
171
- modalContentConditionalClasses: M,
181
+ modalConditionalClasses: M,
182
+ modalContentConditionalClasses: B,
172
183
  customPaddingStyles: A,
173
184
  hasColumnLayout: m,
174
185
  computedColumnWidth: D,
175
186
  // Enums
176
- GridLayoutContainerType: z
187
+ GridLayoutContainerType: q
177
188
  };
178
189
  }
179
190
  });
180
- var j = function() {
191
+ var J = function() {
181
192
  var a = this, e = a._self._c;
182
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) {
183
194
  a.isDismissible && a.closeModalOnClickOutside(s);
184
195
  }, keydown: function(s) {
185
196
  return !s.type.indexOf("key") && a._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : a.internalModalActionClose.apply(null, arguments);
186
- } } }, [e("bento-focus-trap", [e("div", { staticClass: "b-modal-base__wrapper" }, [a.hasSlot("default") || !a.hideCloseButton ? 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.hideCloseButton ? a._e() : e("bento-button", { staticClass: "b-modal-base__close-button", attrs: { variant: "tertiary", type: "button" }, on: { click: a.internalModalActionClose } }, [e("cross-icon", { attrs: { "svg-title": "close" } })], 1)], 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 }, scopedSlots: a._u([{ key: "col-1", fn: function() {
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() {
187
198
  return [a._t("content-col-1")];
188
199
  }, proxy: !0 }, { key: "col-2", fn: function() {
189
200
  return [a._t("content-col-2")];
190
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)]);
191
- }, J = [], V = /* @__PURE__ */ q(
192
- Y,
202
+ }, V = [], X = /* @__PURE__ */ W(
193
203
  j,
194
204
  J,
205
+ V,
195
206
  !1,
196
207
  null,
197
- "b01acd97",
208
+ "03e95a66",
198
209
  null,
199
210
  null
200
211
  );
201
- const dt = V.exports;
212
+ const rt = X.exports;
202
213
  export {
203
- W as B,
214
+ H as B,
204
215
  b as a,
205
216
  u as b,
206
217
  f as c,
207
- H as d,
218
+ K as d,
208
219
  C as e,
209
- dt as f
220
+ rt as f
210
221
  };
211
- //# sourceMappingURL=base-modal.88e7b9d4.js.map
222
+ //# sourceMappingURL=base-modal.31634fe8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.31634fe8.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>\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(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 // If the user has pressed escape, clicked outside or clicked the close icon\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible) {\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;A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D,EAAA,WAAA,aACA,WAAAZ,GAAAhC,CAAA;AAAA,MACA;AAAA,MACA,EAAA,MAAA,GAAA;AAAA,IACA,GAGA8C,EAAA,MAAA;AACA,MAAApC,EAAA,UAAAS,EAAA,SACAU,EAAA;AAAA,IACA,CAAA,GAGA;AAAA;AAAA,MAAA,OAAAV;AAAA,MAEA,mBAAAQ;AAAA,MACA,iBAAAL;AAAA;AAAA,MACA,WAAAO;AAAA,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.37283390.js";
3
- import { BentoPopoverPositions as _ } from "../popover.js";
2
+ import { M as d, B as p } from "./index.d8bd7596.js";
3
+ import { B as _ } from "./index.210d2169.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";
@@ -88,7 +88,7 @@ const f = {}, v = /* @__PURE__ */ a({
88
88
  var A = function() {
89
89
  var t = this, n = t._self._c, e = t._self._setupProxy;
90
90
  return n("div", { staticClass: "b-button-actions-with-menu" }, [n("div", { staticClass: "b-button-actions-with-menu__container-wrapper", attrs: { role: "group" } }, [n(e.BentoButtonActions, { attrs: { actions: e.computedActions, inverse: t.inverse } }), e.computedMenuActions.length ? n(e.BentoMenu, { attrs: { data: e.computedMenuActions, "menu-position": t.menuPosition } }) : t._e()], 1)]);
91
- }, y = [], b = /* @__PURE__ */ m(
91
+ }, y = [], B = /* @__PURE__ */ m(
92
92
  v,
93
93
  A,
94
94
  y,
@@ -98,8 +98,8 @@ var A = function() {
98
98
  null,
99
99
  null
100
100
  );
101
- const C = b.exports;
101
+ const C = B.exports;
102
102
  export {
103
103
  C as B
104
104
  };
105
- //# sourceMappingURL=button-actions-with-menu.a5413243.js.map
105
+ //# sourceMappingURL=button-actions-with-menu.5faea13e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.a5413243.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.5faea13e.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 +1 @@
1
- {"version":3,"file":"button.e09d5980.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;\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 lang=\"ts\">\n import { computed, defineComponent, PropType } 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 /**\n * Button component for all the various types of bento buttons.\n *\n * @usage\n * import { BentoButton, AdlIconPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * :icon-position=\"AdlIconPosition.AFTER\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-button',\n components: { BentoTypography },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: {\n type: Object,\n default: undefined,\n },\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 emits: ['click', 'focus', 'blur', 'keydown.esc'],\n setup(props, { slots, emit, attrs }) {\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((): { [x: string]: boolean } => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(\n (): {\n [x: string]: boolean;\n } => ({\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\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n componentType,\n componentProps,\n\n // Methods\n onClickButton,\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","_sfc_main","defineComponent","BentoTypography","value","props","slots","emit","attrs","componentType","computed","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","e","useHasSlot"],"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,CAA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AAP,EAAA;AAAA,QACA,MAAAA,EAAA;AAAA,MACA,IAAA,EAAA,GAAAA,EAAA,MAAA,mBAAA,IAAA,SAAAW,EAAA,QAAA;AAAA,IAEA,GAGAC,IAAAP,EAAA,OAAA;AAAA,MAAA,CAAA,aAAAL,EAAA,UAAAA,EAAA,WAAA,IAAAN,EAAA,gBAAA,IAAA,GAAA;AAAA,IACA,EAAA,GAGAmB,IAAAR;AAAA,MAAA,OAAA;AAAA,QAGA,GAAAO,EAAA;AAAA,QACA,CAAA,aAAAlB,EAAA,WAAA,GAAAM,EAAA;AAAA,QACA,CAAA,aAAAN,EAAA,UAAA,GAAAM,EAAA;AAAA,QACA,CAAA,aAAAN,EAAA,WAAA,GAAA,CAAAO,EAAA;AAAA,QACA,CAAA,aAAAP,EAAA,SAAA,GAAAM,EAAA;AAAA,MACA;AAAA,IACA;AAYA,WAAA;AAAA;AAAA,MAAA,gBAAAO;AAAA,MAEA,oBAAAM;AAAA,MACA,eAAAT;AAAA,MACA,gBAAAM;AAAA;AAAA,MACA,eAdA,CAAAI,MAAA;AACA,QAAAd,EAAA,YAGAc,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAZ,EAAA,SAAAY,CAAA;AAAA,MAIA;AAAA,MAWA,SAAAC,EAAAd,CAAA;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button.e09d5980.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 lang=\"ts\">\n import { computed, defineComponent, PropType } 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 /**\n * Button component for all the various types of bento buttons.\n *\n * @usage\n * import { BentoButton, AdlIconPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * :icon-position=\"AdlIconPosition.AFTER\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-button',\n components: { BentoTypography },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: {\n type: Object,\n default: undefined,\n },\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 emits: ['click', 'focus', 'blur', 'keydown.esc'],\n setup(props, { slots, emit, attrs }) {\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((): { [x: string]: boolean } => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(\n (): {\n [x: string]: boolean;\n } => ({\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\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n componentType,\n componentProps,\n\n // Methods\n onClickButton,\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","_sfc_main","defineComponent","BentoTypography","value","props","slots","emit","attrs","componentType","computed","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","e","useHasSlot"],"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;ACmDZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;A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