@adyen/bento-vue3 1.5.0 → 1.6.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 (238) hide show
  1. package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
  2. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +77 -77
  3. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
  4. package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +7 -1
  5. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
  6. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +6 -2
  7. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateStickyElementHeight/useCalculateStickyElementHeight.d.ts +2 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +2 -0
  9. package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +3 -0
  10. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -1
  11. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +49 -11
  12. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +2 -2
  13. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +2 -2
  14. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +32 -33
  15. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
  16. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +3 -3
  17. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +60 -60
  18. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +1 -1
  19. package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +1 -1
  20. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +1 -1
  21. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +2 -2
  22. package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +1 -1
  23. package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +1 -1
  24. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +2 -1
  25. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +7 -3
  26. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +11 -1
  27. package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue.d.ts +17 -1
  28. package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-tip.types.d.ts +3 -0
  29. package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +3 -0
  30. package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +3 -3
  31. package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +1 -1
  32. package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/index.d.ts +1 -0
  33. package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/useFixedScroller.d.ts +15 -0
  34. package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/fixed-scroller.vue.d.ts +9 -0
  35. package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/index.d.ts +1 -0
  36. package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
  37. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +4 -5
  38. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +3 -3
  39. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +3 -3
  40. package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +10 -1
  41. package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
  42. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +4 -4
  43. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +4 -4
  44. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
  45. package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +2 -2
  46. package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +3 -3
  47. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -1
  48. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +1 -1
  49. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +1 -1
  50. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +1 -1
  51. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +1 -1
  52. package/dist/@types/packages/vue2/src/components/tabs/components/tab.types.d.ts +2 -1
  53. package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +1 -1
  54. package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +4 -4
  55. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +24 -52
  56. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +4 -4
  57. package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +13 -13
  58. package/dist/@types/packages/vue2/src/composables/use-expandable-content-height/use-expandable-content-height.d.ts +4 -0
  59. package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.keys.d.ts +1 -0
  60. package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.types.d.ts +6 -0
  61. package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +77 -1
  62. package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
  63. package/dist/@types/packages/vue2/src/utils/ts/truncate.d.ts +1 -1
  64. package/dist/accordion.js +42 -47
  65. package/dist/accordion.js.map +1 -1
  66. package/dist/alert.js +4 -4
  67. package/dist/assets/base-modal.css +1 -1
  68. package/dist/assets/button.css +1 -1
  69. package/dist/assets/controls-group.css +1 -1
  70. package/dist/assets/dropdown.css +1 -1
  71. package/dist/assets/index.css +1 -1
  72. package/dist/assets/index10.css +1 -1
  73. package/dist/assets/index11.css +1 -1
  74. package/dist/assets/index12.css +1 -1
  75. package/dist/assets/index13.css +1 -1
  76. package/dist/assets/index14.css +1 -1
  77. package/dist/assets/index15.css +1 -1
  78. package/dist/assets/index16.css +1 -1
  79. package/dist/assets/index17.css +1 -1
  80. package/dist/assets/index18.css +1 -1
  81. package/dist/assets/index19.css +1 -1
  82. package/dist/assets/index2.css +1 -1
  83. package/dist/assets/index20.css +1 -1
  84. package/dist/assets/index21.css +1 -1
  85. package/dist/assets/index22.css +1 -1
  86. package/dist/assets/index23.css +1 -1
  87. package/dist/assets/index24.css +1 -1
  88. package/dist/assets/index25.css +1 -1
  89. package/dist/assets/index26.css +1 -1
  90. package/dist/assets/index28.css +1 -1
  91. package/dist/assets/index29.css +1 -1
  92. package/dist/assets/index3.css +1 -1
  93. package/dist/assets/index30.css +1 -1
  94. package/dist/assets/index31.css +1 -1
  95. package/dist/assets/index32.css +1 -1
  96. package/dist/assets/index33.css +1 -1
  97. package/dist/assets/index34.css +1 -1
  98. package/dist/assets/index35.css +1 -1
  99. package/dist/assets/index36.css +1 -1
  100. package/dist/assets/index37.css +1 -1
  101. package/dist/assets/index38.css +1 -1
  102. package/dist/assets/index39.css +1 -1
  103. package/dist/assets/index4.css +1 -1
  104. package/dist/assets/index40.css +1 -1
  105. package/dist/assets/index41.css +1 -1
  106. package/dist/assets/index42.css +1 -1
  107. package/dist/assets/index43.css +1 -1
  108. package/dist/assets/index44.css +1 -1
  109. package/dist/assets/index45.css +1 -0
  110. package/dist/assets/index5.css +1 -1
  111. package/dist/assets/index6.css +1 -1
  112. package/dist/assets/index7.css +1 -1
  113. package/dist/assets/index8.css +1 -1
  114. package/dist/assets/index9.css +1 -1
  115. package/dist/assets/loading-button.css +1 -1
  116. package/dist/avatar-image.js +1 -1
  117. package/dist/badge.js +1 -1
  118. package/dist/button.js +5 -5
  119. package/dist/card.js +135 -121
  120. package/dist/card.js.map +1 -1
  121. package/dist/checkbox.js +24 -25
  122. package/dist/checkbox.js.map +1 -1
  123. package/dist/chunks/{base-button.9740f320.js → base-button.90687c75.js} +3 -3
  124. package/dist/chunks/{base-button.9740f320.js.map → base-button.90687c75.js.map} +1 -1
  125. package/dist/chunks/{base-modal.be77971f.js → base-modal.c956b084.js} +58 -58
  126. package/dist/chunks/base-modal.c956b084.js.map +1 -0
  127. package/dist/chunks/{button.7072457f.js → button.9d72e2d7.js} +3 -3
  128. package/dist/chunks/{button.7072457f.js.map → button.9d72e2d7.js.map} +1 -1
  129. package/dist/chunks/{calendar.1e50c7d1.js → calendar.e7db78d0.js} +6 -5
  130. package/dist/chunks/{calendar.1e50c7d1.js.map → calendar.e7db78d0.js.map} +1 -1
  131. package/dist/chunks/{checkbox.638bab98.js → checkbox.ecbb4f0c.js} +4 -4
  132. package/dist/chunks/{checkbox.638bab98.js.map → checkbox.ecbb4f0c.js.map} +1 -1
  133. package/dist/chunks/{controls-group.efcf4e8d.js → controls-group.34f1f82a.js} +2 -2
  134. package/dist/chunks/{controls-group.efcf4e8d.js.map → controls-group.34f1f82a.js.map} +1 -1
  135. package/dist/chunks/{copy.527c3d76.js → copy.aaec57b6.js} +3 -3
  136. package/dist/chunks/{copy.527c3d76.js.map → copy.aaec57b6.js.map} +1 -1
  137. package/dist/chunks/date-input.9186a0bf.js.map +1 -1
  138. package/dist/chunks/{dropdown-default-textbox.a1789dc7.js → dropdown-default-textbox.88a42e9b.js} +3 -3
  139. package/dist/chunks/{dropdown-default-textbox.a1789dc7.js.map → dropdown-default-textbox.88a42e9b.js.map} +1 -1
  140. package/dist/chunks/{dropdown.22e51667.js → dropdown.6a484461.js} +182 -177
  141. package/dist/chunks/dropdown.6a484461.js.map +1 -0
  142. package/dist/chunks/{error-message.37b6c7aa.js → error-message.11e1fa1f.js} +2 -2
  143. package/dist/chunks/{error-message.37b6c7aa.js.map → error-message.11e1fa1f.js.map} +1 -1
  144. package/dist/chunks/{footer-actions.5275203a.js → footer-actions.a65cb2e3.js} +3 -3
  145. package/dist/chunks/{footer-actions.5275203a.js.map → footer-actions.a65cb2e3.js.map} +1 -1
  146. package/dist/chunks/{grid-layout.c98e6bc7.js → grid-layout.7c919507.js} +2 -2
  147. package/dist/chunks/{grid-layout.c98e6bc7.js.map → grid-layout.7c919507.js.map} +1 -1
  148. package/dist/chunks/{index.c22c4278.js → index.424e2ea4.js} +6 -6
  149. package/dist/chunks/{index.c22c4278.js.map → index.424e2ea4.js.map} +1 -1
  150. package/dist/chunks/{index.dd20095f.js → index.655b761f.js} +3 -3
  151. package/dist/chunks/{index.dd20095f.js.map → index.655b761f.js.map} +1 -1
  152. package/dist/chunks/{index.c62ea69f.js → index.754349ff.js} +2 -2
  153. package/dist/chunks/{index.c62ea69f.js.map → index.754349ff.js.map} +1 -1
  154. package/dist/chunks/{index.a57930ba.js → index.84f6360f.js} +11 -10
  155. package/dist/chunks/{index.a57930ba.js.map → index.84f6360f.js.map} +1 -1
  156. package/dist/chunks/{index.32ed68b7.js → index.9fc54b60.js} +2 -2
  157. package/dist/chunks/{index.32ed68b7.js.map → index.9fc54b60.js.map} +1 -1
  158. package/dist/chunks/{index.604da8e9.js → index.bc9e0cde.js} +3 -3
  159. package/dist/chunks/{index.604da8e9.js.map → index.bc9e0cde.js.map} +1 -1
  160. package/dist/chunks/{listbox-option-tag.fa70334e.js → listbox-option-tag.ea9f377f.js} +3 -3
  161. package/dist/chunks/{listbox-option-tag.fa70334e.js.map → listbox-option-tag.ea9f377f.js.map} +1 -1
  162. package/dist/chunks/{listbox.4205c0de.js → listbox.a7255ce1.js} +4 -4
  163. package/dist/chunks/{listbox.4205c0de.js.map → listbox.a7255ce1.js.map} +1 -1
  164. package/dist/chunks/{loading-button.41c15584.js → loading-button.fb1f20a3.js} +32 -32
  165. package/dist/chunks/loading-button.fb1f20a3.js.map +1 -0
  166. package/dist/chunks/on-click-outside.3e0c3e2a.js.map +1 -1
  167. package/dist/chunks/{tooltip.c8350cd0.js → tooltip.6af06509.js} +64 -63
  168. package/dist/chunks/tooltip.6af06509.js.map +1 -0
  169. package/dist/chunks/use-expandable-content-height.62fc84e5.js +17 -0
  170. package/dist/chunks/use-expandable-content-height.62fc84e5.js.map +1 -0
  171. package/dist/chunks/use-has-slot.4d98bf29.js +15 -0
  172. package/dist/chunks/use-has-slot.4d98bf29.js.map +1 -0
  173. package/dist/code-snippet.js +7 -7
  174. package/dist/code-snippet.js.map +1 -1
  175. package/dist/country.js +2 -2
  176. package/dist/currency.js +1 -1
  177. package/dist/data-grid.js +944 -888
  178. package/dist/data-grid.js.map +1 -1
  179. package/dist/date-picker.js +7 -7
  180. package/dist/date-range-picker.js +2 -2
  181. package/dist/date.js +1 -1
  182. package/dist/divider.js +1 -1
  183. package/dist/dropdown.js +4 -4
  184. package/dist/empty-state.js +3 -3
  185. package/dist/filter-bar.js +990 -904
  186. package/dist/filter-bar.js.map +1 -1
  187. package/dist/focus-trap.js +1 -1
  188. package/dist/form-layout.js +81 -70
  189. package/dist/form-layout.js.map +1 -1
  190. package/dist/header.js +92 -87
  191. package/dist/header.js.map +1 -1
  192. package/dist/index.js +14 -14
  193. package/dist/info-icon.js +12 -12
  194. package/dist/info-icon.js.map +1 -1
  195. package/dist/input-field.js +115 -110
  196. package/dist/input-field.js.map +1 -1
  197. package/dist/internal.js +144 -18
  198. package/dist/internal.js.map +1 -1
  199. package/dist/link.js +38 -35
  200. package/dist/link.js.map +1 -1
  201. package/dist/loading-indicator.js +1 -1
  202. package/dist/menu.js +8 -6
  203. package/dist/menu.js.map +1 -1
  204. package/dist/modal.js +52 -44
  205. package/dist/modal.js.map +1 -1
  206. package/dist/pagination.js +4 -4
  207. package/dist/payment-method.js +2 -2
  208. package/dist/popover.js +4 -4
  209. package/dist/popper-container.js +1 -1
  210. package/dist/radio-group.js +5 -5
  211. package/dist/search-bar.js +7 -7
  212. package/dist/search-bar.js.map +1 -1
  213. package/dist/segmented-control.js +4 -4
  214. package/dist/sidepanel.js +19 -19
  215. package/dist/sidepanel.js.map +1 -1
  216. package/dist/status.js +2 -2
  217. package/dist/stepper.js +3 -3
  218. package/dist/structured-list.js +1 -1
  219. package/dist/summary-grid.js +5 -5
  220. package/dist/tabs.js +64 -64
  221. package/dist/tabs.js.map +1 -1
  222. package/dist/tag.js +3 -3
  223. package/dist/textarea.js +188 -229
  224. package/dist/textarea.js.map +1 -1
  225. package/dist/timeline.js +37 -37
  226. package/dist/timeline.js.map +1 -1
  227. package/dist/toast.js +4 -4
  228. package/dist/toggle.js +3 -3
  229. package/dist/typography.js +1 -1
  230. package/dist/web-types.json +1 -1
  231. package/package.json +5 -3
  232. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnHeadersTopPosition/useCalculateColumnHeadersTopPosition.d.ts +0 -2
  233. package/dist/chunks/base-modal.be77971f.js.map +0 -1
  234. package/dist/chunks/dropdown.22e51667.js.map +0 -1
  235. package/dist/chunks/loading-button.41c15584.js.map +0 -1
  236. package/dist/chunks/tooltip.c8350cd0.js.map +0 -1
  237. package/dist/chunks/use-has-slot.3daaffc6.js +0 -17
  238. package/dist/chunks/use-has-slot.3daaffc6.js.map +0 -1
package/dist/card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <div\n v-if=\"showCardBody\"\n :id=\"expandable ? cardId : null\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n const toggleExpansion = () => {\n if (!props.disabled) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","cardId","generateUid","showContent","ref","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createElementVNode","_hoisted_3","_hoisted_4","createBlock","_component_chevron_up_icon","_component_chevron_down_icon","createCommentVNode","_component_bento_typography","mergeProps","withCtx","renderSlot","_hoisted_2"],"mappings":";;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;GCiFRE,IAAAC,EAAA;AAAA,EAA+B,MAAA,EAAA,UAAAC,EAAA;AAAA,EACV,MAAA;AAAA,EACX,YAAA,EAAA,eAAAC,GAAA,iBAAAC,GAAA,iBAAAC,GAAA,oBAAAC,EAAA;AAAA,EAC4E,OAAA;AAAA;AAAA;AAAA;AAAA,IAC3E,YAAA;AAAA,MAIS,MAAA;AAAA,MACF,SAAAV,EAAA;AAAA,MACuB,WAAA,CAAAW,MAAA,OAAA,OAAAX,CAAA,EAAA,SAAAW,CAAA;AAAA,IAC+D;AAAA;AAAA;AAAA;AAAA,IAChG,WAAA;AAAA,MAIW,MAAA;AAAA,M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,CAAA,KAAAL,EAAA,IAAA,EAAA;AAAA,IADVT,EAAA,gBAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,MAE4B,KAAA;AAAA,MACnB,IAAAE,EAAA,aAAAA,EAAA,SAAA;AAAA;IAGa,GAAA;AAAA;QAAmB,KAAA;AAAA;MACV,GAAA;AAAA;;MAG3BA,EAAA,WAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,QAA0B,KAAA;AAAA;MACkE,GAAA;AAAA;UAAzB,SAAAE,EAAA;AAAA;;;;;;;"}
1
+ {"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n onMounted(() => updateContentHeight());\n\n const toggleExpansion = () => {\n if (!props.disabled) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Expand animation\n contentDiv,\n contentMaxHeight,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","onMounted","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createElementVNode","_hoisted_3","_hoisted_4","createBlock","_component_chevron_up_icon","_component_chevron_down_icon","createCommentVNode","_component_bento_typography","mergeProps","withCtx","renderSlot","_hoisted_2","createVNode","Transition"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;GCsFRE,KAAAC,EAAA;AAAA,EAA+B,MAAA,EAAA,UAAAC,EAAA;AAAA,EACV,MAAA;AAAA,EACX,YAAA,EAAA,eAAAC,GAAA,iBAAAC,GAAA,iBAAAC,GAAA,oBAAAC,GAAA;AAAA,EAC4E,OAAA;AAAA;AAAA;AAAA;AAAA,IAC3E,YAAA;AAAA,MAIS,MAAA;AAAA,MACF,SAAAV,EAAA;AAAA,MACuB,WAAA,CAAAW,MAAA,OAAA,OAAAX,CAAA,EAAA,SAAAW,CAAA;AAAA,IAC+D;AAAA;AAAA;AAAA;AAAA,IAChG,WAAA;AAAA,MAIW,MAAA;AAAA,MACD,SAAAT,EAAA;AAAA,MACsB,WAAA,CAAAS,MAAA,OAAA,OAAAT,CAAA,EAAA,SAAAS,CAAA;AAAA,IAC8D;AAAA;AAAA;AAAA;AAAA,IAC9F,YAAA;AAAA,MAIY,MAAA;AAAA,MACF,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,QAAA;AAAA,MAIQ,MAAA;AAAA,MACE,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA,IACb,UAAA;AAAA,MAIU,MAAA;AAAA,MACA,SAAA;AAAA,IACG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AAA,UAAiC,KAAA;AAAA;QAcvB,GAAA;AAAA,UAXcK,EAAA,OAAA;AAAA,YAAA,IAAAH,EAAA,aAAAA,EAAA,SAAA;AAAA,YACV,KAAA;AAAA;UAGY,GAAA;AAAA;cAAmB,KAAA;AAAA;YACV,GAAA;AAAA;;YAG3BA,EAAA,WAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,cAA0B,KAAA;AAAA;YACkE,GAAA;AAAA;gBAAzB,SAAAE,EAAA;AAAA;;;;;;;;;;;"}
package/dist/checkbox.js CHANGED
@@ -1,13 +1,13 @@
1
- import { B as v, b as t } from "./chunks/checkbox.638bab98.js";
2
- import { a as X } from "./chunks/checkbox.638bab98.js";
3
- import { defineComponent as E, toRef as _, computed as u, ref as C, watch as B, resolveComponent as p, openBlock as l, createElementBlock as f, createVNode as S, normalizeClass as I, withCtx as c, Fragment as V, renderList as G, createBlock as g, createSlots as M, createTextVNode as y, toDisplayString as k, createCommentVNode as T } from "vue";
1
+ import { B as v, b as l } from "./chunks/checkbox.ecbb4f0c.js";
2
+ import { a as X } from "./chunks/checkbox.ecbb4f0c.js";
3
+ import { defineComponent as E, toRef as _, computed as u, ref as C, watch as B, resolveComponent as p, openBlock as t, createElementBlock as f, createVNode as S, normalizeClass as I, withCtx as c, Fragment as V, renderList as G, createBlock as g, createSlots as M, createTextVNode as y, toDisplayString as k, createCommentVNode as T } from "vue";
4
4
  import { g as w } from "./chunks/unique-id.a2a2b458.js";
5
- import { d as L } from "./chunks/index.32ed68b7.js";
5
+ import { d as L } from "./chunks/index.9fc54b60.js";
6
6
  import { u as x } from "./chunks/use-form-layout-loading.d03e5d48.js";
7
- import { C as A } from "./chunks/controls-group.efcf4e8d.js";
8
- import { E as U } from "./chunks/error-message.37b6c7aa.js";
7
+ import { C as A } from "./chunks/controls-group.34f1f82a.js";
8
+ import { E as U } from "./chunks/error-message.11e1fa1f.js";
9
9
  import { _ as N } from "./chunks/_plugin-vue_export-helper.dad06003.js";
10
- import "./assets/index3.css";
10
+ import "./assets/index20.css";
11
11
  var s = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(s || {});
12
12
  const O = E({
13
13
  name: "bento-checkbox-group",
@@ -78,24 +78,23 @@ const O = E({
78
78
  validator: (e) => Object.values(s).includes(e)
79
79
  }
80
80
  },
81
- emits: [t.UPDATE, t.INPUT],
82
- setup(e, { emit: d }) {
83
- const m = w("error"), { isReadOnly: a } = x(_(e, "readonly")), h = u(
81
+ emits: [l.UPDATE, l.INPUT],
82
+ setup(e, { emit: n }) {
83
+ const h = w("error"), { isReadOnly: a } = x(_(e, "readonly")), m = u(
84
84
  () => !e.disabled && !a.value && (!!e.errorMessage || e.hasError)
85
85
  ), b = u(
86
86
  () => !e.disabled && !a.value && !!e.errorMessage
87
- ), n = u(() => ({
87
+ ), d = u(() => ({
88
88
  "b-checkbox-group__checkboxes--horizontal": e.variant === s.HORIZONTAL
89
89
  })), r = C(e.modelValue);
90
90
  B(
91
- e.modelValue,
91
+ () => e.modelValue,
92
92
  () => {
93
93
  r.value = e.modelValue;
94
- },
95
- { immediate: !0 }
94
+ }
96
95
  );
97
96
  const i = (o) => {
98
- r.value = o, d(t.UPDATE, o), d(t.INPUT, o);
97
+ r.value = o, n(l.UPDATE, o), n(l.INPUT, o);
99
98
  };
100
99
  return e.hasError && L(
101
100
  'BentoCheckboxGroup "hasError" property',
@@ -105,11 +104,11 @@ const O = E({
105
104
  "2.0.0"
106
105
  ), {
107
106
  // Values
108
- errorId: m,
107
+ errorId: h,
109
108
  isReadOnly: a,
110
- shouldShowGroupError: h,
109
+ shouldShowGroupError: m,
111
110
  shouldShowGroupErrorMessage: b,
112
- conditionalClasses: n,
111
+ conditionalClasses: d,
113
112
  inputValue: r,
114
113
  // Methods
115
114
  onInput: i
@@ -117,9 +116,9 @@ const O = E({
117
116
  }
118
117
  });
119
118
  const R = { class: "b-checkbox-group" };
120
- function q(e, d, m, a, h, b) {
121
- const n = p("bento-checkbox"), r = p("controls-group"), i = p("error-message");
122
- return l(), f("div", R, [
119
+ function q(e, n, h, a, m, b) {
120
+ const d = p("bento-checkbox"), r = p("controls-group"), i = p("error-message");
121
+ return t(), f("div", R, [
123
122
  S(r, {
124
123
  class: I(["b-checkbox-group__checkboxes", e.conditionalClasses]),
125
124
  "aria-describedby": e.shouldShowGroupErrorMessage ? e.errorId : "",
@@ -133,7 +132,7 @@ function q(e, d, m, a, h, b) {
133
132
  "tooltip-text": e.tooltipText
134
133
  }, {
135
134
  default: c(() => [
136
- (l(!0), f(V, null, G(e.items, (o) => (l(), g(n, {
135
+ (t(!0), f(V, null, G(e.items, (o) => (t(), g(d, {
137
136
  key: o.value,
138
137
  "model-value": e.inputValue,
139
138
  value: o.value,
@@ -159,7 +158,7 @@ function q(e, d, m, a, h, b) {
159
158
  ]),
160
159
  _: 1
161
160
  }, 8, ["aria-describedby", "class", "description", "disabled", "form", "hide-label", "label", "optional", "required", "tooltip-text"]),
162
- e.shouldShowGroupErrorMessage ? (l(), g(i, {
161
+ e.shouldShowGroupErrorMessage ? (t(), g(i, {
163
162
  key: 0,
164
163
  id: e.errorId,
165
164
  "error-message": e.errorMessage,
@@ -167,10 +166,10 @@ function q(e, d, m, a, h, b) {
167
166
  }, null, 8, ["id", "error-message"])) : T("", !0)
168
167
  ]);
169
168
  }
170
- const J = /* @__PURE__ */ N(O, [["render", q], ["__scopeId", "data-v-aad97585"]]);
169
+ const J = /* @__PURE__ */ N(O, [["render", q], ["__scopeId", "data-v-50658e08"]]);
171
170
  export {
172
171
  v as BentoCheckbox,
173
- t as BentoCheckboxEvent,
172
+ l as BentoCheckboxEvent,
174
173
  J as BentoCheckboxGroup,
175
174
  s as BentoCheckboxGroupVariant,
176
175
  X as BentoCheckboxState
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-checkbox-group',\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n },\n { immediate: true }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","inputValue","ref","watch","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","createVNode","_component_controls_group","normalizeClass","_ctx","Fragment","renderList","item","createBlock","_component_bento_checkbox","createSlots","_component_error_message"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACkER,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,eAAAC,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACmD,OAAA,EAAA,MAAA,aAAA;AAAA,EAC7B,OAAA;AAAA;AAAA;AAAA;AAAA,IACrB,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIwC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKD,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAOI,WAAA,EAAA,MAAA,SAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,OAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKgC,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpC,YAAA,EAAA,MAAA,OAAA,SAAA,MAAA,CAAA,EAAA;AAAA;AAAA;AAAA;AAAA,IAM+B,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAK3B,UAAA,EAA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MACX,IAAAP,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-checkbox-group',\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","inputValue","ref","watch","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","createVNode","_component_controls_group","normalizeClass","_ctx","Fragment","renderList","item","createBlock","_component_bento_checkbox","createSlots","_component_error_message"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACkER,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,eAAAC,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACmD,OAAA,EAAA,MAAA,aAAA;AAAA,EAC7B,OAAA;AAAA;AAAA;AAAA;AAAA,IACrB,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIwC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKD,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAOI,WAAA,EAAA,MAAA,SAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,OAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKgC,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;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CAAA,oBAAA,SAAA,eAAA,YAAA,QAAA,cAAA,SAAA,YAAA,YAAA,cAAA,CAAA;AAAA,IAIRN,EAAA,+BAAAN,EAAA,GAAAU,EAAAG,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAP,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as B, computed as C, ref as y, resolveComponent as _, openBlock as r, createElementBlock as l, normalizeClass as m, renderSlot as u, createCommentVNode as d, createBlock as S, withCtx as k } from "vue";
2
- import { B as g } from "./index.32ed68b7.js";
3
- import { u as h } from "./use-has-slot.3daaffc6.js";
2
+ import { B as g } from "./index.9fc54b60.js";
3
+ import { u as h } from "./use-has-slot.4d98bf29.js";
4
4
  import { _ as L } from "./_plugin-vue_export-helper.dad06003.js";
5
5
  import "../assets/base-button.css";
6
6
  var b = /* @__PURE__ */ ((t) => (t.DESTRUCTIVE = "critical", t.ICON_ONLY = "icon-only", t))(b || {}), n = /* @__PURE__ */ ((t) => (t.BLUR = "blur", t.CLICK = "click", t.FOCUS = "focus", t.KEYDOWN_ESC = "keydown.esc", t))(n || {});
@@ -113,4 +113,4 @@ export {
113
113
  T as B,
114
114
  n as a
115
115
  };
116
- //# sourceMappingURL=base-button.9740f320.js.map
116
+ //# sourceMappingURL=base-button.90687c75.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.9740f320.js","sources":["../../../vue2/src/components/internal/base-button/base-button.types.ts","../../../vue2/src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createCommentVNode","createBlock","_component_bento_typography","_hoisted_3"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,I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,OAAAe,CAAA;AAAA,MAAkC;AAAA,MAclC,cAXJ,CAAAA,MAAA;AACI,QAAAR,EAAAP,EAAA,MAAAe,CAAA;AAAA,MAAiC;AAAA,MAWjC,SAAAC,EAAAV,CAAA;AAAA;AAAA,MACyB,oBAAAM;AAAA,IAGzB;AAAA,EACJ;AAER,CAAA;;EA9H2C,KAAA;AAAA,EAA2B,OAAA;AAAA;;EAM1B,KAAA;AAAA,EAA4B,OAAA;AAAA;;;;AAf/D,SAAAK,EAAA,GAAAC,EAAA,UAAA;AAAA,IACG,KAAA;AAAA,IACP,OAAAC,EAAA,CAAA,iBAAAC,EAAA,kBAAA,CAAA;AAAA,IACU,UAAAA,EAAA;AAAA,IACG,MAAAA,EAAA;AAAA,IACR,iBAAAA,EAAA,eAAA,eAAA;AAAA,IACE,SAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA,IACW,SAAAD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA;EAEA,GAAA;AAAA;;IAGK,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAELH,EAAA,QAAA,SAAA,KAAAH,EAAA,GAAAO,EAAAC,GAAA;AAAA,MAFkC,KAAA;AAAA,MAAC,IAAA;AAAA,MAAe,SAAA;AAAA,MAAe,UAAA;AAAA;;;;;;;IAGpFL,EAAA,QAAA,WAAA,KAAAH,EAAA,GAAAC,EAAA,QAAAQ,GAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"base-button.90687c75.js","sources":["../../../vue2/src/components/internal/base-button/base-button.types.ts","../../../vue2/src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","create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veComponent as m, openBlock as l, createElementBlock as h, createElementVNode as y, normalizeClass as w, withKeys as W, createVNode as S, withCtx as c, normalizeStyle as E, renderSlot as p, createCommentVNode as i, createBlock as C } from "vue";
2
- import { B as H } from "./index.32ed68b7.js";
3
- import { a as Q } from "./button.7072457f.js";
1
+ import { defineComponent as q, useAttrs as K, ref as I, computed as u, watch as w, onMounted as V, resolveComponent as c, openBlock as l, createElementBlock as h, createElementVNode as _, normalizeClass as R, withKeys as W, createVNode as S, withCtx as m, normalizeStyle as E, renderSlot as y, createCommentVNode as i, createBlock as p } from "vue";
2
+ import { B as H } from "./index.9fc54b60.js";
3
+ import { a as Q } from "./button.9d72e2d7.js";
4
4
  import { BentoDivider as Y } from "../divider.js";
5
- import { B as j } from "./index.604da8e9.js";
6
- import { u as J } from "./use-has-slot.3daaffc6.js";
5
+ import { B as j } from "./index.bc9e0cde.js";
6
+ import { u as J } from "./use-has-slot.4d98bf29.js";
7
7
  import { u as X } from "./i18n.6c402773.js";
8
8
  import { C as Z } from "./cross.5c36a670.js";
9
- import { G as x, a as ee } from "./grid-layout.c98e6bc7.js";
9
+ import { G as x, a as ee } from "./grid-layout.7c919507.js";
10
10
  import { _ as oe } from "./_plugin-vue_export-helper.dad06003.js";
11
11
  import "../assets/base-modal.css";
12
- var te = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(te || {}), O = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(O || {}), g = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(g || {}), k = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(k || {}), ae = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(ae || {}), B = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(B || {});
13
- const R = {
12
+ var te = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(te || {}), O = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(O || {}), g = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(g || {}), M = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(M || {}), ae = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(ae || {}), k = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(k || {});
13
+ const T = {
14
14
  "en-US": {
15
15
  ariaLabelFallback: "modal"
16
16
  }
17
17
  }, ne = 500, se = q({
18
- i18n: { messages: R },
18
+ i18n: { messages: T },
19
19
  name: "base-modal",
20
20
  components: { CrossIcon: Z, BentoTypography: H, BentoButton: Q, BentoDivider: Y, BentoFocusTrap: j, GridLayout: x },
21
21
  props: {
@@ -81,7 +81,7 @@ const R = {
81
81
  /**
82
82
  * Defines whether the modal will be an alert modal
83
83
  */
84
- modalRole: { type: String, default: k.DIALOG },
84
+ modalRole: { type: String, default: M.DIALOG },
85
85
  /**
86
86
  * Allows the inner elments to overflow the dialog
87
87
  */
@@ -98,9 +98,9 @@ const R = {
98
98
  */
99
99
  withColumnLayout: { type: Boolean, default: !1 }
100
100
  },
101
- emits: [B.CLOSE_MODAL],
102
- setup(e, { slots: a, emit: M }) {
103
- const { t: L } = X({ messages: R }), D = K(), d = J(a), t = G(null), r = G(!1), A = u(() => {
101
+ emits: [k.CLOSE_MODAL],
102
+ setup(e, { slots: a, emit: B }) {
103
+ const { t: L } = X({ messages: T }), D = K(), d = J(a), t = I(null), r = I(!1), A = u(() => {
104
104
  if (!e.customPadding)
105
105
  return {};
106
106
  const o = {
@@ -117,15 +117,15 @@ const R = {
117
117
  ), b = u(() => e.withColumnLayout && e.size === O.LARGE), f = () => {
118
118
  t.value.showModal();
119
119
  }, n = () => {
120
- M(B.CLOSE_MODAL);
121
- }, T = (o) => {
122
- r.value && o.pseudoElement === "::backdrop" && (t.value.close(), n(), r.value = !1);
123
- }, _ = (o) => {
124
- o && o.preventDefault(), t.value.open && (r.value = !0);
120
+ B(k.CLOSE_MODAL);
125
121
  }, P = () => {
126
- _();
122
+ r.value && (t.value.close(), n(), r.value = !1);
123
+ }, C = () => {
124
+ t.value.open && (r.value = !0);
125
+ }, G = (o) => {
126
+ o && o.preventDefault(), e.isDismissible && C();
127
127
  }, N = ({ target: o }) => {
128
- o && o.tagName === k.DIALOG.toUpperCase() && _();
128
+ o && o.tagName === M.DIALOG.toUpperCase() && G();
129
129
  }, $ = u(() => ({
130
130
  [`b-modal-base__container--${e.size}`]: e.size,
131
131
  "b-modal-base__container--hide": r.value,
@@ -136,18 +136,18 @@ const R = {
136
136
  "b-modal-base__content--with-header": d("default"),
137
137
  "b-modal-base__content--with-actions": d("actions")
138
138
  })), z = u(() => e.columnsSize === g.SMALLER ? [{ small: 4, medium: 4, large: 4 }] : e.columnsSize === g.BIGGER ? [{ small: 8, medium: 8, large: 8 }] : [{ small: 6, medium: 6, large: 6 }]);
139
- return I(
139
+ return w(
140
140
  () => [e.isOpen, t.value],
141
141
  ([o, s], [, U]) => {
142
142
  if (!s)
143
143
  return;
144
- o ? f() : !U || _();
144
+ o ? f() : !U || C();
145
145
  }
146
- ), I(
146
+ ), w(
147
147
  () => e.actions,
148
148
  () => {
149
149
  var o, s;
150
- ((s = (o = e.actions) == null ? void 0 : o[0]) == null ? void 0 : s.state) === "success" && setTimeout(_, ne);
150
+ ((s = (o = e.actions) == null ? void 0 : o[0]) == null ? void 0 : s.state) === "success" && setTimeout(C, ne);
151
151
  },
152
152
  { deep: !0 }
153
153
  ), V(() => {
@@ -159,10 +159,10 @@ const R = {
159
159
  // Handling the state
160
160
  openModal: f,
161
161
  closeModalOnClickOutside: N,
162
- closeModalAfterAnimation: T,
163
- startCloseModalAnimation: _,
162
+ closeModalAfterAnimation: P,
163
+ startCloseModalAnimation: C,
164
164
  // Methods
165
- onCloseButtonClick: P,
165
+ internalModalActionClose: G,
166
166
  hasSlot: d,
167
167
  emitCloseEvent: n,
168
168
  t: L,
@@ -181,28 +181,28 @@ const le = { class: "b-modal-base" }, ie = ["role", "aria-label", "open"], de =
181
181
  "aria-label": "modal actions",
182
182
  class: "b-modal-base__actions"
183
183
  };
184
- function me(e, a, M, L, D, d) {
185
- const t = m("bento-typography"), r = m("cross-icon"), A = m("bento-button"), v = m("bento-divider"), b = m("grid-layout"), f = m("bento-focus-trap");
184
+ function ce(e, a, B, L, D, d) {
185
+ const t = c("bento-typography"), r = c("cross-icon"), A = c("bento-button"), v = c("bento-divider"), b = c("grid-layout"), f = c("bento-focus-trap");
186
186
  return l(), h("div", le, [
187
- y("dialog", {
187
+ _("dialog", {
188
188
  ref: "modal",
189
189
  role: e.modalRole,
190
190
  "aria-label": e.computedAriaLabel,
191
- class: w(["b-modal-base__container", e.modalConditionalClasses]),
191
+ class: R(["b-modal-base__container", e.modalConditionalClasses]),
192
192
  open: e.initiallyOpen,
193
193
  onAnimationend: a[0] || (a[0] = (...n) => e.closeModalAfterAnimation && e.closeModalAfterAnimation(...n)),
194
194
  onClick: a[1] || (a[1] = (n) => e.isDismissible && e.closeModalOnClickOutside(n)),
195
- onKeydown: a[2] || (a[2] = W((...n) => e.startCloseModalAnimation && e.startCloseModalAnimation(...n), ["esc"]))
195
+ onKeydown: a[2] || (a[2] = W((...n) => e.internalModalActionClose && e.internalModalActionClose(...n), ["esc"]))
196
196
  }, [
197
197
  S(f, null, {
198
- default: c(() => [
199
- y("div", de, [
198
+ default: m(() => [
199
+ _("div", de, [
200
200
  e.hasSlot("default") || !e.hideCloseButton ? (l(), h("div", {
201
201
  key: 0,
202
202
  class: "b-modal-base__header-container",
203
203
  style: E(e.customPaddingStyles.header)
204
204
  }, [
205
- y("div", re, [
205
+ _("div", re, [
206
206
  S(t, {
207
207
  class: "b-modal-base__title",
208
208
  "aria-label": "base modal title",
@@ -210,55 +210,55 @@ function me(e, a, M, L, D, d) {
210
210
  variant: "title",
211
211
  stronger: ""
212
212
  }, {
213
- default: c(() => [
214
- e.hasSlot("default") ? p(e.$slots, "default", { key: 0 }, void 0, !0) : i("", !0)
213
+ default: m(() => [
214
+ e.hasSlot("default") ? y(e.$slots, "default", { key: 0 }, void 0, !0) : i("", !0)
215
215
  ]),
216
216
  _: 3
217
217
  }),
218
- e.hideCloseButton ? i("", !0) : (l(), C(A, {
218
+ e.hideCloseButton ? i("", !0) : (l(), p(A, {
219
219
  key: 0,
220
220
  class: "b-modal-base__close-button",
221
221
  variant: "tertiary",
222
222
  type: "button",
223
- onClick: e.onCloseButtonClick
223
+ onClick: e.internalModalActionClose
224
224
  }, {
225
- default: c(() => [
225
+ default: m(() => [
226
226
  S(r, { "svg-title": "close" })
227
227
  ]),
228
228
  _: 1
229
229
  }, 8, ["onClick"]))
230
230
  ]),
231
- e.hasColumnLayout ? (l(), C(v, {
231
+ e.hasColumnLayout ? (l(), p(v, {
232
232
  key: 0,
233
233
  class: "b-modal-base__divider"
234
234
  })) : i("", !0)
235
235
  ], 4)) : i("", !0),
236
- y("div", {
237
- class: w(["b-modal-base__content", e.modalContentConditionalClasses]),
236
+ _("div", {
237
+ class: R(["b-modal-base__content", e.modalContentConditionalClasses]),
238
238
  style: E(e.customPaddingStyles.content)
239
239
  }, [
240
- e.hasSlot("content") || e.hasSlot("content-col-1") && e.hasSlot("content-col-2") ? (l(), C(t, {
240
+ e.hasSlot("content") || e.hasSlot("content-col-1") && e.hasSlot("content-col-2") ? (l(), p(t, {
241
241
  key: 0,
242
242
  "aria-label": "base modal content",
243
243
  el: "div",
244
244
  variant: "body",
245
245
  stronger: ""
246
246
  }, {
247
- default: c(() => [
248
- e.hasColumnLayout ? (l(), C(b, {
247
+ default: m(() => [
248
+ e.hasColumnLayout ? (l(), p(b, {
249
249
  key: 0,
250
250
  "column-width": e.computedColumnWidth,
251
251
  "container-type": e.GridLayoutContainerType.NORMAL,
252
252
  class: "b-modal-base__grid"
253
253
  }, {
254
- "col-1": c(() => [
255
- p(e.$slots, "content-col-1", {}, void 0, !0)
254
+ "col-1": m(() => [
255
+ y(e.$slots, "content-col-1", {}, void 0, !0)
256
256
  ]),
257
- "col-2": c(() => [
258
- p(e.$slots, "content-col-2", {}, void 0, !0)
257
+ "col-2": m(() => [
258
+ y(e.$slots, "content-col-2", {}, void 0, !0)
259
259
  ]),
260
260
  _: 3
261
- }, 8, ["column-width", "container-type"])) : p(e.$slots, "content", { key: 1 }, void 0, !0)
261
+ }, 8, ["column-width", "container-type"])) : y(e.$slots, "content", { key: 1 }, void 0, !0)
262
262
  ]),
263
263
  _: 3
264
264
  })) : i("", !0)
@@ -268,12 +268,12 @@ function me(e, a, M, L, D, d) {
268
268
  class: "b-modal-base__actions-container",
269
269
  style: E(e.customPaddingStyles.actions)
270
270
  }, [
271
- e.hasColumnLayout ? (l(), C(v, {
271
+ e.hasColumnLayout ? (l(), p(v, {
272
272
  key: 0,
273
273
  class: "b-modal-base__divider"
274
274
  })) : i("", !0),
275
- y("div", ue, [
276
- p(e.$slots, "actions", {}, void 0, !0)
275
+ _("div", ue, [
276
+ y(e.$slots, "actions", {}, void 0, !0)
277
277
  ])
278
278
  ], 4)) : i("", !0)
279
279
  ])
@@ -283,14 +283,14 @@ function me(e, a, M, L, D, d) {
283
283
  ], 42, ie)
284
284
  ]);
285
285
  }
286
- const he = /* @__PURE__ */ oe(se, [["render", me], ["__scopeId", "data-v-bfc027d6"]]);
286
+ const he = /* @__PURE__ */ oe(se, [["render", ce], ["__scopeId", "data-v-bfcceb1f"]]);
287
287
  export {
288
288
  te as B,
289
289
  O as a,
290
290
  g as b,
291
- k as c,
291
+ M as c,
292
292
  ae as d,
293
- B as e,
293
+ k as e,
294
294
  he as f
295
295
  };
296
- //# sourceMappingURL=base-modal.be77971f.js.map
296
+ //# sourceMappingURL=base-modal.c956b084.js.map