@adyen/bento-vue2 1.48.0 → 1.50.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 (187) hide show
  1. package/dist/@types/index.d.ts +253 -244
  2. package/dist/action-bar.js +1 -1
  3. package/dist/assets/accordion-item.css +1 -1
  4. package/dist/assets/action-bar.css +1 -1
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/dialog-page.css +1 -1
  9. package/dist/assets/dropdown.css +1 -1
  10. package/dist/assets/file-uploader.css +1 -1
  11. package/dist/assets/filter-bar.css +1 -1
  12. package/dist/assets/header.css +1 -1
  13. package/dist/assets/inspector.css +1 -1
  14. package/dist/assets/menu.css +1 -1
  15. package/dist/assets/modal-fullscreen.css +1 -1
  16. package/dist/assets/payment-method.css +1 -1
  17. package/dist/assets/popover.css +1 -1
  18. package/dist/assets/sidepanel.css +1 -1
  19. package/dist/assets/toggle-button.css +1 -1
  20. package/dist/button.js +1 -1
  21. package/dist/checkbox.js +2 -2
  22. package/dist/chunks/{action-bar.CSgrrcK0.js → action-bar.CGJJrMpa.js} +4 -4
  23. package/dist/chunks/{action-bar.CSgrrcK0.js.map → action-bar.CGJJrMpa.js.map} +1 -1
  24. package/dist/chunks/{base-modal.47Xa68h9.js → base-modal.8kcvtFRx.js} +2 -2
  25. package/dist/chunks/{base-modal.47Xa68h9.js.map → base-modal.8kcvtFRx.js.map} +1 -1
  26. package/dist/chunks/{button-actions-with-menu.D13mJiKO.js → button-actions-with-menu.C5OE7oOu.js} +3 -3
  27. package/dist/chunks/{button-actions-with-menu.D13mJiKO.js.map → button-actions-with-menu.C5OE7oOu.js.map} +1 -1
  28. package/dist/chunks/{checkbox-group.BXfJo9NR.js → checkbox-group.wa6Mtmxa.js} +4 -4
  29. package/dist/chunks/{checkbox-group.BXfJo9NR.js.map → checkbox-group.wa6Mtmxa.js.map} +1 -1
  30. package/dist/chunks/{checkbox.BEHpJDrF.js → checkbox.BPvnJrvd.js} +17 -17
  31. package/dist/chunks/{checkbox.BEHpJDrF.js.map → checkbox.BPvnJrvd.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.CUx6b252.js → code-snippet.3s8WCnke.js} +5 -5
  33. package/dist/chunks/{code-snippet.CUx6b252.js.map → code-snippet.3s8WCnke.js.map} +1 -1
  34. package/dist/chunks/{controls-group.C3RDqB9H.js → controls-group.BnDPMaGI.js} +2 -2
  35. package/dist/chunks/{controls-group.C3RDqB9H.js.map → controls-group.BnDPMaGI.js.map} +1 -1
  36. package/dist/chunks/{copy.adSQlAOY.js → copy.DMlIj53I.js} +3 -3
  37. package/dist/chunks/{copy.adSQlAOY.js.map → copy.DMlIj53I.js.map} +1 -1
  38. package/dist/chunks/currency.B1F9YOIx.js.map +1 -1
  39. package/dist/chunks/{dashboard-section.q1XXEUZc.js → dashboard-section.BgyN5u0K.js} +3 -3
  40. package/dist/chunks/{dashboard-section.q1XXEUZc.js.map → dashboard-section.BgyN5u0K.js.map} +1 -1
  41. package/dist/chunks/{dashed-underline.CpVP3VDL.js → dashed-underline.Cvn5IoHT.js} +3 -3
  42. package/dist/chunks/{dashed-underline.CpVP3VDL.js.map → dashed-underline.Cvn5IoHT.js.map} +1 -1
  43. package/dist/chunks/{data-grid-template.kCxfVaW7.js → data-grid-template.DtWM0Tnu.js} +2 -2
  44. package/dist/chunks/{data-grid-template.kCxfVaW7.js.map → data-grid-template.DtWM0Tnu.js.map} +1 -1
  45. package/dist/chunks/{data-grid.DgxC3G4n.js → data-grid.N5Rxo6QB.js} +671 -665
  46. package/dist/chunks/data-grid.N5Rxo6QB.js.map +1 -0
  47. package/dist/chunks/{date-picker.DqsQJ7P7.js → date-picker.Byv5Z-Xj.js} +3 -3
  48. package/dist/chunks/{date-picker.DqsQJ7P7.js.map → date-picker.Byv5Z-Xj.js.map} +1 -1
  49. package/dist/chunks/{date-range-picker.VZlIz83o.js → date-range-picker.CUS9Q53T.js} +6 -6
  50. package/dist/chunks/{date-range-picker.VZlIz83o.js.map → date-range-picker.CUS9Q53T.js.map} +1 -1
  51. package/dist/chunks/{dropdown-tag.BLAjuup5.js → dropdown-tag.ClUMccWv.js} +4 -4
  52. package/dist/chunks/{dropdown-tag.BLAjuup5.js.map → dropdown-tag.ClUMccWv.js.map} +1 -1
  53. package/dist/chunks/{dropdown.DWgwNFNB.js → dropdown.CC1i41NX.js} +264 -264
  54. package/dist/chunks/dropdown.CC1i41NX.js.map +1 -0
  55. package/dist/chunks/{error-message.Da-p1QIA.js → error-message.xTNEaNn8.js} +2 -2
  56. package/dist/chunks/{error-message.Da-p1QIA.js.map → error-message.xTNEaNn8.js.map} +1 -1
  57. package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
  58. package/dist/chunks/{file-uploader.DT7GsNqI.js → file-uploader.DTkxh9Ct.js} +400 -395
  59. package/dist/chunks/file-uploader.DTkxh9Ct.js.map +1 -0
  60. package/dist/chunks/{filter-bar.D2YR4Tpz.js → filter-bar.gj9sdW5T.js} +17 -18
  61. package/dist/chunks/{filter-bar.D2YR4Tpz.js.map → filter-bar.gj9sdW5T.js.map} +1 -1
  62. package/dist/chunks/{focus-trap.CGypVwG6.js → focus-trap._RrLaKlq.js} +6 -3
  63. package/dist/chunks/{focus-trap.CGypVwG6.js.map → focus-trap._RrLaKlq.js.map} +1 -1
  64. package/dist/chunks/{header.D5MLt9hG.js → header.5rAXro_L.js} +48 -48
  65. package/dist/chunks/{header.D5MLt9hG.js.map → header.5rAXro_L.js.map} +1 -1
  66. package/dist/chunks/{index.D8ivUe7P.js → index.CU8GKq4C.js} +8 -7
  67. package/dist/chunks/{index.D8ivUe7P.js.map → index.CU8GKq4C.js.map} +1 -1
  68. package/dist/chunks/{info-icon-with-popover.CO0mky_N.js → info-icon-with-popover.B0zJWJZn.js} +2 -2
  69. package/dist/chunks/{info-icon-with-popover.CO0mky_N.js.map → info-icon-with-popover.B0zJWJZn.js.map} +1 -1
  70. package/dist/chunks/{info-icon.0d0GzDe2.js → info-icon.C4_l0WAf.js} +3 -3
  71. package/dist/chunks/{info-icon.0d0GzDe2.js.map → info-icon.C4_l0WAf.js.map} +1 -1
  72. package/dist/chunks/{input-field-password.CQtzruQM.js → input-field-password.PU9SY4FC.js} +5 -5
  73. package/dist/chunks/{input-field-password.CQtzruQM.js.map → input-field-password.PU9SY4FC.js.map} +1 -1
  74. package/dist/chunks/{input-field-phone-number.DWKZy2-k.js → input-field-phone-number.D2juJ9ZD.js} +2 -2
  75. package/dist/chunks/{input-field-phone-number.DWKZy2-k.js.map → input-field-phone-number.D2juJ9ZD.js.map} +1 -1
  76. package/dist/chunks/{input-field.3V5IblWw.js → input-field.BPbe00eB.js} +3 -3
  77. package/dist/chunks/{input-field.3V5IblWw.js.map → input-field.BPbe00eB.js.map} +1 -1
  78. package/dist/chunks/inspector.types.BtgXpTC7.js +101 -0
  79. package/dist/chunks/inspector.types.BtgXpTC7.js.map +1 -0
  80. package/dist/chunks/{layout-row.BfS-cPky.js → layout-row.CHwDU8yK.js} +7 -7
  81. package/dist/chunks/{layout-row.BfS-cPky.js.map → layout-row.CHwDU8yK.js.map} +1 -1
  82. package/dist/chunks/{listbox-option-tag.XbvBQqlt.js → listbox-option-tag.BJBWnC2r.js} +2 -2
  83. package/dist/chunks/{listbox-option-tag.XbvBQqlt.js.map → listbox-option-tag.BJBWnC2r.js.map} +1 -1
  84. package/dist/chunks/{menu.DYopJZ12.js → menu.BC7ynpgF.js} +24 -24
  85. package/dist/chunks/{menu.DYopJZ12.js.map → menu.BC7ynpgF.js.map} +1 -1
  86. package/dist/chunks/{modal-fullscreen.Pp5mp7hD.js → modal-fullscreen.Dz3kSuTz.js} +2 -2
  87. package/dist/chunks/{modal-fullscreen.Pp5mp7hD.js.map → modal-fullscreen.Dz3kSuTz.js.map} +1 -1
  88. package/dist/chunks/{modal.CCjAy7Hv.js → modal.DV55hSPn.js} +2 -2
  89. package/dist/chunks/{modal.CCjAy7Hv.js.map → modal.DV55hSPn.js.map} +1 -1
  90. package/dist/chunks/{pagination.8g4bC4tv.js → pagination.CT-h2q0J.js} +2 -2
  91. package/dist/chunks/{pagination.8g4bC4tv.js.map → pagination.CT-h2q0J.js.map} +1 -1
  92. package/dist/chunks/payment-method.Bu76jY3c.js +59 -0
  93. package/dist/chunks/payment-method.Bu76jY3c.js.map +1 -0
  94. package/dist/chunks/payment-method.types.CJKfZQN5.js.map +1 -1
  95. package/dist/chunks/{popover.C-LwO38X.js → popover.CRdrSmFW.js} +17 -16
  96. package/dist/chunks/popover.CRdrSmFW.js.map +1 -0
  97. package/dist/chunks/{popper-container.B1iB2ovW.js → popper-container.CsW4R0-t.js} +2 -2
  98. package/dist/chunks/{popper-container.B1iB2ovW.js.map → popper-container.CsW4R0-t.js.map} +1 -1
  99. package/dist/chunks/{promo-banner.DS0_aROF.js → promo-banner.BNXfyv3h.js} +6 -6
  100. package/dist/chunks/{promo-banner.DS0_aROF.js.map → promo-banner.BNXfyv3h.js.map} +1 -1
  101. package/dist/chunks/{radio-group.1z-IZvLU.js → radio-group.CUgib4vp.js} +4 -4
  102. package/dist/chunks/{radio-group.1z-IZvLU.js.map → radio-group.CUgib4vp.js.map} +1 -1
  103. package/dist/chunks/{search-bar.Bu12OC-l.js → search-bar.bMOGN8_E.js} +3 -3
  104. package/dist/chunks/{search-bar.Bu12OC-l.js.map → search-bar.bMOGN8_E.js.map} +1 -1
  105. package/dist/chunks/{secondary-nav.CLDlWCXX.js → secondary-nav.C9sm93do.js} +3 -3
  106. package/dist/chunks/{secondary-nav.CLDlWCXX.js.map → secondary-nav.C9sm93do.js.map} +1 -1
  107. package/dist/chunks/{segmented-control.BJIlas0M.js → segmented-control.BxCcPbKd.js} +2 -2
  108. package/dist/chunks/{segmented-control.BJIlas0M.js.map → segmented-control.BxCcPbKd.js.map} +1 -1
  109. package/dist/chunks/{selection-card-group.usHcqYKO.js → selection-card-group.0O3gmtoi.js} +11 -11
  110. package/dist/chunks/{selection-card-group.usHcqYKO.js.map → selection-card-group.0O3gmtoi.js.map} +1 -1
  111. package/dist/chunks/{sidepanel.C_ff-PEn.js → sidepanel.Dp6dKRnq.js} +2 -2
  112. package/dist/chunks/{sidepanel.C_ff-PEn.js.map → sidepanel.Dp6dKRnq.js.map} +1 -1
  113. package/dist/chunks/{structured-list-item.TC8mVrrA.js → structured-list-item.DrY71Ndc.js} +4 -4
  114. package/dist/chunks/{structured-list-item.TC8mVrrA.js.map → structured-list-item.DrY71Ndc.js.map} +1 -1
  115. package/dist/chunks/{summary-grid-item-custom.A11AzfH0.js → summary-grid-item-custom.CXs6AMS4.js} +4 -4
  116. package/dist/chunks/{summary-grid-item-custom.A11AzfH0.js.map → summary-grid-item-custom.CXs6AMS4.js.map} +1 -1
  117. package/dist/chunks/{tag.3fthBtwc.js → tag.CevG31iQ.js} +2 -2
  118. package/dist/chunks/{tag.3fthBtwc.js.map → tag.CevG31iQ.js.map} +1 -1
  119. package/dist/chunks/{textarea.CpXux8qX.js → textarea.DHbXaxdU.js} +2 -2
  120. package/dist/chunks/{textarea.CpXux8qX.js.map → textarea.DHbXaxdU.js.map} +1 -1
  121. package/dist/chunks/{timeline-item.Ca9RJt0z.js → timeline-item.C4HOsaEG.js} +4 -4
  122. package/dist/chunks/{timeline-item.Ca9RJt0z.js.map → timeline-item.C4HOsaEG.js.map} +1 -1
  123. package/dist/chunks/{toggle-button.BX_9vB0d.js → toggle-button.DK4H4sHT.js} +5 -5
  124. package/dist/chunks/toggle-button.DK4H4sHT.js.map +1 -0
  125. package/dist/chunks/{tooltip.R2sqydIE.js → tooltip.Bu8o7uyZ.js} +2 -2
  126. package/dist/chunks/{tooltip.R2sqydIE.js.map → tooltip.Bu8o7uyZ.js.map} +1 -1
  127. package/dist/chunks/{tutorial.Cc0tv59x.js → tutorial.BbQox1EZ.js} +4 -4
  128. package/dist/chunks/{tutorial.Cc0tv59x.js.map → tutorial.BbQox1EZ.js.map} +1 -1
  129. package/dist/chunks/{use-cached-selected-values.C24AnZ-w.js → use-cached-selected-values.a_5Iw6Dh.js} +258 -254
  130. package/dist/chunks/use-cached-selected-values.a_5Iw6Dh.js.map +1 -0
  131. package/dist/code-snippet.js +1 -1
  132. package/dist/dashboard-template.js +1 -1
  133. package/dist/dashed-underline.js +1 -1
  134. package/dist/data-grid-template.js +1 -1
  135. package/dist/data-grid.js +1 -1
  136. package/dist/date-picker.js +1 -1
  137. package/dist/date-range-picker.js +1 -1
  138. package/dist/dropdown.js +3 -3
  139. package/dist/file-uploader.js +1 -1
  140. package/dist/filter-bar.js +1 -1
  141. package/dist/focus-trap.js +1 -1
  142. package/dist/header.js +1 -1
  143. package/dist/index.js +44 -44
  144. package/dist/info-icon.js +1 -1
  145. package/dist/input-field-password.js +1 -1
  146. package/dist/input-field-phone-number.js +1 -1
  147. package/dist/input-field.js +1 -1
  148. package/dist/inspector.js +1 -1
  149. package/dist/internal.js +8 -8
  150. package/dist/layout.js +1 -1
  151. package/dist/menu.js +1 -1
  152. package/dist/modal-fullscreen.js +1 -1
  153. package/dist/modal.js +2 -2
  154. package/dist/pagination.js +1 -1
  155. package/dist/payment-method.js +1 -1
  156. package/dist/popover.js +1 -1
  157. package/dist/popper-container.js +1 -1
  158. package/dist/promo-banner.js +1 -1
  159. package/dist/radio-group.js +1 -1
  160. package/dist/search-bar.js +2 -2
  161. package/dist/secondary-nav.js +1 -1
  162. package/dist/segmented-control.js +1 -1
  163. package/dist/selection-card.js +1 -1
  164. package/dist/sidepanel.js +1 -1
  165. package/dist/structured-list.js +1 -1
  166. package/dist/styles/bento-dark.css +2 -1
  167. package/dist/styles/bento-light.css +2 -1
  168. package/dist/styles/bento.css +2 -1
  169. package/dist/styles/legacy.css +3 -0
  170. package/dist/styles/styleguide.css +2 -1
  171. package/dist/summary-grid.js +1 -1
  172. package/dist/tag.js +1 -1
  173. package/dist/textarea.js +1 -1
  174. package/dist/timeline.js +1 -1
  175. package/dist/tutorial.js +1 -1
  176. package/dist/web-types.json +71 -41
  177. package/package.json +5 -5
  178. package/dist/chunks/data-grid.DgxC3G4n.js.map +0 -1
  179. package/dist/chunks/dropdown.DWgwNFNB.js.map +0 -1
  180. package/dist/chunks/file-uploader.DT7GsNqI.js.map +0 -1
  181. package/dist/chunks/inspector.types.GOl_-hXm.js +0 -70
  182. package/dist/chunks/inspector.types.GOl_-hXm.js.map +0 -1
  183. package/dist/chunks/payment-method.BKr_q5cZ.js +0 -84
  184. package/dist/chunks/payment-method.BKr_q5cZ.js.map +0 -1
  185. package/dist/chunks/popover.C-LwO38X.js.map +0 -1
  186. package/dist/chunks/toggle-button.BX_9vB0d.js.map +0 -1
  187. package/dist/chunks/use-cached-selected-values.C24AnZ-w.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as G, useAttrs as Q, useSlots as ee, ref as u, provide as te, inject as ae, toRef as oe, computed as r, toRefs as ne } from "vue";
2
- import { a as re, I as ie, B as se } from "./dropdown.DWgwNFNB.js";
2
+ import { a as re, I as ie, B as se } from "./dropdown.CC1i41NX.js";
3
3
  import { p as de, d as R, B as le } from "./typography.J1v_SPG3.js";
4
4
  import { g as p } from "./generate-uid.NJ8tVoha.js";
5
5
  import { g as ue } from "./get-slot-text.BQS5Olxm.js";
@@ -7,7 +7,7 @@ import { u as pe } from "./aria-label.CaUURpnB.js";
7
7
  import { u as ce } from "./i18n.BQkEbtPM.js";
8
8
  import { u as fe } from "./use-form-layout-loading.D3lALhtC.js";
9
9
  import { u as _e } from "./use-has-slot.C9lQZ6nz.js";
10
- import { F as be, E as ye } from "./error-message.Da-p1QIA.js";
10
+ import { F as be, E as ye } from "./error-message.xTNEaNn8.js";
11
11
  import { n as he } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
12
12
  import "../assets/input-field.css";
13
13
  var s = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.PAYMENT_METHOD = "payment-method", a.STATIC_VALUE = "static-value", a.DROPDOWN = "dropdown", a))(s || {}), i = /* @__PURE__ */ ((a) => (a.START = "start", a.END = "end", a))(i || {}), c = /* @__PURE__ */ ((a) => (a.CONDENSED = "condensed", a.DISABLED = "disabled", a.READONLY = "readonly", a.ERROR = "error", a))(c || {}), E = /* @__PURE__ */ ((a) => (a.SEARCH = "search", a.TEXT = "text", a.NUMBER = "number", a))(E || {}), ve = /* @__PURE__ */ ((a) => (a.INPUT = "input", a.ESCAPE_PRESSED = "escape-pressed", a.UPDATE_DROPDOWN = "update:dropdown", a.DROPDOWN_INPUT = "dropdown-input", a.FOCUS = "focus", a.CHANGE = "change", a.BLUR = "blur", a.KEYDOWN = "keydown", a))(ve || {});
@@ -233,4 +233,4 @@ export {
233
233
  E as d,
234
234
  ve as e
235
235
  };
236
- //# sourceMappingURL=input-field.3V5IblWw.js.map
236
+ //# sourceMappingURL=input-field.BPbe00eB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-field.3V5IblWw.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: string;\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","focus","expose","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJ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AAA,IACJ;AAIJ,WAAAE,EAAA;AAAA,MAAa,YAAAF;AAAA,MACT,OAAAC;AAAA,IACA,CAAA,GAGJ,OAAA,OAAAhE,CAAA,EAAA,SAAAmC,EAAA,IAAA,KACI+B,GAAA,0DAAA/B,EAAA,IAAA,EAAA,GAMJA,EAAA,SACIgC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRvD,EAAA,mBAAA,KACIuD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-field.BPbe00eB.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: string;\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","focus","expose","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAA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AA,IAAA,KACI+B,GAAA,0DAAA/B,EAAA,IAAA,EAAA,GAMJA,EAAA,SACIgC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRvD,EAAA,mBAAA,KACIuD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,101 @@
1
+ import { defineComponent as x, ref as r, computed as m, watch as F, nextTick as E } from "vue";
2
+ import { d as I, B as T } from "./typography.J1v_SPG3.js";
3
+ import { B as k } from "./button.CdAFZa4V.js";
4
+ import { B as w } from "./loading-indicator.z8COalOc.js";
5
+ import { B as S, s as M, g as L, a as D, f as O } from "./focus-trap._RrLaKlq.js";
6
+ import { E as P } from "./expand.CwwKq7Uc.js";
7
+ import { C as z } from "./cross.CsUPDmaA.js";
8
+ import { g as R } from "./generate-uid.NJ8tVoha.js";
9
+ import { u as W } from "./i18n.BQkEbtPM.js";
10
+ import { a as $ } from "./index.CU8GKq4C.js";
11
+ import { n as A } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
12
+ import "../assets/inspector.css";
13
+ const K = {
14
+ "en-US": {
15
+ close: "Close",
16
+ expand: "Expand",
17
+ inspector: "Inspector",
18
+ returnToMainContent: "Return to main content (Ctrl+Shift+S)",
19
+ returnToMainContentDescription: "You can use Ctrl + Shift + S to navigate between the inspector and page sections."
20
+ },
21
+ "ja-JP": {
22
+ close: "閉じる",
23
+ expand: "展開"
24
+ },
25
+ "pt-BR": {
26
+ close: "Fechar",
27
+ expand: "Expandir"
28
+ }
29
+ }, N = { i18n: { messages: K } }, U = /* @__PURE__ */ x({
30
+ ...N,
31
+ __name: "inspector",
32
+ props: {
33
+ activePage: { default: "" },
34
+ expandable: { type: Boolean, default: !1 },
35
+ isOpen: { type: Boolean, default: !1 },
36
+ loading: { type: Boolean, default: !1 },
37
+ size: { default: "small" },
38
+ title: null
39
+ },
40
+ emits: ["update:is-open", "update:active-page", "expand"],
41
+ setup(d, { emit: n }) {
42
+ const e = d, { t } = W(), o = R("returnToMainContentDescription"), f = r(null), c = r(null), g = r(null), s = r(null), p = r(null), u = r(!1), b = m(() => ({
43
+ [`b-inspector--${e.size}`]: !0
44
+ })), C = m(() => `${t("inspector")}, ${e.title}`), _ = async () => {
45
+ e.isOpen ? (s.value = document.activeElement, await E(), M(c.value, s.value)) : i(s.value);
46
+ }, y = (a) => {
47
+ if (u.value)
48
+ return;
49
+ const l = a.shiftKey ? -1 : 1, h = L(l, c.value);
50
+ D() === h && (a.preventDefault(), p.value = document.activeElement, i(s.value), n("update:active-page", void 0));
51
+ }, B = (a) => {
52
+ const l = a.shiftKey && a.ctrlKey && a.key === "S";
53
+ e.isOpen && !u.value && l && v();
54
+ }, v = () => {
55
+ O(c.value) ? (p.value = document.activeElement, i(s.value), n("update:active-page", void 0)) : (s.value = document.activeElement, i(p.value));
56
+ }, i = (a) => {
57
+ a && (a == null || a.focus(), document.activeElement !== a && i(a.parentElement));
58
+ };
59
+ return F(
60
+ () => e.activePage,
61
+ () => {
62
+ e.activePage && _();
63
+ }
64
+ ), $(c, (a) => {
65
+ const l = a[0];
66
+ u.value = f.value.clientWidth === l.contentRect.width;
67
+ }), e.activePage || I(
68
+ 'BentoInspector "active-page" as optional',
69
+ `Make sure to set the "active-page" prop and keep it in sync with "update:active-page".
70
+ "active-page" prop will be required in the next version`,
71
+ "2.0.0"
72
+ ), { __sfc: !0, props: e, emit: n, t, returnToMainContentDescriptionId: o, wrapper: f, inspector: c, page: g, pageLastFocusedElement: s, inspectorLastFocusedElement: p, isFullWidthInspector: u, conditionalClass: b, inspectorAriaLabel: C, setFocus: _, handleTabNavigation: y, handleSectionFocus: B, moveFocusBetweenSections: v, focusElement: i, BentoTypography: T, BentoButton: k, BentoLoadingIndicator: w, BentoFocusTrap: S, ExpandIcon: P, CrossIcon: z };
73
+ }
74
+ });
75
+ var j = function() {
76
+ var n = this, e = n._self._c, t = n._self._setupProxy;
77
+ return e("div", { ref: "wrapper", staticClass: "b-inspector", class: t.conditionalClass, on: { keydown: t.handleSectionFocus } }, [e("div", { ref: "page", staticClass: "b-inspector__page-wrapper" }, [e("div", { staticClass: "b-inspector__page" }, [n._t("page")], 2)]), e("Transition", { attrs: { name: "b-inspector__animation", mode: "out-in" }, on: { "before-enter": t.setFocus, "after-leave": t.setFocus } }, [n.isOpen ? e("aside", { ref: "inspector", staticClass: "b-inspector__container-wrapper", attrs: { "aria-label": t.inspectorAriaLabel }, on: { keydown: function(o) {
78
+ return !o.type.indexOf("key") && n._k(o.keyCode, "tab", 9, o.key, "Tab") ? null : t.handleTabNavigation.apply(null, arguments);
79
+ } } }, [e(t.BentoFocusTrap, { attrs: { disabled: !t.isFullWidthInspector } }, [e("div", { staticClass: "b-inspector__container" }, [e("div", { staticClass: "b-inspector__header" }, [t.isFullWidthInspector ? n._e() : [e(t.BentoButton, { staticClass: "b-inspector__return-content", attrs: { variant: "secondary", condensed: "", "aria-describedby": t.returnToMainContentDescriptionId }, on: { click: t.moveFocusBetweenSections } }, [n._v(" " + n._s(t.t("returnToMainContent")) + " ")]), e("span", { staticClass: "b-inspector__return-content-description", attrs: { id: t.returnToMainContentDescriptionId } }, [n._v(n._s(t.t("returnToMainContentDescription")))])], e(t.BentoTypography, { staticClass: "b-inspector__title", attrs: { el: "h2", variant: "title" } }, [n._v(" " + n._s(n.title) + " ")]), e("div", { staticClass: "b-inspector__icons" }, [n.expandable ? e(t.BentoButton, { attrs: { variant: "tertiary" }, on: { click: function(o) {
80
+ return t.emit("expand");
81
+ } }, scopedSlots: n._u([{ key: "iconLeft", fn: function() {
82
+ return [e(t.ExpandIcon, { attrs: { "svg-title": t.t("expand") } })];
83
+ }, proxy: !0 }], null, !1, 1210869445) }) : n._e(), e(t.BentoButton, { attrs: { variant: "tertiary" }, on: { click: function(o) {
84
+ return t.emit("update:is-open", !1);
85
+ } }, scopedSlots: n._u([{ key: "iconLeft", fn: function() {
86
+ return [e(t.CrossIcon, { attrs: { "svg-title": t.t("close") } })];
87
+ }, proxy: !0 }], null, !1, 858730413) })], 1)], 2), e("div", { staticClass: "b-inspector__content" }, [n.loading ? e(t.BentoLoadingIndicator, { staticClass: "b-inspector__loading-indicator", attrs: { large: "" } }) : n._t("content")], 2)])])], 1) : n._e()])], 1);
88
+ }, q = [], J = /* @__PURE__ */ A(
89
+ U,
90
+ j,
91
+ q,
92
+ !1,
93
+ null,
94
+ "3cffc231"
95
+ );
96
+ const ot = J.exports, st = ["small", "large"];
97
+ export {
98
+ st as B,
99
+ ot as i
100
+ };
101
+ //# sourceMappingURL=inspector.types.BtgXpTC7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector.types.BtgXpTC7.js","sources":["../../src/components/inspector/inspector.vue","../../src/components/inspector/inspector.types.ts"],"sourcesContent":["<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isFullWidthInspector\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isFullWidthInspector\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useResizeObserver } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { BentoInspectorSize } from './inspector.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n activePage: { default: '' },\n expandable: { type: Boolean, default: false },\n isOpen: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n size: { default: 'small' },\n title: null\n});\n\n const emit = defineEmits([\"update:is-open\", \"update:active-page\", \"expand\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const pageLastFocusedElement = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n const isFullWidthInspector = ref(false);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const setFocus = async () => {\n if (props.isOpen) {\n pageLastFocusedElement.value = document.activeElement as HTMLElement;\n await nextTick();\n moveFocusInside(inspector.value, pageLastFocusedElement.value);\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(pageLastFocusedElement.value);\n }\n };\n\n const handleTabNavigation = event => {\n if (isFullWidthInspector.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(pageLastFocusedElement.value);\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isFullWidthInspector.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(pageLastFocusedElement.value);\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n pageLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n useResizeObserver(inspector, entries => {\n const entry = entries[0];\n isFullWidthInspector.value = wrapper.value.clientWidth === entry.contentRect.width;\n });\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n","export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n"],"names":["__default__","messages","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","ref","inspector","page","pageLastFocusedElement","inspectorLastFocusedElement","isFullWidthInspector","conditionalClass","computed","props","inspectorAriaLabel","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","emit","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","watch","useResizeObserver","entries","entry","deprecate","BentoInspectorSizeOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmNIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;iBA1HA,EAAA,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,gC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C;AAAA,MAAA,MAAAlB,EAAA;AAAA,MACgB,MAAA;AAER,QAAAA,EAAA,cACIE,EAAA;AAAA,MACJ;AAAA,IACJ,GAGJiB,EAAA1B,GAAA,CAAA2B,MAAA;AACI,YAAAC,IAAAD,EAAA,CAAA;AACA,MAAAvB,EAAA,QAAAN,EAAA,MAAA,gBAAA8B,EAAA,YAAA;AAAA,IAA6E,CAAA,GAGjFrB,EAAA,cACIsB;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;sBCrLCC,KAAA,CAAA,SAAA,OAAA;"}
@@ -2,7 +2,7 @@ import { defineComponent as y, provide as R, toRef as $, computed as s, useSlots
2
2
  import { n as w } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
3
3
  import { B as T } from "./typography.J1v_SPG3.js";
4
4
  import { u as B } from "./use-has-slot.C9lQZ6nz.js";
5
- import { d as I } from "./index.D8ivUe7P.js";
5
+ import { e as I } from "./index.CU8GKq4C.js";
6
6
  import "../assets/layout-row.css";
7
7
  const h = Symbol("Layout size inject key"), O = {}, P = /* @__PURE__ */ y({
8
8
  ...O,
@@ -38,10 +38,10 @@ const Z = M.exports, W = ["3-9", "9-3", "4-8", "8-4", "6-6"], j = {}, N = /* @__
38
38
  columnsLayout: { default: "6-6" }
39
39
  },
40
40
  setup(n) {
41
- const o = n, l = x(), t = B(l), a = E(h, _("full-width")), e = _(null), m = _(null), f = _(null), u = s(() => a.value === "full-width"), d = s(() => W.includes(o.columnsLayout)), C = s(() => `b-layout-row--${a.value}`), b = s(() => ({
41
+ const o = n, l = x(), t = B(l), e = E(h, _("full-width")), a = _(null), m = _(null), f = _(null), u = s(() => e.value === "full-width"), d = s(() => W.includes(o.columnsLayout)), C = s(() => `b-layout-row--${e.value}`), b = s(() => ({
42
42
  "b-layout-row__column-wrapper": u.value
43
43
  })), L = s(() => {
44
- const c = d.value ? o.columnsLayout.split("-") : [6, 6], r = (i) => u.value ? c[i] : a.value;
44
+ const c = d.value ? o.columnsLayout.split("-") : [6, 6], r = (i) => u.value ? c[i] : e.value;
45
45
  return {
46
46
  col1: `b-layout-row__column--${r(0)}`,
47
47
  col2: `b-layout-row__column--${r(1)}`
@@ -52,8 +52,8 @@ const Z = M.exports, W = ["3-9", "9-3", "4-8", "8-4", "6-6"], j = {}, N = /* @__
52
52
  async (c) => {
53
53
  var i, p, v;
54
54
  await g();
55
- const r = ((i = e.value) == null ? void 0 : i.firstChild) === m.value;
56
- c && !r ? (p = e.value) == null || p.prepend(m.value) : !c && (o.columnsLayout === "3-9" || o.columnsLayout === "4-8") && ((v = e.value) == null || v.prepend(f.value));
55
+ const r = ((i = a.value) == null ? void 0 : i.firstChild) === m.value;
56
+ c && !r ? (p = a.value) == null || p.prepend(m.value) : !c && (o.columnsLayout === "3-9" || o.columnsLayout === "4-8") && ((v = a.value) == null || v.prepend(f.value));
57
57
  },
58
58
  { immediate: !0 }
59
59
  ), z(() => {
@@ -65,7 +65,7 @@ const Z = M.exports, W = ["3-9", "9-3", "4-8", "8-4", "6-6"], j = {}, N = /* @__
65
65
  throw new Error(
66
66
  `${o.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`
67
67
  );
68
- }), { __sfc: !0, props: o, slots: l, hasSlot: t, size: a, row: e, col1: m, col2: f, isFullWidth: u, isValidColumnLayout: d, conditionalRowClass: C, conditionalRowWithColumnsClass: b, conditionalColumnClass: L, BentoTypography: T };
68
+ }), { __sfc: !0, props: o, slots: l, hasSlot: t, size: e, row: a, col1: m, col2: f, isFullWidth: u, isValidColumnLayout: d, conditionalRowClass: C, conditionalRowWithColumnsClass: b, conditionalColumnClass: L, BentoTypography: T };
69
69
  }
70
70
  });
71
71
  var Y = function() {
@@ -84,4 +84,4 @@ export {
84
84
  q as a,
85
85
  Z as l
86
86
  };
87
- //# sourceMappingURL=layout-row.BfS-cPky.js.map
87
+ //# sourceMappingURL=layout-row.CHwDU8yK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-row.BfS-cPky.js","sources":["../../src/components/layout/layout.keys.ts","../../src/components/layout/layout.vue","../../src/components/layout/layout.types.ts","../../src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n variant: { default: 'page' },\n size: { default: 'full-width' }\n});\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behaviour of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n columnsLayout: { default: '6-6' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","_a","_b","_c","onMounted"],"mappings":";;;;;;AAAa,MAAAA,IAAA,OAAA,wBAAA,GC8CTC,IAAA,CAAA;;;;;;;;;AA9BA,IAAAC,EAAAF,GAAAG,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAF,EAAA,YAAA;AAAA,IACE,EAAA,GAG7CG,IAAAH,EAAA,YAAA,SAAA,SAAA;;;;;;;;;;;;;;;qBCjBGI,IAAA,CAAA,OAAA,OAAA,OAAA,OAAA,KAAA,GC2GHC,IAAA,CAAA;;;;;;;iBA/EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACAI,IAAAC,EAAAf,GAAAgB,EAAA,YAAA,CAAA,GAEAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,IAAAH,EAAA,IAAA,GAEAI,IAAAd,EAAA,MAAAQ,EAAA,UAAA,YAAA,GACAO,IAAAf,EAAA,MAAAE,EAAA,SAAAJ,EAAA,aAAA,CAAA,GAEAkB,IAAAhB,EAAA,MAAA,iBAAAQ,EAAA,KAAA,EAAA,GAEAS,IAAAjB,EAAA,OAAA;AAAA,MAAuD,gCAAAc,EAAA;AAAA,IACP,EAAA,GAGhDI,IAAAlB,EAAA,MAAA;AACI,YAAAmB,IAAAJ,EAAA,QAAAjB,EAAA,cAAA,MAAA,GAAA,IAAA,CAAA,GAAA,CAAA,GACAsB,IAAA,CAAAC,MAAAP,EAAA,QAAAK,EAAAE,CAAA,IAAAb,EAAA;AAEA,aAAA;AAAA,QAAO,MAAA,yBAAAY,EAAA,CAAA,CAAA;AAAA,QACgD,MAAA,yBAAAA,EAAA,CAAA,CAAA;AAAA,MACA;AAAA,IACvD,CAAA;AAGJ,WAAAE;AAAA,MAAAC,EAAA,oBAAA;AAAA,MACsC,OAAAC,MAAA;;AAE9B,cAAAC,EAAA;AACA,cAAAC,MAAAC,IAAAhB,EAAA,UAAA,gBAAAgB,EAAA,gBAAAf,EAAA;AACA,QAAAY,KAAA,CAAAE,KACIE,IAAAjB,EAAA,UAAA,QAAAiB,EAAA,QAAAhB,EAAA,SAA6B,CAAAY,MAAA1B,EAAA,kBAAA,SAAAA,EAAA,kBAAA,YAE7B+B,IAAAlB,EAAA,UAAA,QAAAkB,EAAA,QAAAhB,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB,GAGtBiB,EAAA,MAAA;AACI,UAAA,CAAAhB,EAAA,UAAAR,EAAA,OAAA,KAAAA,EAAA,OAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAIR,UAAA,CAAAS,EAAA;AACI,cAAA,IAAA;AAAA,UAAU,GAAAjB,EAAA,aAAA;AAAA,QACgB;AAAA,IAE9B,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"layout-row.CHwDU8yK.js","sources":["../../src/components/layout/layout.keys.ts","../../src/components/layout/layout.vue","../../src/components/layout/layout.types.ts","../../src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n variant: { default: 'page' },\n size: { default: 'full-width' }\n});\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behaviour of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n columnsLayout: { default: '6-6' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","_a","_b","_c","onMounted"],"mappings":";;;;;;AAAa,MAAAA,IAAA,OAAA,wBAAA,GC8CTC,IAAA,CAAA;;;;;;;;;AA9BA,IAAAC,EAAAF,GAAAG,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAF,EAAA,YAAA;AAAA,IACE,EAAA,GAG7CG,IAAAH,EAAA,YAAA,SAAA,SAAA;;;;;;;;;;;;;;;qBCjBGI,IAAA,CAAA,OAAA,OAAA,OAAA,OAAA,KAAA,GC2GHC,IAAA,CAAA;;;;;;;iBA/EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACAI,IAAAC,EAAAf,GAAAgB,EAAA,YAAA,CAAA,GAEAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,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 +1,5 @@
1
1
  import { defineComponent as n, computed as e } from "vue";
2
- import { B as r } from "./tag.3fthBtwc.js";
2
+ import { B as r } from "./tag.CevG31iQ.js";
3
3
  import { B as s } from "./typography.J1v_SPG3.js";
4
4
  import { n as i } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
5
5
  import "../assets/listbox-option-tag.css";
@@ -41,4 +41,4 @@ const u = m.exports;
41
41
  export {
42
42
  u as L
43
43
  };
44
- //# sourceMappingURL=listbox-option-tag.XbvBQqlt.js.map
44
+ //# sourceMappingURL=listbox-option-tag.BJBWnC2r.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listbox-option-tag.XbvBQqlt.js","sources":["../../src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span aria-hidden=\"true\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types';\n import { BentoTag, BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed"],"mappings":";;;;;AAmBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAKA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAIA,WAAA;AAAA;AAAA,MAAA,SAFAC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAIA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"listbox-option-tag.BJBWnC2r.js","sources":["../../src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span aria-hidden=\"true\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types';\n import { BentoTag, BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed"],"mappings":";;;;;AAmBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAKA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAIA,WAAA;AAAA;AAAA,MAAA,SAFAC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAIA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as x, computed as C, ref as i, inject as P, onMounted as U, provide as W } from "vue";
1
+ import { defineComponent as x, computed as b, ref as i, inject as P, onMounted as U, provide as W } from "vue";
2
2
  import { g as w } from "./generate-uid.NJ8tVoha.js";
3
- import { a as O, B as H } from "./popover.C-LwO38X.js";
3
+ import { a as O, B as H } from "./popover.CRdrSmFW.js";
4
4
  import { B as D, D as j } from "./divider.Cc4JFWG_.js";
5
5
  import { B as q, u as G } from "./teleport.B5fwsT5y.js";
6
6
  import { u as V } from "./use-has-slot.C9lQZ6nz.js";
@@ -9,7 +9,7 @@ import { n as g } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
9
9
  import { C as Y, a as R } from "./chevron-left.PIu6yPqe.js";
10
10
  import { a as E, B as Z } from "./base-button.-gx_u8Bd.js";
11
11
  import { B as z } from "./typography.J1v_SPG3.js";
12
- import { B as Q } from "./toggle-button.BX_9vB0d.js";
12
+ import { B as Q } from "./toggle-button.DK4H4sHT.js";
13
13
  import "../assets/menu.css";
14
14
  const X = x({
15
15
  name: "menu-item",
@@ -85,7 +85,7 @@ const X = x({
85
85
  setup(s, { emit: e }) {
86
86
  return {
87
87
  // Values
88
- conditionalClasses: C(() => ({
88
+ conditionalClasses: b(() => ({
89
89
  "b-menu-item--critical": s.critical,
90
90
  "b-menu-item--indent": s.indent
91
91
  })),
@@ -165,7 +165,7 @@ const N = ae.exports, A = {
165
165
  },
166
166
  emits: [d.CLOSE, d.BACK],
167
167
  setup(s, { emit: e }) {
168
- const n = i(null), t = i(0), o = i(s.items.length), u = () => e(d.CLOSE), r = () => e(d.BACK), l = C(() => {
168
+ const n = i(null), t = i(0), o = i(s.items.length), u = () => e(d.CLOSE), r = () => e(d.BACK), l = b(() => {
169
169
  var m;
170
170
  const _ = (m = s.items) == null ? void 0 : m.map((y) => ({
171
171
  ...y,
@@ -197,8 +197,8 @@ const N = ae.exports, A = {
197
197
  });
198
198
  const a = () => {
199
199
  t.value > 0 ? (t.value -= 1, l.value[t.value].disabled && a()) : t.value = o.value, p();
200
- }, b = () => {
201
- t.value < o.value ? (t.value += 1, l.value[t.value].disabled && b()) : t.value = 0, p();
200
+ }, C = () => {
201
+ t.value < o.value ? (t.value += 1, l.value[t.value].disabled && C()) : t.value = 0, p();
202
202
  };
203
203
  return {
204
204
  // Enums
@@ -212,7 +212,7 @@ const N = ae.exports, A = {
212
212
  closeMenu: u,
213
213
  onBackButton: r,
214
214
  focusPrevious: a,
215
- focusNext: b
215
+ focusNext: C
216
216
  };
217
217
  }
218
218
  });
@@ -270,7 +270,7 @@ const de = fe.exports, me = x({
270
270
  },
271
271
  emits: [d.CLOSE, "menu-item-click"],
272
272
  setup(s, { emit: e }) {
273
- const n = i(null), t = i(null), o = i(null), u = i(!1), r = i(null), l = i(s.focusLastElement ? s.data.length - 1 : 0), p = i(0), a = i(s.data.length - 1), b = C(() => s.data.some((c) => c.icon)), _ = C(() => s.indentItems || b.value ? s.data.map((c) => {
273
+ const n = i(null), t = i(null), o = i(null), u = i(!1), r = i(null), l = i(s.focusLastElement ? s.data.length - 1 : 0), p = i(0), a = i(s.data.length - 1), C = b(() => s.data.some((c) => c.icon)), _ = b(() => s.indentItems || C.value ? s.data.map((c) => {
274
274
  let f = !1;
275
275
  return c.icon || (f = !0), {
276
276
  ...c,
@@ -297,10 +297,10 @@ const de = fe.exports, me = x({
297
297
  r.value && u.value && (r.value = null, u.value = !1);
298
298
  }, L = () => {
299
299
  u.value = !1, r.value = null, m();
300
- }, S = C(() => {
300
+ }, S = b(() => {
301
301
  var c, f, h;
302
302
  return (h = (f = (c = o.value) == null ? void 0 : c[0]) == null ? void 0 : f.$el) == null ? void 0 : h.offsetHeight;
303
- }), K = C(() => u.value ? `${S.value}px` : "");
303
+ }), K = b(() => u.value ? `${S.value}px` : "");
304
304
  return {
305
305
  // Values
306
306
  menuItemListRef: n,
@@ -351,9 +351,9 @@ var pe = function() {
351
351
  null,
352
352
  "f2e65437"
353
353
  );
354
- const ve = ye.exports, Ce = Symbol("menu inverse style injection key");
354
+ const ve = ye.exports, be = Symbol("menu inverse style injection key");
355
355
  let T = 0;
356
- const be = {
356
+ const Ce = {
357
357
  beforeCreate() {
358
358
  this.uuid = T.toString(), T += 1;
359
359
  }
@@ -362,7 +362,7 @@ var ke = function() {
362
362
  var e = this, n = e._self._c;
363
363
  return n("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? n("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), n("path", { attrs: { fill: "#00112C", d: "M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00167 0.970945 7.70006 1.00065 7.42598 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65803 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z" } }), n("path", { attrs: { fill: "#00112C", d: "M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00167 11.9709 7.70006 12.0007 7.42598 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65803 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z" } }), n("path", { attrs: { fill: "#00112C", d: "M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65803 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42598 6.61418C7.70006 6.50065 8.00167 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z" } })]);
364
364
  }, he = [], ge = /* @__PURE__ */ g(
365
- be,
365
+ Ce,
366
366
  ke,
367
367
  he,
368
368
  !1,
@@ -441,11 +441,11 @@ const xe = ge.exports, Ie = x({
441
441
  },
442
442
  emits: [d.CLOSE, d.OPEN, "menu-item-click"],
443
443
  setup(s, { emit: e, slots: n }) {
444
- const { t } = J(), o = i(null), u = i(!1), r = i(!1), l = i(null), p = w("menu"), a = w("menu-popover"), b = P(Ce, i(!1));
445
- W(j, b);
446
- const _ = C(() => ({
447
- "b-menu--inverse": b.value
448
- })), m = C(() => s.menuWidth ? { width: `${s.menuWidth}px` } : null), y = C(() => {
444
+ const { t } = J(), o = i(null), u = i(!1), r = i(!1), l = i(null), p = w("menu"), a = w("menu-popover"), C = P(be, i(!1));
445
+ W(j, C);
446
+ const _ = b(() => ({
447
+ "b-menu--inverse": C.value
448
+ })), m = b(() => s.menuWidth ? { width: `${s.menuWidth}px` } : null), y = b(() => {
449
449
  if (s != null && s.button)
450
450
  return {
451
451
  variant: "secondary",
@@ -477,7 +477,7 @@ const xe = ge.exports, Ie = x({
477
477
  isLastElementFocused: r,
478
478
  // Classes
479
479
  computedClasses: _,
480
- isInverseColorSet: b,
480
+ isInverseColorSet: C,
481
481
  // Methods
482
482
  hasSlot: V(n),
483
483
  onKeyDown: B,
@@ -506,7 +506,7 @@ var Be = function() {
506
506
  return [e._t("default")];
507
507
  }, proxy: !0 } : null, e.hasSlot("iconRight") ? { key: "iconRight", fn: function() {
508
508
  return [e._t("iconRight")];
509
- }, proxy: !0 } : null], null, !0) }, "bento-toggle-button", e.computedButtonPropsWithDefaults, !1)), e.menuButtonRef ? n("bento-teleport", { attrs: { disabled: !e.teleport } }, [e.menuButtonRef ? n("bento-popover", { ref: "popoverRef", staticClass: "b-menu__popover", style: e.computedMenuWidth, attrs: { id: e.menuId, open: e.showMenu, "target-element": e.menuButtonRef, position: e.menuPosition, "fixed-positioning": e.menuFixedPositioning, "fallback-position": [
509
+ }, proxy: !0 } : null], null, !0) }, "bento-toggle-button", e.computedButtonPropsWithDefaults, !1)), e.menuButtonRef ? n("bento-teleport", { attrs: { disabled: !e.teleport } }, [e.menuButtonRef ? n("bento-popover", { ref: "popoverRef", staticClass: "b-menu__popover", style: e.computedMenuWidth, attrs: { id: e.menuId, role: null, open: e.showMenu, "target-element": e.menuButtonRef, position: e.menuPosition, "fixed-positioning": e.menuFixedPositioning, "fallback-position": [
510
510
  "bottom-start",
511
511
  "bottom-end",
512
512
  "top-start",
@@ -522,14 +522,14 @@ var Be = function() {
522
522
  Me,
523
523
  !1,
524
524
  null,
525
- "0b7f4a1a"
525
+ "60b1f8b1"
526
526
  );
527
527
  const Ue = Le.exports;
528
528
  export {
529
529
  Ue as B,
530
530
  ne as D,
531
- Ce as M,
531
+ be as M,
532
532
  xe as O,
533
533
  d as a
534
534
  };
535
- //# sourceMappingURL=menu.DYopJZ12.js.map
535
+ //# sourceMappingURL=menu.BC7ynpgF.js.map