@adyen/bento-vue2 1.24.0 → 1.25.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 (188) hide show
  1. package/dist/@types/index.d.ts +415 -528
  2. package/dist/accordion.js +2 -2
  3. package/dist/action-bar.js +6 -6
  4. package/dist/alert.js +69 -104
  5. package/dist/alert.js.map +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/dropdown.css +1 -1
  9. package/dist/assets/index.css +1 -1
  10. package/dist/assets/index10.css +1 -1
  11. package/dist/assets/index11.css +1 -1
  12. package/dist/assets/index12.css +1 -1
  13. package/dist/assets/index13.css +1 -1
  14. package/dist/assets/index14.css +1 -1
  15. package/dist/assets/index15.css +1 -1
  16. package/dist/assets/index16.css +1 -1
  17. package/dist/assets/index17.css +1 -1
  18. package/dist/assets/index18.css +1 -1
  19. package/dist/assets/index19.css +1 -1
  20. package/dist/assets/index2.css +1 -1
  21. package/dist/assets/index20.css +1 -1
  22. package/dist/assets/index21.css +1 -1
  23. package/dist/assets/index22.css +1 -1
  24. package/dist/assets/index23.css +1 -1
  25. package/dist/assets/index24.css +1 -1
  26. package/dist/assets/index25.css +1 -1
  27. package/dist/assets/index26.css +1 -1
  28. package/dist/assets/index27.css +1 -1
  29. package/dist/assets/index28.css +1 -1
  30. package/dist/assets/index29.css +1 -1
  31. package/dist/assets/index3.css +1 -1
  32. package/dist/assets/index30.css +1 -1
  33. package/dist/assets/index31.css +1 -1
  34. package/dist/assets/index32.css +1 -1
  35. package/dist/assets/index33.css +1 -1
  36. package/dist/assets/index34.css +1 -1
  37. package/dist/assets/index35.css +1 -1
  38. package/dist/assets/index36.css +1 -1
  39. package/dist/assets/index37.css +1 -1
  40. package/dist/assets/index38.css +1 -1
  41. package/dist/assets/index39.css +1 -1
  42. package/dist/assets/index40.css +1 -1
  43. package/dist/assets/index41.css +1 -1
  44. package/dist/assets/index42.css +1 -1
  45. package/dist/assets/index43.css +1 -1
  46. package/dist/assets/index44.css +1 -1
  47. package/dist/assets/index45.css +1 -1
  48. package/dist/assets/index46.css +1 -1
  49. package/dist/assets/index47.css +1 -1
  50. package/dist/assets/index48.css +1 -1
  51. package/dist/assets/index5.css +1 -1
  52. package/dist/assets/index6.css +1 -1
  53. package/dist/assets/index7.css +1 -1
  54. package/dist/assets/index8.css +1 -1
  55. package/dist/assets/index9.css +1 -1
  56. package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
  57. package/dist/avatar-image.js +1 -1
  58. package/dist/badge.js +1 -1
  59. package/dist/button.js +5 -5
  60. package/dist/card.js +83 -180
  61. package/dist/card.js.map +1 -1
  62. package/dist/checkbox.js +5 -5
  63. package/dist/chunks/{base-button.090f511d.js → base-button.773343f6.js} +2 -2
  64. package/dist/chunks/{base-button.090f511d.js.map → base-button.773343f6.js.map} +1 -1
  65. package/dist/chunks/{base-modal.aa09a60c.js → base-modal.2d596e6f.js} +6 -6
  66. package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.2d596e6f.js.map} +1 -1
  67. package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.d08d2c51.js} +4 -4
  68. package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.d08d2c51.js.map} +1 -1
  69. package/dist/chunks/{button-actions.239456cb.js → button-actions.a03a672f.js} +3 -3
  70. package/dist/chunks/{button-actions.239456cb.js.map → button-actions.a03a672f.js.map} +1 -1
  71. package/dist/chunks/{button.6e6324f0.js → button.e5f5638f.js} +3 -3
  72. package/dist/chunks/{button.6e6324f0.js.map → button.e5f5638f.js.map} +1 -1
  73. package/dist/chunks/{calendar.1e416969.js → calendar.7d3e2db0.js} +4 -4
  74. package/dist/chunks/{calendar.1e416969.js.map → calendar.7d3e2db0.js.map} +1 -1
  75. package/dist/chunks/{checkbox.f38276e6.js → checkbox.28578383.js} +3 -3
  76. package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.28578383.js.map} +1 -1
  77. package/dist/chunks/{controls-group.f1dfa419.js → controls-group.faa482b2.js} +3 -3
  78. package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.faa482b2.js.map} +1 -1
  79. package/dist/chunks/{copy.acc9f1b0.js → copy.3c50b447.js} +4 -4
  80. package/dist/chunks/{copy.acc9f1b0.js.map → copy.3c50b447.js.map} +1 -1
  81. package/dist/chunks/dialog-page.286ead53.js +133 -0
  82. package/dist/chunks/dialog-page.286ead53.js.map +1 -0
  83. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.a1c0c0fb.js} +2 -2
  84. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.a1c0c0fb.js.map} +1 -1
  85. package/dist/chunks/dropdown.7d4a8dfc.js +775 -0
  86. package/dist/chunks/dropdown.7d4a8dfc.js.map +1 -0
  87. package/dist/chunks/{error-message.8734e591.js → error-message.db315e68.js} +2 -2
  88. package/dist/chunks/{error-message.8734e591.js.map → error-message.db315e68.js.map} +1 -1
  89. package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.3135f86c.js} +2 -2
  90. package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.3135f86c.js.map} +1 -1
  91. package/dist/chunks/{footer-actions.11071f12.js → footer-actions.32891b25.js} +4 -4
  92. package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.32891b25.js.map} +1 -1
  93. package/dist/chunks/{index.87180cdd.js → index.30948302.js} +138 -119
  94. package/dist/chunks/index.30948302.js.map +1 -0
  95. package/dist/chunks/{index.8e6bc325.js → index.444d221f.js} +3 -3
  96. package/dist/chunks/{index.8e6bc325.js.map → index.444d221f.js.map} +1 -1
  97. package/dist/chunks/{index.73abb1a9.js → index.4b6211c7.js} +27 -27
  98. package/dist/chunks/{index.73abb1a9.js.map → index.4b6211c7.js.map} +1 -1
  99. package/dist/chunks/{index.94980f50.js → index.596c4d0a.js} +2 -2
  100. package/dist/chunks/{index.94980f50.js.map → index.596c4d0a.js.map} +1 -1
  101. package/dist/chunks/{index.ff09389c.js → index.81e509f3.js} +6 -6
  102. package/dist/chunks/{index.ff09389c.js.map → index.81e509f3.js.map} +1 -1
  103. package/dist/chunks/{index.f19887a1.js → index.939dd5cf.js} +2 -2
  104. package/dist/chunks/{index.f19887a1.js.map → index.939dd5cf.js.map} +1 -1
  105. package/dist/chunks/{index.51308a21.js → index.94acf214.js} +3 -3
  106. package/dist/chunks/{index.51308a21.js.map → index.94acf214.js.map} +1 -1
  107. package/dist/chunks/{index.49ce3f6a.js → index.9536a077.js} +3 -3
  108. package/dist/chunks/{index.49ce3f6a.js.map → index.9536a077.js.map} +1 -1
  109. package/dist/chunks/{index.03ae22b4.js → index.9e40ffeb.js} +2 -2
  110. package/dist/chunks/{index.03ae22b4.js.map → index.9e40ffeb.js.map} +1 -1
  111. package/dist/chunks/{index.ba6c1040.js → index.d97166c6.js} +2 -2
  112. package/dist/chunks/{index.ba6c1040.js.map → index.d97166c6.js.map} +1 -1
  113. package/dist/chunks/{index.5d5f2200.js → index.ec632d95.js} +6 -6
  114. package/dist/chunks/{index.5d5f2200.js.map → index.ec632d95.js.map} +1 -1
  115. package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.95a65534.js} +3 -3
  116. package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.95a65534.js.map} +1 -1
  117. package/dist/chunks/{loading-button.84a5529d.js → loading-button.e8060c04.js} +2 -2
  118. package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.e8060c04.js.map} +1 -1
  119. package/dist/chunks/{payment-method.faa302de.js → payment-method.564ed43a.js} +2 -2
  120. package/dist/chunks/{payment-method.faa302de.js.map → payment-method.564ed43a.js.map} +1 -1
  121. package/dist/chunks/{tooltip.8e9d733c.js → tooltip.e5deb137.js} +3 -3
  122. package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.e5deb137.js.map} +1 -1
  123. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.8414d283.js} +2 -2
  124. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.8414d283.js.map} +1 -1
  125. package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.3772a679.js} +510 -448
  126. package/dist/chunks/use-cached-selected-values.3772a679.js.map +1 -0
  127. package/dist/code-snippet.js +7 -7
  128. package/dist/code-snippet.js.map +1 -1
  129. package/dist/country.js +2 -2
  130. package/dist/currency.js +1 -1
  131. package/dist/data-grid-template.js +1 -1
  132. package/dist/data-grid.js +758 -725
  133. package/dist/data-grid.js.map +1 -1
  134. package/dist/date-picker.js +19 -19
  135. package/dist/date-range-picker.js +2 -2
  136. package/dist/date.js +1 -1
  137. package/dist/divider.js +1 -1
  138. package/dist/dropdown.js +7 -7
  139. package/dist/empty-state.js +2 -2
  140. package/dist/filter-bar.js +1115 -955
  141. package/dist/filter-bar.js.map +1 -1
  142. package/dist/focus-trap.js +1 -1
  143. package/dist/form-layout.js +2 -2
  144. package/dist/header.js +4 -4
  145. package/dist/index.js +177 -169
  146. package/dist/index.js.map +1 -1
  147. package/dist/info-icon.js +3 -3
  148. package/dist/input-field.js +31 -29
  149. package/dist/input-field.js.map +1 -1
  150. package/dist/internal.js +31 -78
  151. package/dist/internal.js.map +1 -1
  152. package/dist/link.js +1 -1
  153. package/dist/loading-indicator.js +1 -1
  154. package/dist/menu.js +1 -1
  155. package/dist/modal-fullscreen.js +6 -6
  156. package/dist/modal.js +6 -6
  157. package/dist/pagination.js +4 -4
  158. package/dist/payment-method.js +1 -1
  159. package/dist/popover.js +1 -1
  160. package/dist/popper-container.js +1 -1
  161. package/dist/radio-group.js +62 -62
  162. package/dist/radio-group.js.map +1 -1
  163. package/dist/search-bar.js +2 -2
  164. package/dist/secondary-nav.js +2 -2
  165. package/dist/segmented-control.js +3 -3
  166. package/dist/selection-card.js +4 -4
  167. package/dist/sidepanel.js +52 -50
  168. package/dist/sidepanel.js.map +1 -1
  169. package/dist/status.js +2 -2
  170. package/dist/stepper.js +3 -3
  171. package/dist/structured-list.js +1 -1
  172. package/dist/summary-grid.js +3 -3
  173. package/dist/tabs.js +3 -3
  174. package/dist/tag.js +3 -3
  175. package/dist/textarea.js +4 -4
  176. package/dist/timeline.js +7 -7
  177. package/dist/toast.js +4 -4
  178. package/dist/toggle.js +2 -2
  179. package/dist/tutorial.js +6 -6
  180. package/dist/typography.js +1 -1
  181. package/dist/web-types.json +532 -282
  182. package/package.json +3 -2
  183. package/dist/chunks/dialog-page.75b295b7.js +0 -133
  184. package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
  185. package/dist/chunks/dropdown.669b858b.js +0 -797
  186. package/dist/chunks/dropdown.669b858b.js.map +0 -1
  187. package/dist/chunks/index.87180cdd.js.map +0 -1
  188. package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
package/dist/card.js CHANGED
@@ -1,214 +1,117 @@
1
- import { defineComponent as T, ref as h, watch as p, computed as n } from "vue";
2
- import { B as H } from "./chunks/index.ba6c1040.js";
3
- import { a as I, C as D } from "./chunks/chevron-up.81185563.js";
4
- import { u as M } from "./chunks/use-has-slot.fbeb19ec.js";
5
- import { g as O } from "./chunks/unique-id.a2a2b458.js";
6
- import { u as U } from "./chunks/i18n.eb5b985b.js";
7
- import { o as z } from "./chunks/resize.a041304d.js";
8
- import { u as R } from "./chunks/use-expandable-content-height.62fc84e5.js";
9
- import { B as W, c as y } from "./chunks/button-actions.239456cb.js";
10
- import { n as F } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
11
- import "./assets/index11.css";
12
- var u = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e))(u || {}), i = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.SMALL = "small", e))(i || {});
13
- const N = {
1
+ import { defineComponent as T, useSlots as I, ref as C, watch as h, computed as n } from "vue";
2
+ import { B as H } from "./chunks/index.d97166c6.js";
3
+ import { C as D, a as M } from "./chunks/chevron-up.81185563.js";
4
+ import { u as U } from "./chunks/use-expandable-content-height.62fc84e5.js";
5
+ import { u as z } from "./chunks/use-has-slot.fbeb19ec.js";
6
+ import { g as R } from "./chunks/unique-id.a2a2b458.js";
7
+ import { u as O } from "./chunks/i18n.eb5b985b.js";
8
+ import { o as W } from "./chunks/resize.a041304d.js";
9
+ import { c as F, B as N } from "./chunks/button-actions.a03a672f.js";
10
+ import { n as P } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
11
+ import "./assets/index17.css";
12
+ var f = /* @__PURE__ */ ((o) => (o.PRIMARY = "primary", o.SECONDARY = "secondary", o))(f || {}), c = /* @__PURE__ */ ((o) => (o.DEFAULT = "default", o.SMALL = "small", o))(c || {});
13
+ const Y = {
14
14
  "en-US": {
15
15
  showCardContent: "Show card content",
16
16
  hideCardContent: "Hide card content"
17
17
  }
18
- }, j = T({
19
- i18n: { messages: N },
20
- name: "bento-card",
21
- components: { ChevronUpIcon: I, ChevronDownIcon: D, BentoTypography: H, BentoButtonActions: W },
18
+ }, j = {
19
+ i18n: { messages: Y },
20
+ name: "bento-card"
21
+ }, q = /* @__PURE__ */ T({
22
+ ...j,
22
23
  props: {
23
- /**
24
- * Defines the color of card background
25
- */
26
- background: {
27
- type: String,
28
- default: u.PRIMARY,
29
- validator: (e) => Object.values(u).includes(e)
30
- },
31
- /**
32
- * Defines the title size of the card header
33
- */
34
- titleSize: {
35
- type: String,
36
- default: i.DEFAULT,
37
- validator: (e) => Object.values(i).includes(e)
38
- },
39
- /**
40
- * The whole content of the card will be expandable in accordion manner
41
- */
42
- expandable: {
43
- type: Boolean,
44
- default: !1
45
- },
46
- /**
47
- * Sets the expandable card in a closed state
48
- */
49
- closed: {
50
- type: Boolean,
51
- default: !1
52
- },
53
- /**
54
- * Disables the expandable card
55
- */
56
- disabled: {
57
- type: Boolean,
58
- default: !1
59
- },
60
- /**
61
- * List of actions that will be used to render the buttons.
62
- * First element in the list will be rendered as "primary".
63
- * All elements after the first will be rendered as "secondary".
64
- *
65
- * Each object in the list should have a `title`, an `event` and
66
- * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
67
- *
68
- * `title`: Button's text.
69
- *
70
- * `event`: Event triggered when clicking the Button.
71
- *
72
- * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.
73
- *
74
- * ```
75
- * [{
76
- * title: 'Primary',
77
- * event: () => { ... },
78
- * icon: FourPeopleIcon
79
- * }, {
80
- * title: 'Secondary',
81
- * event: () => { ... }
82
- * }]
83
- * ```
84
- */
85
- actions: {
86
- type: Array,
87
- default: null
88
- },
89
- /**
90
- * Defines the layout in which the button actions is presented.
91
- * It can be one of:
92
- *
93
- * @values BUTTONS_START
94
- * @values BUTTONS_END
95
- * @values FILL_CONTAINER
96
- * @values SPACE_BETWEEN
97
- * @values VERTICAL_STACK
98
- */
99
- actionsLayout: {
100
- type: String,
101
- default: y.BUTTONS_END,
102
- validator: (e) => Object.values(y).includes(e)
103
- }
24
+ actions: { default: null },
25
+ actionsLayout: { default: F.BUTTONS_END },
26
+ background: { default: f.PRIMARY },
27
+ closed: { type: Boolean, default: !1 },
28
+ disabled: { type: Boolean, default: !1 },
29
+ expandable: { type: Boolean, default: !1 },
30
+ titleSize: { default: c.DEFAULT }
104
31
  },
105
32
  emits: ["click", "expanded"],
106
- setup(e, { emit: a, slots: t }) {
107
- const { t: d } = U(), o = M(t), c = h(null), v = O("card"), l = h(!e.closed);
108
- p(
109
- () => e.closed,
110
- (s) => {
111
- l.value = !s;
33
+ setup(o, { emit: t }) {
34
+ const a = o, { t: e } = O(), s = I(), d = z(s), i = C(null), x = R("card"), r = C(!a.closed);
35
+ h(
36
+ () => a.closed,
37
+ (l) => {
38
+ r.value = !l;
112
39
  }
113
40
  );
114
- const r = n(() => o("default") || o("description") || o("header")), g = n(() => o("default") || o("header")), _ = n(
41
+ const p = n(() => d("default") || d("description") || d("header")), y = n(() => d("default") || d("header")), b = n(
115
42
  () => {
116
- var s;
117
- return (o("content") || ((s = e.actions) == null ? void 0 : s.length)) && (!e.expandable || e.expandable && l.value);
43
+ var l;
44
+ return (d("content") || ((l = a.actions) == null ? void 0 : l.length)) && (!a.expandable || a.expandable && r.value);
118
45
  }
119
- ), f = n(() => e.expandable && !e.disabled ? 0 : -1), x = n(() => ({
120
- [`b-card--${e.background}`]: e.background,
121
- "b-card--expandable": e.expandable,
122
- "b-card--disabled": e.expandable && e.disabled
46
+ ), g = n(() => a.expandable && !a.disabled ? 0 : -1), v = n(() => ({
47
+ [`b-card--${a.background}`]: a.background,
48
+ "b-card--expandable": a.expandable,
49
+ "b-card--disabled": a.expandable && a.disabled
123
50
  })), m = n(() => ({
124
- "b-card__header--expandable": e.expandable,
125
- "b-card__header--without-body": !e.expandable && !_.value
51
+ "b-card__header--expandable": a.expandable,
52
+ "b-card__header--without-body": !a.expandable && !b.value
126
53
  })), w = n(() => ({
127
- "b-card__toggle--small-text": e.titleSize === i.SMALL
54
+ "b-card__toggle--small-text": a.titleSize === c.SMALL
128
55
  })), S = n(() => ({
129
- "b-card__body--expandable": e.expandable && o("content"),
130
- "b-card__body--without-header": !e.expandable && !r.value
56
+ "b-card__body--expandable": a.expandable && d("content"),
57
+ "b-card__body--without-header": !a.expandable && !p.value
131
58
  })), k = n(() => ({
132
- "b-card__content--without-header": !e.expandable && !r.value,
133
- "b-card__content--expandable": e.expandable
134
- })), A = n(() => {
135
- const s = !e.expandable && e.actions && !o("content");
59
+ "b-card__content--without-header": !a.expandable && !p.value,
60
+ "b-card__content--expandable": a.expandable
61
+ })), B = n(() => {
62
+ const l = !a.expandable && a.actions && !d("content");
136
63
  return {
137
- "b-card__actions--without-content": s,
138
- "b-card__actions--without-content-and-with-header": s && r.value
64
+ "b-card__actions--without-content": l,
65
+ "b-card__actions--without-content-and-with-header": l && p.value
139
66
  };
140
- }), E = n(() => ({
141
- "b-card__title-wrapper--truncated": o("header")
142
- })), L = n(
67
+ }), A = n(() => ({
68
+ "b-card__title-wrapper--truncated": d("header")
69
+ })), E = n(
143
70
  () => ({
144
71
  el: "div",
145
- variant: e.titleSize === i.DEFAULT ? "title" : "body",
146
- strongest: e.titleSize === i.SMALL,
147
- wide: e.titleSize === i.SMALL
72
+ variant: a.titleSize === c.DEFAULT ? "title" : "body",
73
+ strongest: a.titleSize === c.SMALL,
74
+ wide: a.titleSize === c.SMALL
148
75
  })
149
- ), { updateContentHeight: b, contentHeight: C } = R(c, l), B = n(
150
- () => e.expandable && C.value ? { "max-height": C.value } : {}
76
+ ), { updateContentHeight: _, contentHeight: u } = U(i, r), L = n(
77
+ () => a.expandable && u.value ? { "max-height": u.value } : {}
151
78
  );
152
- return p(
153
- () => c.value,
79
+ return h(
80
+ () => i.value,
154
81
  () => {
155
- let s = null;
156
- !s && c.value && (s = z(c.value, () => {
157
- c.value && b();
82
+ let l = null;
83
+ !l && i.value && (l = W(i.value, () => {
84
+ i.value && _();
158
85
  }));
159
86
  }
160
- ), {
161
- // Values
162
- cardId: v,
163
- cardConditionalClasses: x,
164
- cardBodyConditionalClasses: S,
165
- cardHeaderConditionalClasses: m,
166
- cardContentConditionalClasses: k,
167
- cardActionsConditionalClasses: A,
168
- cardTitleWrapperConditionalClasses: E,
169
- cardToggleConditionalClasses: w,
170
- showCardBody: _,
171
- showContent: l,
172
- tabIndex: f,
173
- showHeader: r,
174
- showTitleWrapper: g,
175
- typography: L,
176
- // Expand animation
177
- contentDiv: c,
178
- contentMaxHeight: B,
179
- // Methods
180
- hasSlot: o,
181
- onClick: () => {
182
- e.disabled || a("click");
183
- },
184
- t: d,
185
- toggleExpansion: () => {
186
- !e.disabled && e.expandable && (l.value = !l.value, a("expanded", l.value), b());
187
- }
188
- };
87
+ ), { __sfc: !0, t: e, slots: s, hasSlot: d, props: a, emit: t, contentDiv: i, cardId: x, showContent: r, showHeader: p, showTitleWrapper: y, showCardBody: b, tabIndex: g, cardConditionalClasses: v, cardHeaderConditionalClasses: m, cardToggleConditionalClasses: w, cardBodyConditionalClasses: S, cardContentConditionalClasses: k, cardActionsConditionalClasses: B, cardTitleWrapperConditionalClasses: A, typography: E, updateContentHeight: _, contentHeight: u, contentMaxHeight: L, toggleExpansion: () => {
88
+ !a.disabled && a.expandable && (r.value = !r.value, t("expanded", r.value), _());
89
+ }, onClick: () => {
90
+ a.disabled || t("click");
91
+ }, BentoTypography: H, BentoButtonActions: N, ChevronDownIcon: D, ChevronUpIcon: M };
189
92
  }
190
93
  });
191
- var P = function() {
192
- var a = this, t = a._self._c;
193
- return a._self._setupProxy, t("div", { staticClass: "b-card", class: a.cardConditionalClasses, attrs: { "data-testid": "card" }, on: { click: a.onClick } }, [a.hasSlot("image") ? t("div", { staticClass: "b-card__image" }, [a._t("image")], 2) : a._e(), a.showHeader ? t("div", { staticClass: "b-card__header", class: a.cardHeaderConditionalClasses, attrs: { tabindex: a.tabIndex, "aria-controls": a.expandable ? a.cardId : null, "aria-expanded": a.expandable ? `${a.showContent}` : null, role: a.expandable ? "button" : null }, on: { click: a.toggleExpansion, keypress: [function(d) {
194
- return !d.type.indexOf("key") && a._k(d.keyCode, "enter", 13, d.key, "Enter") ? null : a.toggleExpansion.apply(null, arguments);
195
- }, function(d) {
196
- return !d.type.indexOf("key") && a._k(d.keyCode, "space", 32, d.key, [" ", "Spacebar"]) ? null : a.toggleExpansion.apply(null, arguments);
197
- }] } }, [t("div", { staticClass: "b-card__header-wrapper" }, [a.showTitleWrapper ? t("div", { staticClass: "b-card__header-slot-wrapper" }, [t("div", { staticClass: "b-card__title-wrapper", class: a.cardTitleWrapperConditionalClasses }, [a.expandable ? t("div", { staticClass: "b-card__toggle", class: a.cardToggleConditionalClasses }, [a.showContent ? t("chevron-up-icon", { attrs: { "svg-title": a.t("hideCardContent"), "aria-hidden": "true" } }) : t("chevron-down-icon", { attrs: { "svg-title": a.t("showCardContent"), "aria-hidden": "true" } })], 1) : a._e(), a.hasSlot("default") ? t("bento-typography", a._b({ staticClass: "b-card__title" }, "bento-typography", a.typography, !1), [a._t("default")], 2) : a._e()], 1), a.hasSlot("header") ? [a._t("header")] : a._e()], 2) : a._e(), a.hasSlot("description") ? t("bento-typography", { staticClass: "b-card__description", attrs: { el: "div", variant: "body" } }, [a._t("description")], 2) : a._e()], 1)]) : a._e(), t("Transition", { attrs: { name: "b-card__animation" } }, [a.showCardBody ? t("div", { staticClass: "b-card__wrapper", style: a.contentMaxHeight }, [t("div", { ref: "contentDiv", staticClass: "b-card__body", class: a.cardBodyConditionalClasses, attrs: { id: a.expandable ? a.cardId : null } }, [a.hasSlot("content") ? t("div", { staticClass: "b-card__content", class: a.cardContentConditionalClasses }, [a._t("content")], 2) : a._e(), a.actions ? t("div", { staticClass: "b-card__actions", class: a.cardActionsConditionalClasses }, [t("bento-button-actions", { attrs: { actions: a.actions, layout: a.actionsLayout } })], 1) : a._e()])]) : a._e()])], 1);
198
- }, Y = [], q = /* @__PURE__ */ F(
199
- j,
200
- P,
201
- Y,
94
+ var G = function() {
95
+ var t = this, a = t._self._c, e = t._self._setupProxy;
96
+ return a("div", { staticClass: "b-card", class: e.cardConditionalClasses, attrs: { "data-testid": "card" }, on: { click: e.onClick } }, [e.hasSlot("image") ? a("div", { staticClass: "b-card__image" }, [t._t("image")], 2) : t._e(), e.showHeader ? a("div", { staticClass: "b-card__header", class: e.cardHeaderConditionalClasses, attrs: { tabindex: e.tabIndex, "aria-controls": t.expandable ? e.cardId : null, "aria-expanded": t.expandable ? `${e.showContent}` : null, role: t.expandable ? "button" : null }, on: { click: e.toggleExpansion, keypress: [function(s) {
97
+ return !s.type.indexOf("key") && t._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.toggleExpansion.apply(null, arguments);
98
+ }, function(s) {
99
+ return !s.type.indexOf("key") && t._k(s.keyCode, "space", 32, s.key, [" ", "Spacebar"]) ? null : e.toggleExpansion.apply(null, arguments);
100
+ }] } }, [a("div", { staticClass: "b-card__header-wrapper" }, [e.showTitleWrapper ? a("div", { staticClass: "b-card__header-slot-wrapper" }, [a("div", { staticClass: "b-card__title-wrapper", class: e.cardTitleWrapperConditionalClasses }, [t.expandable ? a("div", { staticClass: "b-card__toggle", class: e.cardToggleConditionalClasses }, [e.showContent ? a(e.ChevronUpIcon, { attrs: { "svg-title": e.t("hideCardContent"), "aria-hidden": "true" } }) : a(e.ChevronDownIcon, { attrs: { "svg-title": e.t("showCardContent"), "aria-hidden": "true" } })], 1) : t._e(), e.hasSlot("default") ? a(e.BentoTypography, t._b({ staticClass: "b-card__title" }, "bento-typography", e.typography, !1), [t._t("default")], 2) : t._e()], 1), e.hasSlot("header") ? [t._t("header")] : t._e()], 2) : t._e(), e.hasSlot("description") ? a(e.BentoTypography, { staticClass: "b-card__description", attrs: { el: "div", variant: "body" } }, [t._t("description")], 2) : t._e()], 1)]) : t._e(), a("Transition", { attrs: { name: "b-card__animation" } }, [e.showCardBody ? a("div", { staticClass: "b-card__wrapper", style: e.contentMaxHeight }, [a("div", { ref: "contentDiv", staticClass: "b-card__body", class: e.cardBodyConditionalClasses, attrs: { id: t.expandable ? e.cardId : null } }, [e.hasSlot("content") ? a("div", { staticClass: "b-card__content", class: e.cardContentConditionalClasses }, [t._t("content")], 2) : t._e(), t.actions ? a("div", { staticClass: "b-card__actions", class: e.cardActionsConditionalClasses }, [a(e.BentoButtonActions, { attrs: { actions: t.actions, layout: t.actionsLayout } })], 1) : t._e()])]) : t._e()])], 1);
101
+ }, J = [], K = /* @__PURE__ */ P(
102
+ q,
103
+ G,
104
+ J,
202
105
  !1,
203
106
  null,
204
- "17b60dc8",
107
+ "d9419ec6",
205
108
  null,
206
109
  null
207
110
  );
208
- const oa = q.exports;
111
+ const la = K.exports;
209
112
  export {
210
- oa as BentoCard,
211
- u as BentoCardBackground,
212
- i as BentoCardTitleSize
113
+ la as BentoCard,
114
+ f as BentoCardBackground,
115
+ c as BentoCardTitleSize
213
116
  };
214
117
  //# sourceMappingURL=card.js.map
package/dist/card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sources":["../src/components/card/card.types.ts","../src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Expand animation\n contentDiv,\n contentMaxHeight,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,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L;AAAA,MACA,kBAAAE;AAAA,MACA,YAAAY;AAAA;AAAA,MACA,YAAApB;AAAA,MAGA,kBAAAwB;AAAA;AAAA,MACA,SAAA1B;AAAA,MAGA,SA5BA,MAAA;AACA,QAAAL,EAAA,YACAC,EAAA,OAAA;AAAA,MACA;AAAA,MA0BA,GAAAE;AAAA,MACA,iBAtCA,MAAA;AACA,QAAA,CAAAH,EAAA,YAAAA,EAAA,eACAW,EAAA,QAAA,CAAAA,EAAA,OACAV,EAAA,YAAAU,EAAA,KAAA,GACAiB,EAAA;AAAA,MACA;AAAA,IAkCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"card.js","sources":["../src/components/card/card.types.ts","../src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, useSlots, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Composables\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(\n defineProps<{\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions?: BentoButtonActionsList;\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout?: BentoButtonActionsLayout | `${BentoButtonActionsLayout}`;\n\n /**\n * Defines the color of card background\n */\n background?: BentoCardBackground | `${BentoCardBackground}`;\n\n /**\n * Sets the expandable card in a closed state\n */\n closed?: boolean;\n\n /**\n * Disables the expandable card\n */\n disabled?: boolean;\n\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable?: boolean;\n\n /**\n * Defines the title size of the card header\n */\n titleSize?: BentoCardTitleSize | `${BentoCardTitleSize}`;\n }>(),\n {\n actions: null,\n actionsLayout: BentoButtonActionsLayout.BUTTONS_END,\n background: BentoCardBackground.PRIMARY,\n closed: false,\n disabled: false,\n expandable: false,\n titleSize: BentoCardTitleSize.DEFAULT,\n }\n );\n\n const emit = defineEmits<{\n (e: 'click');\n (e: 'expanded', isExpanded: boolean);\n }>();\n\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header': isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default {\n i18n: { messages },\n name: 'bento-card',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","__default__","messages","t","useI18n","slots","useSlots","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","props","watch","value","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","emit"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;GCwRRE,IAAA;AAAA,EAAe,MAA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AAA,YACIwB,EAAA,OAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;"}
package/dist/checkbox.js CHANGED
@@ -1,13 +1,13 @@
1
- import { B as y, a as l } from "./chunks/checkbox.f38276e6.js";
1
+ import { B as y, a as l } from "./chunks/checkbox.28578383.js";
2
2
  import { C as D } from "./chunks/checkbox-input.1c3cc8ed.js";
3
3
  import { defineComponent as g, toRef as v, computed as n, watch as c, ref as x } from "vue";
4
4
  import { g as E } from "./chunks/unique-id.a2a2b458.js";
5
- import { d as k } from "./chunks/index.ba6c1040.js";
5
+ import { d as k } from "./chunks/index.d97166c6.js";
6
6
  import { u as C } from "./chunks/use-form-layout-loading.d03e5d48.js";
7
- import { C as S } from "./chunks/controls-group.f1dfa419.js";
8
- import { E as M } from "./chunks/error-message.8734e591.js";
7
+ import { C as S } from "./chunks/controls-group.faa482b2.js";
8
+ import { E as M } from "./chunks/error-message.db315e68.js";
9
9
  import { n as I } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
10
- import "./assets/index35.css";
10
+ import "./assets/index29.css";
11
11
  var s = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r))(s || {});
12
12
  const p = "bento-checkbox-group", T = g({
13
13
  name: p,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as b, computed as r, ref as _ } from "vue";
2
- import { B as d } from "./index.ba6c1040.js";
2
+ import { B as d } from "./index.d97166c6.js";
3
3
  import { u as f } from "./use-has-slot.fbeb19ec.js";
4
4
  import { n as p } from "./_plugin-vue2_normalizer.71e2aa87.js";
5
5
  import "../assets/base-button.css";
@@ -85,4 +85,4 @@ export {
85
85
  U as B,
86
86
  s as a
87
87
  };
88
- //# sourceMappingURL=base-button.090f511d.js.map
88
+ //# sourceMappingURL=base-button.773343f6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.090f511d.js","sources":["../../src/components/internal/base-button/base-button.types.ts","../../src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,cAAA,eAJQA,IAAAD,KAAA,CAAA,CAAA;ACwDZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACAJ,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,EACA;AAAA,EACA,MAAAK,GAAA,EAAA,OAAAC,GAAA,MAAAC,GAAA,OAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAA,kBAAAC,IAAAH,EAAA,eAAA,MAAA,gBAAAG,EAAA;AAAA,MACA;AAAA,KAAA,GAGAC,IAAAC,EAAA,IAAA,GAEAC,IAAAJ,EAAA,OAAA;AAAA,MAAA,CAAA,kBAAAZ,EAAA,aAAA,GAAAO,EAAA;AAAA,MACA,CAAA,kBAAAP,EAAA,WAAA,GAAA,CAAAQ,EAAA;AAAA,IACA,EAAA;AAoBA,WAAA;AAAA;AAAA,MAAA,gBAAAG;AAAA,MAEA,oBAAAK;AAAA;AAAA,MACA,eApBA,CAAAC,MAAA;AACA,QAAAV,EAAA,YAGAU,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAIA;AAAA,MAiBA,eAdA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAAA;AAAA,MAcA,cAXA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,MAAAe,CAAA;AAAA,MAAA;AAAA,MAWA,SAAAC,EAAAV,CAAA;AAAA;AAAA,MACA,oBAAAM;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-button.773343f6.js","sources":["../../src/components/internal/base-button/base-button.types.ts","../../src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,cAAA,eAJQA,IAAAD,KAAA,CAAA,CAAA;ACwDZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACAJ,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,IACAA,EAAA;AAAA,EACA;AAAA,EACA,MAAAK,GAAA,EAAA,OAAAC,GAAA,MAAAC,GAAA,OAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAA,kBAAAC,IAAAH,EAAA,eAAA,MAAA,gBAAAG,EAAA;AAAA,MACA;AAAA,KAAA,GAGAC,IAAAC,EAAA,IAAA,GAEAC,IAAAJ,EAAA,OAAA;AAAA,MAAA,CAAA,kBAAAZ,EAAA,aAAA,GAAAO,EAAA;AAAA,MACA,CAAA,kBAAAP,EAAA,WAAA,GAAA,CAAAQ,EAAA;AAAA,IACA,EAAA;AAoBA,WAAA;AAAA;AAAA,MAAA,gBAAAG;AAAA,MAEA,oBAAAK;AAAA;AAAA,MACA,eApBA,CAAAC,MAAA;AACA,QAAAV,EAAA,YAGAU,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAIA;AAAA,MAiBA,eAdA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,OAAAe,CAAA;AAAA,MAAA;AAAA,MAcA,cAXA,CAAAA,MAAA;AACA,QAAAR,EAAAP,EAAA,MAAAe,CAAA;AAAA,MAAA;AAAA,MAWA,SAAAC,EAAAV,CAAA;AAAA;AAAA,MACA,oBAAAM;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as x, useSlots as q, ref as r, computed as l, inject as Q, watch as F, nextTick as X, onUnmounted as Z, useAttrs as V, onMounted as tt, provide as G, toRefs as et } from "vue";
2
- import { a as at } from "./button.6e6324f0.js";
3
- import { B as ot } from "./index.94980f50.js";
2
+ import { a as at } from "./button.e5f5638f.js";
3
+ import { B as ot } from "./index.596c4d0a.js";
4
4
  import { u as J } from "./use-has-slot.fbeb19ec.js";
5
5
  import { u as nt } from "./i18n.eb5b985b.js";
6
6
  import { M as st } from "./base-modal.keys.b08a6bdf.js";
7
7
  import { g as lt } from "./unique-id.a2a2b458.js";
8
- import { B as it } from "./index.ba6c1040.js";
9
- import { F as ut } from "./footer-actions.11071f12.js";
10
- import { D as rt, B as ct, b as dt, a as mt } from "./dialog-page.75b295b7.js";
8
+ import { B as it } from "./index.d97166c6.js";
9
+ import { F as ut } from "./footer-actions.32891b25.js";
10
+ import { D as rt, B as ct, b as dt, a as mt } from "./dialog-page.286ead53.js";
11
11
  import { o as pt } from "./resize.a041304d.js";
12
12
  import { G as _t, a as gt } from "./grid-layout.e0025286.js";
13
13
  import { n as W } from "./_plugin-vue2_normalizer.71e2aa87.js";
@@ -369,4 +369,4 @@ export {
369
369
  ht as g,
370
370
  Wt as h
371
371
  };
372
- //# sourceMappingURL=base-modal.aa09a60c.js.map
372
+ //# sourceMappingURL=base-modal.2d596e6f.js.map