@adyen/bento-vue2 1.20.1 → 1.21.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 (217) hide show
  1. package/README.md +53 -0
  2. package/dist/@types/components.d.ts +8 -0
  3. package/dist/@types/packages/core/src/components/button/button.types.d.ts +2 -1
  4. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +3 -3
  5. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
  6. package/dist/@types/packages/vue2/src/components/button/components/toggle-button/toggle-button.vue.d.ts +6 -5
  7. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +16 -21
  8. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +21 -1
  9. package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +14 -3
  10. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +9 -0
  11. package/dist/@types/packages/vue2/src/components/modal/components/modal-page/modal-page.vue.d.ts +91 -0
  12. package/dist/@types/packages/vue2/src/components/modal/index.d.ts +2 -1
  13. package/dist/@types/packages/vue2/src/components/modal/modal.keys.d.ts +1 -0
  14. package/dist/@types/packages/vue2/src/components/modal/modal.types.d.ts +9 -0
  15. package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +14 -3
  16. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/index.d.ts +2 -0
  17. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.types.d.ts +2 -0
  18. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +145 -0
  19. package/dist/@types/packages/vue2/src/components/selection-card/index.d.ts +3 -0
  20. package/dist/@types/packages/vue2/src/components/selection-card/selection-card.keys.d.ts +1 -0
  21. package/dist/@types/packages/vue2/src/components/selection-card/selection-card.types.d.ts +22 -0
  22. package/dist/@types/packages/vue2/src/components/selection-card/selection-card.vue.d.ts +90 -0
  23. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  24. package/dist/accordion.js +2 -2
  25. package/dist/action-bar.js +6 -6
  26. package/dist/alert.js +3 -3
  27. package/dist/assets/base-modal.css +1 -1
  28. package/dist/assets/button.css +1 -1
  29. package/dist/assets/checkbox-input.css +1 -0
  30. package/dist/assets/checkbox.css +1 -1
  31. package/dist/assets/dialog-page.css +1 -1
  32. package/dist/assets/index.css +1 -1
  33. package/dist/assets/index10.css +1 -1
  34. package/dist/assets/index11.css +1 -1
  35. package/dist/assets/index12.css +1 -1
  36. package/dist/assets/index13.css +1 -1
  37. package/dist/assets/index14.css +1 -1
  38. package/dist/assets/index15.css +1 -1
  39. package/dist/assets/index16.css +1 -1
  40. package/dist/assets/index17.css +1 -1
  41. package/dist/assets/index18.css +1 -1
  42. package/dist/assets/index19.css +1 -1
  43. package/dist/assets/index2.css +1 -1
  44. package/dist/assets/index20.css +1 -1
  45. package/dist/assets/index21.css +1 -1
  46. package/dist/assets/index22.css +1 -1
  47. package/dist/assets/index23.css +1 -1
  48. package/dist/assets/index24.css +1 -1
  49. package/dist/assets/index25.css +1 -1
  50. package/dist/assets/index26.css +1 -1
  51. package/dist/assets/index27.css +1 -1
  52. package/dist/assets/index28.css +1 -1
  53. package/dist/assets/index29.css +1 -1
  54. package/dist/assets/index3.css +1 -1
  55. package/dist/assets/index30.css +1 -1
  56. package/dist/assets/index31.css +1 -1
  57. package/dist/assets/index32.css +1 -1
  58. package/dist/assets/index33.css +1 -1
  59. package/dist/assets/index34.css +1 -1
  60. package/dist/assets/index35.css +1 -1
  61. package/dist/assets/index36.css +1 -1
  62. package/dist/assets/index37.css +1 -1
  63. package/dist/assets/index38.css +1 -1
  64. package/dist/assets/index39.css +1 -1
  65. package/dist/assets/index4.css +1 -1
  66. package/dist/assets/index40.css +1 -1
  67. package/dist/assets/index41.css +1 -1
  68. package/dist/assets/index42.css +1 -1
  69. package/dist/assets/index43.css +1 -1
  70. package/dist/assets/index44.css +1 -1
  71. package/dist/assets/index45.css +1 -1
  72. package/dist/assets/index46.css +1 -1
  73. package/dist/assets/index47.css +1 -1
  74. package/dist/assets/index48.css +1 -1
  75. package/dist/assets/index49.css +1 -0
  76. package/dist/assets/index5.css +1 -1
  77. package/dist/assets/index6.css +1 -1
  78. package/dist/assets/index7.css +1 -1
  79. package/dist/assets/index8.css +1 -1
  80. package/dist/assets/index9.css +1 -1
  81. package/dist/assets/radio-input.css +1 -0
  82. package/dist/avatar-image.js +1 -1
  83. package/dist/badge.js +1 -1
  84. package/dist/button.js +32 -31
  85. package/dist/button.js.map +1 -1
  86. package/dist/card.js +3 -3
  87. package/dist/checkbox.js +6 -6
  88. package/dist/chunks/{base-button.d3f27fe6.js → base-button.1e390a82.js} +2 -2
  89. package/dist/chunks/{base-button.d3f27fe6.js.map → base-button.1e390a82.js.map} +1 -1
  90. package/dist/chunks/base-modal.7ce3f321.js +372 -0
  91. package/dist/chunks/base-modal.7ce3f321.js.map +1 -0
  92. package/dist/chunks/{button-actions-with-menu.4e274e5d.js → button-actions-with-menu.2722f4ab.js} +4 -4
  93. package/dist/chunks/{button-actions-with-menu.4e274e5d.js.map → button-actions-with-menu.2722f4ab.js.map} +1 -1
  94. package/dist/chunks/{button-actions.98e96aa6.js → button-actions.6bdcc584.js} +3 -3
  95. package/dist/chunks/{button-actions.98e96aa6.js.map → button-actions.6bdcc584.js.map} +1 -1
  96. package/dist/chunks/{button.27948f1c.js → button.ff51261f.js} +18 -18
  97. package/dist/chunks/button.ff51261f.js.map +1 -0
  98. package/dist/chunks/{calendar.943ea7c3.js → calendar.7517c117.js} +4 -4
  99. package/dist/chunks/{calendar.943ea7c3.js.map → calendar.7517c117.js.map} +1 -1
  100. package/dist/chunks/checkbox-input.4c4e4c2e.js +123 -0
  101. package/dist/chunks/checkbox-input.4c4e4c2e.js.map +1 -0
  102. package/dist/chunks/checkbox.a52d6e60.js +160 -0
  103. package/dist/chunks/checkbox.a52d6e60.js.map +1 -0
  104. package/dist/chunks/{controls-group.02abd743.js → controls-group.aee628f6.js} +3 -3
  105. package/dist/chunks/{controls-group.02abd743.js.map → controls-group.aee628f6.js.map} +1 -1
  106. package/dist/chunks/{copy.a9f87101.js → copy.4374d1ea.js} +4 -4
  107. package/dist/chunks/{copy.a9f87101.js.map → copy.4374d1ea.js.map} +1 -1
  108. package/dist/chunks/dialog-page.f3412ccd.js +133 -0
  109. package/dist/chunks/dialog-page.f3412ccd.js.map +1 -0
  110. package/dist/chunks/{dropdown-default-textbox.b4f19086.js → dropdown-default-textbox.cf662c3b.js} +2 -2
  111. package/dist/chunks/{dropdown-default-textbox.b4f19086.js.map → dropdown-default-textbox.cf662c3b.js.map} +1 -1
  112. package/dist/chunks/{dropdown.9abc124c.js → dropdown.321135c2.js} +14 -14
  113. package/dist/chunks/{dropdown.9abc124c.js.map → dropdown.321135c2.js.map} +1 -1
  114. package/dist/chunks/{error-message.3d436de3.js → error-message.14f59b8b.js} +2 -2
  115. package/dist/chunks/{error-message.3d436de3.js.map → error-message.14f59b8b.js.map} +1 -1
  116. package/dist/chunks/{fixed-scroller.c430a595.js → fixed-scroller.22f64181.js} +2 -2
  117. package/dist/chunks/{fixed-scroller.c430a595.js.map → fixed-scroller.22f64181.js.map} +1 -1
  118. package/dist/chunks/{footer-actions.74983707.js → footer-actions.8e51e4db.js} +4 -4
  119. package/dist/chunks/{footer-actions.74983707.js.map → footer-actions.8e51e4db.js.map} +1 -1
  120. package/dist/chunks/{index.3a8caa8d.js → index.07828192.js} +26 -26
  121. package/dist/chunks/{index.3a8caa8d.js.map → index.07828192.js.map} +1 -1
  122. package/dist/chunks/{index.a2095588.js → index.08658e31.js} +3 -3
  123. package/dist/chunks/{index.a2095588.js.map → index.08658e31.js.map} +1 -1
  124. package/dist/chunks/{index.af17c8ac.js → index.0c759683.js} +2 -2
  125. package/dist/chunks/{index.af17c8ac.js.map → index.0c759683.js.map} +1 -1
  126. package/dist/chunks/{index.985d9d31.js → index.20767d8d.js} +3 -3
  127. package/dist/chunks/{index.985d9d31.js.map → index.20767d8d.js.map} +1 -1
  128. package/dist/chunks/{index.d080a0e6.js → index.277bd4f5.js} +7 -7
  129. package/dist/chunks/{index.d080a0e6.js.map → index.277bd4f5.js.map} +1 -1
  130. package/dist/chunks/{index.2f00afab.js → index.3df55152.js} +2 -2
  131. package/dist/chunks/{index.2f00afab.js.map → index.3df55152.js.map} +1 -1
  132. package/dist/chunks/{index.54eb824c.js → index.53296886.js} +3 -3
  133. package/dist/chunks/{index.54eb824c.js.map → index.53296886.js.map} +1 -1
  134. package/dist/chunks/{index.dd7d8418.js → index.97c75b08.js} +166 -165
  135. package/dist/chunks/index.97c75b08.js.map +1 -0
  136. package/dist/chunks/{index.de9a552e.js → index.cb0b1e9f.js} +6 -6
  137. package/dist/chunks/{index.de9a552e.js.map → index.cb0b1e9f.js.map} +1 -1
  138. package/dist/chunks/{index.211ea795.js → index.d60dd2ec.js} +6 -6
  139. package/dist/chunks/{index.211ea795.js.map → index.d60dd2ec.js.map} +1 -1
  140. package/dist/chunks/{index.900d8b24.js → index.f9665634.js} +2 -2
  141. package/dist/chunks/{index.900d8b24.js.map → index.f9665634.js.map} +1 -1
  142. package/dist/chunks/{index.25de3ab8.js → index.fd90ffde.js} +2 -2
  143. package/dist/chunks/{index.25de3ab8.js.map → index.fd90ffde.js.map} +1 -1
  144. package/dist/chunks/{listbox-option-tag.37da51ba.js → listbox-option-tag.f10b8b2d.js} +3 -3
  145. package/dist/chunks/{listbox-option-tag.37da51ba.js.map → listbox-option-tag.f10b8b2d.js.map} +1 -1
  146. package/dist/chunks/{listbox.a142458a.js → listbox.a5623620.js} +5 -5
  147. package/dist/chunks/{listbox.a142458a.js.map → listbox.a5623620.js.map} +1 -1
  148. package/dist/chunks/{loading-button.2c3d9afc.js → loading-button.cc8dcafe.js} +2 -2
  149. package/dist/chunks/{loading-button.2c3d9afc.js.map → loading-button.cc8dcafe.js.map} +1 -1
  150. package/dist/chunks/radio-input.c6550a9c.js +83 -0
  151. package/dist/chunks/radio-input.c6550a9c.js.map +1 -0
  152. package/dist/chunks/{tooltip.0459eb5c.js → tooltip.85b7cefc.js} +3 -3
  153. package/dist/chunks/{tooltip.0459eb5c.js.map → tooltip.85b7cefc.js.map} +1 -1
  154. package/dist/code-snippet.js +7 -7
  155. package/dist/code-snippet.js.map +1 -1
  156. package/dist/country.js +2 -2
  157. package/dist/currency.js +1 -1
  158. package/dist/data-grid.js +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 +729 -731
  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 +4 -4
  170. package/dist/index.js +195 -188
  171. package/dist/index.js.map +1 -1
  172. package/dist/info-icon.js +3 -3
  173. package/dist/input-field.js +4 -4
  174. package/dist/internal.js +8 -8
  175. package/dist/link.js +1 -1
  176. package/dist/loading-indicator.js +1 -1
  177. package/dist/menu.js +1 -1
  178. package/dist/modal-fullscreen.js +6 -6
  179. package/dist/modal.js +108 -73
  180. package/dist/modal.js.map +1 -1
  181. package/dist/pagination.js +4 -4
  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 +73 -146
  186. package/dist/radio-group.js.map +1 -1
  187. package/dist/search-bar.js +2 -2
  188. package/dist/secondary-nav.js +2 -2
  189. package/dist/segmented-control.js +3 -3
  190. package/dist/selection-card.js +251 -0
  191. package/dist/selection-card.js.map +1 -0
  192. package/dist/sidepanel.js +6 -6
  193. package/dist/status.js +2 -2
  194. package/dist/stepper.js +3 -3
  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 +56 -55
  200. package/dist/textarea.js.map +1 -1
  201. package/dist/timeline.js +7 -7
  202. package/dist/toast.js +3 -3
  203. package/dist/toggle.js +2 -2
  204. package/dist/tutorial.js +6 -6
  205. package/dist/typography.js +1 -1
  206. package/dist/web-types.json +465 -33
  207. package/package.json +3 -4
  208. package/dist/chunks/arrow-left.2db60716.js +0 -26
  209. package/dist/chunks/arrow-left.2db60716.js.map +0 -1
  210. package/dist/chunks/base-modal.cc448ad3.js +0 -203
  211. package/dist/chunks/base-modal.cc448ad3.js.map +0 -1
  212. package/dist/chunks/button.27948f1c.js.map +0 -1
  213. package/dist/chunks/checkbox.2c2a1f90.js +0 -275
  214. package/dist/chunks/checkbox.2c2a1f90.js.map +0 -1
  215. package/dist/chunks/dialog-page.0e787c2d.js +0 -113
  216. package/dist/chunks/dialog-page.0e787c2d.js.map +0 -1
  217. package/dist/chunks/index.dd7d8418.js.map +0 -1
@@ -1,26 +0,0 @@
1
- import { n as r } from "./_plugin-vue2_normalizer.71e2aa87.js";
2
- import "../assets/cross.css";
3
- let e = 0;
4
- const n = {
5
- beforeCreate() {
6
- this.uuid = e.toString(), e += 1;
7
- }
8
- };
9
- var l = function() {
10
- var t = this, s = t._self._c;
11
- return s("svg", t._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", t.$attrs, !1), [t.$attrs["svg-title"] ? s("title", [t._v(t._s(t.$attrs["svg-title"]))]) : t._e(), s("path", { attrs: { fill: "#00112C", d: "M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z" } })]);
12
- }, _ = [], a = /* @__PURE__ */ r(
13
- n,
14
- l,
15
- _,
16
- !1,
17
- null,
18
- null,
19
- null,
20
- null
21
- );
22
- const c = a.exports;
23
- export {
24
- c as A
25
- };
26
- //# sourceMappingURL=arrow-left.2db60716.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"arrow-left.2db60716.js","sources":["../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/arrow-left.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n"],"names":["uuid","_sfc_main"],"mappings":";;AAKA,IAAAA,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -1,203 +0,0 @@
1
- import { defineComponent as E, useSlots as w, useAttrs as N, ref as O, computed as i, watch as S, onMounted as F, provide as x } from "vue";
2
- import { B as U } from "./index.2f00afab.js";
3
- import { a as z } from "./button.27948f1c.js";
4
- import { B as q } from "./index.900d8b24.js";
5
- import { u as W } from "./use-has-slot.fbeb19ec.js";
6
- import { u as H } from "./i18n.eb5b985b.js";
7
- import { M as K } from "./base-modal.keys.b08a6bdf.js";
8
- import { g as Y } from "./unique-id.a2a2b458.js";
9
- import { C as J } from "./cross.04678d81.js";
10
- import { G as Q, a as j } from "./grid-layout.e0025286.js";
11
- import { n as X } from "./_plugin-vue2_normalizer.71e2aa87.js";
12
- import "../assets/base-modal.css";
13
- var Z = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.DIALOG = "dialog", a))(Z || {}), $ = /* @__PURE__ */ ((a) => (a.DEFAULT = "BentoModalDefault", a.DIALOG = "BentoModalDialog", a))($ || {}), b = /* @__PURE__ */ ((a) => (a.SMALL = "small", a.MEDIUM = "medium", a.LARGE = "large", a))(b || {}), m = /* @__PURE__ */ ((a) => (a.SMALLER = "smaller", a.EQUAL = "equal", a.BIGGER = "bigger", a))(m || {}), _ = /* @__PURE__ */ ((a) => (a.DIALOG = "dialog", a.ALERT_DIALOG = "alertdialog", a))(_ || {}), V = /* @__PURE__ */ ((a) => (a.CONFIRMATION = "confirmation", a.DESTRUCTIVE = "destructive", a.INFO = "info", a.ACKNOWLEDGEMENT = "acknowledgement", a))(V || {}), tt = /* @__PURE__ */ ((a) => (a.CLOSE_MODAL = "close-modal", a))(tt || {});
14
- const at = {
15
- "en-US": {
16
- ariaLabelFallback: "modal",
17
- close: "Close"
18
- }
19
- }, et = E({
20
- i18n: { messages: at },
21
- name: "base-modal"
22
- }), ot = /* @__PURE__ */ E({
23
- ...et,
24
- props: {
25
- /**
26
- * List of actions that will be used to render the buttons.
27
- * First element in the list will be rendered as "primary".
28
- * All elements after the first will be rendered as "secondary".
29
- * But you may change the color of 1-st action to red with 'critial' key
30
- * Not more than 3 action buttons can be provided
31
- * Or 2 action buttons and 1 Label for them
32
- *
33
- * Each object in the list should have a `title`, an `event` and
34
- * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
35
- *
36
- * `title`: Button's text.
37
- *
38
- * `event`: Event triggered when clicking the Button.
39
- *
40
- * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.
41
- *
42
- * ```
43
- * [{
44
- * title: 'Primary',2
45
- * event: () => { ... },
46
- * icon: FourPeopleIcon
47
- * }, {
48
- * title: 'Secondary',
49
- * event: () => { ... }
50
- * }]
51
- * ```
52
- */
53
- actions: {
54
- type: Array,
55
- default: null
56
- },
57
- /**
58
- * 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.
59
- */
60
- columnsSize: {
61
- type: String,
62
- default: m.SMALLER
63
- },
64
- /**
65
- * If provided, manages the padding of the whole modal container
66
- */
67
- customPadding: { type: String, default: null },
68
- /**
69
- * Hides a cross icon on the right side of the title
70
- */
71
- hideCloseButton: { type: Boolean, required: !0 },
72
- /**
73
- * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.
74
- */
75
- initiallyOpen: { type: Boolean, default: !1 },
76
- /**
77
- * If set to true, it allows the modal to be closed by clicking outside of it
78
- */
79
- isDismissible: { type: Boolean, required: !0 },
80
- /**
81
- * Controls the modal's state from the outside. Set it to true to open the modal
82
- */
83
- isOpen: { type: Boolean, required: !0 },
84
- /**
85
- * Defines whether the modal will be an alert modal
86
- */
87
- modalRole: { type: String, default: _.DIALOG },
88
- /**
89
- * Sets the width of the modal
90
- */
91
- size: {
92
- type: String,
93
- default: b.SMALL
94
- },
95
- /**
96
- * If provided, renders the modal's content in a two-column layout an wth dividers separating its content
97
- */
98
- withColumnLayout: { type: Boolean, default: !1 }
99
- },
100
- emits: ["close-modal"],
101
- setup(a, { expose: e, emit: o }) {
102
- const t = a, n = 500, C = 26, { t: y } = H(), L = w(), v = N(), d = W(L), r = O(null), c = O(!1), A = Y("modal"), I = i(() => t.isDismissible && !t.hideCloseButton), B = i(() => {
103
- if (!t.customPadding)
104
- return {};
105
- const s = {
106
- paddingLeft: t.customPadding,
107
- paddingRight: t.customPadding
108
- }, l = { ...s, paddingTop: void 0, paddingBottom: void 0 };
109
- return d("default") || (l.paddingTop = t.customPadding), d("actions") || (l.paddingBottom = t.customPadding), {
110
- header: {
111
- ...s,
112
- paddingTop: t.customPadding,
113
- flex: 0,
114
- paddingRight: `${parseInt(t.customPadding, 10) + C}px`
115
- },
116
- content: l,
117
- closeButton: { top: t.customPadding, right: t.customPadding },
118
- actions: { ...s, paddingBottom: t.customPadding }
119
- };
120
- }), D = i(() => v["aria-label"] ?? y("ariaLabelFallback")), p = i(() => t.withColumnLayout && t.size === b.LARGE), f = () => {
121
- r.value.showModal();
122
- }, h = () => {
123
- o("close-modal");
124
- }, T = () => {
125
- c.value && (r.value.close(), h(), c.value = !1);
126
- }, u = () => {
127
- r.value.open && (c.value = !0);
128
- }, g = (s) => {
129
- s && s.preventDefault(), !(!t.isDismissible && t.modalRole === _.DIALOG) && u();
130
- }, G = ({ target: s }) => {
131
- s && s.tagName === _.DIALOG.toUpperCase() && g();
132
- }, M = i(() => ({
133
- [`b-modal-base__container--${t.size}`]: t.size,
134
- "b-modal-base__container--hide": c.value,
135
- "b-modal-base__container--column-layout": p.value
136
- })), P = i(() => ({
137
- "b-modal-base__content--column-layout": p.value,
138
- "b-modal-base__content--with-header": d("default"),
139
- "b-modal-base__content--with-actions": d("actions")
140
- })), R = i(() => t.columnsSize === m.SMALLER ? [
141
- { small: 4, medium: 4, large: 4 },
142
- { small: 8, medium: 8, large: 8 }
143
- ] : t.columnsSize === m.BIGGER ? [
144
- { small: 8, medium: 8, large: 8 },
145
- { small: 4, medium: 4, large: 4 }
146
- ] : [
147
- { small: 6, medium: 6, large: 6 },
148
- { small: 6, medium: 6, large: 6 }
149
- ]);
150
- return S(
151
- () => [t.isOpen, r.value],
152
- ([s, l], [, k]) => {
153
- if (!l)
154
- return;
155
- s ? f() : !k || u();
156
- }
157
- ), S(
158
- () => t.actions,
159
- () => {
160
- var s, l;
161
- ((l = (s = t.actions) == null ? void 0 : s[0]) == null ? void 0 : l.state) === "success" && setTimeout(u, n);
162
- },
163
- { deep: !0 }
164
- ), F(() => {
165
- t.isOpen && r.value && f();
166
- }), e({
167
- internalModalActionClose: g
168
- }), x(K, A), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: n, CLOSE_BUTTON_ICON_WIDTH: C, t: y, slots: L, attrs: v, hasSlot: d, modal: r, isClosing: c, modalId: A, emit: o, props: t, showCloseButton: I, customPaddingStyles: B, computedAriaLabel: D, hasColumnLayout: p, openModal: f, emitCloseEvent: h, closeModalAfterAnimation: T, startCloseModalAnimation: u, internalModalActionClose: g, closeModalOnClickOutside: G, modalConditionalClasses: M, modalContentConditionalClasses: P, computedColumnWidth: R, BentoTypography: U, BentoButton: z, BentoFocusTrap: q, GridLayout: Q, GridLayoutContainerType: j, CrossIcon: J };
169
- }
170
- });
171
- var st = function() {
172
- var e = this, o = e._self._c, t = e._self._setupProxy;
173
- return o("div", { staticClass: "b-modal-base" }, [o("dialog", { ref: "modal", staticClass: "b-modal-base__container", class: t.modalConditionalClasses, attrs: { id: t.modalId, role: e.modalRole, "aria-label": t.computedAriaLabel, open: e.initiallyOpen }, on: { animationend: t.closeModalAfterAnimation, click: function(n) {
174
- e.isDismissible && t.closeModalOnClickOutside(n);
175
- }, keydown: function(n) {
176
- return !n.type.indexOf("key") && e._k(n.keyCode, "esc", 27, n.key, ["Esc", "Escape"]) ? null : t.internalModalActionClose.apply(null, arguments);
177
- } } }, [e.isOpen || e.initiallyOpen ? o(t.BentoFocusTrap, [t.showCloseButton ? o(t.BentoButton, { staticClass: "b-modal-base__close-button", style: t.customPaddingStyles.closeButton, attrs: { variant: "tertiary", type: "button" }, on: { click: t.internalModalActionClose } }, [o(t.CrossIcon, { attrs: { "svg-title": t.t("close") } })], 1) : e._e(), o("div", { staticClass: "b-modal-base__wrapper" }, [t.hasSlot("default") || t.showCloseButton ? o("div", { staticClass: "b-modal-base__header-container", style: t.customPaddingStyles.header }, [o("div", { staticClass: "b-modal-base__header" }, [o(t.BentoTypography, { staticClass: "b-modal-base__title", attrs: { "aria-label": "base modal title", el: "span", variant: "title", stronger: "" } }, [t.hasSlot("default") ? e._t("default") : e._e()], 2)], 1)]) : e._e(), o("div", { staticClass: "b-modal-base__content", class: t.modalContentConditionalClasses, style: t.customPaddingStyles.content }, [t.hasSlot("content") || t.hasSlot("content-col-1") && t.hasSlot("content-col-2") ? o(t.BentoTypography, { attrs: { "aria-label": "base modal content", el: "div", variant: "body", stronger: "" } }, [t.hasColumnLayout ? o(t.GridLayout, { staticClass: "b-modal-base__grid", attrs: { "column-width": t.computedColumnWidth, "container-type": t.GridLayoutContainerType.NORMAL, "no-gap": "" }, scopedSlots: e._u([{ key: "col-1", fn: function() {
178
- return [e._t("content-col-1")];
179
- }, proxy: !0 }, { key: "col-2", fn: function() {
180
- return [e._t("content-col-2")];
181
- }, proxy: !0 }], null, !0) }) : e._t("content")], 2) : e._e()], 1), t.hasSlot("actions") ? o("div", { staticClass: "b-modal-base__actions-container", style: t.customPaddingStyles.actions }, [o("div", { staticClass: "b-modal-base__actions", attrs: { "aria-label": "modal actions" } }, [e._t("actions")], 2)]) : e._e()])], 1) : e._e()], 1)]);
182
- }, nt = [], lt = /* @__PURE__ */ X(
183
- ot,
184
- st,
185
- nt,
186
- !1,
187
- null,
188
- "5f27120d",
189
- null,
190
- null
191
- );
192
- const yt = lt.exports;
193
- export {
194
- Z as B,
195
- $ as a,
196
- b,
197
- m as c,
198
- _ as d,
199
- V as e,
200
- tt as f,
201
- yt as g
202
- };
203
- //# sourceMappingURL=base-modal.cc448ad3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-modal.cc448ad3.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 = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariantMapping {\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 :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 <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles.closeButton\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\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 </div>\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 <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 { 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 const CLOSE_BUTTON_ICON_WIDTH = 26;\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 * 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: {\n ...xPadding,\n paddingTop: props.customPadding,\n flex: 0,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n },\n content,\n closeButton: { top: props.customPadding, right: props.customPadding },\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--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","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","__default__","defineComponent","messages","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","CLOSE_BUTTON_ICON_WIDTH","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","MODAL_DIALOG_ID_INJECTION_KEY"],"mappings":";;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,SAAA,UAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,qBACAA,EAAA,SAAA,oBAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,S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../../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;AA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"vue";
2
- import { B as F } from "./index.2f00afab.js";
3
- import { u as H } from "./use-default-slot-validator.b9bff4c6.js";
4
- import { u as Y } from "./use-has-slot.fbeb19ec.js";
5
- import { g as L } from "./unique-id.a2a2b458.js";
6
- import { g as S } from "./get-slot-text.99c3d860.js";
7
- import { u as K } from "./i18n.eb5b985b.js";
8
- import { u as j } from "./aria-label.ac9651a5.js";
9
- import { BentoTag as z } from "../tag.js";
10
- import { C as Z } from "./checkmark-small.520f01b1.js";
11
- import { n as $ } from "./_plugin-vue2_normalizer.71e2aa87.js";
12
- import { E as G } from "./error-message.3d436de3.js";
13
- import "../assets/checkbox.css";
14
- var c = /* @__PURE__ */ ((t) => (t.UNCHECKED = "unchecked", t.DISABLED = "disabled", t.ERROR = "error", t.READONLY = "readonly", t))(c || {}), D = /* @__PURE__ */ ((t) => (t.UPDATE = "update:model-value", t))(D || {});
15
- let I = 0;
16
- const J = {
17
- beforeCreate() {
18
- this.uuid = I.toString(), I += 1;
19
- }
20
- };
21
- var Q = function() {
22
- var e = this, a = e._self._c;
23
- return a("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? a("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), a("path", { attrs: { fill: "#00112C", d: "M4.25 7.25H11.75V8.75H4.25V7.25Z" } })]);
24
- }, W = [], X = /* @__PURE__ */ $(
25
- J,
26
- Q,
27
- W,
28
- !1,
29
- null,
30
- null,
31
- null,
32
- null
33
- );
34
- const ee = X.exports, ae = {
35
- name: "checkbox-input",
36
- inheritAttrs: !1
37
- }, te = /* @__PURE__ */ R({
38
- ...ae,
39
- props: {
40
- /**
41
- * The aria label associated to the input checkbox.
42
- */
43
- ariaLabel: { type: String, default: "" },
44
- /**
45
- * An additional string that serves as description for the input checkbox (useful if the component shows a description).
46
- */
47
- ariaDescribedby: { type: String, default: "" },
48
- /**
49
- * Setting this property to true will disable the checkbox in your form.
50
- */
51
- disabled: { type: Boolean, default: !1 },
52
- /**
53
- * Setting this property to true will show the checkbox in error state.
54
- */
55
- hasError: { type: Boolean, default: !1 },
56
- /**
57
- * Sets the id of the checkbox. Required for accessibility purposes
58
- */
59
- id: { type: String, default: null },
60
- /**
61
- * The :indeterminate CSS pseudo-class represents any form element
62
- * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute
63
- * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,
64
- * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate
65
- * This property lets you control the input.indeterminate native property.
66
- */
67
- indeterminate: { type: Boolean, default: !1 },
68
- /**
69
- * When handling a single checkbox with a singular state, use a boolean.
70
- *
71
- * When handling multiple checkboxes, use an array of keys.
72
- * These keys exist as a set "value" prop for each checkbox.
73
- */
74
- modelValue: {
75
- type: [Boolean, Array],
76
- default: !1
77
- },
78
- /**
79
- * Setting this property to true will set the checkbox to read only state.
80
- */
81
- readonly: { type: Boolean, default: !1 },
82
- /**
83
- * The value of the component. The DOM API casts this to a string.
84
- * The browser uses "on" as the default value.
85
- *
86
- * In the case of multiple checkboxes this value is used as a unique key.
87
- */
88
- value: { type: [String, Number], default: null }
89
- },
90
- emits: ["update:model-value"],
91
- setup(t, { emit: e }) {
92
- const a = t, { disabled: l, indeterminate: f, modelValue: n, readonly: _, value: i } = A(a), v = o(() => ({
93
- [`b-checkbox-input--${c.DISABLED}`]: a.disabled,
94
- [`b-checkbox-input--${c.READONLY}`]: a.readonly
95
- })), g = o(() => ({
96
- [`b-checkbox-input__outline--${c.UNCHECKED}`]: !m.value && !a.indeterminate,
97
- [`b-checkbox-input__outline--${c.ERROR}`]: a.hasError,
98
- [`b-checkbox-input__outline--${c.READONLY}`]: a.readonly
99
- })), u = o(() => Array.isArray(n.value)), m = o(() => u.value ? n.value.some((r) => r === i.value) : n.value), k = o(() => a.hasError && !a.disabled && !a.readonly);
100
- return { __sfc: !0, props: a, emit: e, disabled: l, indeterminate: f, modelValue: n, readonly: _, value: i, conditionalClasses: v, outlineConditionalClasses: g, isCheckboxGroup: u, isChecked: m, ariaInvalid: k, onClick: (r) => {
101
- _.value && r.preventDefault();
102
- }, onChange: (r) => {
103
- if (l.value)
104
- return;
105
- const d = r.target.checked;
106
- if (u.value) {
107
- const s = [...n.value], b = s.indexOf(i.value);
108
- b === -1 ? s.push(i.value) : s.splice(b, 1), e(D.UPDATE, s);
109
- } else
110
- e(D.UPDATE, d);
111
- }, CheckmarkSmallIcon: Z, MinusSmallIcon: ee };
112
- }
113
- });
114
- var le = function() {
115
- var e = this, a = e._self._c, l = e._self._setupProxy;
116
- return a("div", { staticClass: "b-checkbox-input", class: l.conditionalClasses }, [l.indeterminate ? a(l.MinusSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "intermediate" } }) : l.isChecked ? a(l.CheckmarkSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "checked" } }) : e._e(), a("input", { ref: "input", staticClass: "b-checkbox-input__outline", class: l.outlineConditionalClasses, attrs: { id: e.id, role: "checkbox", type: "checkbox", "aria-label": e.ariaLabel, "aria-checked": l.isChecked, "aria-describedby": e.ariaDescribedby, "aria-invalid": l.ariaInvalid, disabled: l.disabled, "aria-readonly": l.readonly }, domProps: { checked: l.isChecked, indeterminate: l.indeterminate, value: l.value }, on: { click: l.onClick, change: l.onChange } })], 1);
117
- }, oe = [], re = /* @__PURE__ */ $(
118
- te,
119
- le,
120
- oe,
121
- !1,
122
- null,
123
- "7fd78e04",
124
- null,
125
- null
126
- );
127
- const se = re.exports;
128
- var p = /* @__PURE__ */ ((t) => (t.UPDATE = "update:model-value", t.INPUT = "input", t))(p || {});
129
- const ne = {
130
- "en-US": {
131
- ariaLabelFallback: "Checkbox",
132
- optional: "optional",
133
- required: "required"
134
- }
135
- }, ie = R({
136
- name: "bento-checkbox",
137
- i18n: { messages: ne },
138
- components: {
139
- BentoTag: z,
140
- BentoTypography: F,
141
- CheckboxInput: se,
142
- ErrorMessage: G
143
- },
144
- model: { prop: "modelValue" },
145
- props: {
146
- /**
147
- * @deprecated from version 2.0.0. Use the aria-label attribute instead.
148
- */
149
- /**
150
- * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.
151
- */
152
- ariaLabel: { type: String, default: null },
153
- /**
154
- * Setting this property to true will disable the checkbox in your form.
155
- */
156
- disabled: { type: Boolean, default: !1 },
157
- /**
158
- * Renders the checkbox in an error state with an error message.
159
- */
160
- errorMessage: { type: String, default: null },
161
- /**
162
- * Setting this property to true will show the checkbox in error state.
163
- */
164
- hasError: { type: Boolean, default: !1 },
165
- /**
166
- * The :indeterminate CSS pseudo-class represents any form element
167
- * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute
168
- * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,
169
- * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate
170
- * This property lets you control the input.indeterminate native property.
171
- */
172
- indeterminate: { type: Boolean, default: !1 },
173
- /**
174
- * When handling a single checkbox with a singular state, use a boolean.
175
- *
176
- * When handling multiple checkboxes, use an array of keys.
177
- * These keys exist as a set "value" prop for each checkbox.
178
- */
179
- modelValue: {
180
- type: [Boolean, Array],
181
- default: !1
182
- },
183
- /**
184
- * Highlights the checkbox is optional.
185
- */
186
- optional: { type: Boolean, default: !1 },
187
- /**
188
- * Setting this property to true will set the checkbox to read only state.
189
- */
190
- readonly: { type: Boolean, default: !1 },
191
- /**
192
- * Highlights the checkbox is required.
193
- */
194
- required: { type: Boolean, default: !1 },
195
- /**
196
- * Sets the properties of the BentoTag component that is placed next to the label.
197
- * {@see BentoTag}
198
- */
199
- tag: { type: Object, default: void 0 },
200
- /**
201
- * The value of the component. The DOM API casts this to a string.
202
- * The browser uses "on" as the default value.
203
- *
204
- * In the case of multiple checkboxes this value is used as a unique key.
205
- */
206
- value: { type: [String, Number], default: null }
207
- },
208
- emits: [p.UPDATE, p.INPUT],
209
- setup(t, { attrs: e, emit: a, slots: l }) {
210
- const { t: f } = K(), n = L("description"), _ = L("error"), i = Y(l), { disabled: v, indeterminate: g, modelValue: u, readonly: m, value: k } = A(t), C = S(l)("default"), x = S(l)("description");
211
- H("bento-checkbox", l.default, l.description);
212
- const r = o(() => Array.isArray(u.value)), d = o(() => r.value ? u.value.some((y) => y === k.value) : u.value), s = o(() => g.value), b = o(
213
- () => !t.disabled && !t.readonly && (t.hasError || !!t.errorMessage)
214
- ), B = o(() => !t.disabled && !t.readonly && !!t.errorMessage), h = o(() => i("content")), E = o(() => (s == null ? void 0 : s.value) || (d == null ? void 0 : d.value)), U = o(
215
- () => (h == null ? void 0 : h.value) && (r == null ? void 0 : r.value) && (E == null ? void 0 : E.value)
216
- ), P = o(
217
- () => s.value ? "mixed" : `${!!d.value}`
218
- ), T = o(
219
- () => `${B.value ? _ : ""} ${C && x ? n : ""}`.trim() || null
220
- ), w = O(e["aria-label"]), { ariaLabel: M } = A(t), N = j({
221
- ariaLabel: w.value,
222
- // TODO: take this line away when the aria-label props is removed
223
- label: M,
224
- defaultFallback: i("default") ? S(l)("default") : f("ariaLabelFallback")
225
- }), V = o(() => b.value), q = o(() => ({
226
- [`b-checkbox--${c.DISABLED}`]: v.value,
227
- [`b-checkbox--${c.READONLY}`]: m.value
228
- }));
229
- return {
230
- // Values
231
- descriptionId: n,
232
- errorId: _,
233
- ariaChecked: P,
234
- ariaDescribedBy: T,
235
- ariaInvalid: V,
236
- computedAriaLabel: N,
237
- conditionalClass: q,
238
- defaultSlotValue: C,
239
- descriptionSlotValue: x,
240
- isCheckboxGroup: r,
241
- isChecked: d,
242
- isIndeterminate: s,
243
- shouldShowError: b,
244
- shouldShowErrorMessage: B,
245
- contentSlotAvailable: U,
246
- hasContentSlot: h,
247
- // Methods
248
- hasSlot: i,
249
- onChange: (y) => {
250
- v.value || (a(p.UPDATE, y), a(p.INPUT, y));
251
- },
252
- t: f
253
- };
254
- }
255
- });
256
- var ce = function() {
257
- var e = this, a = e._self._c;
258
- return e._self._setupProxy, a("label", { staticClass: "b-checkbox", class: e.conditionalClass }, [a("checkbox-input", e._b({ ref: "input", attrs: { "aria-label": e.computedAriaLabel, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "has-error": e.shouldShowError, indeterminate: e.isIndeterminate, value: e.value, "model-value": e.modelValue, readonly: e.readonly }, on: { "update:model-value": e.onChange } }, "checkbox-input", e.$attrs, !1)), e.hasSlot("default") || e.shouldShowErrorMessage ? a("span", { staticClass: "b-checkbox__text" }, [e.hasSlot("default") ? a("bento-typography", { staticClass: "b-checkbox__label", attrs: { el: "span", variant: "body" } }, [a("span", [e._t("default")], 2), e.optional ? a("bento-typography", { staticClass: "b-checkbox__label-requirement", attrs: { el: "span" } }, [e._v("(" + e._s(e.t("optional")) + ")")]) : e.required ? a("bento-typography", { staticClass: "b-checkbox__label-requirement", attrs: { el: "span" } }, [e._v("(" + e._s(e.t("required")) + ")")]) : e._e(), e.tag ? a("bento-tag", e._b({ staticClass: "b-checkbox__label-tag" }, "bento-tag", e.tag, !1)) : e._e()], 1) : e._e(), e.hasSlot("default") && e.hasSlot("description") ? a("bento-typography", { staticClass: "b-checkbox__description", attrs: { id: e.descriptionId, el: "span", variant: "body" } }, [e._t("description")], 2) : e._e(), e.shouldShowErrorMessage ? a("error-message", { attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.contentSlotAvailable ? a("bento-typography", { staticClass: "b-checkbox__content", attrs: { el: "span", variant: "body" } }, [e._t("content")], 2) : e._e()], 1) : e._e()], 1);
259
- }, ue = [], de = /* @__PURE__ */ $(
260
- ie,
261
- ce,
262
- ue,
263
- !1,
264
- null,
265
- "e400ef17",
266
- null,
267
- null
268
- );
269
- const Se = de.exports;
270
- export {
271
- Se as B,
272
- c as C,
273
- p as a
274
- };
275
- //# sourceMappingURL=checkbox.2c2a1f90.js.map