@adyen/bento-vue2 1.1.0 → 1.2.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 (299) hide show
  1. package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +15 -11
  2. package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +14 -14
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -2
  5. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +4 -4
  6. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +4 -4
  7. package/dist/@types/packages/vue2/src/components/button/index.d.ts +1 -1
  8. package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +20 -16
  9. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
  10. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
  11. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +13 -9
  12. package/dist/@types/packages/vue2/src/components/code-snippet/composables/useLanguage.d.ts +2 -2
  13. package/dist/@types/packages/vue2/src/components/country/composables/useCountryCapital/useCountryCapital.d.ts +1 -1
  14. package/dist/@types/packages/vue2/src/components/country/composables/useCountryName/useCountryName.d.ts +1 -1
  15. package/dist/@types/packages/vue2/src/components/country/composables/useCountryPhoneCode/useCountryPhoneCode.d.ts +1 -1
  16. package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +9 -7
  17. package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +5 -5
  18. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +3 -3
  19. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/components/data-grid-config-settings-column-row/data-grid-config-settings-column-row.vue.d.ts +4 -4
  20. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +4 -4
  21. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +1 -1
  22. package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +1 -1
  23. package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +1 -1
  24. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +1 -1
  25. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +3 -3
  26. package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +7 -5
  27. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.types.d.ts +2 -2
  28. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +10 -10
  29. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +13 -13
  30. package/dist/@types/packages/vue2/src/components/date-range-picker/composables/use-date-range-picker-calendar-text.d.ts +1 -1
  31. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +2 -2
  32. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +10 -10
  33. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
  34. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +2 -2
  35. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +1 -1
  36. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/useDropdownOptionsListbox.d.ts +2 -2
  37. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +87 -85
  38. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +2 -2
  39. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.types.d.ts +1 -1
  40. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +18 -16
  41. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/useCountryItems.d.ts +3 -3
  42. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.types.d.ts +2 -2
  43. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +22 -20
  44. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.types.d.ts +2 -2
  45. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +17 -15
  46. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.types.d.ts +2 -2
  47. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +17 -15
  48. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.types.d.ts +1 -1
  49. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +8 -6
  50. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -1
  51. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +1 -1
  52. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.types.d.ts +2 -2
  53. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +14 -12
  54. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +26 -26
  55. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +7 -7
  56. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +2 -2
  57. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +9 -9
  58. package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +1 -1
  59. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +2 -2
  60. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.vue.d.ts +2 -2
  61. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +8 -8
  62. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.vue.d.ts +2 -2
  63. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.vue.d.ts +2 -2
  64. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +7 -7
  65. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +10 -10
  66. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +2 -2
  67. package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +5 -5
  68. package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +8 -6
  69. package/dist/@types/packages/vue2/src/components/input-field/input-field.types.d.ts +1 -1
  70. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +23 -15
  71. package/dist/@types/packages/vue2/src/components/internal/avatar/avatar.vue.d.ts +2 -2
  72. package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +2 -2
  73. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/calendar-month.vue.d.ts +2 -2
  74. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.vue.d.ts +1 -1
  75. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  76. package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +4 -4
  77. package/dist/@types/packages/vue2/src/components/internal/footer-actions/footer-actions.vue.d.ts +1 -1
  78. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +2 -2
  79. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +2 -2
  80. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +2 -2
  81. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option/listbox-option.vue.d.ts +1 -1
  82. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue.d.ts +3 -3
  83. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +4 -4
  84. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue.d.ts +2 -2
  85. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +11 -9
  86. package/dist/@types/packages/vue2/src/components/link/index.d.ts +1 -1
  87. package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +3 -3
  88. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -1
  89. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +3 -3
  90. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +5 -5
  91. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +3 -3
  92. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +4 -4
  93. package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +2 -2
  94. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +7 -7
  95. package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +24 -16
  96. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-context/pagination-context.vue.d.ts +2 -2
  97. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-controls/pagination-controls.vue.d.ts +1 -1
  98. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue.d.ts +1 -1
  99. package/dist/@types/packages/vue2/src/components/payment-method/composables/usePaymentIcon.d.ts +1 -1
  100. package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +6 -4
  101. package/dist/@types/packages/vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue.d.ts +1 -1
  102. package/dist/@types/packages/vue2/src/components/popover/components/popover-title/popover-title.vue.d.ts +1 -1
  103. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +12 -12
  104. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.utils.d.ts +1 -1
  105. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +4 -4
  106. package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +1 -1
  107. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
  108. package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +62 -46
  109. package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +1 -1
  110. package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +3 -3
  111. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +2 -2
  112. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +38 -30
  113. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +16 -10
  114. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +16 -10
  115. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +16 -10
  116. package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +1 -1
  117. package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +1 -1
  118. package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +5 -5
  119. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +8 -6
  120. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +20 -20
  121. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +2 -2
  122. package/dist/@types/packages/vue2/src/components/toast/components/toast-item/toast-item.vue.d.ts +2 -2
  123. package/dist/@types/packages/vue2/src/components/toggle/toggle.types.d.ts +4 -0
  124. package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +9 -9
  125. package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +25 -25
  126. package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +6 -6
  127. package/dist/@types/packages/vue2/src/composables/initials.d.ts +1 -1
  128. package/dist/@types/packages/vue2/src/composables/use-checkbox-select-all/use-checkbox-select-all.d.ts +2 -2
  129. package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +1 -1
  130. package/dist/@types/packages/vue2/src/directives/click-outside/on-click-outside.d.ts +1 -1
  131. package/dist/@types/packages/vue2/src/directives/click-outside/types.d.ts +1 -1
  132. package/dist/@types/packages/vue2/src/directives/click-outside/useEventListener/index.d.ts +1 -1
  133. package/dist/@types/packages/vue2/src/directives/click-outside/utils.d.ts +1 -1
  134. package/dist/@types/packages/vue2/src/directives/tooltip/tooltip.types.d.ts +1 -1
  135. package/dist/@types/packages/vue2/src/plugins/toastController.d.ts +1 -1
  136. package/dist/@types/packages/vue2/src/types/index.d.ts +0 -1
  137. package/dist/@types/packages/vue2/src/types/listbox.d.ts +1 -1
  138. package/dist/@types/packages/vue2/src/utils/ts/aria-label.d.ts +1 -1
  139. package/dist/@types/packages/vue2/src/utils/ts/events.d.ts +1 -1
  140. package/dist/@types/packages/vue2/src/utils/ts/focus-trap.utils.d.ts +1 -1
  141. package/dist/accordion.js +1 -1
  142. package/dist/alert.js +34 -32
  143. package/dist/alert.js.map +1 -1
  144. package/dist/assets/button-actions.css +1 -1
  145. package/dist/assets/button.css +1 -1
  146. package/dist/assets/dropdown.css +1 -1
  147. package/dist/assets/index10.css +1 -1
  148. package/dist/assets/index11.css +1 -1
  149. package/dist/assets/index12.css +1 -1
  150. package/dist/assets/index13.css +1 -1
  151. package/dist/assets/index14.css +1 -1
  152. package/dist/assets/index15.css +1 -1
  153. package/dist/assets/index16.css +1 -1
  154. package/dist/assets/index17.css +1 -1
  155. package/dist/assets/index18.css +1 -1
  156. package/dist/assets/index19.css +1 -1
  157. package/dist/assets/index2.css +1 -1
  158. package/dist/assets/index20.css +1 -1
  159. package/dist/assets/index21.css +1 -1
  160. package/dist/assets/index22.css +1 -1
  161. package/dist/assets/index23.css +1 -1
  162. package/dist/assets/index24.css +1 -1
  163. package/dist/assets/index25.css +1 -1
  164. package/dist/assets/index26.css +1 -1
  165. package/dist/assets/index27.css +1 -1
  166. package/dist/assets/index28.css +1 -1
  167. package/dist/assets/index29.css +1 -1
  168. package/dist/assets/index3.css +1 -1
  169. package/dist/assets/index30.css +1 -1
  170. package/dist/assets/index31.css +1 -1
  171. package/dist/assets/index32.css +1 -1
  172. package/dist/assets/index33.css +1 -1
  173. package/dist/assets/index34.css +1 -1
  174. package/dist/assets/index35.css +1 -1
  175. package/dist/assets/index36.css +1 -1
  176. package/dist/assets/index37.css +1 -1
  177. package/dist/assets/index38.css +1 -1
  178. package/dist/assets/index39.css +1 -1
  179. package/dist/assets/index4.css +1 -1
  180. package/dist/assets/index5.css +1 -1
  181. package/dist/assets/index6.css +1 -1
  182. package/dist/assets/index7.css +1 -1
  183. package/dist/assets/index8.css +1 -1
  184. package/dist/assets/index9.css +1 -1
  185. package/dist/assets/listbox.css +1 -1
  186. package/dist/avatar-image.js +1 -1
  187. package/dist/button.js +3 -3
  188. package/dist/card.js +60 -51
  189. package/dist/card.js.map +1 -1
  190. package/dist/checkbox.js +10 -10
  191. package/dist/checkbox.js.map +1 -1
  192. package/dist/chunks/{base-button.e7630a1d.js → base-button.d4487ac9.js} +2 -2
  193. package/dist/chunks/{base-button.e7630a1d.js.map → base-button.d4487ac9.js.map} +1 -1
  194. package/dist/chunks/{button-actions.03751d96.js → button-actions.cf73ed47.js} +10 -10
  195. package/dist/chunks/{button-actions.03751d96.js.map → button-actions.cf73ed47.js.map} +1 -1
  196. package/dist/chunks/{button.f64585fc.js → button.c27a7ce2.js} +11 -11
  197. package/dist/chunks/button.c27a7ce2.js.map +1 -0
  198. package/dist/chunks/{calendar.c9cfce76.js → calendar.8f50a65a.js} +4 -4
  199. package/dist/chunks/{calendar.c9cfce76.js.map → calendar.8f50a65a.js.map} +1 -1
  200. package/dist/chunks/{checkbox.27fae2af.js → checkbox.c06daf12.js} +3 -3
  201. package/dist/chunks/{checkbox.27fae2af.js.map → checkbox.c06daf12.js.map} +1 -1
  202. package/dist/chunks/{controls-group.e4745546.js → controls-group.9d58a091.js} +2 -2
  203. package/dist/chunks/{controls-group.e4745546.js.map → controls-group.9d58a091.js.map} +1 -1
  204. package/dist/chunks/{copy.888486ff.js → copy.b62beae5.js} +3 -3
  205. package/dist/chunks/{copy.888486ff.js.map → copy.b62beae5.js.map} +1 -1
  206. package/dist/chunks/{dropdown-default-textbox.e425fc5b.js → dropdown-default-textbox.a5eca928.js} +2 -2
  207. package/dist/chunks/{dropdown-default-textbox.e425fc5b.js.map → dropdown-default-textbox.a5eca928.js.map} +1 -1
  208. package/dist/chunks/{dropdown.e298bb6c.js → dropdown.368486b1.js} +60 -58
  209. package/dist/chunks/dropdown.368486b1.js.map +1 -0
  210. package/dist/chunks/{error-message.4269d92b.js → error-message.a581a172.js} +2 -2
  211. package/dist/chunks/{error-message.4269d92b.js.map → error-message.a581a172.js.map} +1 -1
  212. package/dist/chunks/{index.e1fcc9e0.js → index.175f9e2d.js} +3 -3
  213. package/dist/chunks/index.175f9e2d.js.map +1 -0
  214. package/dist/chunks/{index.ada08445.js → index.3b6fc08a.js} +6 -6
  215. package/dist/chunks/{index.ada08445.js.map → index.3b6fc08a.js.map} +1 -1
  216. package/dist/chunks/{index.7bbd6611.js → index.3dfea3bd.js} +3 -3
  217. package/dist/chunks/{index.7bbd6611.js.map → index.3dfea3bd.js.map} +1 -1
  218. package/dist/chunks/{index.96e2f563.js → index.ad39b625.js} +2 -2
  219. package/dist/chunks/{index.96e2f563.js.map → index.ad39b625.js.map} +1 -1
  220. package/dist/chunks/{index.8d590c55.js → index.d07f9800.js} +33 -32
  221. package/dist/chunks/{index.8d590c55.js.map → index.d07f9800.js.map} +1 -1
  222. package/dist/chunks/{index.bc51abe9.js → index.f0d99471.js} +8 -8
  223. package/dist/chunks/{index.bc51abe9.js.map → index.f0d99471.js.map} +1 -1
  224. package/dist/chunks/{listbox-option-tag.aae99730.js → listbox-option-tag.c7e9a228.js} +3 -3
  225. package/dist/chunks/{listbox-option-tag.aae99730.js.map → listbox-option-tag.c7e9a228.js.map} +1 -1
  226. package/dist/chunks/{listbox.99d23071.js → listbox.f51e92cd.js} +28 -27
  227. package/dist/chunks/{listbox.99d23071.js.map → listbox.f51e92cd.js.map} +1 -1
  228. package/dist/chunks/{loading-button.f7768964.js → loading-button.6d34f66f.js} +2 -2
  229. package/dist/chunks/{loading-button.f7768964.js.map → loading-button.6d34f66f.js.map} +1 -1
  230. package/dist/chunks/{tooltip.1e7cda50.js → tooltip.9af34fba.js} +2 -2
  231. package/dist/chunks/{tooltip.1e7cda50.js.map → tooltip.9af34fba.js.map} +1 -1
  232. package/dist/chunks/useCountryItems.5d7b436e.js.map +1 -1
  233. package/dist/code-snippet.js +132 -130
  234. package/dist/code-snippet.js.map +1 -1
  235. package/dist/country.js +17 -16
  236. package/dist/country.js.map +1 -1
  237. package/dist/currency.js +1 -1
  238. package/dist/currency.js.map +1 -1
  239. package/dist/data-grid.js +112 -112
  240. package/dist/data-grid.js.map +1 -1
  241. package/dist/date-picker.js +7 -7
  242. package/dist/date-range-picker.js +2 -2
  243. package/dist/date.js +1 -1
  244. package/dist/divider.js +1 -1
  245. package/dist/dropdown.js +3 -3
  246. package/dist/dropdown.js.map +1 -1
  247. package/dist/filter-bar.js +13 -13
  248. package/dist/filter-bar.js.map +1 -1
  249. package/dist/focus-trap.js +1 -1
  250. package/dist/header.js +30 -30
  251. package/dist/header.js.map +1 -1
  252. package/dist/index.js +147 -147
  253. package/dist/info-icon.js +13 -12
  254. package/dist/info-icon.js.map +1 -1
  255. package/dist/input-field.js +45 -41
  256. package/dist/input-field.js.map +1 -1
  257. package/dist/internal.js +6 -6
  258. package/dist/link.js +12 -12
  259. package/dist/link.js.map +1 -1
  260. package/dist/loading-indicator.js +1 -1
  261. package/dist/menu.js +5 -5
  262. package/dist/menu.js.map +1 -1
  263. package/dist/modal.js +85 -81
  264. package/dist/modal.js.map +1 -1
  265. package/dist/pagination.js +4 -4
  266. package/dist/payment-method.js +12 -11
  267. package/dist/payment-method.js.map +1 -1
  268. package/dist/popover.js +5 -5
  269. package/dist/popover.js.map +1 -1
  270. package/dist/popper-container.js +14 -14
  271. package/dist/popper-container.js.map +1 -1
  272. package/dist/radio-group.js +14 -14
  273. package/dist/radio-group.js.map +1 -1
  274. package/dist/search-bar.js +2 -2
  275. package/dist/segmented-control.js +4 -4
  276. package/dist/status.js +9 -9
  277. package/dist/status.js.map +1 -1
  278. package/dist/structured-list.js +1 -1
  279. package/dist/summary-grid.js +101 -88
  280. package/dist/summary-grid.js.map +1 -1
  281. package/dist/tabs.js +2 -2
  282. package/dist/tag.js +13 -13
  283. package/dist/tag.js.map +1 -1
  284. package/dist/textarea.js +27 -23
  285. package/dist/textarea.js.map +1 -1
  286. package/dist/timeline.js +6 -6
  287. package/dist/timeline.js.map +1 -1
  288. package/dist/toast.js +3 -3
  289. package/dist/toggle.js +117 -2
  290. package/dist/toggle.js.map +1 -1
  291. package/dist/typography.js +1 -1
  292. package/dist/web-types.json +60 -60
  293. package/package.json +4 -3
  294. package/dist/@types/packages/vue2/src/types/label-position.d.ts +0 -4
  295. package/dist/chunks/button.f64585fc.js.map +0 -1
  296. package/dist/chunks/dropdown.e298bb6c.js.map +0 -1
  297. package/dist/chunks/index.4ec4409f.js +0 -121
  298. package/dist/chunks/index.4ec4409f.js.map +0 -1
  299. package/dist/chunks/index.e1fcc9e0.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"popper-container.js","sources":["../src/components/popper-container/popper-container.types.ts","../src/components/popper-container/popper-container.utils.ts","../src/components/popper-container/popper-container.vue"],"sourcesContent":["import type { Modifier, StrictModifiers } from '@popperjs/core';\n\ntype ArrowModifier = Modifier<'arrow', unknown>;\ntype ApplyArrowHideModifier = Modifier<'applyArrowHide', unknown>;\ntype SameWidthModifier = Modifier<'sameWidth', unknown>;\ntype TrackPositionModifer = Modifier<'trackPosition', unknown>;\ntype FlipModifer = Modifier<'flip', unknown>;\nexport type ExtendedModifiers =\n | StrictModifiers\n | ArrowModifier\n | ApplyArrowHideModifier\n | SameWidthModifier\n | TrackPositionModifer\n | FlipModifer;\n\nexport interface PopperContainerArrowProp {\n classes?: string[];\n padding?: string;\n}\n\nexport enum PopperContainerPositionBasic {\n TOP = 'top',\n RIGHT = 'right',\n BOTTOM = 'bottom',\n LEFT = 'left',\n}\n\nexport enum PopperContainerPositionExtended {\n AUTO = 'auto',\n AUTO_START = 'auto-start',\n AUTO_END = 'auto-end',\n TOP_START = 'top-start',\n TOP_END = 'top-end',\n RIGHT_START = 'right-start',\n RIGHT_END = 'right-end',\n BOTTOM_START = 'bottom-start',\n BOTTOM_END = 'bottom-end',\n LEFT_START = 'left-start',\n LEFT_END = 'left-end',\n}\n\n// TODO: add more roles as we figure them out\nexport enum PopperContainerAriaRole {\n TOOLTIP = 'tooltip',\n POPOVER = 'dialog',\n}\n\nexport const PopperContainerPosition = { ...PopperContainerPositionBasic, ...PopperContainerPositionExtended };\nexport type PopperContainerPosition = PopperContainerPositionBasic | PopperContainerPositionExtended;\n\nexport type FallbackPositionProp = PopperContainerPosition[] | PopperContainerPosition;\n","import type { VueNodeElement } from '@/types';\nimport { ExtendedModifiers, FallbackPositionProp, PopperContainerArrowProp } from './popper-container.types';\n\n/**\n * Creates an arrow modifier for popper container.\n * If padding is set in arrow props, then implement in modifier.\n * @param arrow arrow element\n * @param arrowProps arrow props\n * @returns ArrowModifier\n */\nexport const getArrowModifier = (arrow: VueNodeElement, arrowProps: PopperContainerArrowProp) => ({\n name: 'arrow',\n options: {\n element: arrow,\n padding: arrowProps.padding || 0,\n },\n});\n\n/**\n * Created an offset modifier for the popper.\n * If an arrow is set (i.e. an arrow is present in popper) then adjust offset accordingly.\n * See popper docs for more info: https://popper.js.org/docs/v2/modifiers/offset/\n * @param arrow arrow props\n * @param offset offset numbered array\n * @returns OffsetModifier\n */\nexport const getOffsetModifier = (arrowProps: PopperContainerArrowProp, offset: number[]) => ({\n name: 'offset',\n options: { offset: arrowProps ? [offset[0], offset[1] + 7] : offset },\n});\n\n/**\n * Creates popover fallback position for popper if it's scheduled to overflow a given boundary.\n * See docs for more info: https://popper.js.org/docs/v2/modifiers/flip/\n * @param fallbackPosition fallbackPosition\n * @returns FlipModifier\n */\nexport const getFlipModifier = (fallbackPosition: FallbackPositionProp) => ({\n name: 'flip',\n options: {\n fallbackPlacements: Array.isArray(fallbackPosition) ? fallbackPosition : [fallbackPosition],\n },\n});\n\n/**\n * Applies a data-hide attribute to arrow element depending on center offset.\n */\nexport const arrowDataHideAttributeModifier: ExtendedModifiers = {\n name: 'applyArrowHide',\n enabled: true,\n phase: 'write',\n fn({ state }) {\n const { arrow } = state.elements;\n\n if (arrow) {\n if (state.modifiersData.arrow.centerOffset !== 0) {\n arrow.setAttribute('data-hide', '');\n } else {\n arrow.removeAttribute('data-hide');\n }\n }\n },\n};\n\nexport const sameWidthModifier: ExtendedModifiers = {\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: ({ state }) => {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n effect: ({ state }) => {\n state.elements.popper.style.width = `${(state.elements.reference as HTMLElement).offsetWidth}px`;\n },\n};\n","<template>\n <bento-focus-trap\n :id=\"id\"\n ref=\"popperContainerRef\"\n :disabled=\"disabledFocusTrap\"\n class=\"b-popper-container\"\n :role=\"ariaRole\"\n :aria-label=\"ariaLabel\"\n >\n <slot></slot>\n <span\n v-if=\"arrow\"\n ref=\"arrow\"\n :class=\"arrowClasses\"\n class=\"b-popper-container__arrow\"\n data-testid=\"arrow\"\n ></span>\n </bento-focus-trap>\n</template>\n\n<script lang=\"ts\">\n import { createPopper } from '@popperjs/core';\n import type { Instance, PositioningStrategy } from '@popperjs/core';\n import { defineComponent, PropType } from 'vue';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import {\n ExtendedModifiers,\n FallbackPositionProp,\n PopperContainerAriaRole,\n PopperContainerArrowProp,\n PopperContainerPosition,\n PopperContainerPositionBasic,\n } from './popper-container.types';\n import {\n arrowDataHideAttributeModifier,\n getArrowModifier,\n getFlipModifier,\n getOffsetModifier,\n sameWidthModifier,\n } from './popper-container.utils';\n import type { VueNodeElement } from '@/types';\n\n /**\n * A wrapper for the 'popper/core' package that overlays a small piece of content near a target element.\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * e.g. Tooltip\n * More info here on the package: https://popper.js.org/docs/v2/\n *\n * * @usage\n * import { PopperContainer } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { PopperContainer },\n * computed: {\n * targetElement() {\n * return this.$refs.tooltipTarget;\n * },\n * },\n * template: `\n * <popper-container\n * :target-element=\"targetElement\"\n * :position=\"position\"\n * >\n * {{ content }}\n * </popper-container>`,\n * }\n */\n export default defineComponent({\n components: { BentoFocusTrap },\n props: {\n /**\n * The id to be set on the component. Use it for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Defines a string value that provides an accessible name for the popper-container.\n */\n ariaLabel: { type: String, default: null },\n /**\n * Reference to the DOM element or Vue component for positioning\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Position relative to the target element\n * @see {@link https://popper.js.org/docs/v2/constructors/#placement}\n */\n position: {\n type: String as PropType<PopperContainerPosition>,\n default: PopperContainerPosition.AUTO,\n validator: value =>\n Object.values(PopperContainerPosition).includes(value as PopperContainerPositionBasic),\n },\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: { type: Boolean, default: false },\n /**\n * Indicates if container should have additional arrow, pointing at target element\n * Can be just a boolean flag, or an object with additional configuration:\n * @property {Array<string>} arrow.classes – apply any additional classes to the arrow element.\n * @property {string} arrow.padding – useful when content has rounded corners, https://popper.js.org/docs/v2/modifiers/arrow/#padding\n */\n arrow: { type: Object as PropType<PopperContainerArrowProp | boolean>, default: undefined },\n /**\n * Allows to displace a popper container from its target element.\n * @see {@link https://popper.js.org/docs/v2/modifiers/offset/}\n */\n offset: {\n type: Array as PropType<number[]>,\n default: () => [0, 0],\n validator: (value: number[]) => value?.length === 2,\n },\n /**\n * Instructs popper container to have the same width as target element.\n */\n matchWidth: { type: Boolean, default: false },\n /**\n * Disables wrapping focus-trap component.\n * Mostly useful for the storybook demo.\n */\n disabledFocusTrap: { type: Boolean, default: false },\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n /**\n * Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].\n * Useful when not using auto as starting placement.\n * https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\n */\n fallbackPosition: {\n type: [Array, String] as PropType<FallbackPositionProp>,\n default: null,\n },\n /**\n * The aria role assigned to the container. Defaults to null, which means it's not set if nothing is passed.\n */\n ariaRole: {\n type: String as PropType<PopperContainerAriaRole>,\n default: null,\n validator: value => Object.values(PopperContainerAriaRole).includes(value as PopperContainerAriaRole),\n },\n },\n data: () => ({\n popper: null,\n emittedPosition: null,\n }),\n computed: {\n strategy(): PositioningStrategy {\n return this.fixedPositioning ? 'fixed' : 'absolute';\n },\n /**\n * Retrieves all the popper modifiers to be applied to popover.\n * Read utils file for more info on each modifier.\n */\n allModifiers(): ExtendedModifiers[] {\n const currentModifiers: ExtendedModifiers[] = this.modifiers || [];\n const allModifiers = [\n // Create arrow modifier if arrow props are set\n ...(this.arrow ? [getArrowModifier(this.$refs.arrow as VueNodeElement, this.arrow)] : []),\n // Create offset modifier\n getOffsetModifier(this.arrow, this.offset),\n // Apply data-hide attribute to arrow element depnding on center offset.\n arrowDataHideAttributeModifier,\n // If matchWidth set to true, set the width of popover to same as target element.\n ...(this.matchWidth ? [sameWidthModifier] : []),\n // Emits position of popover when position is updated.\n {\n name: 'trackPosition',\n enabled: true,\n phase: 'afterWrite',\n fn: ({ state }) => {\n // Add conditional to make sure that event is only emitted for new placement values\n if (this.emittedPosition !== state.placement) {\n this.emittedPosition = state.placement;\n this.$emit('position', this.emittedPosition);\n }\n },\n },\n // Sets Flip modifier if fallbackPosition is set\n ...(this.fallbackPosition ? [getFlipModifier(this.fallbackPosition)] : []),\n ...(currentModifiers || []),\n ];\n return allModifiers as ExtendedModifiers[];\n },\n /**\n * Sets default arrow classes if none have been set.\n */\n arrowClasses(): string[] {\n return this?.arrow?.classes ?? [];\n },\n },\n watch: {\n targetElement(element: VueNodeElement) {\n this.destroyPopper();\n if ((this.$refs.popperContainerRef as any).$el && element) {\n this.initPopper();\n }\n },\n position(position: PopperContainerPosition) {\n this.updatePopperOptions({ placement: position });\n },\n strategy(strategy: PositioningStrategy) {\n this.updatePopperOptions({ strategy });\n },\n async arrow(arrow: PopperContainerArrowProp | boolean) {\n if (arrow) {\n // Wait for the next rendering cycle to make sure that arrow element is rendered, but only when it is displayed\n await this.$nextTick();\n }\n this.updateModifiers();\n },\n offset: 'updateModifiers',\n matchWidth: 'updateModifiers',\n },\n mounted() {\n this.initPopper();\n },\n beforeUnmount() {\n this.destroyPopper();\n },\n methods: {\n initPopper() {\n const popperElement = (this.targetElement as any).$el\n ? ((this.targetElement as any).$el as Element)\n : (this.targetElement as Element);\n this.popper = createPopper<ExtendedModifiers>(\n popperElement,\n (this.$refs.popperContainerRef as any).$el as HTMLElement,\n {\n placement: this.position,\n strategy: this.strategy,\n modifiers: this.allModifiers as ExtendedModifiers[],\n }\n );\n },\n destroyPopper() {\n // Add some time before destroy to run fade-out animation\n if (this.popper) {\n (this.popper as Instance).destroy();\n }\n },\n updatePopperOptions(options) {\n if (this.popper) {\n (this.popper as Instance).setOptions(options);\n }\n },\n updateModifiers() {\n this.updatePopperOptions({ modifiers: this.allModifiers });\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popper-container.scss\" />\n"],"names":["PopperContainerPositionBasic","PopperContainerPositionBasic2","PopperContainerPositionExtended","PopperContainerPositionExtended2","PopperContainerAriaRole","PopperContainerAriaRole2","PopperContainerPosition","getArrowModifier","arrow","arrowProps","getOffsetModifier","offset","getFlipModifier","fallbackPosition","arrowDataHideAttributeModifier","state","sameWidthModifier","_sfc_main","defineComponent","BentoFocusTrap","value","currentModifiers","_a","element","position","strategy","popperElement","createPopper","options"],"mappings":";;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,MAAA,OACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WACAA,EAAA,cAAA,eACAA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AAA;AAEA,WAAA,oBAAA,EAAA,WAAAA,EAAA,CAAA;AAAA,IAAA;AAAA,IACA,SAAAC,GAAA;AAEA,WAAA,oBAAA,EAAA,UAAAA,EAAA,CAAA;AAAA,IAAA;AAAA,IACA,MAAA,MAAAjB,GAAA;AAEA,MAAAA,KAEA,MAAA,KAAA,UAAA,GAEA,KAAA,gBAAA;AAAA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,EACA;AAAA,EACA,UAAA;AAEA,SAAA,WAAA;AAAA,EAAA;AAAA,EACA,gBAAA;AAEA,SAAA,cAAA;AAAA,EAAA;AAAA,EACA,SAAA;AAAA,IACA,aAAA;AAEA,YAAAkB,IAAA,KAAA,cAAA,MAAA,KAAA,cAAA,MAAA,KAAA;AAGA,WAAA,SAAAC;AAAA,QAAAD;AAAA,QACA,KAAA,MAAA,mBAAA;AAAA,QACA;AAAA,UACA,WAAA,KAAA;AAAA,UACA,UAAA,KAAA;AAAA,UACA,WAAA,KAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,IACA,gBAAA;AAGA,MAAA,KAAA,UACA,KAAA,OAAA,QAAA;AAAA,IACA;AAAA,IACA,oBAAAE,GAAA;AAEA,MAAA,KAAA,UACA,KAAA,OAAA,WAAAA,CAAA;AAAA,IACA;AAAA,IACA,kBAAA;AAEA,WAAA,oBAAA,EAAA,WAAA,KAAA,aAAA,CAAA;AAAA,IAAA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"popper-container.js","sources":["../src/components/popper-container/popper-container.types.ts","../src/components/popper-container/popper-container.utils.ts","../src/components/popper-container/popper-container.vue"],"sourcesContent":["import type { Modifier, StrictModifiers } from '@popperjs/core';\n\ntype ArrowModifier = Modifier<'arrow', unknown>;\ntype ApplyArrowHideModifier = Modifier<'applyArrowHide', unknown>;\ntype SameWidthModifier = Modifier<'sameWidth', unknown>;\ntype TrackPositionModifer = Modifier<'trackPosition', unknown>;\ntype FlipModifer = Modifier<'flip', unknown>;\nexport type ExtendedModifiers =\n | StrictModifiers\n | ArrowModifier\n | ApplyArrowHideModifier\n | SameWidthModifier\n | TrackPositionModifer\n | FlipModifer;\n\nexport interface PopperContainerArrowProp {\n classes?: string[];\n padding?: string;\n}\n\nexport enum PopperContainerPositionBasic {\n TOP = 'top',\n RIGHT = 'right',\n BOTTOM = 'bottom',\n LEFT = 'left',\n}\n\nexport enum PopperContainerPositionExtended {\n AUTO = 'auto',\n AUTO_START = 'auto-start',\n AUTO_END = 'auto-end',\n TOP_START = 'top-start',\n TOP_END = 'top-end',\n RIGHT_START = 'right-start',\n RIGHT_END = 'right-end',\n BOTTOM_START = 'bottom-start',\n BOTTOM_END = 'bottom-end',\n LEFT_START = 'left-start',\n LEFT_END = 'left-end',\n}\n\n// TODO: add more roles as we figure them out\nexport enum PopperContainerAriaRole {\n TOOLTIP = 'tooltip',\n POPOVER = 'dialog',\n}\n\nexport const PopperContainerPosition = { ...PopperContainerPositionBasic, ...PopperContainerPositionExtended };\nexport type PopperContainerPosition = PopperContainerPositionBasic | PopperContainerPositionExtended;\n\nexport type FallbackPositionProp = PopperContainerPosition[] | PopperContainerPosition;\n","import type { VueNodeElement } from '@/types';\nimport { ExtendedModifiers, FallbackPositionProp, PopperContainerArrowProp } from './popper-container.types';\n\n/**\n * Creates an arrow modifier for popper container.\n * If padding is set in arrow props, then implement in modifier.\n * @param arrow arrow element\n * @param arrowProps arrow props\n * @returns ArrowModifier\n */\nexport const getArrowModifier = (arrow: VueNodeElement, arrowProps: PopperContainerArrowProp) => ({\n name: 'arrow',\n options: {\n element: arrow,\n padding: arrowProps.padding || 0,\n },\n});\n\n/**\n * Created an offset modifier for the popper.\n * If an arrow is set (i.e. an arrow is present in popper) then adjust offset accordingly.\n * See popper docs for more info: https://popper.js.org/docs/v2/modifiers/offset/\n * @param arrow arrow props\n * @param offset offset numbered array\n * @returns OffsetModifier\n */\nexport const getOffsetModifier = (arrowProps: PopperContainerArrowProp, offset: number[]) => ({\n name: 'offset',\n options: { offset: arrowProps ? [offset[0], offset[1] + 7] : offset },\n});\n\n/**\n * Creates popover fallback position for popper if it's scheduled to overflow a given boundary.\n * See docs for more info: https://popper.js.org/docs/v2/modifiers/flip/\n * @param fallbackPosition fallbackPosition\n * @returns FlipModifier\n */\nexport const getFlipModifier = (fallbackPosition: FallbackPositionProp) => ({\n name: 'flip',\n options: {\n fallbackPlacements: Array.isArray(fallbackPosition) ? fallbackPosition : [fallbackPosition],\n },\n});\n\n/**\n * Applies a data-hide attribute to arrow element depending on center offset.\n */\nexport const arrowDataHideAttributeModifier: ExtendedModifiers = {\n name: 'applyArrowHide',\n enabled: true,\n phase: 'write',\n fn({ state }) {\n const { arrow } = state.elements;\n\n if (arrow) {\n if (state.modifiersData.arrow.centerOffset !== 0) {\n arrow.setAttribute('data-hide', '');\n } else {\n arrow.removeAttribute('data-hide');\n }\n }\n },\n};\n\nexport const sameWidthModifier: ExtendedModifiers = {\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: ({ state }) => {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n effect: ({ state }) => {\n state.elements.popper.style.width = `${(state.elements.reference as HTMLElement).offsetWidth}px`;\n },\n};\n","<template>\n <bento-focus-trap\n :id=\"id\"\n ref=\"popperContainerRef\"\n :disabled=\"disabledFocusTrap\"\n class=\"b-popper-container\"\n :role=\"ariaRole\"\n :aria-label=\"ariaLabel\"\n >\n <slot></slot>\n <span\n v-if=\"arrow\"\n ref=\"arrow\"\n :class=\"arrowClasses\"\n class=\"b-popper-container__arrow\"\n data-testid=\"arrow\"\n ></span>\n </bento-focus-trap>\n</template>\n\n<script lang=\"ts\">\n import { createPopper } from '@popperjs/core';\n import type { Instance, PositioningStrategy } from '@popperjs/core';\n import { defineComponent, PropType } from 'vue';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import {\n ExtendedModifiers,\n FallbackPositionProp,\n PopperContainerAriaRole,\n PopperContainerArrowProp,\n PopperContainerPosition,\n PopperContainerPositionBasic,\n } from './popper-container.types';\n import {\n arrowDataHideAttributeModifier,\n getArrowModifier,\n getFlipModifier,\n getOffsetModifier,\n sameWidthModifier,\n } from './popper-container.utils';\n import type { VueNodeElement } from '@/types';\n\n /**\n * A wrapper for the 'popper/core' package that overlays a small piece of content near a target element.\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * e.g. Tooltip\n * More info here on the package: https://popper.js.org/docs/v2/\n *\n * * @usage\n * import { PopperContainer } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { PopperContainer },\n * computed: {\n * targetElement() {\n * return this.$refs.tooltipTarget;\n * },\n * },\n * template: `\n * <popper-container\n * :target-element=\"targetElement\"\n * :position=\"position\"\n * >\n * {{ content }}\n * </popper-container>`,\n * }\n */\n export default defineComponent({\n components: { BentoFocusTrap },\n props: {\n /**\n * The id to be set on the component. Use it for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Defines a string value that provides an accessible name for the popper-container.\n */\n ariaLabel: { type: String, default: null },\n /**\n * Reference to the DOM element or Vue component for positioning\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Position relative to the target element\n * @see {@link https://popper.js.org/docs/v2/constructors/#placement}\n */\n position: {\n type: String as PropType<PopperContainerPosition | `${PopperContainerPosition}`>,\n default: PopperContainerPosition.AUTO,\n validator: value =>\n Object.values(PopperContainerPosition).includes(value as PopperContainerPositionBasic),\n },\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * https://popper.js.org/docs/v2/constructors/#strategy\n */\n fixedPositioning: { type: Boolean, default: false },\n /**\n * Indicates if container should have additional arrow, pointing at target element\n * Can be just a boolean flag, or an object with additional configuration:\n * @property {Array<string>} arrow.classes – apply any additional classes to the arrow element.\n * @property {string} arrow.padding – useful when content has rounded corners, https://popper.js.org/docs/v2/modifiers/arrow/#padding\n */\n arrow: { type: Object as PropType<PopperContainerArrowProp | boolean>, default: undefined },\n /**\n * Allows to displace a popper container from its target element.\n * @see {@link https://popper.js.org/docs/v2/modifiers/offset/}\n */\n offset: {\n type: Array as PropType<number[]>,\n default: () => [0, 0],\n validator: (value: number[]) => value?.length === 2,\n },\n /**\n * Instructs popper container to have the same width as target element.\n */\n matchWidth: { type: Boolean, default: false },\n /**\n * Disables wrapping focus-trap component.\n * Mostly useful for the storybook demo.\n */\n disabledFocusTrap: { type: Boolean, default: false },\n /**\n * Custom set of modifiers. Useful for low-level control over Popper behavior in some really complex use cases.\n */\n modifiers: { type: Array, default: null },\n /**\n * Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].\n * Useful when not using auto as starting placement.\n * https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\n */\n fallbackPosition: {\n type: [Array, String] as PropType<FallbackPositionProp>,\n default: null,\n },\n /**\n * The aria role assigned to the container. Defaults to null, which means it's not set if nothing is passed.\n */\n ariaRole: {\n type: String as PropType<PopperContainerAriaRole>,\n default: null,\n validator: value => Object.values(PopperContainerAriaRole).includes(value as PopperContainerAriaRole),\n },\n },\n data: () => ({\n popper: null,\n emittedPosition: null,\n }),\n computed: {\n strategy(): PositioningStrategy {\n return this.fixedPositioning ? 'fixed' : 'absolute';\n },\n /**\n * Retrieves all the popper modifiers to be applied to popover.\n * Read utils file for more info on each modifier.\n */\n allModifiers(): ExtendedModifiers[] {\n const currentModifiers: ExtendedModifiers[] = this.modifiers || [];\n const allModifiers = [\n // Create arrow modifier if arrow props are set\n ...(this.arrow ? [getArrowModifier(this.$refs.arrow as VueNodeElement, this.arrow)] : []),\n // Create offset modifier\n getOffsetModifier(this.arrow, this.offset),\n // Apply data-hide attribute to arrow element depnding on center offset.\n arrowDataHideAttributeModifier,\n // If matchWidth set to true, set the width of popover to same as target element.\n ...(this.matchWidth ? [sameWidthModifier] : []),\n // Emits position of popover when position is updated.\n {\n name: 'trackPosition',\n enabled: true,\n phase: 'afterWrite',\n fn: ({ state }) => {\n // Add conditional to make sure that event is only emitted for new placement values\n if (this.emittedPosition !== state.placement) {\n this.emittedPosition = state.placement;\n this.$emit('position', this.emittedPosition);\n }\n },\n },\n // Sets Flip modifier if fallbackPosition is set\n ...(this.fallbackPosition ? [getFlipModifier(this.fallbackPosition)] : []),\n ...(currentModifiers || []),\n ];\n return allModifiers as ExtendedModifiers[];\n },\n /**\n * Sets default arrow classes if none have been set.\n */\n arrowClasses(): string[] {\n return this?.arrow?.classes ?? [];\n },\n },\n watch: {\n targetElement(element: VueNodeElement) {\n this.destroyPopper();\n if ((this.$refs.popperContainerRef as any).$el && element) {\n this.initPopper();\n }\n },\n position(position: PopperContainerPosition) {\n this.updatePopperOptions({ placement: position });\n },\n strategy(strategy: PositioningStrategy) {\n this.updatePopperOptions({ strategy });\n },\n async arrow(arrow: PopperContainerArrowProp | boolean) {\n if (arrow) {\n // Wait for the next rendering cycle to make sure that arrow element is rendered, but only when it is displayed\n await this.$nextTick();\n }\n this.updateModifiers();\n },\n offset: 'updateModifiers',\n matchWidth: 'updateModifiers',\n },\n mounted() {\n this.initPopper();\n },\n beforeUnmount() {\n this.destroyPopper();\n },\n methods: {\n initPopper() {\n const popperElement = (this.targetElement as any).$el\n ? ((this.targetElement as any).$el as Element)\n : (this.targetElement as Element);\n this.popper = createPopper<ExtendedModifiers>(\n popperElement,\n (this.$refs.popperContainerRef as any).$el as HTMLElement,\n {\n placement: this.position,\n strategy: this.strategy,\n modifiers: this.allModifiers as ExtendedModifiers[],\n }\n );\n },\n destroyPopper() {\n // Add some time before destroy to run fade-out animation\n if (this.popper) {\n (this.popper as Instance).destroy();\n }\n },\n updatePopperOptions(options) {\n if (this.popper) {\n (this.popper as Instance).setOptions(options);\n }\n },\n updateModifiers() {\n this.updatePopperOptions({ modifiers: this.allModifiers });\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popper-container.scss\" />\n"],"names":["PopperContainerPositionBasic","PopperContainerPositionBasic2","PopperContainerPositionExtended","PopperContainerPositionExtended2","PopperContainerAriaRole","PopperContainerAriaRole2","PopperContainerPosition","getArrowModifier","arrow","arrowProps","getOffsetModifier","offset","getFlipModifier","fallbackPosition","arrowDataHideAttributeModifier","state","sameWidthModifier","_sfc_main","defineComponent","BentoFocusTrap","value","currentModifiers","_a","element","position","strategy","popperElement","createPopper","options"],"mappings":";;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,MAAA,OACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WACAA,EAAA,cAAA,eACAA,EAAA,YAAA,aACAA,EAAA,eAAA,gBACAA,EAAA,aAAA,cACAA,EAAA,aAAA,cACAA,EAAA,WAAA,YAXQA,IAAAD,KAAA,CAAA,CAAA,GAeAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,UAAA,UAFQA,IAAAD,KAAA,CAAA,CAAA;AAKL,MAAAE,IAAA,EAAA,GAAAN,GAAA,GAAAE,EAAA,GCrCMK,IAAA,CAAAC,GAAAC,OAAA;AAAA,EAAqF,MAAA;AAAA,EACxF,SAAA;AAAA,IACG,SAAAD;AAAA,IACI,SAAAC,EAAA,WAAA;AAAA,EACsB;AAEvC,IAUaC,IAAA,CAAAD,GAAAE,OAAA;AAAA,EAAiF,MAAA;AAAA,EACpF,SAAA,EAAA,QAAAF,IAAA,CAAAE,EAAA,CAAA,GAAAA,EAAA,CAAA,IAAA,CAAA,IAAAA,EAAA;AAEV,IAQaC,IAAA,CAAAC,OAAA;AAAA,EAA+D,MAAA;AAAA,EAClE,SAAA;AAAA,IACG,oBAAA,MAAA,QAAAA,CAAA,IAAAA,IAAA,CAAAA,CAAA;AAAA,EACqF;AAElG,IAKOC,IAAA;AAAA,EAA0D,M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BAAAE,GAAA;AAEA,MAAA,KAAA,UACA,KAAA,OAAA,WAAAA,CAAA;AAAA,IACA;AAAA,IACA,kBAAA;AAEA,WAAA,oBAAA,EAAA,WAAA,KAAA,aAAA,CAAA;AAAA,IAAA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
@@ -1,16 +1,16 @@
1
- import { defineComponent as b, toRefs as C, computed as o, toRef as S } from "vue";
2
- import { B as I, b as B, a as V, d as A } from "./chunks/index.e1fcc9e0.js";
1
+ import { defineComponent as p, toRefs as C, computed as o, toRef as S } from "vue";
2
+ import { B as I, b as B, a as V, d as A } from "./chunks/index.175f9e2d.js";
3
3
  import { u as R } from "./chunks/aria-label.ac9651a5.js";
4
- import { g as p } from "./chunks/unique-id.a2a2b458.js";
4
+ import { g as f } from "./chunks/unique-id.a2a2b458.js";
5
5
  import { u as T } from "./chunks/use-has-slot.068222e6.js";
6
6
  import { u as D } from "./chunks/use-default-slot-validator.83d977a1.js";
7
7
  import { g as L } from "./chunks/get-slot-text.e5c766d0.js";
8
- import { n as f } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
9
- import { C as k } from "./chunks/controls-group.e4745546.js";
10
- import { E as O } from "./chunks/error-message.4269d92b.js";
11
- import "./assets/index20.css";
8
+ import { n as b } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
9
+ import { C as k } from "./chunks/controls-group.9d58a091.js";
10
+ import { E as O } from "./chunks/error-message.a581a172.js";
11
+ import "./assets/index7.css";
12
12
  var i = /* @__PURE__ */ ((a) => (a.DISABLED = "disabled", a.READONLY = "readonly", a.ERROR = "error", a))(i || {}), d = /* @__PURE__ */ ((a) => (a.HORIZONTAL = "horizontal", a.VERTICAL = "vertical", a))(d || {}), n = /* @__PURE__ */ ((a) => (a.UPDATE = "update:model-value", a))(n || {});
13
- const x = b({
13
+ const x = p({
14
14
  name: "radio-button",
15
15
  components: { BentoTypography: I },
16
16
  props: {
@@ -53,7 +53,7 @@ const x = b({
53
53
  },
54
54
  emits: [n.UPDATE],
55
55
  setup(a, { slots: e, emit: r }) {
56
- const t = T(e), { value: u } = C(a), c = p("radio-button"), _ = p("description"), l = t("default"), s = t("description");
56
+ const t = T(e), { value: u } = C(a), c = f("radio-button"), _ = f("description"), l = t("default"), s = t("description");
57
57
  D("radio-button", l, s);
58
58
  const y = o(() => ({
59
59
  [`b-radio-button--${i.DISABLED}`]: a.disabled,
@@ -91,7 +91,7 @@ const x = b({
91
91
  var M = function() {
92
92
  var e = this, r = e._self._c;
93
93
  return e._self._setupProxy, r("div", { staticClass: "b-radio-button", class: e.conditionalClassContainer, attrs: { "data-testid": "radio-button-container" } }, [r("input", { staticClass: "b-radio-button__input", class: e.conditionalClassInput, attrs: { id: e.radioButtonId, "aria-checked": e.isChecked, "aria-label": e.ariaLabel, "aria-invalid": e.ariaInvalid, "aria-describedby": e.descriptionSlotValue ? e.descriptionId : "", disabled: e.disabled, "aria-readonly": e.readonly, type: "radio", role: "radio" }, domProps: { checked: e.isChecked, value: e.value }, on: { click: e.onClick, change: e.onChange } }), e.defaultSlotValue ? r("label", { staticClass: "b-radio-button__label-container", attrs: { for: e.radioButtonId } }, [e.defaultSlotValue ? r("bento-typography", { staticClass: "b-radio-button__label", attrs: { el: e.BentoTypographyElement.SPAN, variant: e.BentoTypographyVariant.BODY } }, [e._t("default")], 2) : e._e(), e.defaultSlotValue && e.descriptionSlotValue ? r("bento-typography", { staticClass: "b-radio-button__description", attrs: { id: e.descriptionId, el: e.BentoTypographyElement.SPAN, variant: e.BentoTypographyVariant.BODY } }, [e._t("description")], 2) : e._e()], 1) : e._e()]);
94
- }, P = [], N = /* @__PURE__ */ f(
94
+ }, P = [], N = /* @__PURE__ */ b(
95
95
  x,
96
96
  M,
97
97
  P,
@@ -101,7 +101,7 @@ var M = function() {
101
101
  null,
102
102
  null
103
103
  );
104
- const U = N.exports, $ = b({
104
+ const U = N.exports, $ = p({
105
105
  name: "bento-radio-group",
106
106
  components: { ControlsGroup: k, ErrorMessage: O, RadioButton: U },
107
107
  props: {
@@ -175,7 +175,7 @@ const U = N.exports, $ = b({
175
175
  },
176
176
  emits: [n.UPDATE],
177
177
  setup(a, { emit: e }) {
178
- const r = S(a, "modelValue"), t = p("error"), u = o(
178
+ const r = S(a, "modelValue"), t = f("error"), u = o(
179
179
  () => !a.disabled && !a.readonly && (!!a.errorMessage || a.hasError)
180
180
  ), c = o(() => !a.disabled && !a.readonly && !!a.errorMessage), _ = o(() => ({
181
181
  "b-radio-group__buttons--horizontal": a.variant === d.HORIZONTAL
@@ -207,13 +207,13 @@ var w = function() {
207
207
  return [e._v(e._s(t.description))];
208
208
  }, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(t.label) + " ")]);
209
209
  }), 1), e.shouldShowErrorMessage ? r("error-message", { staticClass: "b-radio-group__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e()], 1);
210
- }, G = [], H = /* @__PURE__ */ f(
210
+ }, G = [], H = /* @__PURE__ */ b(
211
211
  $,
212
212
  w,
213
213
  G,
214
214
  !1,
215
215
  null,
216
- "5b435932",
216
+ "851fe60e",
217
217
  null,
218
218
  null
219
219
  );
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sources":["../src/components/radio-group/components/radio-button/radio-button.types.ts","../src/components/radio-group/radio-group.types.ts","../src/components/radio-group/components/radio-button/radio-button.vue","../src/components/radio-group/radio-group.vue"],"sourcesContent":["export enum BentoRadioButtonStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","export enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoRadioGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport enum BentoRadioGroupEvent {\n UPDATE = 'update:model-value',\n}\n","<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <input\n :id=\"radioButtonId\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"descriptionSlotValue ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n :value=\"value\"\n type=\"radio\"\n class=\"b-radio-button__input\"\n :class=\"conditionalClassInput\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n <label v-if=\"defaultSlotValue\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-radio-button__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/unique-id';\n import { computed, ComputedRef, defineComponent, toRefs } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass } from './radio-button.types';\n import { BentoRadioGroupEvent } from '../../radio-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @usage\n * import { RadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { RadioButton },\n * template: `\n * <radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * </radio-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'radio-button',\n components: { BentoTypography },\n props: {\n /**\n * Disable the radio button (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows radio-button in error state (optional)\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number],\n default: null,\n },\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number],\n required: true,\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { slots, emit }) {\n const hasSlot = useHasSlot(slots);\n const { value } = toRefs(props);\n const radioButtonId = generateUid('radio-button');\n const descriptionId = generateUid('description');\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('radio-button', defaultSlotValue, descriptionSlotValue);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n const conditionalClassInput = computed(() => ({\n [`b-radio-button__input--${BentoRadioButtonStateClass.ERROR}`]: props.hasError,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit(BentoRadioGroupEvent.UPDATE, props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n return {\n // Values\n ariaLabel,\n ariaInvalid,\n isChecked,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClassContainer,\n conditionalClassInput,\n radioButtonId,\n descriptionId,\n\n // Events\n onChange,\n onClick,\n\n // Enums\n BentoTypographyVariant,\n BentoTypographyElement,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :class=\"conditionalClasses\"\n :form=\"formId\"\n :disabled=\"disabled\"\n :label=\"label\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n >\n <radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRef } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import RadioButton from './components/radio-button/radio-button.vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupEvent, BentoRadioGroupItems, BentoRadioGroupVariant } from './radio-group.types';\n\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup, BentoRadioGroupVariant } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * :variant=\"BentoRadioGroupVariant.HORIZONTAL\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-radio-group',\n components: { ControlsGroup, ErrorMessage, RadioButton },\n props: {\n /**\n * If set to true, renders all radio-buttons in the group in a disabled state.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * If string is passed, all radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: {\n type: String,\n default: null,\n },\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: {\n type: String,\n default: null,\n },\n /**\n * If set to true, renders all radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * If set to true, renders all radio-buttons in the group in a readonly state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String, null],\n default: null,\n },\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { emit }) {\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n const onInput = value => {\n emit(BentoRadioGroupEvent.UPDATE, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n inputValue,\n errorId,\n shouldShowError,\n shouldShowErrorMessage,\n conditionalClasses,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["BentoRadioButtonStateClass","BentoRadioButtonStateClass2","BentoRadioGroupVariant","BentoRadioGroupVariant2","BentoRadioGroupEvent","BentoRadioGroupEvent2","_sfc_main$1","defineComponent","BentoTypography","props","slots","emit","hasSlot","useHasSlot","value","toRefs","radioButtonId","generateUid","descriptionId","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","conditionalClassContainer","computed","conditionalClassInput","ariaLabel","useAriaLabel","getSlotText","ariaInvalid","isChecked","event","BentoTypographyVariant","BentoTypographyElement","_sfc_main","ControlsGroup","ErrorMessage","RadioButton","inputValue","toRef","errorId","shouldShowError","shouldShowErrorMessage","conditionalClasses","onInput","deprecate"],"mappings":";;;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GCAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAgBAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBADQA,IAAAD,KAAA,CAAA,CAAA;AC0DZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,S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A;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAAlC,EAAA;AAAA,MACA,WAAA,CAAAY,MAAA,OAAA,OAAAZ,CAAA,EAAA,SAAAY,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA,CAAAV,EAAA,MAAA;AAAA,EACA,MAAAK,GAAA,EAAA,MAAAE,EAAA,GAAA;AAEA,UAAA0B,IAAAC,EAAA7B,GAAA,YAAA,GACA8B,IAAAtB,EAAA,OAAA,GAEAuB,IAAAjB;AAAA,MAAA,MAAA,CAAAd,EAAA,YAAA,CAAAA,EAAA,aAAA,CAAA,CAAAA,EAAA,gBAAAA,EAAA;AAAA,IACA,GAEAgC,IAAAlB,EAAA,MAAA,CAAAd,EAAA,YAAA,CAAAA,EAAA,YAAA,CAAA,CAAAA,EAAA,YAAA,GAEAiC,IAAAnB,EAAA,OAAA;AAAA,MAAA,sCAAAd,EAAA,YAAAP,EAAA;AAAA,IACA,EAAA,GAGAyC,IAAA,CAAA7B,MAAA;AACA,MAAAH,EAAAP,EAAA,QAAAU,CAAA;AAAA,IAAA;AAGA,WAAAL,EAAA,YACAmC;AAAA,MAAA;AAAA,MACA;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIA;AAAA;AAAA,MAAA,YAAAP;AAAA,MAEA,SAAAE;AAAA,MACA,iBAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,oBAAAC;AAAA;AAAA,MACA,SAAAC;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"radio-group.js","sources":["../src/components/radio-group/components/radio-button/radio-button.types.ts","../src/components/radio-group/radio-group.types.ts","../src/components/radio-group/components/radio-button/radio-button.vue","../src/components/radio-group/radio-group.vue"],"sourcesContent":["export enum BentoRadioButtonStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","export enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoRadioGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport enum BentoRadioGroupEvent {\n UPDATE = 'update:model-value',\n}\n","<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <input\n :id=\"radioButtonId\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"descriptionSlotValue ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n :value=\"value\"\n type=\"radio\"\n class=\"b-radio-button__input\"\n :class=\"conditionalClassInput\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n <label v-if=\"defaultSlotValue\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <bento-typography\n v-if=\"defaultSlotValue\"\n class=\"b-radio-button__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"defaultSlotValue && descriptionSlotValue\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/unique-id';\n import { computed, ComputedRef, defineComponent, toRefs } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass } from './radio-button.types';\n import { BentoRadioGroupEvent } from '../../radio-group.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @usage\n * import { RadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { RadioButton },\n * template: `\n * <radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * </radio-button>\n * `,\n * }\n */\n export default defineComponent({\n name: 'radio-button',\n components: { BentoTypography },\n props: {\n /**\n * Disable the radio button (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows radio-button in error state (optional)\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number],\n default: null,\n },\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number],\n required: true,\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { slots, emit }) {\n const hasSlot = useHasSlot(slots);\n const { value } = toRefs(props);\n const radioButtonId = generateUid('radio-button');\n const descriptionId = generateUid('description');\n\n const defaultSlotValue = hasSlot('default');\n const descriptionSlotValue = hasSlot('description');\n\n useDefaultSlotValidator('radio-button', defaultSlotValue, descriptionSlotValue);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n const conditionalClassInput = computed(() => ({\n [`b-radio-button__input--${BentoRadioButtonStateClass.ERROR}`]: props.hasError,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit(BentoRadioGroupEvent.UPDATE, props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n return {\n // Values\n ariaLabel,\n ariaInvalid,\n isChecked,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClassContainer,\n conditionalClassInput,\n radioButtonId,\n descriptionId,\n\n // Events\n onChange,\n onClick,\n\n // Enums\n BentoTypographyVariant,\n BentoTypographyElement,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :class=\"conditionalClasses\"\n :form=\"formId\"\n :disabled=\"disabled\"\n :label=\"label\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n >\n <radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRef } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import RadioButton from './components/radio-button/radio-button.vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupEvent, BentoRadioGroupItems, BentoRadioGroupVariant } from './radio-group.types';\n\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup, BentoRadioGroupVariant } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * :variant=\"BentoRadioGroupVariant.HORIZONTAL\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-radio-group',\n components: { ControlsGroup, ErrorMessage, RadioButton },\n props: {\n /**\n * If set to true, renders all radio-buttons in the group in a disabled state.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * If string is passed, all radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: {\n type: String,\n default: null,\n },\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: {\n type: String,\n default: null,\n },\n /**\n * If set to true, renders all radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: {\n type: Boolean,\n default: false,\n },\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * If set to true, renders all radio-buttons in the group in a readonly state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String, null],\n default: null,\n },\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n },\n emits: [BentoRadioGroupEvent.UPDATE],\n setup(props, { emit }) {\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n const onInput = value => {\n emit(BentoRadioGroupEvent.UPDATE, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n inputValue,\n errorId,\n shouldShowError,\n shouldShowErrorMessage,\n conditionalClasses,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["BentoRadioButtonStateClass","BentoRadioButtonStateClass2","BentoRadioGroupVariant","BentoRadioGroupVariant2","BentoRadioGroupEvent","BentoRadioGroupEvent2","_sfc_main$1","defineComponent","BentoTypography","props","slots","emit","hasSlot","useHasSlot","value","toRefs","radioButtonId","generateUid","descriptionId","defaultSlotValue","descriptionSlotValue","useDefaultSlotValidator","conditionalClassContainer","computed","conditionalClassInput","ariaLabel","useAriaLabel","getSlotText","ariaInvalid","isChecked","event","BentoTypographyVariant","BentoTypographyElement","_sfc_main","ControlsGroup","ErrorMessage","RadioButton","inputValue","toRef","errorId","shouldShowError","shouldShowErrorMessage","conditionalClasses","onInput","deprecate"],"mappings":";;;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA,GCAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,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;;;;;;;;;;;;;"}
@@ -4,8 +4,8 @@ import { d as f } from "./chunks/debounce.f8d92e44.js";
4
4
  import { S as m } from "./chunks/search.a8055e95.js";
5
5
  import { C as _ } from "./chunks/cross-circle-fill.d5e9ae44.js";
6
6
  import { n as h } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
7
- import { u as R } from "./chunks/dropdown.e298bb6c.js";
8
- import "./assets/index33.css";
7
+ import { u as R } from "./chunks/dropdown.368486b1.js";
8
+ import "./assets/index8.css";
9
9
  var a = /* @__PURE__ */ ((r) => (r.CLEAR = "clear", r.ESCAPE = "escape-pressed", r.INPUT = "input", r.UPDATE = "update:search-term", r))(a || {}), b = /* @__PURE__ */ ((r) => (r.CLEAR = "search-clear", r.INPUT = "search-input", r.UPDATE = "update:search-term", r))(b || {});
10
10
  const y = {
11
11
  "en-US": {
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as _, computed as a, toRef as f, ref as m, onMounted as v, onUnmounted as C } from "vue";
2
- import { B as h, a as y, b as B } from "./chunks/index.e1fcc9e0.js";
2
+ import { B as h, a as y, b as B } from "./chunks/index.175f9e2d.js";
3
3
  import { g as p } from "./chunks/unique-id.a2a2b458.js";
4
- import { C as k } from "./chunks/listbox.99d23071.js";
4
+ import { C as k } from "./chunks/listbox.f51e92cd.js";
5
5
  import { n as b } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
6
- import { B as S } from "./chunks/dropdown.e298bb6c.js";
7
- import "./assets/index34.css";
6
+ import { B as S } from "./chunks/dropdown.368486b1.js";
7
+ import "./assets/index23.css";
8
8
  const I = _({
9
9
  name: "bento-segmented-control-button",
10
10
  components: { BentoTypography: h, CheckmarkIcon: k },
package/dist/status.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as r, computed as n } from "vue";
2
- import { B as o, a as l, b as _ } from "./chunks/index.e1fcc9e0.js";
2
+ import { B as o, a as l, b as _ } from "./chunks/index.175f9e2d.js";
3
3
  import { n as p } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
4
- import "./assets/index21.css";
5
- var a = /* @__PURE__ */ ((t) => (t.BLUE = "blue", t.GREEN = "green", t.GREY = "grey", t.ORANGE = "orange", t.RED = "red", t.YELLOW = "yellow", t))(a || {});
4
+ import "./assets/index9.css";
5
+ var a = /* @__PURE__ */ ((e) => (e.BLUE = "blue", e.GREEN = "green", e.GREY = "grey", e.ORANGE = "orange", e.RED = "red", e.YELLOW = "yellow", e))(a || {});
6
6
  const i = r({
7
7
  name: "bento-status",
8
8
  components: { BentoTypography: o },
@@ -10,14 +10,14 @@ const i = r({
10
10
  variant: {
11
11
  type: String,
12
12
  required: !0,
13
- validator: (t) => Object.values(a).includes(t)
13
+ validator: (e) => Object.values(a).includes(e)
14
14
  }
15
15
  },
16
- setup(t) {
16
+ setup(e) {
17
17
  return {
18
18
  // Values
19
19
  conditionalClass: n(() => ({
20
- [`b-status__indicator--${t.variant}`]: !0
20
+ [`b-status__indicator--${e.variant}`]: !0
21
21
  })),
22
22
  // Enums
23
23
  BentoTypographyElement: l,
@@ -26,15 +26,15 @@ const i = r({
26
26
  }
27
27
  });
28
28
  var c = function() {
29
- var s = this, e = s._self._c;
30
- return s._self._setupProxy, e("div", { staticClass: "b-status", attrs: { role: "status" } }, [e("span", { staticClass: "b-status__indicator", class: s.conditionalClass, attrs: { role: "presentation" } }), e("bento-typography", { staticClass: "b-status__label", attrs: { el: s.BentoTypographyElement.SPAN, variant: s.BentoTypographyVariant.BODY } }, [s._t("default")], 2)], 1);
29
+ var t = this, s = t._self._c;
30
+ return t._self._setupProxy, s("div", { staticClass: "b-status", attrs: { role: "status" } }, [s("span", { staticClass: "b-status__indicator", class: t.conditionalClass, attrs: { role: "presentation" } }), s("bento-typography", { staticClass: "b-status__label", attrs: { el: t.BentoTypographyElement.SPAN, variant: t.BentoTypographyVariant.BODY } }, [t._t("default")], 2)], 1);
31
31
  }, u = [], d = /* @__PURE__ */ p(
32
32
  i,
33
33
  c,
34
34
  u,
35
35
  !1,
36
36
  null,
37
- "72707de0",
37
+ "2ee563ed",
38
38
  null,
39
39
  null
40
40
  );
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sources":["../src/components/status/status.types.ts","../src/components/status/status.vue"],"sourcesContent":["export enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-status\" role=\"status\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n <bento-typography\n class=\"b-status__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoStatusVariant } from './status.types';\n\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus, BentoStatusVariant } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status :variant=\"BentoStatusVariant.RED\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-status',\n components: { BentoTypography },\n props: {\n variant: {\n type: String as PropType<BentoStatusVariant>,\n required: true,\n validator: (type: BentoStatusVariant) => Object.values(BentoStatusVariant).includes(type),\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({\n [`b-status__indicator--${props.variant}`]: true,\n }));\n\n return {\n // Values\n conditionalClass,\n\n // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./status.scss\" />\n"],"names":["BentoStatusVariant","BentoStatusVariant2","_sfc_main","defineComponent","BentoTypography","type","props","computed","BentoTypographyElement","BentoTypographyVariant"],"mappings":";;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UANQA,IAAAD,KAAA,CAAA,CAAA;ACkCZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,OAAAL,CAAA,EAAA,SAAAK,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAMA,WAAA;AAAA;AAAA,MAAA,kBAJAC,EAAA,OAAA;AAAA,QAAA,CAAA,wBAAAD,EAAA,SAAA,GAAA;AAAA,MACA,EAAA;AAAA;AAAA,MAKA,wBAAAE;AAAA,MAGA,wBAAAC;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"status.js","sources":["../src/components/status/status.types.ts","../src/components/status/status.vue"],"sourcesContent":["export enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-status\" role=\"status\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n <bento-typography\n class=\"b-status__label\"\n :el=\"BentoTypographyElement.SPAN\"\n :variant=\"BentoTypographyVariant.BODY\"\n >\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoStatusVariant } from './status.types';\n\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus, BentoStatusVariant } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status :variant=\"BentoStatusVariant.RED\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-status',\n components: { BentoTypography },\n props: {\n variant: {\n type: String as PropType<BentoStatusVariant | `${BentoStatusVariant}`>,\n required: true,\n validator: (type: BentoStatusVariant) => Object.values(BentoStatusVariant).includes(type),\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({\n [`b-status__indicator--${props.variant}`]: true,\n }));\n\n return {\n // Values\n conditionalClass,\n\n // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./status.scss\" />\n"],"names":["BentoStatusVariant","BentoStatusVariant2","_sfc_main","defineComponent","BentoTypography","type","props","computed","BentoTypographyElement","BentoTypographyVariant"],"mappings":";;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UANQA,IAAAD,KAAA,CAAA,CAAA;ACkCZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,OAAAL,CAAA,EAAA,SAAAK,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAMA,WAAA;AAAA;AAAA,MAAA,kBAJAC,EAAA,OAAA;AAAA,QAAA,CAAA,wBAAAD,EAAA,SAAA,GAAA;AAAA,MACA,EAAA;AAAA;AAAA,MAKA,wBAAAE;AAAA,MAGA,wBAAAC;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { B as r, a as o } from "./chunks/index.ada08445.js";
1
+ import { B as r, a as o } from "./chunks/index.3b6fc08a.js";
2
2
  export {
3
3
  r as BentoStructuredList,
4
4
  o as BentoStructuredListItem