@adyen/bento-vue3 1.40.0 → 1.41.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 (140) hide show
  1. package/dist/@types/components.d.ts +6 -0
  2. package/dist/@types/packages/vue2/src/components/currency/currency.types.d.ts +18 -0
  3. package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +34 -211
  4. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.types.d.ts +0 -1
  5. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +1 -1
  6. package/dist/@types/packages/vue2/src/components/data-grid/composables/index.d.ts +1 -1
  7. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +1 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +10 -1
  9. package/dist/@types/packages/vue2/src/components/data-grid/composables/{use-selector.d.ts → use-selector/use-selector.d.ts} +2 -2
  10. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-sorter.d.ts +1 -2
  11. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +16 -1
  12. package/dist/@types/packages/vue2/src/components/image/image.vue.d.ts +43 -72
  13. package/dist/@types/packages/vue2/src/components/image/index.d.ts +1 -1
  14. package/dist/@types/packages/vue2/src/components/layout/components/layout-row/layout-row.vue.d.ts +54 -0
  15. package/dist/@types/packages/vue2/src/components/layout/index.d.ts +3 -0
  16. package/dist/@types/packages/vue2/src/components/layout/layout.keys.d.ts +1 -0
  17. package/dist/@types/packages/vue2/src/components/layout/layout.types.d.ts +19 -0
  18. package/dist/@types/packages/vue2/src/components/layout/layout.vue.d.ts +53 -0
  19. package/dist/@types/packages/vue2/src/components/promo-banner/__mock-image.d.ts +1 -0
  20. package/dist/@types/packages/vue2/src/components/promo-banner/index.d.ts +2 -0
  21. package/dist/@types/packages/vue2/src/components/promo-banner/promo-banner.types.d.ts +83 -0
  22. package/dist/@types/packages/vue2/src/components/promo-banner/promo-banner.vue.d.ts +65 -0
  23. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.types.d.ts +2 -0
  24. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +19 -4
  25. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -3
  26. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +1 -3
  27. package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +4 -4
  28. package/dist/@types/packages/vue2/src/index.d.ts +2 -0
  29. package/dist/action-bar.js +1 -1
  30. package/dist/assets/accordion-item.css +1 -1
  31. package/dist/assets/action-bar.css +1 -1
  32. package/dist/assets/base-modal.css +1 -1
  33. package/dist/assets/card.css +1 -1
  34. package/dist/assets/currency.css +1 -1
  35. package/dist/assets/data-grid.css +1 -1
  36. package/dist/assets/dialog-page.css +1 -1
  37. package/dist/assets/inspector.css +1 -1
  38. package/dist/assets/layout-row.css +1 -0
  39. package/dist/assets/menu.css +1 -1
  40. package/dist/assets/modal-fullscreen.css +1 -1
  41. package/dist/assets/popover.css +1 -1
  42. package/dist/assets/promo-banner.css +1 -0
  43. package/dist/assets/selection-card-group.css +1 -1
  44. package/dist/assets/sidepanel.css +1 -1
  45. package/dist/assets/structured-list-item.css +1 -1
  46. package/dist/checkbox.js +2 -2
  47. package/dist/chunks/{action-bar.CNH2XWmk.js → action-bar.BZIBGja0.js} +2 -2
  48. package/dist/chunks/{action-bar.CNH2XWmk.js.map → action-bar.BZIBGja0.js.map} +1 -1
  49. package/dist/chunks/{checkbox-group.Bu6WRt6i.js → checkbox-group.Zf-GivDW.js} +2 -2
  50. package/dist/chunks/{checkbox-group.Bu6WRt6i.js.map → checkbox-group.Zf-GivDW.js.map} +1 -1
  51. package/dist/chunks/{checkbox.DfUxRkJe.js → checkbox.DdMkyTo5.js} +15 -15
  52. package/dist/chunks/{checkbox.DfUxRkJe.js.map → checkbox.DdMkyTo5.js.map} +1 -1
  53. package/dist/chunks/{code-snippet.DqTEK8cz.js → code-snippet.Dp_tDJ-S.js} +3 -3
  54. package/dist/chunks/{code-snippet.DqTEK8cz.js.map → code-snippet.Dp_tDJ-S.js.map} +1 -1
  55. package/dist/chunks/{currency.BGrGBnhm.js → currency.Dz2x17_Q.js} +57 -70
  56. package/dist/chunks/currency.Dz2x17_Q.js.map +1 -0
  57. package/dist/chunks/{dashboard-section.rv0r2_-a.js → dashboard-section.BdRXcY4u.js} +2 -2
  58. package/dist/chunks/{dashboard-section.rv0r2_-a.js.map → dashboard-section.BdRXcY4u.js.map} +1 -1
  59. package/dist/chunks/{data-grid.DR-w_KKU.js → data-grid.BC2tOBxm.js} +1329 -1276
  60. package/dist/chunks/data-grid.BC2tOBxm.js.map +1 -0
  61. package/dist/chunks/{date-picker.mfXjVZ9w.js → date-picker.B6HK0sb2.js} +14 -14
  62. package/dist/chunks/{date-picker.mfXjVZ9w.js.map → date-picker.B6HK0sb2.js.map} +1 -1
  63. package/dist/chunks/{date-range-picker.Cs8Ia3Qs.js → date-range-picker.3iWt1Cd6.js} +23 -23
  64. package/dist/chunks/{date-range-picker.Cs8Ia3Qs.js.map → date-range-picker.3iWt1Cd6.js.map} +1 -1
  65. package/dist/chunks/{dropdown-tag.DeoUXbp4.js → dropdown-tag.ChFJ9l5g.js} +2 -2
  66. package/dist/chunks/{dropdown-tag.DeoUXbp4.js.map → dropdown-tag.ChFJ9l5g.js.map} +1 -1
  67. package/dist/chunks/{dropdown.DBxpqjEM.js → dropdown.CMKdLPHi.js} +26 -26
  68. package/dist/chunks/{dropdown.DBxpqjEM.js.map → dropdown.CMKdLPHi.js.map} +1 -1
  69. package/dist/chunks/es6.b4enG1py.js +10 -0
  70. package/dist/chunks/es6.b4enG1py.js.map +1 -0
  71. package/dist/chunks/{filter-bar.DiW13x-f.js → filter-bar.pKcJryD3.js} +7 -7
  72. package/dist/chunks/{filter-bar.DiW13x-f.js.map → filter-bar.pKcJryD3.js.map} +1 -1
  73. package/dist/chunks/image.vue_vue_type_script_setup_true_lang.BMoSMeM-.js +47 -0
  74. package/dist/chunks/image.vue_vue_type_script_setup_true_lang.BMoSMeM-.js.map +1 -0
  75. package/dist/chunks/index.ChdIlujs.js +248 -0
  76. package/dist/chunks/{index.DKQuLmwu.js.map → index.ChdIlujs.js.map} +1 -1
  77. package/dist/chunks/{input-field.DbeVnbwg.js → input-field.Bk2p3kIb.js} +2 -2
  78. package/dist/chunks/{input-field.DbeVnbwg.js.map → input-field.Bk2p3kIb.js.map} +1 -1
  79. package/dist/chunks/layout-row.rzhGrBQ3.js +101 -0
  80. package/dist/chunks/layout-row.rzhGrBQ3.js.map +1 -0
  81. package/dist/chunks/{pagination.B-OihXTg.js → pagination.D_4FRHE9.js} +2 -2
  82. package/dist/chunks/{pagination.B-OihXTg.js.map → pagination.D_4FRHE9.js.map} +1 -1
  83. package/dist/chunks/promo-banner.BRn1iznD.js +126 -0
  84. package/dist/chunks/promo-banner.BRn1iznD.js.map +1 -0
  85. package/dist/chunks/{search-bar.DN-QKFlJ.js → search-bar.D_4u91te.js} +3 -3
  86. package/dist/chunks/{search-bar.DN-QKFlJ.js.map → search-bar.D_4u91te.js.map} +1 -1
  87. package/dist/chunks/{secondary-nav.C-7Qq6rE.js → secondary-nav.CQ3aLyrM.js} +4 -4
  88. package/dist/chunks/{secondary-nav.C-7Qq6rE.js.map → secondary-nav.CQ3aLyrM.js.map} +1 -1
  89. package/dist/chunks/selection-card-group.Du3Cwf47.js +474 -0
  90. package/dist/chunks/selection-card-group.Du3Cwf47.js.map +1 -0
  91. package/dist/chunks/{structured-list-item.BhNJlDub.js → structured-list-item.CujUEOTK.js} +3 -3
  92. package/dist/chunks/structured-list-item.CujUEOTK.js.map +1 -0
  93. package/dist/chunks/{timeline-item.CEolKFn0.js → timeline-item.B8VvkDfR.js} +2 -2
  94. package/dist/chunks/{timeline-item.CEolKFn0.js.map → timeline-item.B8VvkDfR.js.map} +1 -1
  95. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bz6QyDuV.js → tutorial.vue_vue_type_script_setup_true_lang.CGpbGgfc.js} +9 -9
  96. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bz6QyDuV.js.map → tutorial.vue_vue_type_script_setup_true_lang.CGpbGgfc.js.map} +1 -1
  97. package/dist/chunks/{use-cached-selected-values.C7Lt5U_S.js → use-cached-selected-values.DaRzXFIt.js} +2 -2
  98. package/dist/chunks/{use-cached-selected-values.C7Lt5U_S.js.map → use-cached-selected-values.DaRzXFIt.js.map} +1 -1
  99. package/dist/code-snippet.js +1 -1
  100. package/dist/currency.js +1 -1
  101. package/dist/dashboard-template.js +1 -1
  102. package/dist/data-grid.js +1 -1
  103. package/dist/date-picker.js +1 -1
  104. package/dist/date-range-picker.js +1 -1
  105. package/dist/dropdown.js +3 -3
  106. package/dist/filter-bar.js +1 -1
  107. package/dist/image.js +1 -1
  108. package/dist/index.js +197 -190
  109. package/dist/index.js.map +1 -1
  110. package/dist/input-field.js +1 -1
  111. package/dist/internal.js +1 -1
  112. package/dist/layout.js +6 -0
  113. package/dist/layout.js.map +1 -0
  114. package/dist/pagination.js +1 -1
  115. package/dist/promo-banner.js +7 -0
  116. package/dist/promo-banner.js.map +1 -0
  117. package/dist/search-bar.js +2 -2
  118. package/dist/secondary-nav.js +1 -1
  119. package/dist/selection-card.js +1 -1
  120. package/dist/structured-list.js +1 -1
  121. package/dist/styles/bento-dark.css +16 -0
  122. package/dist/styles/bento-light.css +16 -0
  123. package/dist/styles/bento.css +16 -0
  124. package/dist/styles/legacy.css +16 -0
  125. package/dist/styles/styleguide.css +16 -0
  126. package/dist/timeline.js +1 -1
  127. package/dist/tutorial.js +1 -1
  128. package/dist/web-types.json +1 -1
  129. package/package.json +2 -2
  130. package/dist/@types/packages/vue2/src/components/image/image.types.d.ts +0 -19
  131. package/dist/chunks/currency.BGrGBnhm.js.map +0 -1
  132. package/dist/chunks/data-grid.DR-w_KKU.js.map +0 -1
  133. package/dist/chunks/es6.BvpG4Oi6.js +0 -9
  134. package/dist/chunks/es6.BvpG4Oi6.js.map +0 -1
  135. package/dist/chunks/image.0KzfycGE.js +0 -78
  136. package/dist/chunks/image.0KzfycGE.js.map +0 -1
  137. package/dist/chunks/index.DKQuLmwu.js +0 -182
  138. package/dist/chunks/selection-card-group.DkSYInMF.js +0 -392
  139. package/dist/chunks/selection-card-group.DkSYInMF.js.map +0 -1
  140. package/dist/chunks/structured-list-item.BhNJlDub.js.map +0 -1
@@ -1,392 +0,0 @@
1
- import { defineComponent as W, useSlots as X, computed as r, inject as le, ref as R, openBlock as n, createElementBlock as M, normalizeClass as f, createElementVNode as V, unref as l, renderSlot as m, createCommentVNode as v, withModifiers as te, createBlock as d, withCtx as s, createTextVNode as T, toDisplayString as q, createVNode as oe, watch as re, provide as ne, Fragment as ie, renderList as de, mergeProps as x, createSlots as se } from "vue";
2
- import { B as S } from "./typography.DNzU41ah.js";
3
- import { u as ce } from "./aria-label.CaUURpnB.js";
4
- import { g as w } from "./generate-uid.D-HFI38h.js";
5
- import { u as ue } from "./use-has-slot.B7eQSabc.js";
6
- import { a as fe } from "./radio-input.DtvlM-mr.js";
7
- import { a as be } from "./checkbox-input.D8ZUqd4m.js";
8
- import { _ as Z } from "./_plugin-vue_export-helper.CHgC5LLL.js";
9
- import { C as ye } from "./controls-group.RL8WrYdy.js";
10
- import { E as ve } from "./error-message.CmMyB-k9.js";
11
- import "../assets/selection-card-group.css";
12
- var E = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e))(E || {});
13
- const ee = Symbol("selection card radio input injection key"), me = {
14
- key: 0,
15
- class: "b-selection-card__icon",
16
- role: "presentation"
17
- }, pe = ["for"], he = {
18
- name: "bento-selection-card"
19
- }, ge = /* @__PURE__ */ W({
20
- ...he,
21
- props: {
22
- /**
23
- * The description of the selection card
24
- */
25
- description: {
26
- type: String,
27
- default: void 0
28
- },
29
- /**
30
- * Disables the selection card
31
- */
32
- disabled: { type: Boolean, default: !1 },
33
- /**
34
- * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.
35
- */
36
- fullyClickable: { type: Boolean, default: !1 },
37
- /**
38
- * Shows the selection card in error state
39
- */
40
- hasError: { type: Boolean, default: !1 },
41
- /**
42
- * This property should not be used directly.
43
- * It will be used by v-model directive on selection card component.
44
- *
45
- * When handling a single input, use a string or a number.
46
- *
47
- * When handling multiple inputs, use an array of keys.
48
- * These keys exist as a set "value" prop for each input.
49
- */
50
- modelValue: {
51
- type: [Boolean, String, Array],
52
- default: null
53
- },
54
- /**
55
- * Sets the selection card to readonly
56
- */
57
- readonly: { type: Boolean, default: !1 },
58
- /**
59
- * The subtitle of the selection card
60
- */
61
- subtitle: {
62
- type: String,
63
- default: void 0
64
- },
65
- /**
66
- * The title of the selection card
67
- */
68
- title: {
69
- type: String,
70
- required: !0
71
- },
72
- /**
73
- * Indicates the value of the input that will be returned when it's checked.
74
- */
75
- value: {
76
- type: [String, Number],
77
- required: !0
78
- }
79
- },
80
- emits: ["input", "update:model-value"],
81
- setup(e, { emit: B }) {
82
- const a = e, p = B, _ = X(), c = ue(_), h = w("selection-card-input-id"), b = w("selection-card-description"), I = r(
83
- () => a.modelValue
84
- ), g = r(
85
- () => a.modelValue
86
- ), $ = r(() => ({
87
- "b-selection-card--checked": Y.value,
88
- "b-selection-card--fully-clickable": a.fullyClickable
89
- })), A = r(() => ({
90
- [`b-selection-card--${E.DISABLED}`]: a.disabled,
91
- [`b-selection-card--${E.ERROR}`]: a.hasError,
92
- [`b-selection-card--${E.READONLY}`]: a.readonly,
93
- "b-selection-card--center-aligned": N.value
94
- })), i = r(() => ({
95
- "b-selection-card__checkbox-container--center-aligned": N.value
96
- })), G = r(() => ({
97
- "b-selection-card__checkbox-container-text--center-aligned": N.value
98
- })), o = r(() => ({
99
- "b-selection-card__slot--with-icon": c("icon")
100
- })), z = ce({
101
- ariaLabel: a.title,
102
- label: a.value
103
- }), U = r(() => Array.isArray(a.modelValue)), Y = r(() => L.value ? a.value === a.modelValue : U.value ? a.modelValue.some((t) => t === a.value) : a.modelValue), L = le(ee, R(!1)), N = r(() => !a.subtitle && !a.description), y = R(null), D = R(null), O = R(null), j = (t) => {
104
- var u, C, H, J, K, Q;
105
- if (y.value.$refs.inputRef === t.target) {
106
- const ae = P();
107
- F(ae);
108
- return;
109
- }
110
- if (a.disabled && a.readonly || !a.fullyClickable && (D.value && ((C = (u = D.value) == null ? void 0 : u.$el) != null && C.contains(t.target)) || O.value && ((J = (H = O.value) == null ? void 0 : H.$el) != null && J.contains(t.target)) || y.value && ((Q = (K = y.value) == null ? void 0 : K.$el) != null && Q.contains(t.target))))
111
- return;
112
- const k = P();
113
- F(k);
114
- }, P = () => {
115
- var k;
116
- const t = ((k = y.value) == null ? void 0 : k.$refs.inputRef).checked;
117
- if (U.value) {
118
- const u = [...a.modelValue], C = u.indexOf(a.value);
119
- return C === -1 ? u.push(a.value) : u.splice(C, 1), u;
120
- }
121
- return L.value ? a.value : t;
122
- }, F = (t) => {
123
- !a.disabled && !a.readonly && (p("update:model-value", t), p("input", t));
124
- };
125
- return (t, k) => (n(), M("div", {
126
- class: f(["b-selection-card", $.value]),
127
- onClick: j
128
- }, [
129
- V("div", {
130
- class: f(["b-selection-card__container", A.value])
131
- }, [
132
- V("div", {
133
- class: f(["b-selection-card__checkbox-container", i.value])
134
- }, [
135
- V("div", {
136
- class: f(["b-selection-card__checkbox-container-text", G.value])
137
- }, [
138
- l(c)("icon") ? (n(), M("div", me, [
139
- m(t.$slots, "icon", {}, void 0, !0)
140
- ])) : v("", !0),
141
- V("label", {
142
- for: l(h),
143
- class: "b-selection-card__text",
144
- onClick: te(j, ["stop", "prevent"])
145
- }, [
146
- e.subtitle ? (n(), d(l(S), {
147
- key: 0,
148
- class: "b-selection-card__description",
149
- el: "span",
150
- variant: "caption"
151
- }, {
152
- default: s(() => [
153
- T(q(e.subtitle), 1)
154
- ]),
155
- _: 1
156
- })) : v("", !0),
157
- oe(l(S), {
158
- el: "span",
159
- variant: "title"
160
- }, {
161
- default: s(() => [
162
- T(q(e.title), 1)
163
- ]),
164
- _: 1
165
- }),
166
- e.description ? (n(), d(l(S), {
167
- key: 1,
168
- id: "descriptionId",
169
- class: "b-selection-card__description",
170
- el: "span",
171
- variant: "body"
172
- }, {
173
- default: s(() => [
174
- T(q(e.description), 1)
175
- ]),
176
- _: 1
177
- })) : v("", !0)
178
- ], 8, pe)
179
- ], 2),
180
- l(L) ? (n(), d(l(fe), {
181
- key: 0,
182
- id: l(h),
183
- ref_key: "inputRef",
184
- ref: y,
185
- "aria-label": l(z),
186
- "aria-describedby": e.description ? l(b) : void 0,
187
- disabled: e.disabled,
188
- "has-error": e.hasError,
189
- "aria-readonly": e.readonly ?? void 0,
190
- value: e.value,
191
- readonly: e.readonly,
192
- "model-value": I.value
193
- }, null, 8, ["id", "aria-label", "aria-describedby", "disabled", "has-error", "aria-readonly", "value", "readonly", "model-value"])) : (n(), d(l(be), {
194
- key: 1,
195
- id: l(h),
196
- ref_key: "inputRef",
197
- ref: y,
198
- "aria-label": l(z),
199
- "aria-describedby": e.description ? l(b) : void 0,
200
- disabled: e.disabled,
201
- "has-error": e.hasError,
202
- "aria-readonly": e.readonly ?? void 0,
203
- value: e.value,
204
- readonly: e.readonly,
205
- "model-value": g.value
206
- }, null, 8, ["id", "aria-label", "aria-describedby", "disabled", "has-error", "aria-readonly", "value", "readonly", "model-value"]))
207
- ], 2),
208
- l(c)("content") ? (n(), d(l(S), {
209
- key: 0,
210
- ref_key: "slotRef",
211
- ref: D,
212
- el: "div",
213
- class: f(["b-selection-card__slot", o.value])
214
- }, {
215
- default: s(() => [
216
- m(t.$slots, "content", {}, void 0, !0)
217
- ]),
218
- _: 3
219
- }, 8, ["class"])) : v("", !0),
220
- l(c)("dynamicContent") && Y.value ? (n(), d(l(S), {
221
- key: 1,
222
- ref_key: "dynamicSlotRef",
223
- ref: O,
224
- el: "div",
225
- class: f(["b-selection-card__slot", o.value])
226
- }, {
227
- default: s(() => [
228
- m(t.$slots, "dynamicContent", {}, void 0, !0)
229
- ]),
230
- _: 3
231
- }, 8, ["class"])) : v("", !0)
232
- ], 2)
233
- ], 2));
234
- }
235
- }), ke = /* @__PURE__ */ Z(ge, [["__scopeId", "data-v-582a885b"]]), Ce = {}, Se = /* @__PURE__ */ W({
236
- ...Ce,
237
- __name: "selection-card-group",
238
- props: {
239
- /**
240
- * Descriptive supporting text visbile underneath the label.
241
- */
242
- description: { type: String, default: null },
243
- /**
244
- * If set to true, renders all cards in the group in a disabled state.
245
- */
246
- disabled: { type: Boolean, default: !1 },
247
- /**
248
- * Renders all cards in an error state with an error message.
249
- */
250
- errorMessage: { type: String, default: null },
251
- /**
252
- * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.
253
- */
254
- formId: { type: String, default: null },
255
- /**
256
- * Shows/hides the group label.
257
- */
258
- hideLabel: { type: Boolean, default: null },
259
- /**
260
- * Label of the group. Required for accessibility purposes, even if it's not shown
261
- */
262
- label: {
263
- type: String,
264
- required: !0
265
- },
266
- /**
267
- * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.
268
- * @values horizontal, vertical
269
- */
270
- layout: {
271
- type: String,
272
- default: "vertical"
273
- },
274
- /**
275
- * The selection card group's items.
276
- */
277
- items: {
278
- type: Array,
279
- required: !0
280
- },
281
- /**
282
- * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.
283
- * Defaults to no value selected.
284
- */
285
- modelValue: {
286
- type: [Array, String, Number],
287
- default: null
288
- },
289
- /**
290
- * Indicates the field is optional.
291
- */
292
- optional: { type: Boolean, default: !1 },
293
- /**
294
- * Indicates the field is required.
295
- */
296
- required: { type: Boolean, default: !1 },
297
- /**
298
- * Tooltip message.
299
- */
300
- tooltipText: { type: String, default: null },
301
- /**
302
- * If set to true, renders all cards in the group in a readonly state.
303
- */
304
- readonly: { type: Boolean, default: !1 },
305
- /**
306
- * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.
307
- * @values checkbox, radio
308
- */
309
- variant: { type: String, default: "checkbox" }
310
- },
311
- emits: ["input", "update:model-value"],
312
- setup(e, { emit: B }) {
313
- const a = e, p = B, _ = X(), c = (i) => !!_[i], h = r(() => ({
314
- "b-selection-card-group__items--horizontal": a.layout === "horizontal"
315
- })), b = R(a.modelValue);
316
- re(
317
- () => a.modelValue,
318
- () => {
319
- b.value = a.modelValue;
320
- }
321
- );
322
- const I = w("error"), g = r(() => !a.disabled && !a.readonly && !!a.errorMessage), $ = (i) => {
323
- b.value = i, p("update:model-value", i), p("input", i);
324
- }, A = r(() => a.variant === "radio");
325
- return ne(ee, A), (i, G) => (n(), d(l(ye), {
326
- "aria-describedby": g.value ? l(I) : null,
327
- label: e.label,
328
- "hide-label": e.hideLabel,
329
- description: e.description,
330
- disabled: e.disabled,
331
- "tooltip-text": e.tooltipText,
332
- readonly: e.readonly,
333
- required: e.required,
334
- optional: e.optional,
335
- class: "b-selection-card-group",
336
- "component-name": "selection-card-group"
337
- }, {
338
- default: s(() => [
339
- V("div", {
340
- class: f(["b-selection-card-group__items", h.value])
341
- }, [
342
- (n(!0), M(ie, null, de(e.items, (o) => (n(), d(ke, x({
343
- key: `selection-card-${o.value}`,
344
- class: "b-selection-card-group__item",
345
- ref_for: !0
346
- }, o, {
347
- "model-value": b.value,
348
- readonly: e.readonly || o.readonly,
349
- "has-error": g.value,
350
- disabled: e.disabled || o.disabled,
351
- "onUpdate:modelValue": $
352
- }), se({ _: 2 }, [
353
- c("icon") && o.icon ? {
354
- name: "icon",
355
- fn: s(() => [
356
- m(i.$slots, "icon", x({ ref_for: !0 }, o), void 0, !0)
357
- ]),
358
- key: "0"
359
- } : void 0,
360
- c("content") && o.content ? {
361
- name: "content",
362
- fn: s(() => [
363
- m(i.$slots, "content", x({ ref_for: !0 }, o), void 0, !0)
364
- ]),
365
- key: "1"
366
- } : void 0,
367
- c("dynamicContent") && o.dynamicContent ? {
368
- name: "dynamicContent",
369
- fn: s(() => [
370
- m(i.$slots, "dynamicContent", x({ ref_for: !0 }, o), void 0, !0)
371
- ]),
372
- key: "2"
373
- } : void 0
374
- ]), 1040, ["model-value", "readonly", "has-error", "disabled"]))), 128))
375
- ], 2),
376
- g.value ? (n(), d(l(ve), {
377
- key: 0,
378
- id: l(I),
379
- "error-message": e.errorMessage,
380
- class: "b-selection-card-group__error-message"
381
- }, null, 8, ["id", "error-message"])) : v("", !0)
382
- ]),
383
- _: 3
384
- }, 8, ["aria-describedby", "label", "hide-label", "description", "disabled", "tooltip-text", "readonly", "required", "optional"]));
385
- }
386
- }), Ne = /* @__PURE__ */ Z(Se, [["__scopeId", "data-v-79b250a4"]]);
387
- export {
388
- ke as B,
389
- E as a,
390
- Ne as s
391
- };
392
- //# sourceMappingURL=selection-card-group.DkSYInMF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-card-group.DkSYInMF.js","sources":["../../../vue2/src/components/selection-card/selection-card.types.ts","../../../vue2/src/components/selection-card/selection-card.keys.ts","../../../vue2/src/components/selection-card/selection-card.vue","../../../vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { RadioInputValue } from '@/components/internal/radio-input';\nimport { BentoCheckboxType } from '@/core/components/checkbox/checkbox.types';\nimport { VueNodeElement } from '@/types';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { BentoCheckboxType, BentoMultiCheckboxType, CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, RadioInputValue } from '../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, inject, PropType, Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the selection card is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoSelectionCardValue);\n /**\n * Emitted when the selection card is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoSelectionCardValue);\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div class=\"b-selection-card-group__items\" :class=\"conditionalItemsClasses\">\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, ref, useSlots, watch } from 'vue';\n import { BentoSelectionCardGroupLayout, BentoSelectionCardGroupVariant } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage } from '../../../internal';\n import { BentoSelectionCardItem, BentoSelectionCardModelValue } from '../../selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all cards in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * Label of the group. Required for accessibility purposes, even if it's not shown\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @values horizontal, vertical\n */\n layout: {\n type: String as PropType<BentoSelectionCardGroupLayout>,\n default: 'vertical',\n },\n\n /**\n * The selection card group's items.\n */\n items: {\n type: Array as PropType<BentoSelectionCardItem[]>,\n required: true,\n },\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Array, String, Number] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.\n * @values checkbox, radio\n */\n variant: { type: String as PropType<BentoSelectionCardGroupVariant>, default: 'checkbox' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the selection card is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoSelectionCardModelValue);\n /**\n * Emitted when the selection card is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoSelectionCardModelValue);\n }>();\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n const onInput = value => {\n inputValue.value = value;\n emit('update:model-value', value);\n emit('input', value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","_b","_a","_d","_c","_f","_e","newValue","currentValue","newCheckedList","index","__default__","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","onInput","value","isRadioVariant","provide"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"structured-list-item.BhNJlDub.js","sources":["../../../vue2/src/components/structured-list/structured-list.keys.ts","../../../vue2/src/components/structured-list/structured-list.types.ts","../../../vue2/src/components/structured-list/structured-list.vue","../../../vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth?: number;\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n */\n layout?: BentoStructuredListLayoutOptions;\n }>(),\n {\n labelsWidth: null,\n layout: '33-66',\n }\n );\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\">\n * 123456\n * </bento-currency>\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps<{\n /**\n * Label to display for the value\n */\n label: string;\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo?: string;\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy?: string;\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search?: (event: Event) => void;\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip?: string;\n /**\n * Truncates the value of the item\n */\n truncate?: boolean;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\">\n * 123456\n * </bento-currency>\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","props","__props","isCondensed","inject","computedLayout","computed","computedLabelsWidth","provide","__default__","messages","DEFAULT_LABELS_WIDTH","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","labelTypographyVariant"],"mappings":";;;;;;;;;;;AAAa,MAAAA,IAAA,OAAA,+CAAA,GACAC,IAAA,OAAA,4CAAA,GCANC,IAAA,CAAA,SAAA,SAAA,SAAA,OAAA,uCCoFHC,IAAA,CAAA;;;;;;;;AAvEA,UAAAC,IAAAC,GA0BAC,IAAAC,EAAAP,GAAA,EAAA,GAEAQ,IAAAC;AAAA,MAAuB,MAAAP,EAAA,SAAAE,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EM,IAAAD,EAAA,MACIH,IACI,UAGJF,EAAA,cACI,GAAAA,EAAA,WAAA,OAGJ,GAAAI,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA,CAAA,GAA4C;AAGhD,WAAAG,EAAAV,GAAAS,CAAA;;;;;;;;;;;;;;GC8DAE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;AAxEA,UAAAC,IAAA,OAEAV,IAAAC,GA2BA,EAAA,GAAAU,EAAA,IAAAC,EAAA,EAAA,UAAAH,EAAA,CAAA,GACAP,IAAAC,EAAAP,GAAA,EAAA,GACAiB,IAAAV,EAAAN,GAAAiB,EAAAJ,CAAA,CAAA,GACAK,IAAAV,EAAA,MAAA,cAAAQ,EAAA,KAAA,EAAA,GACAG,IAAAX,EAAA,OAAA;AAAA,MAA2C,qCAAAH;AAAA,IACF,EAAA,GAGzCe,IAAAZ,EAAA,OAAA;AAAA,MAAgD,2CAAAL,EAAA;AAAA,IACK,EAAA,GAGrDkB,IAAAb,EAAA,MAAAH,IAAA,YAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}