@adyen/bento-vue3 1.25.0 → 1.27.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 (239) hide show
  1. package/dist/@types/components.d.ts +4 -0
  2. package/dist/@types/packages/core/src/utils/ts/storybook.d.ts +12 -0
  3. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -0
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.types.d.ts +2 -1
  6. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +3 -3
  7. package/dist/@types/packages/vue2/src/components/code-snippet/utils/get-lang-loader.d.ts +2 -1
  8. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.vue.d.ts +1 -1
  9. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +10 -2
  10. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.types.d.ts +3 -0
  11. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +8 -6
  12. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +27 -11
  13. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.types.d.ts +1 -0
  14. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-hovering/use-column-hovering.d.ts +19 -6
  15. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +38 -12
  16. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +19 -6
  17. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-resizer.d.ts +19 -6
  18. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -1
  19. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +29 -48
  20. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +1 -18
  21. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +12 -0
  22. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +36 -54
  23. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +27 -22
  24. package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +76 -1
  25. package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +20 -0
  26. package/dist/@types/packages/vue2/src/components/tutorial/tutorial.types.d.ts +1 -0
  27. package/dist/@types/packages/vue2/src/components/tutorial/tutorial.vue.d.ts +42 -3
  28. package/dist/@types/packages/vue2/src/components/typography/index.d.ts +1 -1
  29. package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +1 -1
  30. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  31. package/dist/@types/packages/vue2/src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue.d.ts +78 -0
  32. package/dist/@types/packages/vue2/src/templates/dashboard-template/dashboard-template.types.d.ts +8 -0
  33. package/dist/@types/packages/vue2/src/templates/dashboard-template/dashboard-template.vue.d.ts +103 -0
  34. package/dist/@types/packages/vue2/src/templates/dashboard-template/index.d.ts +3 -0
  35. package/dist/@types/packages/vue2/src/utils/ts/storybook.d.ts +1 -12
  36. package/dist/accordion.js +2 -2
  37. package/dist/action-bar.js +70 -154
  38. package/dist/action-bar.js.map +1 -1
  39. package/dist/alert.js +3 -3
  40. package/dist/assets/base-modal.css +1 -1
  41. package/dist/assets/button-actions.css +1 -1
  42. package/dist/assets/button.css +1 -1
  43. package/dist/assets/dialog-page.css +1 -1
  44. package/dist/assets/dropdown.css +1 -1
  45. package/dist/assets/index.css +1 -1
  46. package/dist/assets/index10.css +1 -1
  47. package/dist/assets/index11.css +1 -1
  48. package/dist/assets/index12.css +1 -1
  49. package/dist/assets/index13.css +1 -1
  50. package/dist/assets/index14.css +1 -1
  51. package/dist/assets/index15.css +1 -1
  52. package/dist/assets/index16.css +1 -1
  53. package/dist/assets/index17.css +1 -1
  54. package/dist/assets/index18.css +1 -1
  55. package/dist/assets/index19.css +1 -1
  56. package/dist/assets/index2.css +1 -1
  57. package/dist/assets/index20.css +1 -1
  58. package/dist/assets/index21.css +1 -1
  59. package/dist/assets/index22.css +1 -1
  60. package/dist/assets/index23.css +1 -1
  61. package/dist/assets/index24.css +1 -1
  62. package/dist/assets/index25.css +1 -1
  63. package/dist/assets/index26.css +1 -1
  64. package/dist/assets/index27.css +1 -1
  65. package/dist/assets/index28.css +1 -1
  66. package/dist/assets/index29.css +1 -1
  67. package/dist/assets/index3.css +1 -1
  68. package/dist/assets/index30.css +1 -1
  69. package/dist/assets/index31.css +1 -1
  70. package/dist/assets/index32.css +1 -1
  71. package/dist/assets/index33.css +1 -1
  72. package/dist/assets/index34.css +1 -1
  73. package/dist/assets/index35.css +1 -1
  74. package/dist/assets/index36.css +1 -1
  75. package/dist/assets/index37.css +1 -1
  76. package/dist/assets/index38.css +1 -1
  77. package/dist/assets/index39.css +1 -1
  78. package/dist/assets/index4.css +1 -1
  79. package/dist/assets/index40.css +1 -1
  80. package/dist/assets/index41.css +1 -1
  81. package/dist/assets/index42.css +1 -1
  82. package/dist/assets/index43.css +1 -1
  83. package/dist/assets/index44.css +1 -1
  84. package/dist/assets/index45.css +1 -1
  85. package/dist/assets/index46.css +1 -1
  86. package/dist/assets/index47.css +1 -1
  87. package/dist/assets/index48.css +1 -1
  88. package/dist/assets/index49.css +1 -0
  89. package/dist/assets/index5.css +1 -1
  90. package/dist/assets/index6.css +1 -1
  91. package/dist/assets/index7.css +1 -1
  92. package/dist/assets/index8.css +1 -1
  93. package/dist/assets/index9.css +1 -1
  94. package/dist/assets/use-cached-selected-values.css +1 -1
  95. package/dist/avatar-image.js +1 -1
  96. package/dist/badge.js +1 -1
  97. package/dist/button.js +5 -5
  98. package/dist/card.js +3 -3
  99. package/dist/checkbox.js +5 -5
  100. package/dist/chunks/{base-button.6be8b60e.js → base-button.a0140a4c.js} +2 -2
  101. package/dist/chunks/{base-button.6be8b60e.js.map → base-button.a0140a4c.js.map} +1 -1
  102. package/dist/chunks/{base-modal.310c4790.js → base-modal.4102f69d.js} +6 -6
  103. package/dist/chunks/{base-modal.310c4790.js.map → base-modal.4102f69d.js.map} +1 -1
  104. package/dist/chunks/{button-actions-with-menu.a007b034.js → button-actions-with-menu.4f311411.js} +4 -4
  105. package/dist/chunks/{button-actions-with-menu.a007b034.js.map → button-actions-with-menu.4f311411.js.map} +1 -1
  106. package/dist/chunks/{button-actions.adc0a2fe.js → button-actions.82163994.js} +42 -40
  107. package/dist/chunks/button-actions.82163994.js.map +1 -0
  108. package/dist/chunks/{button.de5589fa.js → button.ae4760cd.js} +27 -26
  109. package/dist/chunks/button.ae4760cd.js.map +1 -0
  110. package/dist/chunks/{calendar.73f5b904.js → calendar.a9c5a68c.js} +5 -5
  111. package/dist/chunks/{calendar.73f5b904.js.map → calendar.a9c5a68c.js.map} +1 -1
  112. package/dist/chunks/{checkbox.4c96cc23.js → checkbox.9c30c07b.js} +3 -3
  113. package/dist/chunks/{checkbox.4c96cc23.js.map → checkbox.9c30c07b.js.map} +1 -1
  114. package/dist/chunks/{controls-group.37a67734.js → controls-group.8357e3fd.js} +3 -3
  115. package/dist/chunks/{controls-group.37a67734.js.map → controls-group.8357e3fd.js.map} +1 -1
  116. package/dist/chunks/{copy.43de2653.js → copy.60ee6ac3.js} +4 -4
  117. package/dist/chunks/{copy.43de2653.js.map → copy.60ee6ac3.js.map} +1 -1
  118. package/dist/chunks/{dialog-page.cd8c7fff.js → dialog-page.cb6ce9b6.js} +3 -3
  119. package/dist/chunks/{dialog-page.cd8c7fff.js.map → dialog-page.cb6ce9b6.js.map} +1 -1
  120. package/dist/chunks/{dropdown-default-textbox.424e0eb6.js → dropdown-default-textbox.cda0798f.js} +3 -3
  121. package/dist/chunks/{dropdown-default-textbox.424e0eb6.js.map → dropdown-default-textbox.cda0798f.js.map} +1 -1
  122. package/dist/chunks/{dropdown.57b2ea6f.js → dropdown.0ae3b842.js} +118 -128
  123. package/dist/chunks/dropdown.0ae3b842.js.map +1 -0
  124. package/dist/chunks/{error-message.4bd22112.js → error-message.d2bdeb80.js} +2 -2
  125. package/dist/chunks/{error-message.4bd22112.js.map → error-message.d2bdeb80.js.map} +1 -1
  126. package/dist/chunks/{events.58c00e6d.js → events.f14a214b.js} +5 -5
  127. package/dist/chunks/events.f14a214b.js.map +1 -0
  128. package/dist/chunks/{fixed-scroller.5b93a6a6.js → fixed-scroller.7b42cb1e.js} +2 -2
  129. package/dist/chunks/{fixed-scroller.5b93a6a6.js.map → fixed-scroller.7b42cb1e.js.map} +1 -1
  130. package/dist/chunks/{footer-actions.c401ec50.js → footer-actions.64f6f5d8.js} +4 -4
  131. package/dist/chunks/{footer-actions.c401ec50.js.map → footer-actions.64f6f5d8.js.map} +1 -1
  132. package/dist/chunks/{index.faec0854.js → index.2d7b4511.js} +9 -9
  133. package/dist/chunks/{index.faec0854.js.map → index.2d7b4511.js.map} +1 -1
  134. package/dist/chunks/index.2fcd1233.js +103 -0
  135. package/dist/chunks/index.2fcd1233.js.map +1 -0
  136. package/dist/chunks/{index.f71015d8.js → index.6295e754.js} +3 -3
  137. package/dist/chunks/{index.f71015d8.js.map → index.6295e754.js.map} +1 -1
  138. package/dist/chunks/{index.8b10ee32.js → index.6bb6f38c.js} +6 -6
  139. package/dist/chunks/{index.8b10ee32.js.map → index.6bb6f38c.js.map} +1 -1
  140. package/dist/chunks/{index.73ac0db6.js → index.8aa536a8.js} +3 -3
  141. package/dist/chunks/{index.73ac0db6.js.map → index.8aa536a8.js.map} +1 -1
  142. package/dist/chunks/{index.ea65003b.js → index.9d7fb316.js} +2 -2
  143. package/dist/chunks/{index.ea65003b.js.map → index.9d7fb316.js.map} +1 -1
  144. package/dist/chunks/{index.bab8811d.js → index.a001a0a8.js} +6 -6
  145. package/dist/chunks/{index.bab8811d.js.map → index.a001a0a8.js.map} +1 -1
  146. package/dist/chunks/{index.98bbaed9.js → index.b18c78d6.js} +2 -2
  147. package/dist/chunks/{index.98bbaed9.js.map → index.b18c78d6.js.map} +1 -1
  148. package/dist/chunks/{index.aa83aa48.js → index.eb38a6c4.js} +3 -3
  149. package/dist/chunks/{index.aa83aa48.js.map → index.eb38a6c4.js.map} +1 -1
  150. package/dist/chunks/{index.11b6dd35.js → index.ee15db35.js} +17 -17
  151. package/dist/chunks/index.ee15db35.js.map +1 -0
  152. package/dist/chunks/{index.8682bd04.js → index.f9d081d2.js} +2 -2
  153. package/dist/chunks/{index.8682bd04.js.map → index.f9d081d2.js.map} +1 -1
  154. package/dist/chunks/index.fedbb4c2.js +125 -0
  155. package/dist/chunks/index.fedbb4c2.js.map +1 -0
  156. package/dist/chunks/{keyboard-navigation.ca47dfa8.js → keyboard-navigation.bbc3d15c.js} +2 -2
  157. package/dist/chunks/{keyboard-navigation.ca47dfa8.js.map → keyboard-navigation.bbc3d15c.js.map} +1 -1
  158. package/dist/chunks/{listbox-option-tag.d1a3b340.js → listbox-option-tag.2aea037c.js} +3 -3
  159. package/dist/chunks/{listbox-option-tag.d1a3b340.js.map → listbox-option-tag.2aea037c.js.map} +1 -1
  160. package/dist/chunks/{loading-button.2db95771.js → loading-button.6b81b546.js} +2 -2
  161. package/dist/chunks/{loading-button.2db95771.js.map → loading-button.6b81b546.js.map} +1 -1
  162. package/dist/chunks/{payment-method.26fa5509.js → payment-method.d5595a7c.js} +2 -2
  163. package/dist/chunks/{payment-method.26fa5509.js.map → payment-method.d5595a7c.js.map} +1 -1
  164. package/dist/chunks/{tooltip.e29f7d7e.js → tooltip.36172265.js} +4 -4
  165. package/dist/chunks/{tooltip.e29f7d7e.js.map → tooltip.36172265.js.map} +1 -1
  166. package/dist/chunks/{use-bento-toast-controller.98ca249a.js → use-bento-toast-controller.3dc4e113.js} +2 -2
  167. package/dist/chunks/{use-bento-toast-controller.98ca249a.js.map → use-bento-toast-controller.3dc4e113.js.map} +1 -1
  168. package/dist/chunks/{use-cached-selected-values.a9b0fb3d.js → use-cached-selected-values.3c312296.js} +396 -375
  169. package/dist/chunks/use-cached-selected-values.3c312296.js.map +1 -0
  170. package/dist/code-snippet.js +137 -135
  171. package/dist/code-snippet.js.map +1 -1
  172. package/dist/country.js +2 -2
  173. package/dist/currency.js +1 -1
  174. package/dist/dashboard-template.js +169 -0
  175. package/dist/dashboard-template.js.map +1 -0
  176. package/dist/data-grid-template.js +1 -1
  177. package/dist/data-grid.js +1295 -1253
  178. package/dist/data-grid.js.map +1 -1
  179. package/dist/date-picker.js +8 -8
  180. package/dist/date-range-picker.js +2 -2
  181. package/dist/date.js +1 -1
  182. package/dist/divider.js +1 -1
  183. package/dist/dropdown.js +7 -7
  184. package/dist/empty-state.js +3 -3
  185. package/dist/filter-bar.js +84 -82
  186. package/dist/filter-bar.js.map +1 -1
  187. package/dist/focus-trap.js +1 -1
  188. package/dist/form-layout.js +53 -51
  189. package/dist/form-layout.js.map +1 -1
  190. package/dist/header.js +4 -4
  191. package/dist/index.js +66 -63
  192. package/dist/index.js.map +1 -1
  193. package/dist/info-icon.js +3 -3
  194. package/dist/input-field.js +4 -4
  195. package/dist/internal.js +8 -8
  196. package/dist/link.js +1 -1
  197. package/dist/loading-indicator.js +1 -1
  198. package/dist/menu.js +1 -1
  199. package/dist/modal-fullscreen.js +6 -6
  200. package/dist/modal.js +6 -6
  201. package/dist/pagination.js +4 -4
  202. package/dist/payment-method.js +1 -1
  203. package/dist/popover.js +1 -1
  204. package/dist/popper-container.js +1 -1
  205. package/dist/radio-group.js +4 -4
  206. package/dist/search-bar.js +2 -2
  207. package/dist/secondary-nav.js +2 -2
  208. package/dist/segmented-control.js +66 -72
  209. package/dist/segmented-control.js.map +1 -1
  210. package/dist/selection-card.js +4 -4
  211. package/dist/sidepanel.js +6 -6
  212. package/dist/status.js +2 -2
  213. package/dist/stepper.js +4 -4
  214. package/dist/structured-list.js +1 -1
  215. package/dist/summary-grid.js +3 -3
  216. package/dist/tabs.js +81 -77
  217. package/dist/tabs.js.map +1 -1
  218. package/dist/tag.js +3 -3
  219. package/dist/textarea.js +4 -4
  220. package/dist/timeline.js +7 -7
  221. package/dist/toast.js +4 -4
  222. package/dist/toggle.js +2 -2
  223. package/dist/tutorial.js +168 -132
  224. package/dist/tutorial.js.map +1 -1
  225. package/dist/typography.js +1 -1
  226. package/dist/web-types.json +1 -1
  227. package/package.json +8 -6
  228. package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +0 -8
  229. package/dist/chunks/button-actions.adc0a2fe.js.map +0 -1
  230. package/dist/chunks/button.de5589fa.js.map +0 -1
  231. package/dist/chunks/checkmark.eb3c7a06.js +0 -29
  232. package/dist/chunks/checkmark.eb3c7a06.js.map +0 -1
  233. package/dist/chunks/dropdown.57b2ea6f.js.map +0 -1
  234. package/dist/chunks/events.58c00e6d.js.map +0 -1
  235. package/dist/chunks/index.11b6dd35.js.map +0 -1
  236. package/dist/chunks/index.38752f78.js +0 -168
  237. package/dist/chunks/index.38752f78.js.map +0 -1
  238. package/dist/chunks/use-cached-selected-values.a9b0fb3d.js.map +0 -1
  239. /package/dist/@types/packages/{vue2 → core}/src/components/typography/typography.types.d.ts +0 -0
package/dist/toggle.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as $, ref as y, computed as p, toRefs as V, watch as D, resolveComponent as _, openBlock as n, createElementBlock as k, normalizeClass as T, withDirectives as w, createElementVNode as b, vModelCheckbox as O, createBlock as g, createCommentVNode as i, withCtx as h, renderSlot as v } from "vue";
2
2
  import { C as N } from "./chunks/checkmark-small.c79220d9.js";
3
- import { B as U } from "./chunks/index.11b6dd35.js";
3
+ import { B as U } from "./chunks/index.ee15db35.js";
4
4
  import { g as j } from "./chunks/unique-id.a2a2b458.js";
5
5
  import { u as z } from "./chunks/use-default-slot-validator.1169c221.js";
6
6
  import { u as H } from "./chunks/use-has-slot.4d98bf29.js";
7
7
  import { g as m } from "./chunks/get-slot-text.bead058f.js";
8
8
  import { u as M } from "./chunks/aria-label.ac9651a5.js";
9
9
  import { _ as P } from "./chunks/_plugin-vue_export-helper.dad06003.js";
10
- import "./assets/index47.css";
10
+ import "./assets/index34.css";
11
11
  var C = /* @__PURE__ */ ((e) => (e.LABEL_FIRST = "label-first", e))(C || {}), d = /* @__PURE__ */ ((e) => (e.BEFORE = "before", e.AFTER = "after", e))(d || {});
12
12
  const q = $({
13
13
  name: "bento-toggle",
package/dist/tutorial.js CHANGED
@@ -1,16 +1,16 @@
1
- import { defineComponent as x, ref as O, openBlock as u, createBlock as S, unref as o, withCtx as f, createElementVNode as c, normalizeStyle as j, createElementBlock as b, mergeProps as R, toDisplayString as E, createCommentVNode as y, computed as r, isRef as q, watch as L, nextTick as Z, createVNode as h, withKeys as z, createSlots as H, createTextVNode as I, renderSlot as U, pushScopeId as W, popScopeId as X, Fragment as G, renderList as J } from "vue";
2
- import { B as Q } from "./chunks/index.8b10ee32.js";
3
- import { B as F, a as Y } from "./chunks/index.bab8811d.js";
4
- import { B } from "./chunks/index.11b6dd35.js";
5
- import { BentoImage as tt } from "./image.js";
6
- import { u as et } from "./chunks/i18n.f7e6533e.js";
7
- import { R as ot } from "./chunks/refresh.bd60f6a8.js";
8
- import { _ as k } from "./chunks/_plugin-vue_export-helper.dad06003.js";
9
- import { a as N, h as at, o as st } from "./chunks/index.f71015d8.js";
10
- import { B as nt } from "./chunks/button-actions.adc0a2fe.js";
11
- import "./assets/index36.css";
12
- var A;
13
- const it = /* @__PURE__ */ x({
1
+ import { defineComponent as k, ref as B, openBlock as c, createBlock as O, unref as o, withCtx as v, createElementVNode as p, normalizeStyle as q, createElementBlock as b, mergeProps as N, toDisplayString as E, createCommentVNode as S, computed as l, isRef as Z, watch as I, nextTick as z, createVNode as y, withKeys as H, createSlots as U, createTextVNode as R, renderSlot as W, pushScopeId as X, popScopeId as G, Fragment as J, renderList as Q } from "vue";
2
+ import { B as Y } from "./chunks/index.6bb6f38c.js";
3
+ import { B as P, a as tt } from "./chunks/index.a001a0a8.js";
4
+ import { B as $ } from "./chunks/index.ee15db35.js";
5
+ import { BentoImage as et } from "./image.js";
6
+ import { u as ot } from "./chunks/i18n.f7e6533e.js";
7
+ import { R as st } from "./chunks/refresh.bd60f6a8.js";
8
+ import { _ as F } from "./chunks/_plugin-vue_export-helper.dad06003.js";
9
+ import { a as A, h as nt, o as at } from "./chunks/index.6295e754.js";
10
+ import { B as it } from "./chunks/button-actions.82163994.js";
11
+ import "./assets/index37.css";
12
+ var V;
13
+ const lt = /* @__PURE__ */ k({
14
14
  __name: "tutorial-indicator",
15
15
  props: {
16
16
  /**
@@ -18,95 +18,95 @@ const it = /* @__PURE__ */ x({
18
18
  * The indicator will position itself around the target element.
19
19
  */
20
20
  targetElement: {
21
- type: (A = N.props) == null ? void 0 : A.targetElement.type,
21
+ type: (V = A.props) == null ? void 0 : V.targetElement.type,
22
22
  required: !0
23
23
  }
24
24
  },
25
25
  setup(t) {
26
- const e = O({
26
+ const e = B({
27
27
  width: "0",
28
28
  height: "0",
29
29
  borderRadius: "0"
30
30
  });
31
- function s(d) {
31
+ function u(d) {
32
32
  try {
33
- const a = parseFloat(getComputedStyle(d).getPropertyValue("border-radius"));
34
- return Number.isNaN(a) ? "" : `${a + 2 * 2}px`;
33
+ const _ = parseFloat(getComputedStyle(d).getPropertyValue("border-radius"));
34
+ return Number.isNaN(_) ? "" : `${_ + 2 * 2}px`;
35
35
  } catch {
36
36
  return "";
37
37
  }
38
38
  }
39
- const v = [
40
- at(),
41
- st({
39
+ const a = [
40
+ nt(),
41
+ at({
42
42
  mainAxis: 2,
43
43
  alignmentAxis: -2
44
44
  }),
45
45
  {
46
46
  name: "updateIndicatorSize",
47
- fn: ({ x: d, y: a, elements: n }) => {
48
- const p = n.reference;
49
- return e.value.width = `${p.offsetWidth + 4 * 2}px`, e.value.height = `${p.offsetHeight + 4 * 2}px`, e.value.borderRadius = s(p), { x: d, y: a };
47
+ fn: ({ x: d, y: _, elements: s }) => {
48
+ const n = s.reference;
49
+ return e.value.width = `${n.offsetWidth + 4 * 2}px`, e.value.height = `${n.offsetHeight + 4 * 2}px`, e.value.borderRadius = u(n), { x: d, y: _ };
50
50
  }
51
51
  }
52
52
  ];
53
- return (d, a) => (u(), S(o(N), {
53
+ return (d, _) => (c(), O(o(A), {
54
54
  "target-element": t.targetElement,
55
- middleware: v,
55
+ middleware: a,
56
56
  position: "top-start",
57
57
  "fixed-positioning": "",
58
58
  "disabled-focus-trap": "",
59
59
  class: "b-tutorial-indicator",
60
60
  "data-testid": "tutorial-indicator"
61
61
  }, {
62
- default: f(() => [
63
- c("div", {
62
+ default: v(() => [
63
+ p("div", {
64
64
  class: "b-tutorial-indicator__highlight",
65
- style: j(e.value)
65
+ style: q(e.value)
66
66
  }, null, 4)
67
67
  ]),
68
68
  _: 1
69
69
  }, 8, ["target-element"]));
70
70
  }
71
71
  });
72
- const rt = /* @__PURE__ */ k(it, [["__scopeId", "data-v-672deffb"]]);
73
- let P = 0;
74
- const lt = {
72
+ const rt = /* @__PURE__ */ F(lt, [["__scopeId", "data-v-672deffb"]]);
73
+ let D = 0;
74
+ const ut = {
75
75
  beforeCreate() {
76
- this.uuid = P.toString(), P += 1;
76
+ this.uuid = D.toString(), D += 1;
77
77
  }
78
- }, ut = { key: 0 }, ct = ["clip-path"], dt = /* @__PURE__ */ c("path", {
78
+ }, ct = { key: 0 }, pt = ["clip-path"], dt = /* @__PURE__ */ p("path", {
79
79
  fill: "#00112C",
80
80
  d: "M9.51195 0.398918C8.00859 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.704529 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8887 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.5555 10.9198 13.2667 11.4124 12.9177 11.8573L4.14271 3.0823C4.58761 2.73333 5.08018 2.44448 5.60823 2.22576ZM3.08208 4.14298L11.857 12.9179C11.7327 13.0154 11.6044 13.1085 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C2.89155 4.39564 2.98456 4.26733 3.08208 4.14298Z"
81
- }, null, -1), pt = [
81
+ }, null, -1), _t = [
82
82
  dt
83
- ], _t = ["id"], ft = /* @__PURE__ */ c("rect", {
83
+ ], ft = ["id"], vt = /* @__PURE__ */ p("rect", {
84
84
  width: "16",
85
85
  height: "16",
86
86
  fill: "#fff"
87
- }, null, -1), vt = [
88
- ft
87
+ }, null, -1), mt = [
88
+ vt
89
89
  ];
90
- function mt(t, l, e, s, v, d) {
91
- return u(), b("svg", R({ role: "img" }, t.$attrs, {
90
+ function gt(t, r, e, u, a, d) {
91
+ return c(), b("svg", N({ role: "img" }, t.$attrs, {
92
92
  class: "ui-assets-icons-16",
93
93
  xmlns: "http://www.w3.org/2000/svg",
94
94
  width: "16",
95
95
  height: "16",
96
96
  fill: "none"
97
97
  }), [
98
- t.$attrs["svg-title"] ? (u(), b("title", ut, E(t.$attrs["svg-title"]), 1)) : y("", !0),
99
- c("g", {
98
+ t.$attrs["svg-title"] ? (c(), b("title", ct, E(t.$attrs["svg-title"]), 1)) : S("", !0),
99
+ p("g", {
100
100
  "clip-path": "url(#uia-icons-16-blocked__a" + t.uuid + ")"
101
- }, pt, 8, ct),
102
- c("defs", null, [
103
- c("clipPath", {
101
+ }, _t, 8, pt),
102
+ p("defs", null, [
103
+ p("clipPath", {
104
104
  id: "uia-icons-16-blocked__a" + t.uuid
105
- }, vt, 8, _t)
105
+ }, mt, 8, ft)
106
106
  ])
107
107
  ], 16);
108
108
  }
109
- const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
109
+ const ht = /* @__PURE__ */ F(ut, [["render", gt]]), L = {
110
110
  "en-US": {
111
111
  finish: "Finish",
112
112
  next: "Next",
@@ -116,13 +116,13 @@ const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
116
116
  startTour: "Start tour",
117
117
  stepsOfTotal: "{step} of {totalSteps}"
118
118
  }
119
- }, ht = (t) => (W("data-v-dc83a55d"), t = t(), X(), t), yt = { key: 0 }, St = /* @__PURE__ */ ht(() => /* @__PURE__ */ c("div", {
119
+ }, yt = (t) => (X("data-v-9513f48c"), t = t(), G(), t), St = { key: 0 }, Ot = /* @__PURE__ */ yt(() => /* @__PURE__ */ p("div", {
120
120
  "aria-hidden": "true",
121
121
  class: "b-tutorial-popover__ripple"
122
- }, null, -1)), bt = { class: "b-tutorial-popover__header" }, Ct = { class: "b-tutorial-popover__footer" }, Tt = { class: "b-tutorial-popover__actions" }, Ot = {
123
- i18n: { messages: D }
124
- }, Et = /* @__PURE__ */ x({
125
- ...Ot,
122
+ }, null, -1)), bt = { class: "b-tutorial-popover__header" }, Ct = { class: "b-tutorial-popover__footer" }, Tt = { class: "b-tutorial-popover__actions" }, Bt = {
123
+ i18n: { messages: L }
124
+ }, Et = /* @__PURE__ */ k({
125
+ ...Bt,
126
126
  __name: "tutorial-popover",
127
127
  props: {
128
128
  /**
@@ -158,8 +158,17 @@ const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
158
158
  */
159
159
  position: {
160
160
  type: String,
161
- default: F.BOTTOM_START,
162
- validator: (t) => Object.values(F).includes(t)
161
+ default: P.BOTTOM_START,
162
+ validator: (t) => Object.values(P).includes(t)
163
+ },
164
+ /**
165
+ * Options to control the scroll into view behavior.
166
+ * Takes the same options as the `scrollIntoView` function
167
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView}
168
+ */
169
+ scrollOptions: {
170
+ type: [Boolean, Object],
171
+ default: null
163
172
  },
164
173
  /**
165
174
  * Indicates whether this popover is a single tutorial or a tour.
@@ -203,103 +212,105 @@ const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
203
212
  }
204
213
  },
205
214
  emits: ["next", "finish", "restart"],
206
- setup(t, { emit: l }) {
207
- const e = t, { t: s } = et({ messages: D }), v = r(() => ({
208
- title: s("skipTour"),
209
- event: () => l("finish")
210
- })), d = r(() => ({
211
- title: s("startTour"),
212
- event: () => l("next")
213
- })), a = r(() => ({
214
- title: s("next"),
215
- event: () => l("next")
216
- })), n = r(() => ({
217
- title: s("finish"),
218
- event: () => l("finish")
219
- })), p = r(() => ({
220
- title: s("ok"),
221
- event: () => l("finish")
222
- })), C = O(!1), g = O(!1), m = r(() => {
215
+ setup(t, { emit: r }) {
216
+ const e = t, u = { behavior: "smooth" }, { t: a } = ot({ messages: L }), d = l(() => ({
217
+ title: a("skipTour"),
218
+ event: () => r("finish")
219
+ })), _ = l(() => ({
220
+ title: a("startTour"),
221
+ event: () => r("next")
222
+ })), s = l(() => ({
223
+ title: a("next"),
224
+ event: () => r("next")
225
+ })), n = l(() => ({
226
+ title: a("finish"),
227
+ event: () => r("finish")
228
+ })), g = l(() => ({
229
+ title: a("ok"),
230
+ event: () => r("finish")
231
+ })), C = B(!1), h = B(!1), m = l(() => {
223
232
  var i;
224
- return q(e.targetElement) ? ((i = e.targetElement.value) == null ? void 0 : i.$el) || e.targetElement.value : e.targetElement.$el || e.targetElement;
225
- }), T = r(() => e.step === 0), w = r(() => e.step === e.totalSteps), V = r(() => !T.value), K = r(() => [
233
+ return Z(e.targetElement) ? ((i = e.targetElement.value) == null ? void 0 : i.$el) || e.targetElement.value : e.targetElement.$el || e.targetElement;
234
+ }), T = l(() => e.step === 0), w = l(() => e.step === e.totalSteps), j = l(() => !T.value), K = l(() => [
226
235
  {
227
- text: s("restartTour"),
228
- handler: () => l("restart"),
229
- icon: ot
236
+ text: a("restartTour"),
237
+ handler: () => r("restart"),
238
+ icon: st
230
239
  },
231
240
  ...w.value ? [] : [
232
241
  {
233
242
  text: "Skip tour",
234
- handler: () => l("finish"),
235
- icon: gt
243
+ handler: () => r("finish"),
244
+ icon: ht
236
245
  }
237
246
  ]
238
- ]), M = r(() => {
247
+ ]), M = l(() => {
239
248
  let i;
240
- T.value ? i = e.single ? p.value : d.value : w.value ? i = n.value : i = a.value;
241
- const _ = [i];
242
- return T.value && !e.single ? _.push(v.value) : e.action && _.push(e.action), _;
249
+ T.value ? i = e.single ? g.value : _.value : w.value ? i = n.value : i = s.value;
250
+ const f = [i];
251
+ return T.value && !e.single ? f.push(d.value) : e.action && f.push(e.action), f;
243
252
  });
244
- return L(
253
+ return I(
245
254
  () => e.active,
246
255
  async (i) => {
247
- var _, $;
248
- i && ((_ = m.value) != null && _.scrollIntoView) && (($ = m.value) == null || $.scrollIntoView({ behavior: "smooth" }), await Z()), C.value = i, g.value = i;
256
+ var f, x;
257
+ i && ((f = m.value) != null && f.scrollIntoView) && ((x = m.value) == null || x.scrollIntoView(
258
+ e.scrollOptions != null ? e.scrollOptions : u
259
+ ), await z()), C.value = i, h.value = i;
249
260
  },
250
261
  { immediate: !0 }
251
- ), (i, _) => t.active && o(m) ? (u(), b("div", yt, [
252
- g.value && o(m) ? (u(), S(o(rt), {
262
+ ), (i, f) => t.active && o(m) ? (c(), b("div", St, [
263
+ h.value && o(m) ? (c(), O(o(rt), {
253
264
  key: 0,
254
265
  "target-element": o(m)
255
- }, null, 8, ["target-element"])) : y("", !0),
256
- h(o(Y), {
266
+ }, null, 8, ["target-element"])) : S("", !0),
267
+ y(o(tt), {
257
268
  "target-element": o(m),
258
269
  position: t.position,
259
270
  open: C.value,
260
271
  "aria-label": t.title,
261
272
  "fixed-positioning": "",
262
273
  class: "b-tutorial-popover",
263
- onKeydown: _[0] || (_[0] = z(($) => l("finish"), ["esc", "native"]))
264
- }, H({
265
- default: f(() => [
266
- St,
267
- c("div", bt, [
268
- h(o(B), {
274
+ onKeydown: f[0] || (f[0] = H((x) => r("finish"), ["esc", "native"]))
275
+ }, U({
276
+ default: v(() => [
277
+ Ot,
278
+ p("div", bt, [
279
+ y(o($), {
269
280
  variant: "title",
270
281
  el: "span"
271
282
  }, {
272
- default: f(() => [
273
- I(E(t.title), 1)
283
+ default: v(() => [
284
+ R(E(t.title), 1)
274
285
  ]),
275
286
  _: 1
276
287
  }),
277
- o(V) ? (u(), S(o(B), {
288
+ o(j) ? (c(), O(o($), {
278
289
  key: 0,
279
290
  el: "span",
280
291
  class: "b-tutorial-popover__steps"
281
292
  }, {
282
- default: f(() => [
283
- I(E(o(s)("stepsOfTotal", { step: t.step, totalSteps: t.totalSteps })), 1)
293
+ default: v(() => [
294
+ R(E(o(a)("stepsOfTotal", { step: t.step, totalSteps: t.totalSteps })), 1)
284
295
  ]),
285
296
  _: 1
286
- })) : y("", !0)
297
+ })) : S("", !0)
287
298
  ]),
288
- h(o(B), null, {
289
- default: f(() => [
290
- U(i.$slots, "default", {}, void 0, !0)
299
+ y(o($), null, {
300
+ default: v(() => [
301
+ W(i.$slots, "default", {}, void 0, !0)
291
302
  ]),
292
303
  _: 3
293
304
  }),
294
- c("div", Ct, [
295
- o(T) ? y("", !0) : (u(), S(o(Q), {
305
+ p("div", Ct, [
306
+ o(T) ? S("", !0) : (c(), O(o(Y), {
296
307
  key: 0,
297
308
  data: o(K),
298
309
  class: "b-tutorial-popover__menu",
299
310
  "data-testid": "menu-button"
300
311
  }, null, 8, ["data"])),
301
- c("div", Tt, [
302
- h(o(nt), {
312
+ p("div", Tt, [
313
+ y(o(it), {
303
314
  actions: o(M),
304
315
  layout: "buttons-end"
305
316
  }, null, 8, ["actions"])
@@ -310,8 +321,8 @@ const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
310
321
  }, [
311
322
  t.image ? {
312
323
  name: "image",
313
- fn: f(() => [
314
- h(o(tt), R(t.image, {
324
+ fn: v(() => [
325
+ y(o(et), N(t.image, {
315
326
  "aspect-ratio": "landscape",
316
327
  class: "b-tutorial-popover__image"
317
328
  }), null, 16)
@@ -319,13 +330,20 @@ const gt = /* @__PURE__ */ k(lt, [["render", mt]]), D = {
319
330
  key: "0"
320
331
  } : void 0
321
332
  ]), 1032, ["target-element", "position", "open", "aria-label"])
322
- ])) : y("", !0);
333
+ ])) : S("", !0);
323
334
  }
324
335
  });
325
- const $t = /* @__PURE__ */ k(Et, [["__scopeId", "data-v-dc83a55d"]]), Bt = { class: "b-tutorial" }, It = {}, Kt = /* @__PURE__ */ x({
336
+ const xt = /* @__PURE__ */ F(Et, [["__scopeId", "data-v-9513f48c"]]), $t = { class: "b-tutorial" }, It = {}, jt = /* @__PURE__ */ k({
326
337
  ...It,
327
338
  __name: "tutorial",
328
339
  props: {
340
+ /**
341
+ * The current step index. If provided, will start the tutorial in that step.
342
+ */
343
+ index: {
344
+ type: Number,
345
+ default: null
346
+ },
329
347
  /**
330
348
  * The steps configuration for the tutorial.
331
349
  *
@@ -334,34 +352,52 @@ const $t = /* @__PURE__ */ k(Et, [["__scopeId", "data-v-dc83a55d"]]), Bt = { cla
334
352
  type: Array,
335
353
  required: !0,
336
354
  validator: (t) => t.length > 0
355
+ },
356
+ /**
357
+ * Options to control the scroll into view behavior.
358
+ * Takes the same options as the `scrollIntoView` function
359
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView}
360
+ */
361
+ scrollOptions: {
362
+ type: [Boolean, Object],
363
+ default: null
337
364
  }
338
365
  },
339
- setup(t) {
340
- const l = t, e = O(0), s = r(() => l.steps.length - 1), v = r(() => s.value === 0);
341
- function d(a, n) {
366
+ emits: ["update:index"],
367
+ setup(t, { emit: r }) {
368
+ const e = t, u = B(e.index || 0), a = l(() => e.steps.length - 1), d = l(() => a.value === 0);
369
+ function _(s, n) {
342
370
  return {
343
371
  // Visual
344
- targetElement: a.target,
345
- image: a.image,
346
- title: a.title,
372
+ targetElement: s.target,
373
+ image: s.image,
374
+ title: s.title,
347
375
  step: n,
348
- totalSteps: s.value,
349
- action: a.action,
376
+ totalSteps: a.value,
377
+ action: s.action,
378
+ scrollOptions: e.scrollOptions,
350
379
  // Config
351
- active: n === e.value,
352
- single: v.value,
353
- position: a.position
380
+ active: n === u.value,
381
+ single: d.value,
382
+ position: s.position
354
383
  };
355
384
  }
356
- return (a, n) => (u(), b("div", Bt, [
357
- (u(!0), b(G, null, J(t.steps, (p, C) => (u(), S(o($t), R(d(p, C), {
358
- key: p.title,
359
- onFinish: n[0] || (n[0] = (g) => e.value = -1),
360
- onNext: n[1] || (n[1] = (g) => e.value += 1),
361
- onRestart: n[2] || (n[2] = (g) => e.value = 0)
385
+ return I(u, (s) => {
386
+ r("update:index", s);
387
+ }), I(
388
+ () => e.index,
389
+ (s) => {
390
+ s >= -1 && s <= a.value && (u.value = s);
391
+ }
392
+ ), (s, n) => (c(), b("div", $t, [
393
+ (c(!0), b(J, null, Q(t.steps, (g, C) => (c(), O(o(xt), N(_(g, C), {
394
+ key: g.title,
395
+ onFinish: n[0] || (n[0] = (h) => u.value = -1),
396
+ onNext: n[1] || (n[1] = (h) => u.value += 1),
397
+ onRestart: n[2] || (n[2] = (h) => u.value = 0)
362
398
  }), {
363
- default: f(() => [
364
- I(E(p.description), 1)
399
+ default: v(() => [
400
+ R(E(g.description), 1)
365
401
  ]),
366
402
  _: 2
367
403
  }, 1040))), 128))
@@ -369,6 +405,6 @@ const $t = /* @__PURE__ */ k(Et, [["__scopeId", "data-v-dc83a55d"]]), Bt = { cla
369
405
  }
370
406
  });
371
407
  export {
372
- Kt as BentoTutorial
408
+ jt as BentoTutorial
373
409
  };
374
410
  //# sourceMappingURL=tutorial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tutorial.js","sources":["../../vue2/src/components/tutorial/components/tutorial-popover/components/tutorial-indicator/tutorial-indicator.vue","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/blocked.vue","../../vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue","../../vue2/src/components/tutorial/tutorial.vue"],"sourcesContent":["<template>\n <popper-container\n :target-element=\"targetElement\"\n :middleware=\"middleware\"\n position=\"top-start\"\n fixed-positioning\n disabled-focus-trap\n class=\"b-tutorial-indicator\"\n data-testid=\"tutorial-indicator\"\n >\n <div class=\"b-tutorial-indicator__highlight\" :style=\"computedStyles\"></div>\n </popper-container>\n</template>\n\n<script setup lang=\"ts\">\n import { ref } from 'vue';\n import { hide, type Middleware, offset } from '@floating-ui/vue';\n import { PopperContainer } from '@/components/popper-container';\n\n const BORDER_OFFSET = 2;\n\n defineProps({\n /**\n * Tutorial indicator's target element.\n * The indicator will position itself around the target element.\n */\n targetElement: {\n type: PopperContainer.props?.targetElement.type,\n required: true,\n },\n });\n\n const computedStyles = ref({\n width: '0',\n height: '0',\n borderRadius: '0',\n });\n\n function getBorderRadius(element: HTMLElement) {\n try {\n const radius = parseFloat(getComputedStyle(element).getPropertyValue('border-radius'));\n return Number.isNaN(radius) ? '' : `${radius + 2 * BORDER_OFFSET}px`;\n } catch {\n return '';\n }\n }\n\n const middleware = [\n hide(),\n offset({\n mainAxis: BORDER_OFFSET,\n alignmentAxis: -BORDER_OFFSET,\n }),\n {\n name: 'updateIndicatorSize',\n fn: ({ x, y, elements }) => {\n const target = elements.reference as HTMLElement;\n computedStyles.value.width = `${target.offsetWidth + 4 * BORDER_OFFSET}px`;\n computedStyles.value.height = `${target.offsetHeight + 4 * BORDER_OFFSET}px`;\n computedStyles.value.borderRadius = getBorderRadius(target);\n return { x, y };\n },\n } as Middleware,\n ];\n</script>\n\n<style lang=\"scss\" scoped src=\"./tutorial-indicator.scss\" />\n","\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><g :clip-path=\"'url(#uia-icons-16-blocked__a' + uuid + ')'\"><path fill=\"#00112C\" d=\"M9.51195 0.398918C8.00859 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.704529 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8887 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.5555 10.9198 13.2667 11.4124 12.9177 11.8573L4.14271 3.0823C4.58761 2.73333 5.08018 2.44448 5.60823 2.22576ZM3.08208 4.14298L11.857 12.9179C11.7327 13.0154 11.6044 13.1085 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C2.89155 4.39564 2.98456 4.26733 3.08208 4.14298Z\"/></g><defs><clipPath :id=\"'uia-icons-16-blocked__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></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","<template>\n <div v-if=\"active && targetElement\">\n <tutorial-indicator v-if=\"isIndicatorVisible && targetElement\" :target-element=\"targetElement\" />\n\n <bento-popover\n :target-element=\"targetElement\"\n :position=\"position\"\n :open=\"isPopoverOpen\"\n :aria-label=\"title\"\n fixed-positioning\n class=\"b-tutorial-popover\"\n @keydown.esc.native=\"emit('finish')\"\n >\n <template v-if=\"image\" #image>\n <bento-image v-bind=\"image\" aspect-ratio=\"landscape\" class=\"b-tutorial-popover__image\" />\n </template>\n\n <div aria-hidden=\"true\" class=\"b-tutorial-popover__ripple\"></div>\n\n <div class=\"b-tutorial-popover__header\">\n <bento-typography variant=\"title\" el=\"span\"> {{ title }} </bento-typography>\n\n <bento-typography v-if=\"showSteps\" el=\"span\" class=\"b-tutorial-popover__steps\">\n {{ t('stepsOfTotal', { step, totalSteps }) }}\n </bento-typography>\n </div>\n\n <bento-typography>\n <slot />\n </bento-typography>\n\n <div class=\"b-tutorial-popover__footer\">\n <bento-menu\n v-if=\"!isFirstStep\"\n :data=\"menuData\"\n class=\"b-tutorial-popover__menu\"\n data-testid=\"menu-button\"\n />\n <div class=\"b-tutorial-popover__actions\">\n <bento-button-actions :actions=\"computedActions\" layout=\"buttons-end\" />\n </div>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, isRef, nextTick, PropType, ref, type default as Vue, watch } from 'vue';\n import { BentoMenu } from '@/components/menu';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { type BentoButtonActionObject, BentoButtonActions } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { TutorialIndicator } from './components/tutorial-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoMenuItem } from '@/components/menu/components';\n import type { VueNodeElement } from '@/types';\n import type { BentoTutorialStep } from '../../tutorial.types';\n import RefreshIcon from '@adyen/ui-assets-icons-16/vue/refresh';\n import BlockedIcon from '@adyen/ui-assets-icons-16/vue/blocked';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Optional configuration for the secondary action.\n * In tour tutorials, this is ignored for the introductory step.\n */\n action: {\n type: Object as PropType<BentoButtonActionObject>,\n default: null,\n },\n\n /**\n * Indicates whether this popover is the active step (and should be visible).\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Optional illustration to display at the top of the popover.\n */\n image: {\n type: Object as PropType<BentoTutorialStep['image']>,\n default: null,\n },\n\n /**\n * Popover's position relative to the target element.\n * Possible values are:\n * 'auto', 'auto-start', 'auto-end',\n * 'top', 'top-start', 'top-end'\n * 'right', 'right-start', 'right-end'\n * 'bottom', 'bottom-start', 'bottom-end'\n * 'left', 'left-start', 'left-end'\n */\n position: {\n type: String as PropType<`${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Indicates whether this popover is a single tutorial or a tour.\n */\n single: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The tutorial step number.\n * In tour tutorials, `0` is the introductory step, and is displayed next\n * to the title.\n */\n step: {\n type: Number,\n default: null,\n },\n\n /**\n * Tutorial popover's target element.\n * The popover will position itself relatively to target element.\n */\n targetElement: {\n type: [Element, Object] as PropType<VueNodeElement>,\n required: true,\n },\n\n /**\n * The tutorial step title.\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Total count of steps.\n * In tour tutorials, this does not include the introductory step, and is\n * displayed next to the title.\n */\n totalSteps: {\n type: Number,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const emit = defineEmits<{\n /**\n * Emitted when the user clicks the primary action in popovers during introductory or intermediate steps of tour tutorials\n */\n (e: 'next'): void;\n\n /**\n * Emitted when the user clicks the primary action in a single tutorial, the last step of a tour, or skips the tutorial\n */\n (e: 'finish'): void;\n\n /**\n * Emitted when the user selects the restart tour option\n */\n (e: 'restart'): void;\n }>();\n\n const ACTION_SKIP = computed<BentoButtonActionObject>(() => ({\n title: t('skipTour') as string,\n event: () => emit('finish'),\n }));\n\n const ACTION_START = computed<BentoButtonActionObject>(() => ({\n title: t('startTour') as string,\n event: () => emit('next'),\n }));\n\n const ACTION_NEXT = computed<BentoButtonActionObject>(() => ({\n title: t('next') as string,\n event: () => emit('next'),\n }));\n\n const ACTION_FINISH = computed<BentoButtonActionObject>(() => ({\n title: t('finish') as string,\n event: () => emit('finish'),\n }));\n\n const ACTION_OK = computed<BentoButtonActionObject>(() => ({\n title: t('ok') as string,\n event: () => emit('finish'),\n }));\n\n const isPopoverOpen = ref(false);\n const isIndicatorVisible = ref(false);\n\n const targetElement = computed(() => {\n if (isRef(props.targetElement)) {\n return ((props.targetElement.value as Vue)?.$el || props.targetElement.value) as HTMLElement;\n }\n return ((props.targetElement as Vue).$el || props.targetElement) as HTMLElement;\n });\n\n const isFirstStep = computed(() => props.step === 0);\n const isLastStep = computed(() => props.step === props.totalSteps);\n\n const showSteps = computed(() => !isFirstStep.value);\n\n const menuData = computed<BentoMenuItem[]>(() => [\n {\n text: t('restartTour'),\n handler: () => emit('restart'),\n icon: RefreshIcon,\n },\n ...(isLastStep.value\n ? []\n : [\n {\n text: 'Skip tour',\n handler: () => emit('finish'),\n icon: BlockedIcon,\n },\n ]),\n ]);\n\n const computedActions = computed(() => {\n let primaryAction: BentoButtonActionObject;\n if (isFirstStep.value) {\n primaryAction = props.single ? ACTION_OK.value : ACTION_START.value;\n } else if (isLastStep.value) {\n primaryAction = ACTION_FINISH.value;\n } else {\n primaryAction = ACTION_NEXT.value;\n }\n\n const actions = [primaryAction];\n if (isFirstStep.value && !props.single) {\n actions.push(ACTION_SKIP.value);\n } else if (props.action) {\n actions.push(props.action);\n }\n\n return actions;\n });\n\n watch(\n () => props.active,\n async isActive => {\n if (isActive && targetElement.value?.scrollIntoView) {\n targetElement.value?.scrollIntoView({ behavior: 'smooth' });\n\n // Skip to next tick to preserve popover appear animation\n await nextTick();\n }\n\n isPopoverOpen.value = isActive;\n isIndicatorVisible.value = isActive;\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./tutorial-popover.scss\" />\n","<template>\n <div class=\"b-tutorial\">\n <tutorial-popover\n v-for=\"(step, index) in steps\"\n v-bind=\"getPopoverProps(step, index)\"\n :key=\"step.title\"\n @finish=\"currentStep = -1\"\n @next=\"currentStep += 1\"\n @restart=\"currentStep = 0\"\n >\n {{ step.description }}\n </tutorial-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref } from 'vue';\n import { TutorialPopover } from './components/tutorial-popover';\n import type { BentoTutorialStep } from './tutorial.types';\n\n const props = defineProps({\n /**\n * The steps configuration for the tutorial.\n *\n */\n steps: {\n type: Array as PropType<BentoTutorialStep[]>,\n required: true,\n validator: (value: BentoTutorialStep[]) => value.length > 0,\n },\n });\n\n const currentStep = ref(0);\n\n const totalSteps = computed(() => props.steps.length - 1);\n const isSingleTutorial = computed(() => totalSteps.value === 0);\n\n function getPopoverProps(step: BentoTutorialStep, index: number) {\n return {\n // Visual\n targetElement: step.target,\n image: step.image,\n title: step.title,\n step: index,\n totalSteps: totalSteps.value,\n action: step.action,\n\n // Config\n active: index === currentStep.value,\n single: isSingleTutorial.value,\n position: step.position,\n };\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * The Tutorial is a temporary popover that should be used to educate users about\n * new or unfamiliar features or experiences.\n *\n * You can use single tutorial or chain them into a tour.\n *\n * Only use this component for new features/experiences that are not obvious and\n * self-explanatory on their own.\n *\n * @example\n * import { BentoTutorial } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTutorial },\n * template: `\n * <bento-tutorial\n * :steps=\"[\n * {\n * target: targetElement1,\n * title: 'Tutorial intro title',\n * description: 'Intro body content',\n * image: { src: imageSource, alt: 'Alt text' }\n * },\n * {\n * target: targetElement1,\n * title: 'Tutorial intro title',\n * description: 'Intro body content',\n * action: { title: 'Action label', event: () => {} }\n * },\n * ]\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n"],"names":["computedStyles","ref","getBorderRadius","element","radius","middleware","hide","offset","x","y","elements","target","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$2","toDisplayString","__default__$1","messages","t","useI18n","ACTION_SKIP","computed","emit","ACTION_START","ACTION_NEXT","ACTION_FINISH","ACTION_OK","isPopoverOpen","isIndicatorVisible","targetElement","isRef","props","_a","isFirstStep","isLastStep","showSteps","menuData","RefreshIcon","BlockedIcon","computedActions","primaryAction","actions","watch","isActive","_b","nextTick","__default__","currentStep","totalSteps","isSingleTutorial","getPopoverProps","step","index"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCI,UAAAA,IAAAC,EAAA;AAAA,MAA2B,OAAA;AAAA,MAChB,QAAA;AAAA,MACC,cAAA;AAAA,IACM,CAAA;AAGlB,aAAAC,EAAAC,GAAA;AACI,UAAA;AACI,cAAAC,IAAA,WAAA,iBAAAD,CAAA,EAAA,iBAAA,eAAA,CAAA;AACA,eAAA,OAAA,MAAAC,CAAA,IAAA,KAAA,GAAAA,IAAA,IAAA;AAAA,MAAmD,QAAA;AAEnD,eAAA;AAAA,MAAO;AAAA,IACX;AAGJ,UAAAC,IAAA;AAAA,MAAmBC,GAAA;AAAA,MACVC,GAAA;AAAA,QACE,UAAA;AAAA,QACO,eAAA;AAAA,MACM,CAAA;AAAA,MACnB;AAAA,QACD,MAAA;AAAA,QACU,IAAA,CAAA,EAAA,GAAAC,GAAA,GAAAC,GAAA,UAAAC,EAAA,MAAA;AAEF,gBAAAC,IAAAD,EAAA;AACA,iBAAAV,EAAA,MAAA,QAAA,GAAAW,EAAA,cAAA,IAAA,OACAX,EAAA,MAAA,SAAA,GAAAW,EAAA,eAAA,IAAA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AAA,IAAO,CAAA;AAGX,WAAAC;AAAA,MAAA,MAAAX,EAAA;AAAA,MACgB,OAAAY,MAAA;;AAER,QAAAA,OAAAX,IAAAH,EAAA,UAAA,QAAAG,EAAA,qBACIY,IAAAf,EAAA,UAAA,QAAAe,EAAA,eAAA,EAAA,UAAA,SAAA,IAGA,MAAAC,EAAA,IAGJlB,EAAA,QAAAgB,GACAf,EAAA,QAAAe;AAAA,MAA2B;AAAA,MAC/B,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oGC3KtBG,KAAA,CAAA;;;;;;;;;;;;;;;iBA1DAC,IAAAjD,EAAA,CAAA,GAEAkD,IAAA3B,EAAA,MAAAU,EAAA,MAAA,SAAA,CAAA,GACAkB,IAAA5B,EAAA,MAAA2B,EAAA,UAAA,CAAA;AAEA,aAAAE,EAAAC,GAAAC,GAAA;AACI,aAAA;AAAA;AAAA,QAAO,eAAAD,EAAA;AAAA,QAEiB,OAAAA,EAAA;AAAA,QACR,OAAAA,EAAA;AAAA,QACA,MAAAC;AAAA,QACN,YAAAJ,EAAA;AAAA,QACiB,QAAAG,EAAA;AAAA;AAAA,QACV,QAAAC,MAAAL,EAAA;AAAA,QAGiB,QAAAE,EAAA;AAAA,QACL,UAAAE,EAAA;AAAA,MACV;AAAA,IACnB;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"tutorial.js","sources":["../../vue2/src/components/tutorial/components/tutorial-popover/components/tutorial-indicator/tutorial-indicator.vue","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/blocked.vue","../../vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue","../../vue2/src/components/tutorial/tutorial.vue"],"sourcesContent":["<template>\n <popper-container\n :target-element=\"targetElement\"\n :middleware=\"middleware\"\n position=\"top-start\"\n fixed-positioning\n disabled-focus-trap\n class=\"b-tutorial-indicator\"\n data-testid=\"tutorial-indicator\"\n >\n <div class=\"b-tutorial-indicator__highlight\" :style=\"computedStyles\"></div>\n </popper-container>\n</template>\n\n<script setup lang=\"ts\">\n import { ref } from 'vue';\n import { hide, type Middleware, offset } from '@floating-ui/vue';\n import { PopperContainer } from '@/components/popper-container';\n\n const BORDER_OFFSET = 2;\n\n defineProps({\n /**\n * Tutorial indicator's target element.\n * The indicator will position itself around the target element.\n */\n targetElement: {\n type: PopperContainer.props?.targetElement.type,\n required: true,\n },\n });\n\n const computedStyles = ref({\n width: '0',\n height: '0',\n borderRadius: '0',\n });\n\n function getBorderRadius(element: HTMLElement) {\n try {\n const radius = parseFloat(getComputedStyle(element).getPropertyValue('border-radius'));\n return Number.isNaN(radius) ? '' : `${radius + 2 * BORDER_OFFSET}px`;\n } catch {\n return '';\n }\n }\n\n const middleware = [\n hide(),\n offset({\n mainAxis: BORDER_OFFSET,\n alignmentAxis: -BORDER_OFFSET,\n }),\n {\n name: 'updateIndicatorSize',\n fn: ({ x, y, elements }) => {\n const target = elements.reference as HTMLElement;\n computedStyles.value.width = `${target.offsetWidth + 4 * BORDER_OFFSET}px`;\n computedStyles.value.height = `${target.offsetHeight + 4 * BORDER_OFFSET}px`;\n computedStyles.value.borderRadius = getBorderRadius(target);\n return { x, y };\n },\n } as Middleware,\n ];\n</script>\n\n<style lang=\"scss\" scoped src=\"./tutorial-indicator.scss\" />\n","\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><g :clip-path=\"'url(#uia-icons-16-blocked__a' + uuid + ')'\"><path fill=\"#00112C\" d=\"M9.51195 0.398918C8.00859 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.704529 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8887 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.5555 10.9198 13.2667 11.4124 12.9177 11.8573L4.14271 3.0823C4.58761 2.73333 5.08018 2.44448 5.60823 2.22576ZM3.08208 4.14298L11.857 12.9179C11.7327 13.0154 11.6044 13.1085 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C2.89155 4.39564 2.98456 4.26733 3.08208 4.14298Z\"/></g><defs><clipPath :id=\"'uia-icons-16-blocked__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></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","<template>\n <div v-if=\"active && targetElement\">\n <tutorial-indicator v-if=\"isIndicatorVisible && targetElement\" :target-element=\"targetElement\" />\n\n <bento-popover\n :target-element=\"targetElement\"\n :position=\"position\"\n :open=\"isPopoverOpen\"\n :aria-label=\"title\"\n fixed-positioning\n class=\"b-tutorial-popover\"\n @keydown.esc.native=\"emit('finish')\"\n >\n <template v-if=\"image\" #image>\n <bento-image v-bind=\"image\" aspect-ratio=\"landscape\" class=\"b-tutorial-popover__image\" />\n </template>\n\n <div aria-hidden=\"true\" class=\"b-tutorial-popover__ripple\"></div>\n\n <div class=\"b-tutorial-popover__header\">\n <bento-typography variant=\"title\" el=\"span\"> {{ title }} </bento-typography>\n\n <bento-typography v-if=\"showSteps\" el=\"span\" class=\"b-tutorial-popover__steps\">\n {{ t('stepsOfTotal', { step, totalSteps }) }}\n </bento-typography>\n </div>\n\n <bento-typography>\n <slot />\n </bento-typography>\n\n <div class=\"b-tutorial-popover__footer\">\n <bento-menu\n v-if=\"!isFirstStep\"\n :data=\"menuData\"\n class=\"b-tutorial-popover__menu\"\n data-testid=\"menu-button\"\n />\n <div class=\"b-tutorial-popover__actions\">\n <bento-button-actions :actions=\"computedActions\" layout=\"buttons-end\" />\n </div>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, isRef, nextTick, PropType, ref, type default as Vue, watch } from 'vue';\n import { BentoMenu } from '@/components/menu';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { type BentoButtonActionObject, BentoButtonActions } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { TutorialIndicator } from './components/tutorial-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoMenuItem } from '@/components/menu/components';\n import type { VueNodeElement } from '@/types';\n import type { BentoTutorialScrollOptions, BentoTutorialStep } from '../../tutorial.types';\n import RefreshIcon from '@adyen/ui-assets-icons-16/vue/refresh';\n import BlockedIcon from '@adyen/ui-assets-icons-16/vue/blocked';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_SCROLL_OPTIONS: BentoTutorialScrollOptions = { behavior: 'smooth' };\n\n const props = defineProps({\n /**\n * Optional configuration for the secondary action.\n * In tour tutorials, this is ignored for the introductory step.\n */\n action: {\n type: Object as PropType<BentoButtonActionObject>,\n default: null,\n },\n\n /**\n * Indicates whether this popover is the active step (and should be visible).\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Optional illustration to display at the top of the popover.\n */\n image: {\n type: Object as PropType<BentoTutorialStep['image']>,\n default: null,\n },\n\n /**\n * Popover's position relative to the target element.\n * Possible values are:\n * 'auto', 'auto-start', 'auto-end',\n * 'top', 'top-start', 'top-end'\n * 'right', 'right-start', 'right-end'\n * 'bottom', 'bottom-start', 'bottom-end'\n * 'left', 'left-start', 'left-end'\n */\n position: {\n type: String as PropType<`${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Options to control the scroll into view behavior.\n * Takes the same options as the `scrollIntoView` function\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView}\n */\n scrollOptions: {\n type: [Boolean, Object] as PropType<BentoTutorialScrollOptions>,\n default: null,\n },\n\n /**\n * Indicates whether this popover is a single tutorial or a tour.\n */\n single: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The tutorial step number.\n * In tour tutorials, `0` is the introductory step, and is displayed next\n * to the title.\n */\n step: {\n type: Number,\n default: null,\n },\n\n /**\n * Tutorial popover's target element.\n * The popover will position itself relatively to target element.\n */\n targetElement: {\n type: [Element, Object] as PropType<VueNodeElement>,\n required: true,\n },\n\n /**\n * The tutorial step title.\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Total count of steps.\n * In tour tutorials, this does not include the introductory step, and is\n * displayed next to the title.\n */\n totalSteps: {\n type: Number,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const emit = defineEmits<{\n /**\n * Emitted when the user clicks the primary action in popovers during introductory or intermediate steps of tour tutorials\n */\n (e: 'next'): void;\n\n /**\n * Emitted when the user clicks the primary action in a single tutorial, the last step of a tour, or skips the tutorial\n */\n (e: 'finish'): void;\n\n /**\n * Emitted when the user selects the restart tour option\n */\n (e: 'restart'): void;\n }>();\n\n const ACTION_SKIP = computed<BentoButtonActionObject>(() => ({\n title: t('skipTour') as string,\n event: () => emit('finish'),\n }));\n\n const ACTION_START = computed<BentoButtonActionObject>(() => ({\n title: t('startTour') as string,\n event: () => emit('next'),\n }));\n\n const ACTION_NEXT = computed<BentoButtonActionObject>(() => ({\n title: t('next') as string,\n event: () => emit('next'),\n }));\n\n const ACTION_FINISH = computed<BentoButtonActionObject>(() => ({\n title: t('finish') as string,\n event: () => emit('finish'),\n }));\n\n const ACTION_OK = computed<BentoButtonActionObject>(() => ({\n title: t('ok') as string,\n event: () => emit('finish'),\n }));\n\n const isPopoverOpen = ref(false);\n const isIndicatorVisible = ref(false);\n\n const targetElement = computed(() => {\n if (isRef(props.targetElement)) {\n return ((props.targetElement.value as Vue)?.$el || props.targetElement.value) as HTMLElement;\n }\n return ((props.targetElement as Vue).$el || props.targetElement) as HTMLElement;\n });\n\n const isFirstStep = computed(() => props.step === 0);\n const isLastStep = computed(() => props.step === props.totalSteps);\n\n const showSteps = computed(() => !isFirstStep.value);\n\n const menuData = computed<BentoMenuItem[]>(() => [\n {\n text: t('restartTour'),\n handler: () => emit('restart'),\n icon: RefreshIcon,\n },\n ...(isLastStep.value\n ? []\n : [\n {\n text: 'Skip tour',\n handler: () => emit('finish'),\n icon: BlockedIcon,\n },\n ]),\n ]);\n\n const computedActions = computed(() => {\n let primaryAction: BentoButtonActionObject;\n if (isFirstStep.value) {\n primaryAction = props.single ? ACTION_OK.value : ACTION_START.value;\n } else if (isLastStep.value) {\n primaryAction = ACTION_FINISH.value;\n } else {\n primaryAction = ACTION_NEXT.value;\n }\n\n const actions = [primaryAction];\n if (isFirstStep.value && !props.single) {\n actions.push(ACTION_SKIP.value);\n } else if (props.action) {\n actions.push(props.action);\n }\n\n return actions;\n });\n\n watch(\n () => props.active,\n async isActive => {\n if (isActive && targetElement.value?.scrollIntoView) {\n targetElement.value?.scrollIntoView(\n props.scrollOptions != null ? props.scrollOptions : DEFAULT_SCROLL_OPTIONS\n );\n\n // Skip to next tick to preserve popover appear animation\n await nextTick();\n }\n\n isPopoverOpen.value = isActive;\n isIndicatorVisible.value = isActive;\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./tutorial-popover.scss\" />\n","<template>\n <div class=\"b-tutorial\">\n <tutorial-popover\n v-for=\"(step, i) in steps\"\n v-bind=\"getPopoverProps(step, i)\"\n :key=\"step.title\"\n @finish=\"currentStep = -1\"\n @next=\"currentStep += 1\"\n @restart=\"currentStep = 0\"\n >\n {{ step.description }}\n </tutorial-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, watch } from 'vue';\n import { TutorialPopover } from './components/tutorial-popover';\n import type { BentoTutorialScrollOptions, BentoTutorialStep } from './tutorial.types';\n\n const props = defineProps({\n /**\n * The current step index. If provided, will start the tutorial in that step.\n */\n index: {\n type: Number,\n default: null,\n },\n\n /**\n * The steps configuration for the tutorial.\n *\n */\n steps: {\n type: Array as PropType<BentoTutorialStep[]>,\n required: true,\n validator: (value: BentoTutorialStep[]) => value.length > 0,\n },\n\n /**\n * Options to control the scroll into view behavior.\n * Takes the same options as the `scrollIntoView` function\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView}\n */\n scrollOptions: {\n type: [Boolean, Object] as PropType<BentoTutorialScrollOptions>,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Fired every time the step index is changed. `-1` value means the tutorial is finished/skipped.\n */\n (e: 'update:index', value: number);\n }>();\n\n const currentStep = ref(props.index || 0);\n\n const totalSteps = computed(() => props.steps.length - 1);\n const isSingleTutorial = computed(() => totalSteps.value === 0);\n\n function getPopoverProps(step: BentoTutorialStep, index: number) {\n return {\n // Visual\n targetElement: step.target,\n image: step.image,\n title: step.title,\n step: index,\n totalSteps: totalSteps.value,\n action: step.action,\n scrollOptions: props.scrollOptions,\n\n // Config\n active: index === currentStep.value,\n single: isSingleTutorial.value,\n position: step.position,\n };\n }\n\n watch(currentStep, step => {\n emit('update:index', step);\n });\n\n watch(\n () => props.index,\n value => {\n if (value >= -1 && value <= totalSteps.value) {\n currentStep.value = value;\n }\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The Tutorial is a temporary popover that should be used to educate users about\n * new or unfamiliar features or experiences.\n *\n * You can use single tutorial or chain them into a tour.\n *\n * Only use this component for new features/experiences that are not obvious and\n * self-explanatory on their own.\n *\n * @example\n * import { BentoTutorial } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTutorial },\n * template: `\n * <bento-tutorial\n * :steps=\"[\n * {\n * target: targetElement1,\n * title: 'Tutorial intro title',\n * description: 'Intro body content',\n * image: { src: imageSource, alt: 'Alt text' }\n * },\n * {\n * target: targetElement1,\n * title: 'Tutorial intro title',\n * description: 'Intro body content',\n * action: { title: 'Action label', event: () => {} }\n * },\n * ]\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n"],"names":["computedStyles","ref","getBorderRadius","element","radius","middleware","hide","offset","x","y","elements","target","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$2","toDisplayString","__default__$1","messages","DEFAULT_SCROLL_OPTIONS","t","useI18n","ACTION_SKIP","computed","emit","ACTION_START","ACTION_NEXT","ACTION_FINISH","ACTION_OK","isPopoverOpen","isIndicatorVisible","targetElement","isRef","props","_a","isFirstStep","isLastStep","showSteps","menuData","RefreshIcon","BlockedIcon","computedActions","primaryAction","actions","watch","isActive","_b","nextTick","__default__","currentStep","totalSteps","isSingleTutorial","getPopoverProps","step","index","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCI,UAAAA,IAAAC,EAAA;AAAA,MAA2B,OAAA;AAAA,MAChB,QAAA;AAAA,MACC,cAAA;AAAA,IACM,CAAA;AAGlB,aAAAC,EAAAC,GAAA;AACI,UAAA;AACI,cAAAC,IAAA,WAAA,iBAAAD,CAAA,EAAA,iBAAA,eAAA,CAAA;AACA,eAAA,OAAA,MAAAC,CAAA,IAAA,KAAA,GAAAA,IAAA,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AAC;AAAA,QACN,YAAAJ,EAAA;AAAA,QACiB,QAAAG,EAAA;AAAA,QACV,eAAApB,EAAA;AAAA;AAAA,QACQ,QAAAqB,MAAAL,EAAA;AAAA,QAGS,QAAAE,EAAA;AAAA,QACL,UAAAE,EAAA;AAAA,MACV;AAAA,IACnB;AAGJ,WAAAT,EAAAK,GAAA,CAAAI,MAAA;AACI,MAAA7B,EAAA,gBAAA6B,CAAA;AAAA,IAAyB,CAAA,GAG7BT;AAAA,MAAA,MAAAX,EAAA;AAAA,MACgB,CAAAsB,MAAA;AAER,QAAAA,KAAA,MAAAA,KAAAL,EAAA,UACID,EAAA,QAAAM;AAAA,MACJ;AAAA,IACJ;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
@@ -1,4 +1,4 @@
1
- import { B as p, c as e, b as r, a as y } from "./chunks/index.11b6dd35.js";
1
+ import { B as p, c as e, b as r, a as y } from "./chunks/index.ee15db35.js";
2
2
  export {
3
3
  p as BentoTypography,
4
4
  e as BentoTypographyElement,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "@adyen/bento-vue3",
4
- "version": "1.25.0",
4
+ "version": "1.27.0",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",