@adyen/bento-vue3 1.45.0 → 1.47.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 (199) hide show
  1. package/dist/@types/index.d.ts +128 -47
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/calendar.css +1 -1
  9. package/dist/assets/card.css +1 -1
  10. package/dist/assets/data-grid.css +1 -1
  11. package/dist/assets/date-picker.css +1 -1
  12. package/dist/assets/date-range-picker.css +1 -1
  13. package/dist/assets/dialog-page.css +1 -1
  14. package/dist/assets/divider.css +1 -1
  15. package/dist/assets/dropdown.css +1 -1
  16. package/dist/assets/file-uploader.css +1 -1
  17. package/dist/assets/input-field-password.css +1 -1
  18. package/dist/assets/input-field.css +1 -1
  19. package/dist/assets/inspector.css +1 -1
  20. package/dist/assets/menu.css +1 -1
  21. package/dist/assets/modal-fullscreen.css +1 -1
  22. package/dist/assets/popover.css +1 -1
  23. package/dist/assets/radio-group.css +1 -1
  24. package/dist/assets/radio-input.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/assets/status.css +1 -1
  27. package/dist/assets/step.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{accordion-item.DfOb4Pyx.js → accordion-item.LeB4jteX.js} +5 -5
  32. package/dist/chunks/{accordion-item.DfOb4Pyx.js.map → accordion-item.LeB4jteX.js.map} +1 -1
  33. package/dist/chunks/{action-bar.CmDQZkM2.js → action-bar.BN-AoRn0.js} +11 -11
  34. package/dist/chunks/{action-bar.CmDQZkM2.js.map → action-bar.BN-AoRn0.js.map} +1 -1
  35. package/dist/chunks/{alert.D1Ax6AnI.js → alert.DTX7XqPC.js} +7 -7
  36. package/dist/chunks/{alert.D1Ax6AnI.js.map → alert.DTX7XqPC.js.map} +1 -1
  37. package/dist/chunks/{base-modal.DbJYaHyG.js → base-modal.BsD3EOCY.js} +5 -5
  38. package/dist/chunks/{base-modal.DbJYaHyG.js.map → base-modal.BsD3EOCY.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.BUyecZNi.js → button-actions-with-menu.CUL1q1Ca.js} +4 -4
  40. package/dist/chunks/{button-actions-with-menu.BUyecZNi.js.map → button-actions-with-menu.CUL1q1Ca.js.map} +1 -1
  41. package/dist/chunks/{button-actions.CShVMUOC.js → button-actions.DBgK5Qwo.js} +5 -5
  42. package/dist/chunks/{button-actions.CShVMUOC.js.map → button-actions.DBgK5Qwo.js.map} +1 -1
  43. package/dist/chunks/{calendar.1qqtC8ba.js → calendar.CKY08nCx.js} +120 -107
  44. package/dist/chunks/{calendar.1qqtC8ba.js.map → calendar.CKY08nCx.js.map} +1 -1
  45. package/dist/chunks/{card.rkMUtirc.js → card.BUBXMpP5.js} +10 -10
  46. package/dist/chunks/{card.rkMUtirc.js.map → card.BUBXMpP5.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.PTNxE0kL.js → checkbox-group.DOAFzAX-.js} +4 -4
  48. package/dist/chunks/{checkbox-group.PTNxE0kL.js.map → checkbox-group.DOAFzAX-.js.map} +1 -1
  49. package/dist/chunks/{checkbox.D9FJcICR.js → checkbox.J51-tG4g.js} +22 -22
  50. package/dist/chunks/{checkbox.D9FJcICR.js.map → checkbox.J51-tG4g.js.map} +1 -1
  51. package/dist/chunks/code-snippet.CUzz3c-V.js +422 -0
  52. package/dist/chunks/code-snippet.CUzz3c-V.js.map +1 -0
  53. package/dist/chunks/{codemirror.CXFEqvAi.js → codemirror.0fz2cWJS.js} +4970 -4661
  54. package/dist/chunks/codemirror.0fz2cWJS.js.map +1 -0
  55. package/dist/chunks/{controls-group.BHxcGQ2A.js → controls-group.CjqybvY2.js} +2 -2
  56. package/dist/chunks/{controls-group.BHxcGQ2A.js.map → controls-group.CjqybvY2.js.map} +1 -1
  57. package/dist/chunks/{copy.DAMq-zRP.js → copy.VRsofU-g.js} +5 -5
  58. package/dist/chunks/{copy.DAMq-zRP.js.map → copy.VRsofU-g.js.map} +1 -1
  59. package/dist/chunks/{country.Cv_8NTmw.js → country.D2t_VEYd.js} +2 -2
  60. package/dist/chunks/{country.Cv_8NTmw.js.map → country.D2t_VEYd.js.map} +1 -1
  61. package/dist/chunks/{country.types.pilf5B3F.js → country.types.CLjbulKL.js} +4114 -4114
  62. package/dist/chunks/{country.types.pilf5B3F.js.map → country.types.CLjbulKL.js.map} +1 -1
  63. package/dist/chunks/{dashboard-section.Buh9mb22.js → dashboard-section.BAJgkMXW.js} +3 -3
  64. package/dist/chunks/{dashboard-section.Buh9mb22.js.map → dashboard-section.BAJgkMXW.js.map} +1 -1
  65. package/dist/chunks/{dashed-underline.DYVSwQtH.js → dashed-underline.B_eVv1aB.js} +2 -2
  66. package/dist/chunks/{dashed-underline.DYVSwQtH.js.map → dashed-underline.B_eVv1aB.js.map} +1 -1
  67. package/dist/chunks/{data-grid-template.B6xmEgaM.js → data-grid-template.DrwGj6Yq.js} +2 -2
  68. package/dist/chunks/{data-grid-template.B6xmEgaM.js.map → data-grid-template.DrwGj6Yq.js.map} +1 -1
  69. package/dist/chunks/{data-grid.DVc9qzLU.js → data-grid.V4b5UdXZ.js} +46 -46
  70. package/dist/chunks/{data-grid.DVc9qzLU.js.map → data-grid.V4b5UdXZ.js.map} +1 -1
  71. package/dist/chunks/{date-picker.Bt4fyPQ4.js → date-picker.DjuQyWzZ.js} +45 -36
  72. package/dist/chunks/date-picker.DjuQyWzZ.js.map +1 -0
  73. package/dist/chunks/{date-range-picker.Bna_2pBL.js → date-range-picker.CmxXWnBc.js} +328 -324
  74. package/dist/chunks/date-range-picker.CmxXWnBc.js.map +1 -0
  75. package/dist/chunks/divider.qUOSAbU6.js +33 -0
  76. package/dist/chunks/divider.qUOSAbU6.js.map +1 -0
  77. package/dist/chunks/{dropdown-default-textbox.ipIFhyWZ.js → dropdown-default-textbox.Dl8Jv2bS.js} +4 -4
  78. package/dist/chunks/{dropdown-default-textbox.ipIFhyWZ.js.map → dropdown-default-textbox.Dl8Jv2bS.js.map} +1 -1
  79. package/dist/chunks/{dropdown-tag.DLyxItIS.js → dropdown-tag.D8hXRrMj.js} +4 -4
  80. package/dist/chunks/{dropdown-tag.DLyxItIS.js.map → dropdown-tag.D8hXRrMj.js.map} +1 -1
  81. package/dist/chunks/{dropdown.CZDXXpKe.js → dropdown.BWu3fV-K.js} +263 -256
  82. package/dist/chunks/dropdown.BWu3fV-K.js.map +1 -0
  83. package/dist/chunks/{error-message.BVE3JdTq.js → error-message.qsc0nOWT.js} +8 -8
  84. package/dist/chunks/{error-message.BVE3JdTq.js.map → error-message.qsc0nOWT.js.map} +1 -1
  85. package/dist/chunks/{es6.jIyAPBgt.js → es6.BtaxuP0b.js} +7 -7
  86. package/dist/chunks/es6.BtaxuP0b.js.map +1 -0
  87. package/dist/chunks/file-uploader.BNGBBltW.js +2226 -0
  88. package/dist/chunks/file-uploader.BNGBBltW.js.map +1 -0
  89. package/dist/chunks/{filter-bar.oihCCt5N.js → filter-bar.Db-KfD-S.js} +53 -53
  90. package/dist/chunks/{filter-bar.oihCCt5N.js.map → filter-bar.Db-KfD-S.js.map} +1 -1
  91. package/dist/chunks/{footer-actions.n0JIXO4Q.js → footer-actions.BG8-pOU-.js} +2 -2
  92. package/dist/chunks/{footer-actions.n0JIXO4Q.js.map → footer-actions.BG8-pOU-.js.map} +1 -1
  93. package/dist/chunks/{form-layout-title.srkVLEUW.js → form-layout-title._25l9_Xm.js} +2 -2
  94. package/dist/chunks/{form-layout-title.srkVLEUW.js.map → form-layout-title._25l9_Xm.js.map} +1 -1
  95. package/dist/chunks/{header.CAHXObTT.js → header.vPx_0dwO.js} +4 -4
  96. package/dist/chunks/{header.CAHXObTT.js.map → header.vPx_0dwO.js.map} +1 -1
  97. package/dist/chunks/{info-icon-with-popover.DFv8U4sh.js → info-icon-with-popover.CieLDo3g.js} +5 -5
  98. package/dist/chunks/{info-icon-with-popover.DFv8U4sh.js.map → info-icon-with-popover.CieLDo3g.js.map} +1 -1
  99. package/dist/chunks/{input-field-password.DedPkZxg.js → input-field-password.CS7rxMCK.js} +80 -80
  100. package/dist/chunks/{input-field-password.DedPkZxg.js.map → input-field-password.CS7rxMCK.js.map} +1 -1
  101. package/dist/chunks/{input-field.3PUv6XC3.js → input-field.Cx4fMIb7.js} +126 -117
  102. package/dist/chunks/input-field.Cx4fMIb7.js.map +1 -0
  103. package/dist/chunks/{inspector.types.Dr0D250X.js → inspector.types.DQQN1eqF.js} +5 -5
  104. package/dist/chunks/{inspector.types.Dr0D250X.js.map → inspector.types.DQQN1eqF.js.map} +1 -1
  105. package/dist/chunks/{menu.Dmzh3Uat.js → menu.CihQsfY6.js} +5 -5
  106. package/dist/chunks/{menu.Dmzh3Uat.js.map → menu.CihQsfY6.js.map} +1 -1
  107. package/dist/chunks/{modal-fullscreen.BazQAAU1.js → modal-fullscreen.D39_mhdY.js} +5 -5
  108. package/dist/chunks/{modal-fullscreen.BazQAAU1.js.map → modal-fullscreen.D39_mhdY.js.map} +1 -1
  109. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.C8vZDtlE.js → modal.vue_vue_type_script_setup_true_lang.BHd_MGgH.js} +4 -4
  110. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.C8vZDtlE.js.map → modal.vue_vue_type_script_setup_true_lang.BHd_MGgH.js.map} +1 -1
  111. package/dist/chunks/{pagination.BCC3GZV5.js → pagination.CbzgV2xT.js} +45 -45
  112. package/dist/chunks/{pagination.BCC3GZV5.js.map → pagination.CbzgV2xT.js.map} +1 -1
  113. package/dist/chunks/{popover.3KG1IoYE.js → popover.Bzb-pzfB.js} +2 -2
  114. package/dist/chunks/{popover.3KG1IoYE.js.map → popover.Bzb-pzfB.js.map} +1 -1
  115. package/dist/chunks/{radio-group.CeiSaH6M.js → radio-group.DkfCMh_u.js} +107 -94
  116. package/dist/chunks/radio-group.DkfCMh_u.js.map +1 -0
  117. package/dist/chunks/{radio-input.0TPahhZT.js → radio-input.DKfQGxtp.js} +27 -23
  118. package/dist/chunks/{radio-input.0TPahhZT.js.map → radio-input.DKfQGxtp.js.map} +1 -1
  119. package/dist/chunks/{search-bar.BZDJJtWB.js → search-bar.BTu1j3Ll.js} +7 -7
  120. package/dist/chunks/{search-bar.BZDJJtWB.js.map → search-bar.BTu1j3Ll.js.map} +1 -1
  121. package/dist/chunks/{secondary-nav.qm-rh-r6.js → secondary-nav.Bqvz5hjH.js} +8 -8
  122. package/dist/chunks/{secondary-nav.qm-rh-r6.js.map → secondary-nav.Bqvz5hjH.js.map} +1 -1
  123. package/dist/chunks/{selection-card-group.DPGh4nwl.js → selection-card-group.BHYvAL-T.js} +12 -12
  124. package/dist/chunks/{selection-card-group.DPGh4nwl.js.map → selection-card-group.BHYvAL-T.js.map} +1 -1
  125. package/dist/chunks/{sidepanel.DxSdFwm1.js → sidepanel.Bk35AAFF.js} +5 -5
  126. package/dist/chunks/{sidepanel.DxSdFwm1.js.map → sidepanel.Bk35AAFF.js.map} +1 -1
  127. package/dist/chunks/status.types.DsYAH3RM.js +45 -0
  128. package/dist/chunks/status.types.DsYAH3RM.js.map +1 -0
  129. package/dist/chunks/{structured-list-item.DpI6jzfM.js → structured-list-item.wpnBS69h.js} +5 -5
  130. package/dist/chunks/{structured-list-item.DpI6jzfM.js.map → structured-list-item.wpnBS69h.js.map} +1 -1
  131. package/dist/chunks/{summary-grid-item-custom.DCNWMasy.js → summary-grid-item-custom.C8AD1NAh.js} +2 -2
  132. package/dist/chunks/{summary-grid-item-custom.DCNWMasy.js.map → summary-grid-item-custom.C8AD1NAh.js.map} +1 -1
  133. package/dist/chunks/{textarea.CCr8inwI.js → textarea.C0k8by9A.js} +2 -2
  134. package/dist/chunks/{textarea.CCr8inwI.js.map → textarea.C0k8by9A.js.map} +1 -1
  135. package/dist/chunks/{timeline-item.DG9YaOiC.js → timeline-item.CYw68jQr.js} +13 -13
  136. package/dist/chunks/{timeline-item.DG9YaOiC.js.map → timeline-item.CYw68jQr.js.map} +1 -1
  137. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CQ0vEvB4.js → tutorial.vue_vue_type_script_setup_true_lang.CjlNffBI.js} +10 -10
  138. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CQ0vEvB4.js.map → tutorial.vue_vue_type_script_setup_true_lang.CjlNffBI.js.map} +1 -1
  139. package/dist/chunks/{use-cached-selected-values.BBD_AA1m.js → use-cached-selected-values.YAg3m-Af.js} +10 -10
  140. package/dist/chunks/{use-cached-selected-values.BBD_AA1m.js.map → use-cached-selected-values.YAg3m-Af.js.map} +1 -1
  141. package/dist/chunks/{use-country-items.DnPo3yxj.js → use-country-items.DJn6gU4P.js} +2 -2
  142. package/dist/chunks/{use-country-items.DnPo3yxj.js.map → use-country-items.DJn6gU4P.js.map} +1 -1
  143. package/dist/code-snippet.js +1 -1
  144. package/dist/country.js +2 -2
  145. package/dist/dashboard-template.js +1 -1
  146. package/dist/dashed-underline.js +1 -1
  147. package/dist/data-grid-template.js +1 -1
  148. package/dist/data-grid.js +1 -1
  149. package/dist/date-picker.js +2 -2
  150. package/dist/date-range-picker.js +2 -2
  151. package/dist/divider.js +1 -1
  152. package/dist/dropdown.js +4 -4
  153. package/dist/file-uploader.js +1 -1
  154. package/dist/filter-bar.js +1 -1
  155. package/dist/form-layout.js +1 -1
  156. package/dist/header.js +1 -1
  157. package/dist/index.js +47 -47
  158. package/dist/input-field-password.js +1 -1
  159. package/dist/input-field.js +1 -1
  160. package/dist/inspector.js +1 -1
  161. package/dist/internal.js +8 -8
  162. package/dist/menu.js +1 -1
  163. package/dist/modal-fullscreen.js +1 -1
  164. package/dist/modal.js +2 -2
  165. package/dist/pagination.js +1 -1
  166. package/dist/popover.js +1 -1
  167. package/dist/radio-group.js +2 -2
  168. package/dist/search-bar.js +2 -2
  169. package/dist/secondary-nav.js +1 -1
  170. package/dist/selection-card.js +1 -1
  171. package/dist/sidepanel.js +1 -1
  172. package/dist/status.js +1 -1
  173. package/dist/structured-list.js +1 -1
  174. package/dist/styles/bento-dark.css +2 -0
  175. package/dist/styles/bento-light.css +2 -0
  176. package/dist/styles/bento.css +2 -0
  177. package/dist/styles/legacy.css +7 -5
  178. package/dist/styles/styleguide.css +2 -0
  179. package/dist/summary-grid.js +1 -1
  180. package/dist/textarea.js +1 -1
  181. package/dist/timeline.js +1 -1
  182. package/dist/tutorial.js +1 -1
  183. package/dist/web-types.json +1 -1
  184. package/package.json +7 -4
  185. package/dist/chunks/code-snippet.volJxGqR.js +0 -392
  186. package/dist/chunks/code-snippet.volJxGqR.js.map +0 -1
  187. package/dist/chunks/codemirror.CXFEqvAi.js.map +0 -1
  188. package/dist/chunks/date-picker.Bt4fyPQ4.js.map +0 -1
  189. package/dist/chunks/date-range-picker.Bna_2pBL.js.map +0 -1
  190. package/dist/chunks/divider.DwBC4bpr.js +0 -22
  191. package/dist/chunks/divider.DwBC4bpr.js.map +0 -1
  192. package/dist/chunks/dropdown.CZDXXpKe.js.map +0 -1
  193. package/dist/chunks/es6.jIyAPBgt.js.map +0 -1
  194. package/dist/chunks/file-uploader.BXHt0PWz.js +0 -1077
  195. package/dist/chunks/file-uploader.BXHt0PWz.js.map +0 -1
  196. package/dist/chunks/input-field.3PUv6XC3.js.map +0 -1
  197. package/dist/chunks/radio-group.CeiSaH6M.js.map +0 -1
  198. package/dist/chunks/status.types.Dil95sGx.js +0 -44
  199. package/dist/chunks/status.types.Dil95sGx.js.map +0 -1
@@ -1,25 +1,25 @@
1
- import { defineComponent as A, useSlots as _, toRefs as D, computed as i, createElementBlock as y, openBlock as r, normalizeClass as $, createVNode as V, createElementVNode as H, unref as a, createCommentVNode as b, createBlock as g, withCtx as s, renderSlot as S, mergeProps as U, toRef as N, watch as z, Fragment as F, renderList as G, createSlots as j, createTextVNode as T, toDisplayString as M } from "vue";
2
- import { u as P } from "./use-form-layout-loading.D3lALhtC.js";
3
- import { u as w } from "./use-has-slot.B7eQSabc.js";
4
- import { g as L } from "./generate-uid.NJ8tVoha.js";
5
- import { B as C, d as Z } from "./typography.DN5eC5ch.js";
6
- import { C as Y } from "./controls-group.BHxcGQ2A.js";
7
- import { B as J } from "./tag.BuUbvgok.js";
8
- import { u as K } from "./aria-label.CaUURpnB.js";
9
- import { u as Q } from "./use-default-slot-validator.O02rzsob.js";
10
- import { g as W } from "./get-slot-text.D5WBGjic.js";
11
- import { R as O, a as X } from "./radio-input.0TPahhZT.js";
12
- import { _ as x } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
- import { E as ee } from "./error-message.BVE3JdTq.js";
1
+ import { defineComponent as $, useSlots as w, toRefs as z, ref as q, computed as n, createElementBlock as g, openBlock as r, normalizeClass as D, createVNode as N, createElementVNode as F, unref as t, createCommentVNode as f, createBlock as h, withCtx as s, renderSlot as E, mergeProps as G, toRef as x, watch as j, Fragment as P, renderList as Z, createSlots as Y, createTextVNode as M, toDisplayString as O } from "vue";
2
+ import { u as J } from "./use-form-layout-loading.D3lALhtC.js";
3
+ import { u as H } from "./use-has-slot.B7eQSabc.js";
4
+ import { g as T } from "./generate-uid.NJ8tVoha.js";
5
+ import { B as L, d as K } from "./typography.DN5eC5ch.js";
6
+ import { C as Q } from "./controls-group.CjqybvY2.js";
7
+ import { B as W } from "./tag.BuUbvgok.js";
8
+ import { u as X } from "./aria-label.CaUURpnB.js";
9
+ import { u as ee } from "./use-default-slot-validator.O02rzsob.js";
10
+ import { g as te } from "./get-slot-text.D5WBGjic.js";
11
+ import { R as A, a as ae } from "./radio-input.DKfQGxtp.js";
12
+ import { _ as U } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
+ import { E as oe } from "./error-message.qsc0nOWT.js";
14
14
  import "../assets/radio-group.css";
15
- const ae = ["for"], te = {
15
+ const re = ["for"], le = {
16
16
  key: 0,
17
17
  class: "b-radio-button__primary-label"
18
- }, oe = {
18
+ }, de = {
19
19
  name: "bento-radio-button",
20
20
  model: { prop: "modelValue" }
21
- }, re = /* @__PURE__ */ A({
22
- ...oe,
21
+ }, ne = /* @__PURE__ */ $({
22
+ ...de,
23
23
  props: {
24
24
  /**
25
25
  * Disable the radio button (optional)
@@ -63,90 +63,96 @@ const ae = ["for"], te = {
63
63
  }
64
64
  },
65
65
  emits: ["input", "update:model-value"],
66
- setup(e, { emit: E }) {
67
- const u = _(), d = w(u), o = e, m = E, { value: t } = D(o), h = L("bento-radio-button"), f = L("description");
68
- Q("bento-radio-button", u.default, u.description);
69
- const p = i(() => ({
70
- [`b-radio-button--${O.DISABLED}`]: o.disabled,
71
- [`b-radio-button--${O.READONLY}`]: o.readonly
72
- })), I = K({
73
- ariaLabel: W(u)("default"),
74
- label: t.value
75
- }), v = i(() => o.value === o.modelValue), k = () => {
76
- !o.disabled && !o.readonly && (m("update:model-value", o.value), m("input", o.value));
66
+ setup(e, { expose: k, emit: R }) {
67
+ const i = w(), d = H(i), o = e, b = R, { value: a } = z(o), B = T("bento-radio-button"), m = T("description"), u = q(null);
68
+ ee("bento-radio-button", i.default, i.description);
69
+ const S = n(() => ({
70
+ [`b-radio-button--${A.DISABLED}`]: o.disabled,
71
+ [`b-radio-button--${A.READONLY}`]: o.readonly
72
+ })), C = X({
73
+ ariaLabel: te(i)("default"),
74
+ label: a.value
75
+ }), p = n(() => o.value === o.modelValue), V = () => {
76
+ !o.disabled && !o.readonly && (b("update:model-value", o.value), b("input", o.value));
77
77
  };
78
- return (n, R) => (r(), y("div", {
79
- class: $(["b-radio-button", p.value]),
78
+ return k({
79
+ focus: () => {
80
+ u.value.focus();
81
+ }
82
+ }), (y, _) => (r(), g("div", {
83
+ class: D(["b-radio-button", S.value]),
80
84
  "data-testid": "radio-button-container"
81
85
  }, [
82
- V(a(X), {
83
- id: a(h),
84
- "aria-label": a(I),
85
- "aria-describedby": a(d)("description") ? a(f) : "",
86
- checked: v.value,
86
+ N(t(ae), {
87
+ id: t(B),
88
+ ref_key: "radioInputRef",
89
+ ref: u,
90
+ "aria-label": t(C),
91
+ "aria-describedby": t(d)("description") ? t(m) : "",
92
+ checked: p.value,
87
93
  disabled: e.disabled,
88
94
  readonly: e.readonly,
89
95
  "has-error": e.hasError,
90
- value: a(t),
96
+ value: t(a),
91
97
  "model-value": e.modelValue,
92
98
  name: e.name,
93
- "onUpdate:modelValue": k
99
+ "onUpdate:modelValue": V
94
100
  }, null, 8, ["id", "aria-label", "aria-describedby", "checked", "disabled", "readonly", "has-error", "value", "model-value", "name"]),
95
- H("div", null, [
96
- a(d)("default") ? (r(), y("label", {
101
+ F("div", null, [
102
+ t(d)("default") ? (r(), g("label", {
97
103
  key: 0,
98
- for: a(h),
104
+ for: t(B),
99
105
  class: "b-radio-button__label-container"
100
106
  }, [
101
- a(d)("default") ? (r(), y("span", te, [
102
- V(a(C), {
107
+ t(d)("default") ? (r(), g("span", le, [
108
+ N(t(L), {
103
109
  class: "b-radio-button__label",
104
110
  el: "span",
105
111
  variant: "body"
106
112
  }, {
107
113
  default: s(() => [
108
- S(n.$slots, "default", {}, void 0, !0)
114
+ E(y.$slots, "default", {}, void 0, !0)
109
115
  ]),
110
116
  _: 3
111
117
  }),
112
- e.tag ? (r(), g(a(J), U({
118
+ e.tag ? (r(), h(t(W), G({
113
119
  key: 0,
114
120
  class: "b-radio-button__label-tag"
115
- }, e.tag), null, 16)) : b("", !0)
116
- ])) : b("", !0),
117
- a(d)("default") && a(d)("description") ? (r(), g(a(C), {
121
+ }, e.tag), null, 16)) : f("", !0)
122
+ ])) : f("", !0),
123
+ t(d)("default") && t(d)("description") ? (r(), h(t(L), {
118
124
  key: 1,
119
- id: a(f),
125
+ id: t(m),
120
126
  class: "b-radio-button__description",
121
127
  el: "span",
122
128
  variant: "body"
123
129
  }, {
124
130
  default: s(() => [
125
- S(n.$slots, "description", {}, void 0, !0)
131
+ E(y.$slots, "description", {}, void 0, !0)
126
132
  ]),
127
133
  _: 3
128
- }, 8, ["id"])) : b("", !0)
129
- ], 8, ae)) : b("", !0),
130
- a(d)("content") && v.value ? (r(), g(a(C), {
134
+ }, 8, ["id"])) : f("", !0)
135
+ ], 8, re)) : f("", !0),
136
+ t(d)("content") && p.value ? (r(), h(t(L), {
131
137
  key: 1,
132
138
  class: "b-radio-button__content",
133
139
  el: "div"
134
140
  }, {
135
141
  default: s(() => [
136
- S(n.$slots, "content", {}, void 0, !0)
142
+ E(y.$slots, "content", {}, void 0, !0)
137
143
  ]),
138
144
  _: 3
139
- })) : b("", !0)
145
+ })) : f("", !0)
140
146
  ])
141
147
  ], 2));
142
148
  }
143
- }), le = /* @__PURE__ */ x(re, [["__scopeId", "data-v-1ad01dd1"]]);
144
- var B = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(B || {});
145
- const de = { class: "b-radio-group" }, ne = {
149
+ }), se = /* @__PURE__ */ U(ne, [["__scopeId", "data-v-bdac124f"]]);
150
+ var I = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(I || {});
151
+ const ie = { class: "b-radio-group" }, ue = {
146
152
  name: "bento-radio-group",
147
153
  model: { prop: "modelValue" }
148
- }, ie = /* @__PURE__ */ A({
149
- ...ne,
154
+ }, ce = /* @__PURE__ */ $({
155
+ ...ue,
150
156
  props: {
151
157
  /**
152
158
  * Descriptive supporting text visbile underneath the label.
@@ -214,27 +220,27 @@ const de = { class: "b-radio-group" }, ne = {
214
220
  */
215
221
  variant: {
216
222
  type: String,
217
- default: B.VERTICAL,
218
- validator: (e) => Object.values(B).includes(e)
223
+ default: I.VERTICAL,
224
+ validator: (e) => Object.values(I).includes(e)
219
225
  }
220
226
  },
221
227
  emits: ["input", "update:model-value"],
222
- setup(e, { emit: E }) {
223
- const u = "bento-radio-group", d = _(), o = w(d), m = E, t = e, h = N(t, "modelValue"), f = L("error"), { isReadOnly: p } = P(N(t, "readonly")), I = i(
224
- () => !t.disabled && !p.value && (!!t.errorMessage || t.hasError)
225
- ), v = i(() => !t.disabled && !p.value && !!t.errorMessage), k = i(() => ({
226
- "b-radio-group__buttons--horizontal": t.variant === B.HORIZONTAL
227
- })), n = i(() => t.variant === "vertical"), R = i(() => o("content") && !(n != null && n.value)), q = (c) => {
228
- m("update:model-value", c), m("input", c);
228
+ setup(e, { expose: k, emit: R }) {
229
+ const i = "bento-radio-group", d = w(), o = H(d), b = R, a = e, B = x(a, "modelValue"), m = T("error"), { isReadOnly: u } = J(x(a, "readonly")), S = q(null), C = n(
230
+ () => !a.disabled && !u.value && (!!a.errorMessage || a.hasError)
231
+ ), p = n(() => !a.disabled && !u.value && !!a.errorMessage), V = n(() => ({
232
+ "b-radio-group__buttons--horizontal": a.variant === I.HORIZONTAL
233
+ })), v = n(() => a.variant === "vertical"), y = n(() => o("content") && !(v != null && v.value)), _ = (c) => {
234
+ b("update:model-value", c), b("input", c);
229
235
  };
230
- return t.hasError && Z(
236
+ return a.hasError && K(
231
237
  'BentoRadioGroup "hasError" property',
232
238
  `Use the BentoRadioGroup "errorMessage" property instead to indicate that there is a modifier error.
233
239
  Having the field as "undefined" will hide/remove the error.
234
240
  <bento-radio-group errorMessage="Error message text" />`,
235
241
  "2.0.0"
236
- ), z(
237
- R,
242
+ ), j(
243
+ y,
238
244
  (c) => {
239
245
  if (c)
240
246
  throw new Error("The content slot is only available for the vertical radio group layout");
@@ -242,11 +248,15 @@ const de = { class: "b-radio-group" }, ne = {
242
248
  {
243
249
  immediate: !0
244
250
  }
245
- ), (c, se) => (r(), y("div", de, [
246
- V(a(Y), {
247
- class: $(["b-radio-group__buttons", k.value]),
248
- "aria-describedby": v.value ? a(f) : "",
249
- "component-name": u,
251
+ ), k({
252
+ focus: () => {
253
+ S.value[0].focus();
254
+ }
255
+ }), (c, be) => (r(), g("div", ie, [
256
+ N(t(Q), {
257
+ class: D(["b-radio-group__buttons", V.value]),
258
+ "aria-describedby": p.value ? t(m) : "",
259
+ "component-name": i,
250
260
  description: e.description,
251
261
  disabled: e.disabled,
252
262
  form: e.formId,
@@ -257,33 +267,36 @@ const de = { class: "b-radio-group" }, ne = {
257
267
  "tooltip-text": e.tooltipText
258
268
  }, {
259
269
  default: s(() => [
260
- (r(!0), y(F, null, G(e.items, (l) => (r(), g(a(le), {
270
+ (r(!0), g(P, null, Z(e.items, (l) => (r(), h(t(se), {
271
+ ref_for: !0,
272
+ ref_key: "radioButton",
273
+ ref: S,
261
274
  key: l.value,
262
- "model-value": h.value,
275
+ "model-value": B.value,
263
276
  value: l.value,
264
277
  disabled: e.disabled || l.disabled,
265
- readonly: a(p) || l.readonly,
266
- "has-error": I.value || l.hasError,
278
+ readonly: t(u) || l.readonly,
279
+ "has-error": C.value || l.hasError,
267
280
  tag: l.tag,
268
281
  name: e.formId || e.label,
269
- "onUpdate:modelValue": q
270
- }, j({
282
+ "onUpdate:modelValue": _
283
+ }, Y({
271
284
  default: s(() => [
272
- T(M(l.label), 1)
285
+ M(O(l.label), 1)
273
286
  ]),
274
287
  _: 2
275
288
  }, [
276
289
  l.description ? {
277
290
  name: "description",
278
291
  fn: s(() => [
279
- T(M(l.description), 1)
292
+ M(O(l.description), 1)
280
293
  ]),
281
294
  key: "0"
282
295
  } : void 0,
283
- a(o)("content") && n.value ? {
296
+ t(o)("content") && v.value ? {
284
297
  name: "content",
285
298
  fn: s(() => [
286
- S(c.$slots, "content", {}, void 0, !0)
299
+ E(c.$slots, "content", {}, void 0, !0)
287
300
  ]),
288
301
  key: "1"
289
302
  } : void 0
@@ -291,18 +304,18 @@ const de = { class: "b-radio-group" }, ne = {
291
304
  ]),
292
305
  _: 3
293
306
  }, 8, ["aria-describedby", "class", "description", "disabled", "form", "label", "optional", "required", "hide-label", "tooltip-text"]),
294
- v.value ? (r(), g(a(ee), {
307
+ p.value ? (r(), h(t(oe), {
295
308
  key: 0,
296
- id: a(f),
309
+ id: t(m),
297
310
  "error-message": e.errorMessage,
298
311
  class: "b-radio-group__error-message"
299
- }, null, 8, ["id", "error-message"])) : b("", !0)
312
+ }, null, 8, ["id", "error-message"])) : f("", !0)
300
313
  ]));
301
314
  }
302
- }), Ie = /* @__PURE__ */ x(ie, [["__scopeId", "data-v-64d070cf"]]);
315
+ }), Ve = /* @__PURE__ */ U(ce, [["__scopeId", "data-v-5f588a4c"]]);
303
316
  export {
304
- Ie as B,
305
- B as a,
306
- le as b
317
+ Ve as B,
318
+ I as a,
319
+ se as b
307
320
  };
308
- //# sourceMappingURL=radio-group.CeiSaH6M.js.map
321
+ //# sourceMappingURL=radio-group.DkfCMh_u.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.DkfCMh_u.js","sources":["../../../vue2/src/components/radio-group/components/radio-button/radio-button.vue","../../../vue2/src/components/radio-group/radio-group.types.ts","../../../vue2/src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n ref=\"radioInputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, PropType, ref, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, BentoRadioButtonTag, BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\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 radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoRadioButtonTag>, default: undefined },\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<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the radio button is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoRadioButtonValue);\n\n /**\n * Emitted when the radio button is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoRadioButtonValue);\n }>();\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n const radioInputRef = ref(null);\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n\n const focus = () => {\n radioInputRef.value.focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n ref=\"radioButton\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupItems, BentoRadioGroupValue, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<{\n /**\n * Emitted when an option inside the group is selected. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoRadioGroupValue);\n\n /**\n * Emitted when an option inside the group is selected. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoRadioGroupValue);\n }>();\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 bento-radio-buttons in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If passed as a prop, all bento-radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String] as PropType<BentoRadioGroupValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all bento-radio-button in the group in a readonly state.\n */\n readonly: { 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 * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n });\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const radioButton = ref(null);\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onInput = value => {\n emit('update:model-value', value);\n emit('input', value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n\n const focus = () => {\n radioButton.value[0].focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","props","__props","emit","__emit","value","toRefs","radioButtonId","generateUid","descriptionId","radioInputRef","ref","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","onChange","__expose","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","radioButton","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onInput","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;;;;GAsLIA,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvIA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACAI,IAAAC,GAiDAC,IAAAC,GAYA,EAAA,OAAAC,EAAA,IAAAC,EAAAL,CAAA,GACAM,IAAAC,EAAA,oBAAA,GACAC,IAAAD,EAAA,aAAA,GACAE,IAAAC,EAAA,IAAA;AAEA,IAAAC,GAAA,sBAAAf,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAgB,IAAAC,EAAA,OAAA;AAAA,MAAkD,CAAA,mBAAAC,EAAA,QAAA,EAAA,GAAAd,EAAA;AAAA,MACoB,CAAA,mBAAAc,EAAA,QAAA,EAAA,GAAAd,EAAA;AAAA,IACA,EAAA,GAGtEe,IAAAC,EAAA;AAAA,MAA+B,WAAAC,GAAArB,CAAA,EAAA,SAAA;AAAA,MACY,OAAAQ,EAAA;AAAA,IAC1B,CAAA,GAGjBc,IAAAL,EAAA,MAAAb,EAAA,UAAAA,EAAA,UAAA,GAEAmB,IAAA,MAAA;AACI,MAAA,CAAAnB,EAAA,YAAA,CAAAA,EAAA,aACIE,EAAA,sBAAAF,EAAA,KAAA,GACAE,EAAA,SAAAF,EAAA,KAAA;AAAA,IACJ;AAOJ,WAAAoB,EAAA;AAAA,MAAa,OAJb,MAAA;AACI,QAAAX,EAAA,MAAA,MAAA;AAAA,MAA0B;AAAA,IAI1B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3II,IAAAY,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;uCCsORE,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApLA,UAAAC,IAAA,qBAEA5B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAM,IAAAC,GAYAH,IAAAC,GAqFAwB,IAAAC,EAAA1B,GAAA,YAAA,GACA2B,IAAApB,EAAA,OAAA,GACA,EAAA,YAAAqB,EAAA,IAAAC,EAAAH,EAAA1B,GAAA,UAAA,CAAA,GACA8B,IAAApB,EAAA,IAAA,GAEAqB,IAAAlB;AAAA,MAAwB,MAAA,CAAAb,EAAA,YAAA,CAAA4B,EAAA,UAAA,CAAA,CAAA5B,EAAA,gBAAAA,EAAA;AAAA,IACyD,GAEjFgC,IAAAnB,EAAA,MAAA,CAAAb,EAAA,YAAA,CAAA4B,EAAA,SAAA,CAAA,CAAA5B,EAAA,YAAA,GAEAiC,IAAApB,EAAA,OAAA;AAAA,MAA2C,sCAAAb,EAAA,YAAAqB,EAAA;AAAA,IACwC,EAAA,GAInFa,IAAArB,EAAA,MAAAb,EAAA,YAAA,UAAA,GACAmC,IAAAtB,EAAA,MAAAf,EAAA,SAAA,KAAA,EAAAoC,KAAA,QAAAA,EAAA,MAAA,GAEAE,IAAA,CAAAhC,MAAA;AACI,MAAAF,EAAA,sBAAAE,CAAA,GACAF,EAAA,SAAAE,CAAA;AAAA,IAAmB;AAGvB,WAAAJ,EAAA,YACIqC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRC;AAAA,MAAAH;AAAA,MACI,CAAAI,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA,MAAA,wEAAA;AAAA,MACJ;AAAA,MACJ;AAAA,QACA,WAAA;AAAA,MACe;AAAA,IACf,GAOJnB,EAAA;AAAA,MAAa,OAJb,MAAA;AACI,QAAAU,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,MAA2B;AAAA,IAI3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as m, toRefs as y, ref as p, computed as r, createElementBlock as v, openBlock as h, normalizeClass as R, unref as E } from "vue";
2
- import { _ as k } from "./_plugin-vue_export-helper.CHgC5LLL.js";
1
+ import { defineComponent as y, toRefs as p, ref as v, computed as r, createElementBlock as h, openBlock as R, normalizeClass as E, unref as k } from "vue";
2
+ import { _ as D } from "./_plugin-vue_export-helper.CHgC5LLL.js";
3
3
  import "../assets/radio-input.css";
4
4
  var l = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e))(l || {});
5
- const D = ["id", "aria-checked", "aria-label", "aria-invalid", "aria-describedby", "checked", "disabled", "aria-readonly", "value", "name"], g = {
5
+ const g = ["id", "aria-checked", "aria-label", "aria-invalid", "aria-describedby", "checked", "disabled", "aria-readonly", "value", "name"], B = {
6
6
  name: "radio-input",
7
7
  inheritAttrs: !1
8
- }, B = /* @__PURE__ */ m({
9
- ...g,
8
+ }, L = /* @__PURE__ */ y({
9
+ ...B,
10
10
  props: {
11
11
  /**
12
12
  * The aria label associated to the input checkbox.
@@ -54,39 +54,43 @@ const D = ["id", "aria-checked", "aria-label", "aria-invalid", "aria-describedby
54
54
  name: { type: String, default: null }
55
55
  },
56
56
  emits: ["update:model-value"],
57
- setup(e, { emit: t }) {
58
- const a = e, n = t, { value: o } = y(a), u = p(null), s = r(() => ({
57
+ setup(e, { expose: n, emit: o }) {
58
+ const a = e, u = o, { value: s } = p(a), i = v(null), c = r(() => ({
59
59
  [`b-radio-input--${l.DISABLED}`]: a.disabled,
60
60
  [`b-radio-input--${l.ERROR}`]: a.hasError,
61
61
  [`b-radio-input--${l.READONLY}`]: a.readonly
62
- })), c = r(() => a.hasError), i = r(() => a.value === a.modelValue), f = () => {
63
- !a.disabled && !a.readonly && n("update:model-value", a.value);
64
- }, b = (d) => {
62
+ })), f = r(() => a.hasError), t = r(() => a.value === a.modelValue), b = () => {
63
+ !a.disabled && !a.readonly && u("update:model-value", a.value);
64
+ }, m = (d) => {
65
65
  a.readonly && d.preventDefault();
66
66
  };
67
- return (d, L) => (h(), v("input", {
67
+ return n({
68
+ focus: () => {
69
+ i.value.focus();
70
+ }
71
+ }), (d, A) => (R(), h("input", {
68
72
  id: e.id,
69
73
  ref_key: "inputRef",
70
- ref: u,
71
- "aria-checked": i.value,
74
+ ref: i,
75
+ "aria-checked": t.value,
72
76
  "aria-label": e.ariaLabel,
73
- "aria-invalid": c.value,
77
+ "aria-invalid": f.value,
74
78
  "aria-describedby": e.ariaDescribedby,
75
- checked: i.value,
79
+ checked: t.value,
76
80
  disabled: e.disabled,
77
81
  "aria-readonly": e.readonly ? e.readonly : void 0,
78
- value: E(o),
82
+ value: k(s),
79
83
  name: e.name,
80
84
  type: "radio",
81
- class: R(["b-radio-input", s.value]),
85
+ class: E(["b-radio-input", c.value]),
82
86
  role: "radio",
83
- onClick: b,
84
- onChange: f
85
- }, null, 42, D));
87
+ onClick: m,
88
+ onChange: b
89
+ }, null, 42, g));
86
90
  }
87
- }), C = /* @__PURE__ */ k(B, [["__scopeId", "data-v-34e624f8"]]);
91
+ }), N = /* @__PURE__ */ D(L, [["__scopeId", "data-v-26a0b71e"]]);
88
92
  export {
89
93
  l as R,
90
- C as a
94
+ N as a
91
95
  };
92
- //# sourceMappingURL=radio-input.0TPahhZT.js.map
96
+ //# sourceMappingURL=radio-input.DKfQGxtp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-input.0TPahhZT.js","sources":["../../../core/src/components/radio-input/radio-input.types.ts","../../../vue2/src/components/internal/radio-input/radio-input.vue"],"sourcesContent":["export type RadioInputValue = string | number;\n\nexport enum RadioInputStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","<template>\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedby\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly ? readonly : undefined\"\n :value=\"value\"\n :name=\"name\"\n type=\"radio\"\n class=\"b-radio-input\"\n :class=\"conditionalClasses\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ComputedRef, PropType, ref, toRefs } from 'vue';\n import { RadioInputStateClass, RadioInputValue } from '@/core/components/radio-input/radio-input.types';\n import type { HTMLAttributes } from 'vue/types/jsx.d.ts';\n\n const props = defineProps({\n /**\n * The aria label associated to the input checkbox.\n */\n ariaLabel: { type: String, default: '' },\n\n /**\n * An additional string that serves as description for the input checkbox (useful if the component shows a description).\n */\n ariaDescribedby: { type: String, default: '' },\n\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Sets the id of the radio input. Required for accessibility purposes\n */\n id: { type: String, default: null },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<RadioInputValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\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<RadioInputValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: { type: String, default: null },\n });\n\n const emit = defineEmits<{\n /**\n * Emit that emits the input value\n */\n (e: 'update:model-value', value: RadioInputValue): void;\n }>();\n\n const { value } = toRefs(props);\n\n const inputRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-radio-input--${RadioInputStateClass.DISABLED}`]: props.disabled,\n [`b-radio-input--${RadioInputStateClass.ERROR}`]: props.hasError,\n [`b-radio-input--${RadioInputStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component that renders a radio input (without label)\n *\n * @example\n * import { RadioInput } from '@/internal/radio-input';\n *\n * export default {\n * components: { BentoCheckboxInput },\n * template: `\n * <label for=\"checkbox-id\">Your label</label>\n * <span id=\"description-id\">Description</span>\n * <radio-input id=\"checkbox-id\" aria=label=\"Your label\" aria-describedby=\"description-id\" />\n * `\n * }\n */\n export default {\n name: 'radio-input',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/radio-input/radio-input.scss\" />\n"],"names":["RadioInputStateClass","RadioInputStateClass2","__default__","props","__props","emit","__emit","value","toRefs","inputRef","ref","conditionalClasses","computed","ariaInvalid","isChecked","onChange","onClick","event"],"mappings":";;;AAEY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;6ICmIRE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7GA,UAAAC,IAAAC,GAuDAC,IAAAC,GAOA,EAAA,OAAAC,EAAA,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,kBAAAZ,EAAA,QAAA,EAAA,GAAAG,EAAA;AAAA,MACoB,CAAA,kBAAAH,EAAA,KAAA,EAAA,GAAAG,EAAA;AAAA,MACH,CAAA,kBAAAH,EAAA,QAAA,EAAA,GAAAG,EAAA;AAAA,IACG,EAAA,GAG/DU,IAAAD,EAAA,MAAAT,EAAA,QAAA,GAEAW,IAAAF,EAAA,MAAAT,EAAA,UAAAA,EAAA,UAAA,GAEAY,IAAA,MAAA;AACI,MAAA,CAAAZ,EAAA,YAAA,CAAAA,EAAA,YACIE,EAAA,sBAAAF,EAAA,KAAA;AAAA,IACJ,GAIJa,IAAA,CAAAC,MAAA;AACI,MAAAd,EAAA,YACIc,EAAA,eAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"radio-input.DKfQGxtp.js","sources":["../../../core/src/components/radio-input/radio-input.types.ts","../../../vue2/src/components/internal/radio-input/radio-input.vue"],"sourcesContent":["export type RadioInputValue = string | number;\n\nexport enum RadioInputStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","<template>\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedby\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly ? readonly : undefined\"\n :value=\"value\"\n :name=\"name\"\n type=\"radio\"\n class=\"b-radio-input\"\n :class=\"conditionalClasses\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ComputedRef, PropType, ref, toRefs } from 'vue';\n import { RadioInputStateClass, RadioInputValue } from '@/core/components/radio-input/radio-input.types';\n import type { HTMLAttributes } from 'vue/types/jsx.d.ts';\n\n const props = defineProps({\n /**\n * The aria label associated to the input checkbox.\n */\n ariaLabel: { type: String, default: '' },\n\n /**\n * An additional string that serves as description for the input checkbox (useful if the component shows a description).\n */\n ariaDescribedby: { type: String, default: '' },\n\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Sets the id of the radio input. Required for accessibility purposes\n */\n id: { type: String, default: null },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<RadioInputValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\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<RadioInputValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: { type: String, default: null },\n });\n\n const emit = defineEmits<{\n /**\n * Emit that emits the input value\n */\n (e: 'update:model-value', value: RadioInputValue): void;\n }>();\n\n const { value } = toRefs(props);\n\n const inputRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-radio-input--${RadioInputStateClass.DISABLED}`]: props.disabled,\n [`b-radio-input--${RadioInputStateClass.ERROR}`]: props.hasError,\n [`b-radio-input--${RadioInputStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n const focus = () => {\n inputRef.value.focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component that renders a radio input (without label)\n *\n * @example\n * import { RadioInput } from '@/internal/radio-input';\n *\n * export default {\n * components: { BentoCheckboxInput },\n * template: `\n * <label for=\"checkbox-id\">Your label</label>\n * <span id=\"description-id\">Description</span>\n * <radio-input id=\"checkbox-id\" aria=label=\"Your label\" aria-describedby=\"description-id\" />\n * `\n * }\n */\n export default {\n name: 'radio-input',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/radio-input/radio-input.scss\" />\n"],"names":["RadioInputStateClass","RadioInputStateClass2","__default__","props","__props","emit","__emit","value","toRefs","inputRef","ref","conditionalClasses","computed","ariaInvalid","isChecked","onChange","onClick","event","__expose"],"mappings":";;;AAEY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;6IC2IRE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArHA,UAAAC,IAAAC,GAuDAC,IAAAC,GAOA,EAAA,OAAAC,EAAA,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,kBAAAZ,EAAA,QAAA,EAAA,GAAAG,EAAA;AAAA,MACoB,CAAA,kBAAAH,EAAA,KAAA,EAAA,GAAAG,EAAA;AAAA,MACH,CAAA,kBAAAH,EAAA,QAAA,EAAA,GAAAG,EAAA;AAAA,IACG,EAAA,GAG/DU,IAAAD,EAAA,MAAAT,EAAA,QAAA,GAEAW,IAAAF,EAAA,MAAAT,EAAA,UAAAA,EAAA,UAAA,GAEAY,IAAA,MAAA;AACI,MAAA,CAAAZ,EAAA,YAAA,CAAAA,EAAA,YACIE,EAAA,sBAAAF,EAAA,KAAA;AAAA,IACJ,GAIJa,IAAA,CAAAC,MAAA;AACI,MAAAd,EAAA,YACIc,EAAA,eAAA;AAAA,IACJ;AAOJ,WAAAC,EAAA;AAAA,MAAa,OAJb,MAAA;AACI,QAAAT,EAAA,MAAA,MAAA;AAAA,MAAqB;AAAA,IAIrB,CAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as S, provide as E, toRef as g, useAttrs as A, ref as p, watch as P, createElementBlock as T, openBlock as N, createVNode as n, mergeProps as F, unref as s, createSlots as x, withCtx as m, createElementVNode as L, withKeys as f } from "vue";
2
2
  import { d as U } from "./debounce.DUTu11PS.js";
3
3
  import { u as k } from "./i18n.WMYWtwxB.js";
4
- import { B as K } from "./input-field.3PUv6XC3.js";
5
- import { I as R } from "./dropdown.CZDXXpKe.js";
4
+ import { B as K } from "./input-field.Cx4fMIb7.js";
5
+ import { I as R } from "./dropdown.BWu3fV-K.js";
6
6
  import { S as w } from "./search.KgjmJMHa.js";
7
7
  import { C as D } from "./cross-circle-fill.BzSjakuO.js";
8
8
  import { _ as $ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
@@ -13,13 +13,13 @@ const b = {
13
13
  clearSearch: "Clear search",
14
14
  search: "Search"
15
15
  },
16
- "pt-BR": {
17
- clearSearch: "Limpar busca",
18
- search: "Buscar"
19
- },
20
16
  "ja-JP": {
21
17
  clearSearch: "検索をクリア",
22
18
  search: "検索"
19
+ },
20
+ "pt-BR": {
21
+ clearSearch: "Limpar busca",
22
+ search: "Buscar"
23
23
  }
24
24
  }, J = { class: "b-search-bar" }, V = {
25
25
  i18n: { messages: b }
@@ -129,4 +129,4 @@ export {
129
129
  h as a,
130
130
  B as b
131
131
  };
132
- //# sourceMappingURL=search-bar.BZDJJtWB.js.map
132
+ //# sourceMappingURL=search-bar.BTu1j3Ll.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-bar.BZDJJtWB.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import BentoInputField from '@/components/input-field/input-field.vue';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n import { useAttrs } from 'vue';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: { type: String, required: true },\n\n /**\n * Reduces height of the search bar\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint: { type: String, default: '' },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Text displayed as the value being searched\n */\n value: { type: String, default: undefined },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","t","useI18n","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;kCC8LRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArJA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GAgCAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AAQlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OALb,MAAA;AACI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"search-bar.BTu1j3Ll.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import BentoInputField from '@/components/input-field/input-field.vue';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n import { useAttrs } from 'vue';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: { type: String, required: true },\n\n /**\n * Reduces height of the search bar\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint: { type: String, default: '' },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Text displayed as the value being searched\n */\n value: { type: String, default: undefined },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","t","useI18n","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;kCC8LRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArJA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GAgCAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AAQlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OALb,MAAA;AACI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as f, inject as E, computed as v, createElementBlock as s, openBlock as a, normalizeClass as O, createVNode as y, unref as t, withCtx as I, createTextVNode as V, toDisplayString as w, createElementVNode as T, Fragment as B, renderList as N, ref as x, readonly as L, watch as M, provide as j, createBlock as b } from "vue";
2
- import { B as F } from "./dropdown.CZDXXpKe.js";
1
+ import { defineComponent as f, inject as E, computed as v, createElementBlock as s, openBlock as a, normalizeClass as O, createVNode as y, unref as t, withCtx as I, createTextVNode as B, toDisplayString as V, createElementVNode as T, Fragment as w, renderList as N, ref as x, readonly as L, watch as M, provide as j, createBlock as b } from "vue";
2
+ import { B as F } from "./dropdown.BWu3fV-K.js";
3
3
  import { e as q } from "./index.BMkVmbZj.js";
4
4
  import { u as z } from "./i18n.WMYWtwxB.js";
5
- import { d as Q } from "./es6.jIyAPBgt.js";
5
+ import { B as Q } from "./es6.BtaxuP0b.js";
6
6
  import { B as C } from "./typography.DN5eC5ch.js";
7
7
  import { _ as g } from "./_plugin-vue_export-helper.CHgC5LLL.js";
8
8
  import "../assets/secondary-nav.css";
@@ -30,7 +30,7 @@ const S = Symbol("secondary nav state"), R = {}, U = /* @__PURE__ */ f({
30
30
  stronger: ""
31
31
  }, {
32
32
  default: I(() => [
33
- V(w(r.label), 1)
33
+ B(V(r.label), 1)
34
34
  ]),
35
35
  _: 1
36
36
  })
@@ -55,12 +55,12 @@ const S = Symbol("secondary nav state"), R = {}, U = /* @__PURE__ */ f({
55
55
  stronger: ""
56
56
  }, {
57
57
  default: I(() => [
58
- V(w(o.label), 1)
58
+ B(V(o.label), 1)
59
59
  ]),
60
60
  _: 1
61
61
  }),
62
62
  T("ul", G, [
63
- (a(!0), s(B, null, N(o.items, (l) => (a(), s("li", {
63
+ (a(!0), s(w, null, N(o.items, (l) => (a(), s("li", {
64
64
  key: l.value
65
65
  }, [
66
66
  y(t(A), {
@@ -114,7 +114,7 @@ const S = Symbol("secondary nav state"), R = {}, U = /* @__PURE__ */ f({
114
114
  value: _.value,
115
115
  onInput: h
116
116
  }, null, 8, ["aria-label", "items", "static-categories", "value"])) : (a(), s("ul", W, [
117
- (a(!0), s(B, null, N(e.items, (c) => (a(), s("li", {
117
+ (a(!0), s(w, null, N(e.items, (c) => (a(), s("li", {
118
118
  key: c.label
119
119
  }, [
120
120
  "items" in c ? (a(), b(t(K), {
@@ -134,4 +134,4 @@ const S = Symbol("secondary nav state"), R = {}, U = /* @__PURE__ */ f({
134
134
  export {
135
135
  ce as s
136
136
  };
137
- //# sourceMappingURL=secondary-nav.qm-rh-r6.js.map
137
+ //# sourceMappingURL=secondary-nav.Bqvz5hjH.js.map