@adyen/bento-vue2 1.26.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 (203) hide show
  1. package/dist/@types/components.d.ts +4 -0
  2. package/dist/@types/index.d.ts +513 -136
  3. package/dist/accordion.js +2 -2
  4. package/dist/action-bar.js +61 -146
  5. package/dist/action-bar.js.map +1 -1
  6. package/dist/alert.js +3 -3
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button-actions.css +1 -1
  9. package/dist/assets/button.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown.css +1 -1
  12. package/dist/assets/index.css +1 -1
  13. package/dist/assets/index10.css +1 -1
  14. package/dist/assets/index11.css +1 -1
  15. package/dist/assets/index12.css +1 -1
  16. package/dist/assets/index13.css +1 -1
  17. package/dist/assets/index14.css +1 -1
  18. package/dist/assets/index15.css +1 -1
  19. package/dist/assets/index16.css +1 -1
  20. package/dist/assets/index17.css +1 -1
  21. package/dist/assets/index18.css +1 -1
  22. package/dist/assets/index19.css +1 -1
  23. package/dist/assets/index2.css +1 -1
  24. package/dist/assets/index20.css +1 -1
  25. package/dist/assets/index21.css +1 -1
  26. package/dist/assets/index22.css +1 -1
  27. package/dist/assets/index23.css +1 -1
  28. package/dist/assets/index24.css +1 -1
  29. package/dist/assets/index25.css +1 -1
  30. package/dist/assets/index26.css +1 -1
  31. package/dist/assets/index27.css +1 -1
  32. package/dist/assets/index28.css +1 -1
  33. package/dist/assets/index29.css +1 -1
  34. package/dist/assets/index3.css +1 -1
  35. package/dist/assets/index30.css +1 -1
  36. package/dist/assets/index31.css +1 -1
  37. package/dist/assets/index32.css +1 -1
  38. package/dist/assets/index33.css +1 -1
  39. package/dist/assets/index34.css +1 -1
  40. package/dist/assets/index35.css +1 -1
  41. package/dist/assets/index36.css +1 -1
  42. package/dist/assets/index37.css +1 -1
  43. package/dist/assets/index38.css +1 -1
  44. package/dist/assets/index39.css +1 -1
  45. package/dist/assets/index4.css +1 -1
  46. package/dist/assets/index40.css +1 -1
  47. package/dist/assets/index41.css +1 -1
  48. package/dist/assets/index42.css +1 -1
  49. package/dist/assets/index43.css +1 -1
  50. package/dist/assets/index44.css +1 -1
  51. package/dist/assets/index45.css +1 -1
  52. package/dist/assets/index46.css +1 -1
  53. package/dist/assets/index47.css +1 -1
  54. package/dist/assets/index48.css +1 -1
  55. package/dist/assets/index49.css +1 -0
  56. package/dist/assets/index5.css +1 -1
  57. package/dist/assets/index6.css +1 -1
  58. package/dist/assets/index7.css +1 -1
  59. package/dist/assets/index8.css +1 -1
  60. package/dist/assets/index9.css +1 -1
  61. package/dist/assets/use-cached-selected-values.css +1 -1
  62. package/dist/avatar-image.js +1 -1
  63. package/dist/badge.js +1 -1
  64. package/dist/button.js +5 -5
  65. package/dist/card.js +3 -3
  66. package/dist/checkbox.js +5 -5
  67. package/dist/chunks/{base-button.ad74b6f8.js → base-button.852204dc.js} +2 -2
  68. package/dist/chunks/{base-button.ad74b6f8.js.map → base-button.852204dc.js.map} +1 -1
  69. package/dist/chunks/{base-modal.1fff7abe.js → base-modal.4fb7528b.js} +6 -6
  70. package/dist/chunks/{base-modal.1fff7abe.js.map → base-modal.4fb7528b.js.map} +1 -1
  71. package/dist/chunks/{button-actions-with-menu.e845d77a.js → button-actions-with-menu.bf968959.js} +4 -4
  72. package/dist/chunks/{button-actions-with-menu.e845d77a.js.map → button-actions-with-menu.bf968959.js.map} +1 -1
  73. package/dist/chunks/{button-actions.81db18e8.js → button-actions.87e589e3.js} +31 -29
  74. package/dist/chunks/button-actions.87e589e3.js.map +1 -0
  75. package/dist/chunks/button.cb90b55c.js +101 -0
  76. package/dist/chunks/button.cb90b55c.js.map +1 -0
  77. package/dist/chunks/{calendar.640b8d25.js → calendar.f02e0a5a.js} +5 -5
  78. package/dist/chunks/{calendar.640b8d25.js.map → calendar.f02e0a5a.js.map} +1 -1
  79. package/dist/chunks/{checkbox.bfed007c.js → checkbox.9f9c978a.js} +3 -3
  80. package/dist/chunks/{checkbox.bfed007c.js.map → checkbox.9f9c978a.js.map} +1 -1
  81. package/dist/chunks/{controls-group.4fb50009.js → controls-group.121a307d.js} +3 -3
  82. package/dist/chunks/{controls-group.4fb50009.js.map → controls-group.121a307d.js.map} +1 -1
  83. package/dist/chunks/{copy.f85700c6.js → copy.6808b2dc.js} +4 -4
  84. package/dist/chunks/{copy.f85700c6.js.map → copy.6808b2dc.js.map} +1 -1
  85. package/dist/chunks/{dialog-page.73da22cf.js → dialog-page.7fd7d006.js} +3 -3
  86. package/dist/chunks/{dialog-page.73da22cf.js.map → dialog-page.7fd7d006.js.map} +1 -1
  87. package/dist/chunks/{dropdown-default-textbox.54ca1b18.js → dropdown-default-textbox.d0f17d96.js} +3 -3
  88. package/dist/chunks/{dropdown-default-textbox.54ca1b18.js.map → dropdown-default-textbox.d0f17d96.js.map} +1 -1
  89. package/dist/chunks/{dropdown.10c034aa.js → dropdown.a8037bca.js} +188 -197
  90. package/dist/chunks/dropdown.a8037bca.js.map +1 -0
  91. package/dist/chunks/{error-message.31ec12b7.js → error-message.bdcc1020.js} +2 -2
  92. package/dist/chunks/{error-message.31ec12b7.js.map → error-message.bdcc1020.js.map} +1 -1
  93. package/dist/chunks/{events.58c00e6d.js → events.f14a214b.js} +5 -5
  94. package/dist/chunks/events.f14a214b.js.map +1 -0
  95. package/dist/chunks/{fixed-scroller.4eb9a9ac.js → fixed-scroller.82ef6187.js} +2 -2
  96. package/dist/chunks/{fixed-scroller.4eb9a9ac.js.map → fixed-scroller.82ef6187.js.map} +1 -1
  97. package/dist/chunks/{footer-actions.a1e09b4f.js → footer-actions.58d14a16.js} +4 -4
  98. package/dist/chunks/{footer-actions.a1e09b4f.js.map → footer-actions.58d14a16.js.map} +1 -1
  99. package/dist/chunks/{index.15b088b9.js → index.0a30d358.js} +6 -6
  100. package/dist/chunks/{index.15b088b9.js.map → index.0a30d358.js.map} +1 -1
  101. package/dist/chunks/{index.d553d3d1.js → index.1deef79e.js} +2 -2
  102. package/dist/chunks/{index.d553d3d1.js.map → index.1deef79e.js.map} +1 -1
  103. package/dist/chunks/index.3c69be27.js +85 -0
  104. package/dist/chunks/index.3c69be27.js.map +1 -0
  105. package/dist/chunks/index.561786f6.js +126 -0
  106. package/dist/chunks/index.561786f6.js.map +1 -0
  107. package/dist/chunks/{index.b21197ca.js → index.614a5138.js} +2 -2
  108. package/dist/chunks/{index.b21197ca.js.map → index.614a5138.js.map} +1 -1
  109. package/dist/chunks/{index.8b8c3b16.js → index.854d6498.js} +9 -9
  110. package/dist/chunks/{index.8b8c3b16.js.map → index.854d6498.js.map} +1 -1
  111. package/dist/chunks/{index.885d05a9.js → index.939dd5cf.js} +2 -2
  112. package/dist/chunks/{index.885d05a9.js.map → index.939dd5cf.js.map} +1 -1
  113. package/dist/chunks/{index.1ea85d4a.js → index.a48e7f99.js} +6 -6
  114. package/dist/chunks/{index.1ea85d4a.js.map → index.a48e7f99.js.map} +1 -1
  115. package/dist/chunks/{index.317fca12.js → index.bd1d28d0.js} +3 -3
  116. package/dist/chunks/{index.317fca12.js.map → index.bd1d28d0.js.map} +1 -1
  117. package/dist/chunks/{index.671768a1.js → index.c8621e8e.js} +3 -3
  118. package/dist/chunks/{index.671768a1.js.map → index.c8621e8e.js.map} +1 -1
  119. package/dist/chunks/{index.7eefc59c.js → index.ccc7e8d7.js} +3 -3
  120. package/dist/chunks/{index.7eefc59c.js.map → index.ccc7e8d7.js.map} +1 -1
  121. package/dist/chunks/{index.dd30e538.js → index.e29a6907.js} +2 -2
  122. package/dist/chunks/{index.dd30e538.js.map → index.e29a6907.js.map} +1 -1
  123. package/dist/chunks/{keyboard-navigation.ca47dfa8.js → keyboard-navigation.bbc3d15c.js} +2 -2
  124. package/dist/chunks/{keyboard-navigation.ca47dfa8.js.map → keyboard-navigation.bbc3d15c.js.map} +1 -1
  125. package/dist/chunks/{listbox-option-tag.6bbb6bbe.js → listbox-option-tag.8708be60.js} +3 -3
  126. package/dist/chunks/{listbox-option-tag.6bbb6bbe.js.map → listbox-option-tag.8708be60.js.map} +1 -1
  127. package/dist/chunks/{loading-button.eafc9e1b.js → loading-button.692dbdc8.js} +2 -2
  128. package/dist/chunks/{loading-button.eafc9e1b.js.map → loading-button.692dbdc8.js.map} +1 -1
  129. package/dist/chunks/{payment-method.6c1ce07c.js → payment-method.c55dd352.js} +2 -2
  130. package/dist/chunks/{payment-method.6c1ce07c.js.map → payment-method.c55dd352.js.map} +1 -1
  131. package/dist/chunks/{tooltip.58ef3f4a.js → tooltip.efddb5f3.js} +4 -4
  132. package/dist/chunks/{tooltip.58ef3f4a.js.map → tooltip.efddb5f3.js.map} +1 -1
  133. package/dist/chunks/{use-bento-toast-controller.c3277f73.js → use-bento-toast-controller.5dac1f3c.js} +2 -2
  134. package/dist/chunks/{use-bento-toast-controller.c3277f73.js.map → use-bento-toast-controller.5dac1f3c.js.map} +1 -1
  135. package/dist/chunks/{use-cached-selected-values.69297473.js → use-cached-selected-values.98a9ed01.js} +225 -206
  136. package/dist/chunks/use-cached-selected-values.98a9ed01.js.map +1 -0
  137. package/dist/code-snippet.js +131 -129
  138. package/dist/code-snippet.js.map +1 -1
  139. package/dist/country.js +2 -2
  140. package/dist/currency.js +1 -1
  141. package/dist/dashboard-template.js +109 -0
  142. package/dist/dashboard-template.js.map +1 -0
  143. package/dist/data-grid-template.js +1 -1
  144. package/dist/data-grid.js +78 -70
  145. package/dist/data-grid.js.map +1 -1
  146. package/dist/date-picker.js +8 -8
  147. package/dist/date-range-picker.js +2 -2
  148. package/dist/date.js +1 -1
  149. package/dist/divider.js +1 -1
  150. package/dist/dropdown.js +7 -7
  151. package/dist/empty-state.js +3 -3
  152. package/dist/filter-bar.js +77 -75
  153. package/dist/filter-bar.js.map +1 -1
  154. package/dist/focus-trap.js +1 -1
  155. package/dist/form-layout.js +2 -2
  156. package/dist/header.js +4 -4
  157. package/dist/index.js +82 -79
  158. package/dist/index.js.map +1 -1
  159. package/dist/info-icon.js +3 -3
  160. package/dist/input-field.js +4 -4
  161. package/dist/internal.js +8 -8
  162. package/dist/link.js +1 -1
  163. package/dist/loading-indicator.js +1 -1
  164. package/dist/menu.js +1 -1
  165. package/dist/modal-fullscreen.js +6 -6
  166. package/dist/modal.js +6 -6
  167. package/dist/pagination.js +4 -4
  168. package/dist/payment-method.js +1 -1
  169. package/dist/popover.js +1 -1
  170. package/dist/popper-container.js +1 -1
  171. package/dist/radio-group.js +4 -4
  172. package/dist/search-bar.js +2 -2
  173. package/dist/secondary-nav.js +2 -2
  174. package/dist/segmented-control.js +40 -41
  175. package/dist/segmented-control.js.map +1 -1
  176. package/dist/selection-card.js +4 -4
  177. package/dist/sidepanel.js +6 -6
  178. package/dist/status.js +2 -2
  179. package/dist/stepper.js +4 -4
  180. package/dist/structured-list.js +1 -1
  181. package/dist/summary-grid.js +3 -3
  182. package/dist/tabs.js +68 -67
  183. package/dist/tabs.js.map +1 -1
  184. package/dist/tag.js +3 -3
  185. package/dist/textarea.js +4 -4
  186. package/dist/timeline.js +7 -7
  187. package/dist/toast.js +4 -4
  188. package/dist/toggle.js +2 -2
  189. package/dist/tutorial.js +68 -53
  190. package/dist/tutorial.js.map +1 -1
  191. package/dist/typography.js +1 -1
  192. package/dist/web-types.json +133 -70
  193. package/package.json +9 -6
  194. package/dist/chunks/button-actions.81db18e8.js.map +0 -1
  195. package/dist/chunks/button.9d6435ae.js +0 -100
  196. package/dist/chunks/button.9d6435ae.js.map +0 -1
  197. package/dist/chunks/checkmark.a6ed8f47.js +0 -26
  198. package/dist/chunks/checkmark.a6ed8f47.js.map +0 -1
  199. package/dist/chunks/dropdown.10c034aa.js.map +0 -1
  200. package/dist/chunks/events.58c00e6d.js.map +0 -1
  201. package/dist/chunks/index.aaf965f8.js +0 -147
  202. package/dist/chunks/index.aaf965f8.js.map +0 -1
  203. package/dist/chunks/use-cached-selected-values.69297473.js.map +0 -1
package/dist/tabs.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as m, toRefs as E, ref as b, provide as u, computed as w, inject as T, onUnmounted as A, watch as N, nextTick as B } from "vue";
2
- import { E as k, T as I, a as y } from "./chunks/tabs.keys.358742f2.js";
3
- import { n as g } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
4
- import { B as R } from "./chunks/index.dd30e538.js";
5
- import { g as D } from "./chunks/unique-id.a2a2b458.js";
6
- import { F as S } from "./chunks/fixed-scroller.4eb9a9ac.js";
7
- import "./assets/index43.css";
8
- const K = m({
1
+ import { defineComponent as I, toRefs as w, ref as b, provide as p, computed as A, inject as m, onUnmounted as N, watch as B, nextTick as k } from "vue";
2
+ import { E as R, T as y, a as g } from "./chunks/tabs.keys.358742f2.js";
3
+ import { n as h } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
4
+ import { B as D } from "./chunks/index.e29a6907.js";
5
+ import { g as S } from "./chunks/unique-id.a2a2b458.js";
6
+ import { F as K } from "./chunks/fixed-scroller.82ef6187.js";
7
+ import "./assets/index22.css";
8
+ const F = I({
9
9
  props: {
10
10
  /**
11
11
  * Title of the tab
@@ -29,40 +29,40 @@ const K = m({
29
29
  default: !1
30
30
  }
31
31
  },
32
- setup(n) {
33
- const { disabled: e, withNotificationIndicator: t } = E(n), l = b();
34
- u(k, (s) => {
35
- l.value = s;
32
+ setup(a) {
33
+ const { disabled: e, withNotificationIndicator: t } = w(a), l = b();
34
+ p(R, (T) => {
35
+ l.value = T;
36
36
  });
37
- const d = w(() => l.value ?? n.title), _ = T(I), r = T(y), { id: v, unregisterTab: p } = _({ disabled: e, title: d, withNotificationIndicator: t });
38
- return A(() => p()), { activeTabId: r, id: v, computedTitle: d };
37
+ const r = A(() => l.value ?? a.title), _ = m(y), c = m(g), { id: u, unregisterTab: v } = _({ disabled: e, title: r, withNotificationIndicator: t });
38
+ return N(() => v()), { activeTabId: c, id: u, computedTitle: r };
39
39
  }
40
40
  });
41
- var F = function() {
41
+ var L = function() {
42
42
  var e = this, t = e._self._c;
43
43
  return e._self._setupProxy, t("div", { directives: [{ name: "show", rawName: "v-show", value: e.activeTabId === e.id, expression: "activeTabId === id" }], staticClass: "b-tab", attrs: { id: `${e.id}-tabpanel`, role: "tabpanel", "aria-labelledby": e.id } }, [e.activeTabId === e.id ? [e._t("default")] : e._e()], 2);
44
- }, L = [], O = /* @__PURE__ */ g(
45
- K,
44
+ }, O = [], X = /* @__PURE__ */ h(
46
45
  F,
47
46
  L,
47
+ O,
48
48
  !1,
49
49
  null,
50
50
  "7e802d0d",
51
51
  null,
52
52
  null
53
53
  );
54
- const H = O.exports, h = (n, e) => {
55
- const t = n === 0 ? e.length - 1 : n - 1;
56
- return e[t].disabled ? h(t, e) : t;
57
- }, x = (n, e) => {
58
- const t = n === e.length - 1 ? 0 : n + 1;
54
+ const M = X.exports, x = (a, e) => {
55
+ const t = a === 0 ? e.length - 1 : a - 1;
59
56
  return e[t].disabled ? x(t, e) : t;
57
+ }, C = (a, e) => {
58
+ const t = a === e.length - 1 ? 0 : a + 1;
59
+ return e[t].disabled ? C(t, e) : t;
60
60
  };
61
- var f = /* @__PURE__ */ ((n) => (n.ACTIVE_TAB_INDEX = "update:active-tab-index", n))(f || {});
62
- const X = m({
61
+ var f = /* @__PURE__ */ ((a) => (a.ACTIVE_TAB_INDEX = "update:active-tab-index", a))(f || {});
62
+ const Y = I({
63
63
  components: {
64
- BentoTypography: R,
65
- FixedScroller: S
64
+ BentoTypography: D,
65
+ FixedScroller: K
66
66
  },
67
67
  props: {
68
68
  /**
@@ -71,73 +71,74 @@ const X = m({
71
71
  activeTabIndex: { type: Number, default: 0 }
72
72
  },
73
73
  emits: [f.ACTIVE_TAB_INDEX],
74
- setup(n, { emit: e }) {
75
- const t = b([]), l = b(null), a = b("");
76
- u(y, a);
77
- const d = (s) => () => {
74
+ setup(a, { emit: e }) {
75
+ const t = b([]), l = b(null), i = b(), r = b("");
76
+ p(g, r);
77
+ const _ = (n) => () => {
78
78
  var o;
79
- t.value = (o = t.value) == null ? void 0 : o.filter(({ id: i }) => i !== s);
79
+ t.value = (o = t.value) == null ? void 0 : o.filter(({ id: s }) => s !== n);
80
80
  };
81
- u(I, ({ title: s, disabled: o, withNotificationIndicator: i }) => {
82
- const c = D("b-tab");
83
- return t.value.push({ disabled: o, id: c, title: s, withNotificationIndicator: i }), { id: c, unregisterTab: d(c) };
81
+ p(y, ({ title: n, disabled: o, withNotificationIndicator: s }) => {
82
+ const d = S("b-tab");
83
+ return t.value.push({ disabled: o, id: d, title: n, withNotificationIndicator: s }), { id: d, unregisterTab: _(d) };
84
84
  });
85
- const r = (s) => {
86
- if (s.code === "ArrowLeft" || s.code === "ArrowRight") {
87
- const o = t.value.find((c) => document.activeElement.id === c.id);
88
- let i = t.value.indexOf(o);
89
- s.code === "ArrowLeft" ? i = h(i, t.value) : s.code === "ArrowRight" && (i = x(i, t.value)), l.value.children[i].focus();
85
+ const u = (n) => {
86
+ if (n.code === "ArrowLeft" || n.code === "ArrowRight") {
87
+ const o = t.value.find((d) => document.activeElement.id === d.id);
88
+ let s = t.value.indexOf(o);
89
+ n.code === "ArrowLeft" ? s = x(s, t.value) : n.code === "ArrowRight" && (s = C(s, t.value)), l.value.children[s].focus();
90
90
  }
91
91
  };
92
- return N(
93
- [() => n.activeTabIndex, t],
94
- ([s, o]) => {
95
- B(() => {
96
- var c;
97
- const i = o[s];
98
- a.value = i && !i.disabled ? i.id : (c = t.value.find(({ disabled: C }) => !C)) == null ? void 0 : c.id;
92
+ return B(
93
+ [() => a.activeTabIndex, t],
94
+ ([n, o]) => {
95
+ k(() => {
96
+ var d;
97
+ const s = o[n];
98
+ r.value = s && !s.disabled ? s.id : (d = t.value.find(({ disabled: E }) => !E)) == null ? void 0 : d.id;
99
99
  });
100
100
  },
101
101
  { immediate: !0 }
102
102
  ), {
103
103
  tabs: t,
104
104
  tablist: l,
105
- activeTabId: a,
106
- onKeydownTabsNavigation: r,
107
- handleTabChange: (s) => {
108
- a.value = s;
109
- const o = t.value.findIndex(({ id: i }) => i === a.value);
105
+ tablistwrapper: i,
106
+ activeTabId: r,
107
+ onKeydownTabsNavigation: u,
108
+ handleTabChange: (n) => {
109
+ r.value = n;
110
+ const o = t.value.findIndex(({ id: s }) => s === r.value);
110
111
  e(f.ACTIVE_TAB_INDEX, o);
111
112
  },
112
- isDisabled: (s) => s ? "disabled" : !1
113
+ isDisabled: (n) => n ? "disabled" : !1
113
114
  };
114
115
  }
115
116
  });
116
- var Y = function() {
117
+ var P = function() {
117
118
  var e = this, t = e._self._c;
118
- return e._self._setupProxy, t("div", { staticClass: "b-tabs" }, [t("fixed-scroller", { staticClass: "b-tabs__tab-list-wrapper", attrs: { condensed: "", "extra-padding-top": 5 } }, [t("div", { ref: "tablist", staticClass: "b-tabs__tab-list", attrs: { role: "tablist" }, on: { keydown: e.onKeydownTabsNavigation } }, e._l(e.tabs, function({ disabled: l, id: a, title: d, withNotificationIndicator: _ }) {
119
- return t("button", { key: a, staticClass: "b-tabs__tab", class: {
120
- "b-tabs__tab--active": e.activeTabId === a,
119
+ return e._self._setupProxy, t("div", { staticClass: "b-tabs" }, [t("fixed-scroller", { ref: "tablistwrapper", staticClass: "b-tabs__tab-list-wrapper", attrs: { condensed: "", "extra-padding-top": 5 } }, [t("div", { ref: "tablist", staticClass: "b-tabs__tab-list", attrs: { role: "tablist" }, on: { keydown: e.onKeydownTabsNavigation } }, e._l(e.tabs, function({ disabled: l, id: i, title: r, withNotificationIndicator: _ }) {
120
+ return t("button", { key: i, staticClass: "b-tabs__tab", class: {
121
+ "b-tabs__tab--active": e.activeTabId === i,
121
122
  "b-tabs__tab--disabled": l
122
- }, attrs: { id: a, role: "tab", type: "button", "aria-controls": `${a}-tabpanel`, "aria-selected": e.activeTabId === a ? "true" : "false", tabindex: e.activeTabId === a && !l.value ? null : -1, disabled: e.isDisabled(l) }, on: { click: function(r) {
123
- return e.handleTabChange(a);
124
- }, keydown: function(r) {
125
- return !r.type.indexOf("key") && e._k(r.keyCode, "enter", 13, r.key, "Enter") && e._k(r.keyCode, "space", 32, r.key, [" ", "Spacebar"]) ? null : e.handleTabChange(a);
126
- } } }, [t("span", { staticClass: "b-tabs__tab-text" }, [t("bento-typography", { staticClass: "b-tabs__tab-title", attrs: { el: "span", variant: "body", stronger: "" } }, [e._v(" " + e._s(d) + " ")]), _ ? t("span", { staticClass: "b-tabs__tab-notification-dot", attrs: { "aria-hidden": "true" } }) : e._e()], 1), t("span", { directives: [{ name: "show", rawName: "v-show", value: e.activeTabId === a, expression: "activeTabId === id" }], staticClass: "b-tabs__tab-underline", attrs: { "aria-hidden": "true" } })]);
123
+ }, attrs: { id: i, role: "tab", type: "button", "aria-controls": `${i}-tabpanel`, "aria-selected": e.activeTabId === i ? "true" : "false", tabindex: e.activeTabId === i && !l.value ? null : -1, disabled: e.isDisabled(l) }, on: { click: function(c) {
124
+ return e.handleTabChange(i);
125
+ }, keydown: function(c) {
126
+ return !c.type.indexOf("key") && e._k(c.keyCode, "enter", 13, c.key, "Enter") && e._k(c.keyCode, "space", 32, c.key, [" ", "Spacebar"]) ? null : e.handleTabChange(i);
127
+ } } }, [t("span", { staticClass: "b-tabs__tab-text" }, [t("bento-typography", { staticClass: "b-tabs__tab-title", attrs: { el: "span", variant: "body", stronger: "" } }, [e._v(" " + e._s(r) + " ")]), _ ? t("span", { staticClass: "b-tabs__tab-notification-dot", attrs: { "aria-hidden": "true" } }) : e._e()], 1), t("span", { directives: [{ name: "show", rawName: "v-show", value: e.activeTabId === i, expression: "activeTabId === id" }], staticClass: "b-tabs__tab-underline", attrs: { "aria-hidden": "true" } })]);
127
128
  }), 0)]), e._t("default")], 2);
128
- }, P = [], $ = /* @__PURE__ */ g(
129
- X,
129
+ }, $ = [], G = /* @__PURE__ */ h(
130
130
  Y,
131
131
  P,
132
+ $,
132
133
  !1,
133
134
  null,
134
- "7c9f829f",
135
+ "7fc977e3",
135
136
  null,
136
137
  null
137
138
  );
138
- const M = $.exports;
139
+ const Q = G.exports;
139
140
  export {
140
- H as BentoTab,
141
- M as BentoTabs
141
+ M as BentoTab,
142
+ Q as BentoTabs
142
143
  };
143
144
  //# sourceMappingURL=tabs.js.map
package/dist/tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../src/components/tabs/components/tab.vue","../src/components/tabs/tabs.utils.ts","../src/components/tabs/tabs.types.ts","../src/components/tabs/tabs.vue"],"sourcesContent":["<template>\n <div v-show=\"activeTabId === id\" :id=\"`${id}-tabpanel`\" class=\"b-tab\" role=\"tabpanel\" :aria-labelledby=\"id\">\n <template v-if=\"activeTabId === id\">\n <slot />\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, ref, toRefs } from 'vue';\n import {\n EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY,\n TABS_ACTIVE_TAB_ID_KEY,\n TABS_REGISTER_TAB_INJECTION_KEY,\n } from '../tabs.keys';\n import { BentoTabsRegisterTab } from '../tabs.types';\n import { BentoTabProvidedTitle } from './tab.types';\n\n export default defineComponent({\n props: {\n /**\n * Title of the tab\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Determines whether the tab is disabled\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays the tab with a notification indicator\n */\n withNotificationIndicator: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n // External title injection\n const { disabled, withNotificationIndicator } = toRefs(props);\n const componentTitle = ref();\n const setTitle: BentoTabProvidedTitle = (value: string) => {\n componentTitle.value = value;\n };\n provide(EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY, setTitle);\n\n const computedTitle = computed(() => (componentTitle.value ?? props.title) as string);\n\n const registerTab: BentoTabsRegisterTab = inject(TABS_REGISTER_TAB_INJECTION_KEY);\n const activeTabId = inject(TABS_ACTIVE_TAB_ID_KEY);\n\n const { id, unregisterTab } = registerTab({ disabled, title: computedTitle, withNotificationIndicator });\n\n onUnmounted(() => unregisterTab());\n\n return { activeTabId, id, computedTitle };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./tab.scss\" />\n","import { BentoTab } from './components/tab.types';\n\nexport const getPreviousTabIndex = (activeTabIndex: number, tabsValue: BentoTab[]) => {\n const newActiveTabIndex = activeTabIndex === 0 ? tabsValue.length - 1 : activeTabIndex - 1;\n if (tabsValue[newActiveTabIndex].disabled) {\n return getPreviousTabIndex(newActiveTabIndex, tabsValue);\n }\n return newActiveTabIndex;\n};\n\nexport const getNextTabIndex = (activeTabIndex: number, tabsValue: BentoTab[]) => {\n const newActiveTabIndex = activeTabIndex === tabsValue.length - 1 ? 0 : activeTabIndex + 1;\n if (tabsValue[newActiveTabIndex].disabled) {\n return getNextTabIndex(newActiveTabIndex, tabsValue);\n }\n return newActiveTabIndex;\n};\n","import type { Ref } from 'vue';\n\nexport type BentoTabsRegisterTab = (props: {\n disabled: Ref<boolean>;\n title: Ref<string>;\n withNotificationIndicator: Ref<boolean>;\n}) => { id: string; unregisterTab: () => void };\n\nexport enum BentoTabsEvent {\n ACTIVE_TAB_INDEX = 'update:active-tab-index',\n}\n","<template>\n <div class=\"b-tabs\">\n <fixed-scroller condensed :extra-padding-top=\"5\" class=\"b-tabs__tab-list-wrapper\">\n <div ref=\"tablist\" class=\"b-tabs__tab-list\" role=\"tablist\" @keydown=\"onKeydownTabsNavigation\">\n <button\n v-for=\"{ disabled, id, title, withNotificationIndicator } in tabs\"\n :id=\"id\"\n :key=\"id\"\n role=\"tab\"\n type=\"button\"\n class=\"b-tabs__tab\"\n :class=\"{\n 'b-tabs__tab--active': activeTabId === id,\n 'b-tabs__tab--disabled': disabled,\n }\"\n :aria-controls=\"`${id}-tabpanel`\"\n :aria-selected=\"activeTabId === id ? 'true' : 'false'\"\n :tabindex=\"activeTabId === id && !disabled.value ? null : -1\"\n :disabled=\"isDisabled(disabled)\"\n @click=\"handleTabChange(id)\"\n @keydown.enter.space=\"handleTabChange(id)\"\n >\n <span class=\"b-tabs__tab-text\">\n <bento-typography class=\"b-tabs__tab-title\" el=\"span\" variant=\"body\" stronger>\n {{ title }}\n </bento-typography>\n <span\n v-if=\"withNotificationIndicator\"\n class=\"b-tabs__tab-notification-dot\"\n aria-hidden=\"true\"\n ></span>\n </span>\n <span v-show=\"activeTabId === id\" class=\"b-tabs__tab-underline\" aria-hidden=\"true\"></span>\n </button>\n </div>\n </fixed-scroller>\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, nextTick, provide, ref, Ref, watch } from 'vue';\n\n // components\n import { BentoTypography } from '@/components/typography';\n import { FixedScroller } from '@/internal';\n\n // utils\n import { generateUid } from '@/utils/ts/unique-id';\n import { getNextTabIndex, getPreviousTabIndex } from './tabs.utils';\n\n // types\n import { BentoTab } from './components/tab.types';\n import { BentoTabsEvent, BentoTabsRegisterTab } from './tabs.types';\n\n // keys\n import { TABS_ACTIVE_TAB_ID_KEY, TABS_REGISTER_TAB_INJECTION_KEY } from './tabs.keys';\n import { Booleanish } from '@/types';\n\n /**\n * Tabs are used to navigate between different, but related content views within a page.\n * This component conforms to the official WAI-ARIA guidelines for tabs: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n *\n * @example\n * import { BentoTabs, BentoTab } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTabs, BentoTab },\n * template: `\n * <bento-tabs v-bind=\"$props\">\n * <bento-tab title=\"Maria Ahlefeldt\">\n * (16 January 1755 - 20 December 1810) was a Danish, (originally German), composer. She is known as the first female composer in Denmark.\n * </bento-tab>\n * <bento-tab title=\"Carl Andersen\">\n * (29 April 1847 - 7 May 1909) was a Danish flutist, conductor and composer born in Copenhagen, son of the flutist Christian Joachim Andersen.\n * </bento-tab>\n * <bento-tab title=\"Karl Truffel\">\n * (1 March 1981 - 7 November 1992) was a Danish dog and commander born in Berlin, son of the machinist Tom Jahoor Truffel.\n * </bento-tab>\n * <bento-tab title=\"Maria Ahlefeldt\" :disabled=\"true\">\n * (16 January 1755 - 20 December 1810) was a Danish, (originally German), composer. She is known as the first female composer in Denmark.\n * </bento-tab>\n * </bento-tabs>\n * `\n * };\n */\n\n // component\n export default defineComponent({\n components: {\n BentoTypography,\n FixedScroller,\n },\n props: {\n /**\n * Sets the active tab by its index (0 being the first tab item).\n */\n activeTabIndex: { type: Number, default: 0 },\n },\n emits: [BentoTabsEvent.ACTIVE_TAB_INDEX],\n setup(props, { emit }) {\n const tabs: Ref<BentoTab[]> = ref([]);\n const tablist = ref(null);\n const activeTabId = ref('');\n\n provide(TABS_ACTIVE_TAB_ID_KEY, activeTabId);\n\n // unregister tab if removed / destroyed\n const unregisterTab = (tabIdToRemove: string) => () => {\n tabs.value = tabs.value?.filter(({ id }) => id !== tabIdToRemove);\n };\n\n // register tab\n const registerTab: BentoTabsRegisterTab = ({ title, disabled, withNotificationIndicator }) => {\n const id = generateUid('b-tab');\n\n // add tab to tabs\n tabs.value.push({ disabled, id, title, withNotificationIndicator });\n\n // return values to the Tab component\n return { id, unregisterTab: unregisterTab(id) };\n };\n\n // provide activeTab and registerTab to tab items\n provide(TABS_REGISTER_TAB_INJECTION_KEY, registerTab);\n\n // keyboard navigation\n const onKeydownTabsNavigation = (e: KeyboardEvent) => {\n if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') {\n // find tab that is focussed\n const activeTab = tabs.value.find(tab => document.activeElement.id === tab.id);\n let activeTabIndex = tabs.value.indexOf(activeTab);\n\n // conditionally increase or decrease the\n if (e.code === 'ArrowLeft') {\n activeTabIndex = getPreviousTabIndex(activeTabIndex, tabs.value);\n } else if (e.code === 'ArrowRight') {\n activeTabIndex = getNextTabIndex(activeTabIndex, tabs.value);\n }\n\n // focus new active tab\n tablist.value.children[activeTabIndex].focus();\n }\n };\n\n watch(\n [() => props.activeTabIndex, tabs],\n ([index, currentTabs]) => {\n nextTick(() => {\n const tab = currentTabs[index];\n activeTabId.value =\n tab && !tab.disabled ? tab.id : tabs.value.find(({ disabled }) => !disabled)?.id;\n });\n },\n { immediate: true }\n );\n\n const handleTabChange = (tabId: string) => {\n activeTabId.value = tabId;\n const activeIndex = tabs.value.findIndex(({ id }) => id === activeTabId.value);\n emit(BentoTabsEvent.ACTIVE_TAB_INDEX, activeIndex);\n };\n\n const isDisabled = (isDisabledTab: Ref<boolean>): Booleanish =>\n (isDisabledTab ? 'disabled' : false) as Booleanish;\n\n return {\n tabs,\n tablist,\n activeTabId,\n onKeydownTabsNavigation,\n handleTabChange,\n isDisabled,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./tabs.scss\" />\n"],"names":["_sfc_main$1","defineComponent","props","disabled","withNotificationIndicator","toRefs","componentTitle","ref","provide","EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY","value","computedTitle","computed","registerTab","inject","TABS_REGISTER_TAB_INJECTION_KEY","activeTabId","TABS_ACTIVE_TAB_ID_KEY","id","unregisterTab","onUnmounted","getPreviousTabIndex","activeTabIndex","tabsValue","newActiveTabIndex","getNextTabIndex","BentoTabsEvent","BentoTabsEvent2","_sfc_main","BentoTypography","FixedScroller","emit","tabs","tablist","tabIdToRemove","_a","title","generateUid","onKeydownTabsNavigation","e","activeTab","tab","watch","index","currentTabs","nextTick","tabId","activeIndex","isDisabledTab"],"mappings":";;;;;;;AAkBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,2BAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAGA,UAAA,EAAA,UAAAC,GAAA,2BAAAC,EAAA,IAAAC,EAAAH,CAAA,GACAI,IAAAC,EAAA;AAIA,IAAAC,EAAAC,GAHA,CAAAC,MAAA;AACA,MAAAJ,EAAA,QAAAI;AAAA,IAAA,C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AAAA,MACA,aAAAjB;AAAA,MACA,yBAAAsB;AAAA,MACA,iBAbA,CAAAQ,MAAA;AACA,QAAA9B,EAAA,QAAA8B;AACA,cAAAC,IAAAf,EAAA,MAAA,UAAA,CAAA,EAAA,IAAAd,EAAA,MAAAA,MAAAF,EAAA,KAAA;AACA,QAAAe,EAAAL,EAAA,kBAAAqB,CAAA;AAAA,MAAA;AAAA,MAWA,YARA,CAAAC,MAAAA,IAAA,aAAA;AAAA,IASA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tabs.js","sources":["../src/components/tabs/components/tab.vue","../src/components/tabs/tabs.utils.ts","../src/components/tabs/tabs.types.ts","../src/components/tabs/tabs.vue"],"sourcesContent":["<template>\n <div v-show=\"activeTabId === id\" :id=\"`${id}-tabpanel`\" class=\"b-tab\" role=\"tabpanel\" :aria-labelledby=\"id\">\n <template v-if=\"activeTabId === id\">\n <slot />\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, provide, ref, toRefs } from 'vue';\n import {\n EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY,\n TABS_ACTIVE_TAB_ID_KEY,\n TABS_REGISTER_TAB_INJECTION_KEY,\n } from '../tabs.keys';\n import { BentoTabsRegisterTab } from '../tabs.types';\n import { BentoTabProvidedTitle } from './tab.types';\n\n export default defineComponent({\n props: {\n /**\n * Title of the tab\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Determines whether the tab is disabled\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays the tab with a notification indicator\n */\n withNotificationIndicator: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n // External title injection\n const { disabled, withNotificationIndicator } = toRefs(props);\n const componentTitle = ref();\n const setTitle: BentoTabProvidedTitle = (value: string) => {\n componentTitle.value = value;\n };\n provide(EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY, setTitle);\n\n const computedTitle = computed(() => (componentTitle.value ?? props.title) as string);\n\n const registerTab: BentoTabsRegisterTab = inject(TABS_REGISTER_TAB_INJECTION_KEY);\n const activeTabId = inject(TABS_ACTIVE_TAB_ID_KEY);\n\n const { id, unregisterTab } = registerTab({ disabled, title: computedTitle, withNotificationIndicator });\n\n onUnmounted(() => unregisterTab());\n\n return { activeTabId, id, computedTitle };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./tab.scss\" />\n","import { BentoTab } from './components/tab.types';\n\nexport const getPreviousTabIndex = (activeTabIndex: number, tabsValue: BentoTab[]) => {\n const newActiveTabIndex = activeTabIndex === 0 ? tabsValue.length - 1 : activeTabIndex - 1;\n if (tabsValue[newActiveTabIndex].disabled) {\n return getPreviousTabIndex(newActiveTabIndex, tabsValue);\n }\n return newActiveTabIndex;\n};\n\nexport const getNextTabIndex = (activeTabIndex: number, tabsValue: BentoTab[]) => {\n const newActiveTabIndex = activeTabIndex === tabsValue.length - 1 ? 0 : activeTabIndex + 1;\n if (tabsValue[newActiveTabIndex].disabled) {\n return getNextTabIndex(newActiveTabIndex, tabsValue);\n }\n return newActiveTabIndex;\n};\n","import type { Ref } from 'vue';\n\nexport type BentoTabsRegisterTab = (props: {\n disabled: Ref<boolean>;\n title: Ref<string>;\n withNotificationIndicator: Ref<boolean>;\n}) => { id: string; unregisterTab: () => void };\n\nexport enum BentoTabsEvent {\n ACTIVE_TAB_INDEX = 'update:active-tab-index',\n}\n","<template>\n <div class=\"b-tabs\">\n <fixed-scroller ref=\"tablistwrapper\" condensed :extra-padding-top=\"5\" class=\"b-tabs__tab-list-wrapper\">\n <div ref=\"tablist\" class=\"b-tabs__tab-list\" role=\"tablist\" @keydown=\"onKeydownTabsNavigation\">\n <button\n v-for=\"{ disabled, id, title, withNotificationIndicator } in tabs\"\n :id=\"id\"\n :key=\"id\"\n role=\"tab\"\n type=\"button\"\n class=\"b-tabs__tab\"\n :class=\"{\n 'b-tabs__tab--active': activeTabId === id,\n 'b-tabs__tab--disabled': disabled,\n }\"\n :aria-controls=\"`${id}-tabpanel`\"\n :aria-selected=\"activeTabId === id ? 'true' : 'false'\"\n :tabindex=\"activeTabId === id && !disabled.value ? null : -1\"\n :disabled=\"isDisabled(disabled)\"\n @click=\"handleTabChange(id)\"\n @keydown.enter.space=\"handleTabChange(id)\"\n >\n <span class=\"b-tabs__tab-text\">\n <bento-typography class=\"b-tabs__tab-title\" el=\"span\" variant=\"body\" stronger>\n {{ title }}\n </bento-typography>\n <span\n v-if=\"withNotificationIndicator\"\n class=\"b-tabs__tab-notification-dot\"\n aria-hidden=\"true\"\n ></span>\n </span>\n <span v-show=\"activeTabId === id\" class=\"b-tabs__tab-underline\" aria-hidden=\"true\"></span>\n </button>\n </div>\n </fixed-scroller>\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, nextTick, provide, ref, Ref, watch } from 'vue';\n\n // components\n import { BentoTypography } from '@/components/typography';\n import { FixedScroller } from '@/internal';\n\n // utils\n import { generateUid } from '@/utils/ts/unique-id';\n import { getNextTabIndex, getPreviousTabIndex } from './tabs.utils';\n\n // types\n import { BentoTab } from './components/tab.types';\n import { BentoTabsEvent, BentoTabsRegisterTab } from './tabs.types';\n\n // keys\n import { TABS_ACTIVE_TAB_ID_KEY, TABS_REGISTER_TAB_INJECTION_KEY } from './tabs.keys';\n import { Booleanish } from '@/types';\n\n /**\n * Tabs are used to navigate between different, but related content views within a page.\n * This component conforms to the official WAI-ARIA guidelines for tabs: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n *\n * @example\n * import { BentoTabs, BentoTab } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTabs, BentoTab },\n * template: `\n * <bento-tabs v-bind=\"$props\">\n * <bento-tab title=\"Maria Ahlefeldt\">\n * (16 January 1755 - 20 December 1810) was a Danish, (originally German), composer. She is known as the first female composer in Denmark.\n * </bento-tab>\n * <bento-tab title=\"Carl Andersen\">\n * (29 April 1847 - 7 May 1909) was a Danish flutist, conductor and composer born in Copenhagen, son of the flutist Christian Joachim Andersen.\n * </bento-tab>\n * <bento-tab title=\"Karl Truffel\">\n * (1 March 1981 - 7 November 1992) was a Danish dog and commander born in Berlin, son of the machinist Tom Jahoor Truffel.\n * </bento-tab>\n * <bento-tab title=\"Maria Ahlefeldt\" :disabled=\"true\">\n * (16 January 1755 - 20 December 1810) was a Danish, (originally German), composer. She is known as the first female composer in Denmark.\n * </bento-tab>\n * </bento-tabs>\n * `\n * };\n */\n\n // component\n export default defineComponent({\n components: {\n BentoTypography,\n FixedScroller,\n },\n props: {\n /**\n * Sets the active tab by its index (0 being the first tab item).\n */\n activeTabIndex: { type: Number, default: 0 },\n },\n emits: [BentoTabsEvent.ACTIVE_TAB_INDEX],\n setup(props, { emit }) {\n const tabs: Ref<BentoTab[]> = ref([]);\n const tablist = ref(null);\n const tablistwrapper = ref<InstanceType<typeof FixedScroller>>();\n const activeTabId = ref('');\n\n provide(TABS_ACTIVE_TAB_ID_KEY, activeTabId);\n\n // unregister tab if removed / destroyed\n const unregisterTab = (tabIdToRemove: string) => () => {\n tabs.value = tabs.value?.filter(({ id }) => id !== tabIdToRemove);\n };\n\n // register tab\n const registerTab: BentoTabsRegisterTab = ({ title, disabled, withNotificationIndicator }) => {\n const id = generateUid('b-tab');\n\n // add tab to tabs\n tabs.value.push({ disabled, id, title, withNotificationIndicator });\n\n // return values to the Tab component\n return { id, unregisterTab: unregisterTab(id) };\n };\n\n // provide activeTab and registerTab to tab items\n provide(TABS_REGISTER_TAB_INJECTION_KEY, registerTab);\n\n // keyboard navigation\n const onKeydownTabsNavigation = (e: KeyboardEvent) => {\n if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') {\n // find tab that is focussed\n const activeTab = tabs.value.find(tab => document.activeElement.id === tab.id);\n let activeTabIndex = tabs.value.indexOf(activeTab);\n\n // conditionally increase or decrease the\n if (e.code === 'ArrowLeft') {\n activeTabIndex = getPreviousTabIndex(activeTabIndex, tabs.value);\n } else if (e.code === 'ArrowRight') {\n activeTabIndex = getNextTabIndex(activeTabIndex, tabs.value);\n }\n\n // focus new active tab\n tablist.value.children[activeTabIndex].focus();\n }\n };\n\n watch(\n [() => props.activeTabIndex, tabs],\n ([index, currentTabs]) => {\n nextTick(() => {\n const tab = currentTabs[index];\n activeTabId.value =\n tab && !tab.disabled ? tab.id : tabs.value.find(({ disabled }) => !disabled)?.id;\n });\n },\n { immediate: true }\n );\n\n const handleTabChange = (tabId: string) => {\n activeTabId.value = tabId;\n const activeIndex = tabs.value.findIndex(({ id }) => id === activeTabId.value);\n emit(BentoTabsEvent.ACTIVE_TAB_INDEX, activeIndex);\n };\n\n const isDisabled = (isDisabledTab: Ref<boolean>): Booleanish =>\n (isDisabledTab ? 'disabled' : false) as Booleanish;\n\n return {\n tabs,\n tablist,\n tablistwrapper,\n activeTabId,\n onKeydownTabsNavigation,\n handleTabChange,\n isDisabled,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./tabs.scss\" />\n"],"names":["_sfc_main$1","defineComponent","props","disabled","withNotificationIndicator","toRefs","componentTitle","ref","provide","EXTERNAL_TITLE_REGISTER_ENTRY_INJECTION_KEY","value","computedTitle","computed","registerTab","inject","TABS_REGISTER_TAB_INJECTION_KEY","activeTabId","TABS_ACTIVE_TAB_ID_KEY","id","unregisterTab","onUnmounted","getPreviousTabIndex","activeTabIndex","tabsValue","newActiveTabIndex","getNextTabIndex","BentoTabsEvent","BentoTabsEvent2","_sfc_main","BentoTypography","FixedScroller","emit","tabs","tablist","tablistwrapper","tabIdToRemove","_a","title","generateUid","onKeydownTabsNavigation","e","activeTab","tab","watch","index","currentTabs","nextTick","tabId","activeIndex","isDisabledTab"],"mappings":";;;;;;;AAkBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,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MAAA;AAEA,QAAAC,EAAA,MAAA;;AACA,gBAAAJ,IAAAG,EAAAD,CAAA;AACA,UAAA5B,EAAA,QAAA0B,KAAA,CAAAA,EAAA,WAAAA,EAAA,MAAAN,IAAAJ,EAAA,MAAA,KAAA,CAAA,EAAA,UAAA7B,EAAA,MAAA,CAAAA,CAAA,MAAA,gBAAAiC,EAAA;AAAA,QACA,CAAA;AAAA,MACA;AAAA,MACA,EAAA,WAAA,GAAA;AAAA,IACA,GAYA;AAAA,MAAA,MAAAJ;AAAA,MACA,SAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,aAAAlB;AAAA,MACA,yBAAAuB;AAAA,MACA,iBAdA,CAAAQ,MAAA;AACA,QAAA/B,EAAA,QAAA+B;AACA,cAAAC,IAAAhB,EAAA,MAAA,UAAA,CAAA,EAAA,IAAAd,EAAA,MAAAA,MAAAF,EAAA,KAAA;AACA,QAAAe,EAAAL,EAAA,kBAAAsB,CAAA;AAAA,MAAA;AAAA,MAYA,YATA,CAAAC,MAAAA,IAAA,aAAA;AAAA,IAUA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/tag.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as c, computed as o } from "vue";
2
- import { B as d } from "./chunks/index.dd30e538.js";
2
+ import { B as d } from "./chunks/index.e29a6907.js";
3
3
  import { u as m } from "./chunks/aria-label.ac9651a5.js";
4
4
  import { g as s } from "./chunks/get-slot-text.99c3d860.js";
5
- import { b as _ } from "./chunks/tooltip.58ef3f4a.js";
5
+ import { b as _ } from "./chunks/tooltip.efddb5f3.js";
6
6
  import { n as v } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
7
- import "./assets/index36.css";
7
+ import "./assets/index14.css";
8
8
  var r = /* @__PURE__ */ ((t) => (t.GREY = "grey", t.BLUE = "blue", t.GREEN = "green", t.ORANGE = "orange", t.RED = "red", t.WHITE = "white", t))(r || {});
9
9
  const p = c({
10
10
  name: "bento-tag",
package/dist/textarea.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as K, useAttrs as Q, toRefs as O, ref as d, toRef as X, computed as n, watch as L, nextTick as ee, onMounted as te, onUnmounted as ae } from "vue";
2
- import { a as le } from "./chunks/button.9d6435ae.js";
3
- import { B as re } from "./chunks/index.dd30e538.js";
2
+ import { a as le } from "./chunks/button.cb90b55c.js";
3
+ import { B as re } from "./chunks/index.e29a6907.js";
4
4
  import { n as T } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
5
5
  import { g as se } from "./chunks/unique-id.a2a2b458.js";
6
6
  import { o as F } from "./chunks/resize.a041304d.js";
7
7
  import { u as oe } from "./chunks/aria-label.ac9651a5.js";
8
8
  import { u as ne } from "./chunks/i18n.eb5b985b.js";
9
9
  import { u as ie } from "./chunks/use-form-layout-loading.d03e5d48.js";
10
- import { E as ue, F as ce } from "./chunks/error-message.31ec12b7.js";
11
- import "./assets/index30.css";
10
+ import { E as ue, F as ce } from "./chunks/error-message.bdcc1020.js";
11
+ import "./assets/index41.css";
12
12
  let H = 0;
13
13
  const de = {
14
14
  beforeCreate() {
package/dist/timeline.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { defineComponent as Y, computed as r, ref as N, toRefs as Z, provide as A, inject as D, onUnmounted as G } from "vue";
2
- import { a as z } from "./chunks/button.9d6435ae.js";
2
+ import { a as z } from "./chunks/button.cb90b55c.js";
3
3
  import { BentoTextarea as Q } from "./textarea.js";
4
4
  import { u as H } from "./chunks/i18n.eb5b985b.js";
5
- import { B as X } from "./chunks/button-actions.81db18e8.js";
5
+ import { B as X } from "./chunks/button-actions.87e589e3.js";
6
6
  import { n as x } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
7
- import { B as ee } from "./chunks/index.b21197ca.js";
8
- import { B as te } from "./chunks/index.317fca12.js";
7
+ import { B as ee } from "./chunks/index.614a5138.js";
8
+ import { B as te } from "./chunks/index.bd1d28d0.js";
9
9
  import { BentoTag as ie } from "./tag.js";
10
- import { B as ae, d as se } from "./chunks/index.dd30e538.js";
11
- import { B as ne, a as oe, S as re } from "./chunks/index.aaf965f8.js";
10
+ import { B as ae, d as se } from "./chunks/index.e29a6907.js";
11
+ import { B as ne, a as oe, S as re } from "./chunks/index.3c69be27.js";
12
12
  import { g as le } from "./chunks/unique-id.a2a2b458.js";
13
13
  import { u as me } from "./chunks/use-has-slot.fbeb19ec.js";
14
14
  import { r as ce, e as de, t as w, g as k } from "./chunks/index.f55fdc32.js";
15
15
  import { c as ue, a as _e } from "./chunks/index.86453263.js";
16
- import "./assets/index31.css";
16
+ import "./assets/index42.css";
17
17
  var F = 1e3 * 60, M = 60 * 24, U = M * 30, j = M * 365;
18
18
  function B(t, e) {
19
19
  var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
package/dist/toast.js CHANGED
@@ -2,11 +2,11 @@ import { defineComponent as $, ref as c, computed as d, watch as k, onMounted as
2
2
  import "./chunks/index.4c062058.js";
3
3
  import { C as L } from "./chunks/cross-small.e851e0de.js";
4
4
  import { u as P } from "./chunks/i18n.eb5b985b.js";
5
- import { a as N } from "./chunks/button.9d6435ae.js";
6
- import { B as U } from "./chunks/index.dd30e538.js";
5
+ import { a as N } from "./chunks/button.cb90b55c.js";
6
+ import { B as U } from "./chunks/index.e29a6907.js";
7
7
  import { n as B } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
8
- import { u as O } from "./chunks/use-bento-toast-controller.c3277f73.js";
9
- import "./assets/index32.css";
8
+ import { u as O } from "./chunks/use-bento-toast-controller.5dac1f3c.js";
9
+ import "./assets/index43.css";
10
10
  const M = {
11
11
  "en-US": {
12
12
  dismiss: "Dismiss"
package/dist/toggle.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as k, ref as p, computed as u, toRefs as I, watch as A } from "vue";
2
2
  import { C as B } from "./chunks/checkmark-small.520f01b1.js";
3
- import { B as L } from "./chunks/index.dd30e538.js";
3
+ import { B as L } from "./chunks/index.e29a6907.js";
4
4
  import { g as E } from "./chunks/unique-id.a2a2b458.js";
5
5
  import { u as F } from "./chunks/use-default-slot-validator.b9bff4c6.js";
6
6
  import { u as R } from "./chunks/use-has-slot.fbeb19ec.js";
7
7
  import { g } from "./chunks/get-slot-text.99c3d860.js";
8
8
  import { u as x } from "./chunks/aria-label.ac9651a5.js";
9
9
  import { n as T } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
10
- import "./assets/index33.css";
10
+ import "./assets/index48.css";
11
11
  var f = /* @__PURE__ */ ((t) => (t.LABEL_FIRST = "label-first", t))(f || {}), d = /* @__PURE__ */ ((t) => (t.BEFORE = "before", t.AFTER = "after", t))(d || {});
12
12
  const D = k({
13
13
  name: "bento-toggle",
package/dist/tutorial.js CHANGED
@@ -1,16 +1,16 @@
1
- import { defineComponent as g, ref as d, computed as n, isRef as F, watch as I, nextTick as P } from "vue";
2
- import { B as $ } from "./chunks/index.1ea85d4a.js";
3
- import { B as S, a as k } from "./chunks/index.15b088b9.js";
4
- import { B as w } from "./chunks/index.dd30e538.js";
5
- import { BentoImage as A } from "./image.js";
6
- import { u as N } from "./chunks/i18n.eb5b985b.js";
1
+ import { defineComponent as h, ref as d, computed as n, isRef as I, watch as g, nextTick as P } from "vue";
2
+ import { B as $ } from "./chunks/index.a48e7f99.js";
3
+ import { B as T, a as k } from "./chunks/index.0a30d358.js";
4
+ import { B as w } from "./chunks/index.e29a6907.js";
5
+ import { BentoImage as N } from "./image.js";
6
+ import { u as A } from "./chunks/i18n.eb5b985b.js";
7
7
  import { R as D } from "./chunks/refresh.71a03998.js";
8
8
  import { n as f } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
9
- import { a as T, h as j, o as L } from "./chunks/index.671768a1.js";
10
- import { B as M } from "./chunks/button-actions.81db18e8.js";
11
- import "./assets/index34.css";
9
+ import { a as b, h as j, o as L } from "./chunks/index.c8621e8e.js";
10
+ import { B as M } from "./chunks/button-actions.87e589e3.js";
11
+ import "./assets/index45.css";
12
12
  var B;
13
- const V = /* @__PURE__ */ g({
13
+ const V = /* @__PURE__ */ h({
14
14
  __name: "tutorial-indicator",
15
15
  props: {
16
16
  /**
@@ -18,7 +18,7 @@ const V = /* @__PURE__ */ g({
18
18
  * The indicator will position itself around the target element.
19
19
  */
20
20
  targetElement: {
21
- type: (B = T.props) == null ? void 0 : B.targetElement.type,
21
+ type: (B = b.props) == null ? void 0 : B.targetElement.type,
22
22
  required: !0
23
23
  }
24
24
  },
@@ -30,8 +30,8 @@ const V = /* @__PURE__ */ g({
30
30
  });
31
31
  function s(l) {
32
32
  try {
33
- const r = parseFloat(getComputedStyle(l).getPropertyValue("border-radius"));
34
- return Number.isNaN(r) ? "" : `${r + 2 * 2}px`;
33
+ const i = parseFloat(getComputedStyle(l).getPropertyValue("border-radius"));
34
+ return Number.isNaN(i) ? "" : `${i + 2 * 2}px`;
35
35
  } catch {
36
36
  return "";
37
37
  }
@@ -44,13 +44,13 @@ const V = /* @__PURE__ */ g({
44
44
  }),
45
45
  {
46
46
  name: "updateIndicatorSize",
47
- fn: ({ x: l, y: r, elements: u }) => {
48
- const p = u.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: l, y: r };
47
+ fn: ({ x: l, y: i, elements: r }) => {
48
+ const p = r.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: l, y: i };
50
50
  }
51
51
  }
52
52
  ];
53
- return { __sfc: !0, BORDER_OFFSET: 2, computedStyles: e, getBorderRadius: s, middleware: o, PopperContainer: T };
53
+ return { __sfc: !0, BORDER_OFFSET: 2, computedStyles: e, getBorderRadius: s, middleware: o, PopperContainer: b };
54
54
  }
55
55
  });
56
56
  var q = function() {
@@ -67,10 +67,10 @@ var q = function() {
67
67
  null
68
68
  );
69
69
  const z = Z.exports;
70
- let b = 0;
70
+ let x = 0;
71
71
  const H = {
72
72
  beforeCreate() {
73
- this.uuid = b.toString(), b += 1;
73
+ this.uuid = x.toString(), x += 1;
74
74
  }
75
75
  };
76
76
  var U = function() {
@@ -98,7 +98,7 @@ const G = X.exports, J = {
98
98
  }
99
99
  }, Q = {
100
100
  i18n: { messages: J }
101
- }, Y = /* @__PURE__ */ g({
101
+ }, Y = /* @__PURE__ */ h({
102
102
  ...Q,
103
103
  __name: "tutorial-popover",
104
104
  props: {
@@ -135,8 +135,8 @@ const G = X.exports, J = {
135
135
  */
136
136
  position: {
137
137
  type: String,
138
- default: S.BOTTOM_START,
139
- validator: (a) => Object.values(S).includes(a)
138
+ default: T.BOTTOM_START,
139
+ validator: (a) => Object.values(T).includes(a)
140
140
  },
141
141
  /**
142
142
  * Options to control the scroll into view behavior.
@@ -190,25 +190,25 @@ const G = X.exports, J = {
190
190
  },
191
191
  emits: ["next", "finish", "restart"],
192
192
  setup(a, { emit: t }) {
193
- const e = a, s = { behavior: "smooth" }, { t: o } = N(), l = n(() => ({
193
+ const e = a, s = { behavior: "smooth" }, { t: o } = A(), l = n(() => ({
194
194
  title: o("skipTour"),
195
195
  event: () => t("finish")
196
- })), r = n(() => ({
196
+ })), i = n(() => ({
197
197
  title: o("startTour"),
198
198
  event: () => t("next")
199
- })), u = n(() => ({
199
+ })), r = n(() => ({
200
200
  title: o("next"),
201
201
  event: () => t("next")
202
202
  })), p = n(() => ({
203
203
  title: o("finish"),
204
204
  event: () => t("finish")
205
- })), h = n(() => ({
205
+ })), y = n(() => ({
206
206
  title: o("ok"),
207
207
  event: () => t("finish")
208
- })), y = d(!1), C = d(!1), v = n(() => {
209
- var i;
210
- return F(e.targetElement) ? ((i = e.targetElement.value) == null ? void 0 : i.$el) || e.targetElement.value : e.targetElement.$el || e.targetElement;
211
- }), _ = n(() => e.step === 0), m = n(() => e.step === e.totalSteps), E = n(() => !_.value), x = n(() => [
208
+ })), C = d(!1), O = d(!1), v = n(() => {
209
+ var u;
210
+ return I(e.targetElement) ? ((u = e.targetElement.value) == null ? void 0 : u.$el) || e.targetElement.value : e.targetElement.$el || e.targetElement;
211
+ }), _ = n(() => e.step === 0), m = n(() => e.step === e.totalSteps), E = n(() => !_.value), R = n(() => [
212
212
  {
213
213
  text: o("restartTour"),
214
214
  handler: () => t("restart"),
@@ -221,22 +221,22 @@ const G = X.exports, J = {
221
221
  icon: G
222
222
  }
223
223
  ]
224
- ]), R = n(() => {
225
- let i;
226
- _.value ? i = e.single ? h.value : r.value : m.value ? i = p.value : i = u.value;
227
- const c = [i];
224
+ ]), F = n(() => {
225
+ let u;
226
+ _.value ? u = e.single ? y.value : i.value : m.value ? u = p.value : u = r.value;
227
+ const c = [u];
228
228
  return _.value && !e.single ? c.push(l.value) : e.action && c.push(e.action), c;
229
229
  });
230
- return I(
230
+ return g(
231
231
  () => e.active,
232
- async (i) => {
233
- var c, O;
234
- i && ((c = v.value) != null && c.scrollIntoView) && ((O = v.value) == null || O.scrollIntoView(
232
+ async (u) => {
233
+ var c, S;
234
+ u && ((c = v.value) != null && c.scrollIntoView) && ((S = v.value) == null || S.scrollIntoView(
235
235
  e.scrollOptions != null ? e.scrollOptions : s
236
- ), await P()), y.value = i, C.value = i;
236
+ ), await P()), C.value = u, O.value = u;
237
237
  },
238
238
  { immediate: !0 }
239
- ), { __sfc: !0, DEFAULT_SCROLL_OPTIONS: s, props: e, t: o, emit: t, ACTION_SKIP: l, ACTION_START: r, ACTION_NEXT: u, ACTION_FINISH: p, ACTION_OK: h, isPopoverOpen: y, isIndicatorVisible: C, targetElement: v, isFirstStep: _, isLastStep: m, showSteps: E, menuData: x, computedActions: R, BentoMenu: $, BentoPopover: k, BentoTypography: w, BentoButtonActions: M, BentoImage: A, TutorialIndicator: z };
239
+ ), { __sfc: !0, DEFAULT_SCROLL_OPTIONS: s, props: e, t: o, emit: t, ACTION_SKIP: l, ACTION_START: i, ACTION_NEXT: r, ACTION_FINISH: p, ACTION_OK: y, isPopoverOpen: C, isIndicatorVisible: O, targetElement: v, isFirstStep: _, isLastStep: m, showSteps: E, menuData: R, computedActions: F, BentoMenu: $, BentoPopover: k, BentoTypography: w, BentoButtonActions: M, BentoImage: N, TutorialIndicator: z };
240
240
  }
241
241
  });
242
242
  var tt = function() {
@@ -256,10 +256,17 @@ var tt = function() {
256
256
  null,
257
257
  null
258
258
  );
259
- const ot = st.exports, rt = {}, nt = /* @__PURE__ */ g({
259
+ const ot = st.exports, rt = {}, nt = /* @__PURE__ */ h({
260
260
  ...rt,
261
261
  __name: "tutorial",
262
262
  props: {
263
+ /**
264
+ * The current step index. If provided, will start the tutorial in that step.
265
+ */
266
+ index: {
267
+ type: Number,
268
+ default: null
269
+ },
263
270
  /**
264
271
  * The steps configuration for the tutorial.
265
272
  *
@@ -279,35 +286,43 @@ const ot = st.exports, rt = {}, nt = /* @__PURE__ */ g({
279
286
  default: null
280
287
  }
281
288
  },
282
- setup(a) {
283
- const t = a, e = d(0), s = n(() => t.steps.length - 1), o = n(() => s.value === 0);
284
- function l(r, u) {
289
+ emits: ["update:index"],
290
+ setup(a, { emit: t }) {
291
+ const e = a, s = d(e.index || 0), o = n(() => e.steps.length - 1), l = n(() => o.value === 0);
292
+ function i(r, p) {
285
293
  return {
286
294
  // Visual
287
295
  targetElement: r.target,
288
296
  image: r.image,
289
297
  title: r.title,
290
- step: u,
291
- totalSteps: s.value,
298
+ step: p,
299
+ totalSteps: o.value,
292
300
  action: r.action,
293
- scrollOptions: t.scrollOptions,
301
+ scrollOptions: e.scrollOptions,
294
302
  // Config
295
- active: u === e.value,
296
- single: o.value,
303
+ active: p === s.value,
304
+ single: l.value,
297
305
  position: r.position
298
306
  };
299
307
  }
300
- return { __sfc: !0, props: t, currentStep: e, totalSteps: s, isSingleTutorial: o, getPopoverProps: l, TutorialPopover: ot };
308
+ return g(s, (r) => {
309
+ t("update:index", r);
310
+ }), g(
311
+ () => e.index,
312
+ (r) => {
313
+ r >= -1 && r <= o.value && (s.value = r);
314
+ }
315
+ ), { __sfc: !0, props: e, emit: t, currentStep: s, totalSteps: o, isSingleTutorial: l, getPopoverProps: i, TutorialPopover: ot };
301
316
  }
302
317
  });
303
318
  var at = function() {
304
319
  var t = this, e = t._self._c, s = t._self._setupProxy;
305
320
  return e("div", { staticClass: "b-tutorial" }, t._l(t.steps, function(o, l) {
306
- return e(s.TutorialPopover, t._b({ key: o.title, on: { finish: function(r) {
321
+ return e(s.TutorialPopover, t._b({ key: o.title, on: { finish: function(i) {
307
322
  s.currentStep = -1;
308
- }, next: function(r) {
323
+ }, next: function(i) {
309
324
  s.currentStep += 1;
310
- }, restart: function(r) {
325
+ }, restart: function(i) {
311
326
  s.currentStep = 0;
312
327
  } } }, "tutorial-popover", s.getPopoverProps(o, l), !1), [t._v(" " + t._s(o.description) + " ")]);
313
328
  }), 1);