@adyen/bento-vue2 1.7.0 → 1.8.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 (223) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/packages/core/src/components/button/button.types.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +11 -0
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +7 -2
  6. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +28 -18
  7. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +25 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +13 -1
  9. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +9 -0
  10. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +6 -2
  11. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +153 -12
  12. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +1 -1
  13. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +18 -0
  14. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +320 -21
  15. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
  16. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
  17. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
  18. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
  20. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +12 -3
  21. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +30 -24
  22. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
  23. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +9 -0
  24. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +12 -0
  25. package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +11 -1
  26. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.d.ts +2 -0
  27. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.types.d.ts +13 -0
  28. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.d.ts +2 -0
  29. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +14 -0
  30. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.d.ts +2 -0
  31. package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.types.d.ts +22 -0
  32. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  33. package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +48 -0
  34. package/dist/@types/packages/vue2/src/components/internal/field-label/index.d.ts +1 -0
  35. package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +11 -0
  36. package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
  37. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +2 -1
  38. package/dist/@types/packages/vue2/src/components/popover/popover.keys.d.ts +1 -0
  39. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +16 -22
  40. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -0
  41. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.keys.d.ts +1 -0
  42. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +20 -1
  43. package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +4 -4
  44. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +9 -0
  45. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +19 -2
  46. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +4 -2
  47. package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +18 -2
  48. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  49. package/dist/accordion.js +1 -1
  50. package/dist/action-bar.js +112 -93
  51. package/dist/action-bar.js.map +1 -1
  52. package/dist/alert.js +1 -1
  53. package/dist/assets/base-modal.css +1 -1
  54. package/dist/assets/calendar.css +1 -1
  55. package/dist/assets/checkbox.css +1 -1
  56. package/dist/assets/controls-group.css +1 -1
  57. package/dist/assets/dropdown.css +1 -1
  58. package/dist/assets/field-label.css +1 -0
  59. package/dist/assets/grid-layout.css +1 -1
  60. package/dist/assets/index.css +1 -1
  61. package/dist/assets/index11.css +1 -1
  62. package/dist/assets/index12.css +1 -1
  63. package/dist/assets/index13.css +1 -1
  64. package/dist/assets/index14.css +1 -1
  65. package/dist/assets/index15.css +1 -1
  66. package/dist/assets/index16.css +1 -1
  67. package/dist/assets/index17.css +1 -1
  68. package/dist/assets/index18.css +1 -1
  69. package/dist/assets/index19.css +1 -1
  70. package/dist/assets/index2.css +1 -1
  71. package/dist/assets/index20.css +1 -1
  72. package/dist/assets/index21.css +1 -1
  73. package/dist/assets/index22.css +1 -1
  74. package/dist/assets/index23.css +1 -1
  75. package/dist/assets/index24.css +1 -1
  76. package/dist/assets/index25.css +1 -1
  77. package/dist/assets/index26.css +1 -1
  78. package/dist/assets/index27.css +1 -1
  79. package/dist/assets/index28.css +1 -1
  80. package/dist/assets/index29.css +1 -1
  81. package/dist/assets/index3.css +1 -1
  82. package/dist/assets/index30.css +1 -1
  83. package/dist/assets/index32.css +1 -1
  84. package/dist/assets/index33.css +1 -1
  85. package/dist/assets/index34.css +1 -1
  86. package/dist/assets/index35.css +1 -1
  87. package/dist/assets/index36.css +1 -1
  88. package/dist/assets/index37.css +1 -1
  89. package/dist/assets/index38.css +1 -1
  90. package/dist/assets/index39.css +1 -1
  91. package/dist/assets/index4.css +1 -1
  92. package/dist/assets/index40.css +1 -1
  93. package/dist/assets/index41.css +1 -1
  94. package/dist/assets/index42.css +1 -1
  95. package/dist/assets/index43.css +1 -1
  96. package/dist/assets/index44.css +1 -1
  97. package/dist/assets/index45.css +1 -1
  98. package/dist/assets/index5.css +1 -1
  99. package/dist/assets/index6.css +1 -1
  100. package/dist/assets/index7.css +1 -1
  101. package/dist/assets/index8.css +1 -1
  102. package/dist/assets/index9.css +1 -1
  103. package/dist/assets/loading-button.css +1 -1
  104. package/dist/avatar-image.js +1 -1
  105. package/dist/badge.js +1 -1
  106. package/dist/button.js +38 -35
  107. package/dist/button.js.map +1 -1
  108. package/dist/card.js +1 -1
  109. package/dist/checkbox.js +5 -5
  110. package/dist/chunks/{base-modal.88e7b9d4.js → base-modal.31634fe8.js} +60 -49
  111. package/dist/chunks/base-modal.31634fe8.js.map +1 -0
  112. package/dist/chunks/{button-actions-with-menu.a5413243.js → button-actions-with-menu.5faea13e.js} +5 -5
  113. package/dist/chunks/{button-actions-with-menu.a5413243.js.map → button-actions-with-menu.5faea13e.js.map} +1 -1
  114. package/dist/chunks/button.e09d5980.js.map +1 -1
  115. package/dist/chunks/calendar.47e9e755.js +959 -0
  116. package/dist/chunks/calendar.47e9e755.js.map +1 -0
  117. package/dist/chunks/{checkbox.5343e28e.js → checkbox.2277450e.js} +67 -56
  118. package/dist/chunks/checkbox.2277450e.js.map +1 -0
  119. package/dist/chunks/controls-group.6c5bfccd.js +79 -0
  120. package/dist/chunks/controls-group.6c5bfccd.js.map +1 -0
  121. package/dist/chunks/{copy.346eadb1.js → copy.a85c2e9f.js} +3 -3
  122. package/dist/chunks/{copy.346eadb1.js.map → copy.a85c2e9f.js.map} +1 -1
  123. package/dist/chunks/{dropdown.f1253a54.js → dropdown.ce937989.js} +200 -196
  124. package/dist/chunks/dropdown.ce937989.js.map +1 -0
  125. package/dist/chunks/field-label.330edb60.js +107 -0
  126. package/dist/chunks/field-label.330edb60.js.map +1 -0
  127. package/dist/chunks/{grid-layout.b7e0d964.js → grid-layout.a806acb2.js} +36 -27
  128. package/dist/chunks/grid-layout.a806acb2.js.map +1 -0
  129. package/dist/chunks/index.210d2169.js +290 -0
  130. package/dist/chunks/index.210d2169.js.map +1 -0
  131. package/dist/chunks/{index.8ac70774.js → index.66503760.js} +3 -3
  132. package/dist/chunks/{index.8ac70774.js.map → index.66503760.js.map} +1 -1
  133. package/dist/chunks/{index.2625175a.js → index.86fc63ca.js} +30 -28
  134. package/dist/chunks/{index.2625175a.js.map → index.86fc63ca.js.map} +1 -1
  135. package/dist/chunks/{index.a201f750.js → index.89942d3a.js} +4 -5
  136. package/dist/chunks/{index.a201f750.js.map → index.89942d3a.js.map} +1 -1
  137. package/dist/chunks/index.a5de5242.js +130 -0
  138. package/dist/chunks/index.a5de5242.js.map +1 -0
  139. package/dist/chunks/index.a99ffd48.js +634 -0
  140. package/dist/chunks/index.a99ffd48.js.map +1 -0
  141. package/dist/chunks/index.d80206ed.js +10 -0
  142. package/dist/chunks/index.d80206ed.js.map +1 -0
  143. package/dist/chunks/{index.37283390.js → index.d8bd7596.js} +96 -99
  144. package/dist/chunks/{index.37283390.js.map → index.d8bd7596.js.map} +1 -1
  145. package/dist/chunks/{listbox-option-tag.6a09e8e2.js → listbox-option-tag.97af47fc.js} +6 -7
  146. package/dist/chunks/{listbox-option-tag.6a09e8e2.js.map → listbox-option-tag.97af47fc.js.map} +1 -1
  147. package/dist/chunks/{listbox.73c38f38.js → listbox.d039b178.js} +5 -6
  148. package/dist/chunks/{listbox.73c38f38.js.map → listbox.d039b178.js.map} +1 -1
  149. package/dist/chunks/loading-button.9a9cbbad.js +89 -0
  150. package/dist/chunks/loading-button.9a9cbbad.js.map +1 -0
  151. package/dist/chunks/{tooltip.104e5fac.js → tooltip.ecd0f707.js} +2 -2
  152. package/dist/chunks/{tooltip.104e5fac.js.map → tooltip.ecd0f707.js.map} +1 -1
  153. package/dist/code-snippet.js +4 -4
  154. package/dist/code-snippet.js.map +1 -1
  155. package/dist/country.js +1 -1
  156. package/dist/data-grid.js +563 -541
  157. package/dist/data-grid.js.map +1 -1
  158. package/dist/date-picker.js +83 -80
  159. package/dist/date-picker.js.map +1 -1
  160. package/dist/date-range-picker.js +2 -2
  161. package/dist/divider.js +1 -1
  162. package/dist/dropdown.js +3 -3
  163. package/dist/empty-state.js +1 -1
  164. package/dist/filter-bar.js +13 -12
  165. package/dist/filter-bar.js.map +1 -1
  166. package/dist/focus-trap.js +1 -1
  167. package/dist/form-layout.js +1 -1
  168. package/dist/header.js +63 -67
  169. package/dist/header.js.map +1 -1
  170. package/dist/index.js +211 -209
  171. package/dist/index.js.map +1 -1
  172. package/dist/info-icon.js +3 -3
  173. package/dist/input-field.js +57 -55
  174. package/dist/input-field.js.map +1 -1
  175. package/dist/internal.js +13 -12
  176. package/dist/link.js +1 -1
  177. package/dist/loading-indicator.js +1 -1
  178. package/dist/menu.js +1 -1
  179. package/dist/modal.js +2 -2
  180. package/dist/modal.js.map +1 -1
  181. package/dist/pagination.js +2 -2
  182. package/dist/payment-method.js +1 -1
  183. package/dist/popover.js +3 -305
  184. package/dist/popover.js.map +1 -1
  185. package/dist/popper-container.js +1 -1
  186. package/dist/radio-group.js +3 -3
  187. package/dist/search-bar.js +2 -2
  188. package/dist/segmented-control.js +2 -2
  189. package/dist/sidepanel.js +2 -2
  190. package/dist/status.js +1 -1
  191. package/dist/stepper.js +1 -1
  192. package/dist/structured-list.js +1 -1
  193. package/dist/summary-grid.js +3 -3
  194. package/dist/summary-grid.js.map +1 -1
  195. package/dist/tabs.js +1 -1
  196. package/dist/tag.js +2 -2
  197. package/dist/textarea.js +59 -56
  198. package/dist/textarea.js.map +1 -1
  199. package/dist/timeline.js +226 -173
  200. package/dist/timeline.js.map +1 -1
  201. package/dist/toast.js +1 -1
  202. package/dist/toggle.js +1 -1
  203. package/dist/tutorial.js +7 -7
  204. package/dist/web-types.json +519 -393
  205. package/package.json +3 -3
  206. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -118
  207. package/dist/assets/error-message.css +0 -1
  208. package/dist/chunks/base-modal.88e7b9d4.js.map +0 -1
  209. package/dist/chunks/calendar.24d0ac04.js +0 -821
  210. package/dist/chunks/calendar.24d0ac04.js.map +0 -1
  211. package/dist/chunks/checkbox.5343e28e.js.map +0 -1
  212. package/dist/chunks/controls-group.2a21bd83.js +0 -87
  213. package/dist/chunks/controls-group.2a21bd83.js.map +0 -1
  214. package/dist/chunks/dropdown.f1253a54.js.map +0 -1
  215. package/dist/chunks/error-message.8302a46c.js +0 -47
  216. package/dist/chunks/error-message.8302a46c.js.map +0 -1
  217. package/dist/chunks/grid-layout.b7e0d964.js.map +0 -1
  218. package/dist/chunks/index.d6b5f5e1.js +0 -112
  219. package/dist/chunks/index.d6b5f5e1.js.map +0 -1
  220. package/dist/chunks/index.e566354f.js +0 -532
  221. package/dist/chunks/index.e566354f.js.map +0 -1
  222. package/dist/chunks/loading-button.c65682d6.js +0 -86
  223. package/dist/chunks/loading-button.c65682d6.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"summary-grid.js","sources":["../src/components/summary-grid/summary-grid.vue","../src/components/summary-grid/summary-grid.types.ts","../src/components/summary-grid/components/summary-grid-item/summary-grid-item.types.ts","../src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, provide } from 'vue';\n import { BentoSummaryGridColumnWidth, BentoSummaryGridLayout } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import { SUMMARY_GRID_LAYOUT_INJECTION_KEY } from '@/components/summary-grid/summary-grid.keys';\n\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid',\n components: { GridLayout },\n props: {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth: {\n type: Object as PropType<BentoSummaryGridColumnWidth>,\n default: null,\n },\n },\n\n setup(_props, { slots }) {\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n }\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n\n return {\n hasSlot: useHasSlot(slots),\n numberOfRows,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","import { GridLayoutColumnWidth } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: Array<GridLayoutColumnWidth>;\n row2?: Array<GridLayoutColumnWidth>;\n row3?: Array<GridLayoutColumnWidth>;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum SummaryGridItemType {\n AMOUNT = 'amount',\n PERCENTAGE = 'percentage',\n NUMERIC = 'numeric',\n TEXT = 'text',\n CUSTOM = 'custom',\n}\n","<template>\n <div class=\"b-summary-grid-item\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n {{ title }}\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRefs } from 'vue';\n\n // Components\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItemType } from './summary-grid-item.types';\n\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default defineComponent({\n name: 'summary-grid-item',\n components: { BentoInfoIcon, BentoTypography, BentoTag, Copy },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Applies styling based on content type\n */\n // TODO add text truncation for SummaryGridItemType.TEXT\n itemType: {\n type: String as PropType<SummaryGridItemType | `${SummaryGridItemType}`>,\n default: SummaryGridItemType.CUSTOM,\n validator: (value: SummaryGridItemType) => Object.values(SummaryGridItemType).includes(value),\n },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: { type: String, default: null },\n\n /**\n * Text used as a title\n */\n title: { type: String, required: true },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: { type: Boolean, default: false },\n\n // amount, percentage and numeric props\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n // TODO implement logic for Large size\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n\n /**\n * Shows colored trend label next to text content\n */\n trend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the color of trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Shows colored trend tag next to secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the color of secondary trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n },\n setup(props, { slots }) {\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n\n const tagVariantColor = direction => {\n switch (direction) {\n case BentoSummaryGridItemTrendDirection.POSITIVE:\n return BentoTagVariant.GREEN;\n case BentoSummaryGridItemTrendDirection.NEGATIVE:\n return BentoTagVariant.RED;\n default:\n return BentoTagVariant.BLUE;\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed(() => {\n if (size.value === BentoSummaryGridItemSize.SMALL) {\n return BentoTypographyVariant.BODY;\n }\n if (itemType.value !== SummaryGridItemType.TEXT) {\n return BentoTypographyVariant.TITLE;\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === BentoSummaryGridItemSize.LARGE,\n strongest: size.value === BentoSummaryGridItemSize.SMALL,\n wide: size.value === BentoSummaryGridItemSize.SMALL,\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const summaryBarItemTrendConditionalClasses = computed(() => ({\n [`b-summary-grid-item__content-trend--${props.trend}`]: props.trend,\n }));\n\n return {\n // Values\n trendVariant,\n secondaryTrendVariant,\n typographyProps,\n\n // Styles\n computedStyles,\n summaryBarItemTrendConditionalClasses,\n\n // Utils\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-amount\"\n >\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <div v-if=\"secondaryLabel\" class=\"b-summary-grid-item-amount__secondary-label\">{{ secondaryLabel }}</div>\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-amount',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Adds additional label next to amount content\n */\n secondaryLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows colored trend label next to main label\n */\n trend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-numeric\"\n >\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-numeric',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows colored trend label next to main numeric content\n */\n trend: {\n type: String,\n default: null,\n },\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-percentage\"\n >\n {{ label }}%\n <template v-if=\"secondaryMetric\" #secondary> {{ secondaryMetric }}% </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-percentage',\n components: { SummaryGridItem },\n props: {\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows colored trend label next to text content\n */\n trend: {\n type: String,\n default: undefined,\n },\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: undefined,\n },\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n class=\"b-summary-grid-item-text\"\n >\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-text',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n @copy-to-clipoard=\"$emit('copy-to-clipboard')\"\n >\n <slot />\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import SummaryGridItem from '../summary-grid-item/summary-grid-item.vue';\n\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-custom',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: { type: String, default: null },\n\n /**\n * Text used as a title\n */\n title: { type: String, required: true },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: { type: Boolean, default: false },\n },\n emits: ['copy-to-clipboard'],\n });\n</script>\n"],"names":["_sfc_main$6","defineComponent","GridLayout","_props","slots","numberOfRows","slotRows","_b","_a","slotName","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","useHasSlot","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2","SummaryGridItemType","SummaryGridItemType2","_sfc_main$5","BentoInfoIcon","BentoTypography","BentoTag","Copy","value","props","trendDirection","secondaryTrendDirection","itemType","size","toRefs","tagVariantColor","direction","BentoTagVariant","trendVariant","computed","secondaryTrendVariant","typographyContentElement","BentoTypographyVariant","typographyProps","computedStyles","summaryBarItemTrendConditionalClasses","_sfc_main$4","SummaryGridItem","_sfc_main$3","_sfc_main$2","_sfc_main$1","_sfc_main"],"mappings":";;;;;;;;;;AA2DA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,aAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA,EAAA,OAAAC,EAAA,GAAA;;AAGA,QAAAC,IAAA;AACA,QAAAD,GAAA;AACA,YAAAE,KAAAC,KAAAC,IAAA,OAAA,KAAAJ,CAAA,MAAA,gBAAAI,EAAA,OAAA,CAAAC,MAAAA,EAAA,SAAA,OAAA,OAAA,gBAAAF,EAAA,IAAA,CAAAE,MAAA;;AAAA,yBAAAD,IAAAC,EAAA,MAAA,GAAA,MAAA,gBAAAD,EAAA,IAAA,EAAA;AAAA;AAIA,UADAH,IAAA,KAAA,IAAA,GAAAC,CAAA,GACAD,IAAA;AACA,cAAA,IAAA;AAAA,UAAA;AAAA,QACA;AAAA;AAWA,WAAAK,EAAAC,GANA,OAGA,EAAA,wBAAA,EAGA,GAEA;AAAA,M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BAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA,EAKA;AAAA,EACA,OAAA,CAAA,mBAAA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"summary-grid.js","sources":["../src/components/summary-grid/summary-grid.vue","../src/components/summary-grid/summary-grid.types.ts","../src/components/summary-grid/components/summary-grid-item/summary-grid-item.types.ts","../src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, provide } from 'vue';\n import { BentoSummaryGridColumnWidth, BentoSummaryGridLayout } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import { SUMMARY_GRID_LAYOUT_INJECTION_KEY } from '@/components/summary-grid/summary-grid.keys';\n\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid',\n components: { GridLayout },\n props: {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth: {\n type: Object as PropType<BentoSummaryGridColumnWidth>,\n default: null,\n },\n },\n\n setup(_props, { slots }) {\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n }\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n\n return {\n hasSlot: useHasSlot(slots),\n numberOfRows,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","import { GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum SummaryGridItemType {\n AMOUNT = 'amount',\n PERCENTAGE = 'percentage',\n NUMERIC = 'numeric',\n TEXT = 'text',\n CUSTOM = 'custom',\n}\n","<template>\n <div class=\"b-summary-grid-item\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n {{ title }}\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, toRefs } from 'vue';\n\n // Components\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItemType } from './summary-grid-item.types';\n\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default defineComponent({\n name: 'summary-grid-item',\n components: { BentoInfoIcon, BentoTypography, BentoTag, Copy },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Applies styling based on content type\n */\n // TODO add text truncation for SummaryGridItemType.TEXT\n itemType: {\n type: String as PropType<SummaryGridItemType | `${SummaryGridItemType}`>,\n default: SummaryGridItemType.CUSTOM,\n validator: (value: SummaryGridItemType) => Object.values(SummaryGridItemType).includes(value),\n },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: { type: String, default: null },\n\n /**\n * Text used as a title\n */\n title: { type: String, required: true },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: { type: Boolean, default: false },\n\n // amount, percentage and numeric props\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n // TODO implement logic for Large size\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n\n /**\n * Shows colored trend label next to text content\n */\n trend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the color of trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Shows colored trend tag next to secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the color of secondary trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n },\n setup(props, { slots }) {\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n\n const tagVariantColor = direction => {\n switch (direction) {\n case BentoSummaryGridItemTrendDirection.POSITIVE:\n return BentoTagVariant.GREEN;\n case BentoSummaryGridItemTrendDirection.NEGATIVE:\n return BentoTagVariant.RED;\n default:\n return BentoTagVariant.BLUE;\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed(() => {\n if (size.value === BentoSummaryGridItemSize.SMALL) {\n return BentoTypographyVariant.BODY;\n }\n if (itemType.value !== SummaryGridItemType.TEXT) {\n return BentoTypographyVariant.TITLE;\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === BentoSummaryGridItemSize.LARGE,\n strongest: size.value === BentoSummaryGridItemSize.SMALL,\n wide: size.value === BentoSummaryGridItemSize.SMALL,\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const summaryBarItemTrendConditionalClasses = computed(() => ({\n [`b-summary-grid-item__content-trend--${props.trend}`]: props.trend,\n }));\n\n return {\n // Values\n trendVariant,\n secondaryTrendVariant,\n typographyProps,\n\n // Styles\n computedStyles,\n summaryBarItemTrendConditionalClasses,\n\n // Utils\n hasSlot: useHasSlot(slots),\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-amount\"\n >\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <div v-if=\"secondaryLabel\" class=\"b-summary-grid-item-amount__secondary-label\">{{ secondaryLabel }}</div>\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-amount',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Adds additional label next to amount content\n */\n secondaryLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows colored trend label next to main label\n */\n trend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-numeric\"\n >\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-numeric',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows colored trend label next to main numeric content\n */\n trend: {\n type: String,\n default: null,\n },\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: null,\n },\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n class=\"b-summary-grid-item-percentage\"\n >\n {{ label }}%\n <template v-if=\"secondaryMetric\" #secondary> {{ secondaryMetric }}% </template>\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import {\n BentoSummaryGridItemSize,\n BentoSummaryGridItemTrendDirection,\n } from '@/components/summary-grid/summary-grid.types';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-percentage',\n components: { SummaryGridItem },\n props: {\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Amount to be shown as the secondary metric value\n */\n secondaryMetric: {\n type: String,\n default: null,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n /**\n * Shows colored trend label next to text content\n */\n trend: {\n type: String,\n default: undefined,\n },\n /**\n * Defines the direction (color) of the trend label\n */\n trendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Shows colored secondary trend tag next to the secondary metric value\n */\n secondaryTrend: {\n type: String,\n default: undefined,\n },\n /**\n * Defines the direction (color) of the secondary metric's trend tag\n */\n secondaryTrendDirection: {\n type: String as PropType<BentoSummaryGridItemTrendDirection | `${BentoSummaryGridItemTrendDirection}`>,\n default: BentoSummaryGridItemTrendDirection.POSITIVE,\n validator: (value: BentoSummaryGridItemTrendDirection) =>\n Object.values(BentoSummaryGridItemTrendDirection).includes(value),\n },\n /**\n * Defines the size of the `summary-grid-item` text content\n */\n size: {\n type: String as PropType<BentoSummaryGridItemSize | `${BentoSummaryGridItemSize}`>,\n default: BentoSummaryGridItemSize.SMALL,\n validator: (value: BentoSummaryGridItemSize) => Object.values(BentoSummaryGridItemSize).includes(value),\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n class=\"b-summary-grid-item-text\"\n >\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-text',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Amount to be shown as the main value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Text used as a title\n */\n title: {\n type: String,\n required: true,\n },\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: {\n type: String,\n default: null,\n },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: {\n type: Boolean,\n default: false,\n },\n },\n });\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n @copy-to-clipoard=\"$emit('copy-to-clipboard')\"\n >\n <slot />\n </summary-grid-item>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import SummaryGridItem from '../summary-grid-item/summary-grid-item.vue';\n\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-summary-grid-item-custom',\n components: { SummaryGridItem },\n props: {\n /**\n * Text to copy to the clipboard\n */\n copy: { type: String, default: undefined },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: { type: String, default: null },\n\n /**\n * Text used as a title\n */\n title: { type: String, required: true },\n\n /**\n * The width of `summary-grid-item` fits its content\n */\n fitContent: { type: Boolean, default: false },\n },\n emits: ['copy-to-clipboard'],\n });\n</script>\n"],"names":["_sfc_main$6","defineComponent","GridLayout","_props","slots","numberOfRows","slotRows","_b","_a","slotName","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","useHasSlot","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2","SummaryGridItemType","SummaryGridItemType2","_sfc_main$5","BentoInfoIcon","BentoTypography","BentoTag","Copy","value","props","trendDirection","secondaryTrendDirection","itemType","size","toRefs","tagVariantColor","direction","BentoTagVariant","trendVariant","computed","secondaryTrendVariant","typographyContentElement","BentoTypographyVariant","typographyProps","computedStyles","summaryBarItemTrendConditionalClasses","_sfc_main$4","SummaryGridItem","_sfc_main$3","_sfc_main$2","_sfc_main$1","_sfc_main"],"mappings":";;;;;;;;;;AA2DA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,aAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA,EAAA,OAAAC,EAAA,GAAA;;AAGA,QAAA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AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,qBAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,YAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;uBC1CAI,KAAA9C,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAA0C,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA,EAAA,MAAA,QAAA,SAAA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,qBAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA,EAKA;AAAA,EACA,OAAA,CAAA,mBAAA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
package/dist/tabs.js CHANGED
@@ -4,7 +4,7 @@ import { n as g } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
4
4
  import { B as R } from "./chunks/index.965ac1af.js";
5
5
  import { g as D } from "./chunks/unique-id.a2a2b458.js";
6
6
  import { F as S } from "./chunks/fixed-scroller.8994e30a.js";
7
- import "./assets/index25.css";
7
+ import "./assets/index24.css";
8
8
  const K = m({
9
9
  props: {
10
10
  /**
package/dist/tag.js CHANGED
@@ -2,9 +2,9 @@ import { defineComponent as c, computed as o } from "vue";
2
2
  import { B as d } from "./chunks/index.965ac1af.js";
3
3
  import { u as m } from "./chunks/aria-label.ac9651a5.js";
4
4
  import { g as s } from "./chunks/get-slot-text.c1114034.js";
5
- import { b as _ } from "./chunks/tooltip.104e5fac.js";
5
+ import { b as _ } from "./chunks/tooltip.ecd0f707.js";
6
6
  import { n as v } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
7
- import "./assets/index26.css";
7
+ import "./assets/index25.css";
8
8
  var r = /* @__PURE__ */ ((t) => (t.GREY = "grey", t.BLUE = "blue", t.GREEN = "green", t.ORANGE = "orange", t.RED = "red", t.WHITE = "white", t))(r || {});
9
9
  const p = c({
10
10
  name: "bento-tag",
package/dist/textarea.js CHANGED
@@ -1,47 +1,46 @@
1
- import { defineComponent as z, useAttrs as V, toRefs as A, ref as d, toRef as Y, computed as n, watch as y, nextTick as Z, onMounted as G } from "vue";
2
- import { B as j } from "./chunks/index.965ac1af.js";
3
- import { a as J } from "./chunks/button.e09d5980.js";
1
+ import { defineComponent as z, useAttrs as V, toRefs as S, ref as d, toRef as Y, computed as n, watch as m, nextTick as Z, onMounted as G } from "vue";
2
+ import { a as j } from "./chunks/button.e09d5980.js";
3
+ import { B as J } from "./chunks/index.965ac1af.js";
4
+ import { n as I } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
4
5
  import { g as K } from "./chunks/unique-id.a2a2b458.js";
5
6
  import { o as Q } from "./chunks/resize.a041304d.js";
6
- import { u as X } from "./chunks/i18n.155748d6.js";
7
- import { u as ee } from "./chunks/aria-label.ac9651a5.js";
7
+ import { u as X } from "./chunks/aria-label.ac9651a5.js";
8
+ import { u as ee } from "./chunks/i18n.155748d6.js";
8
9
  import { u as te } from "./chunks/use-form-layout-loading.d03e5d48.js";
9
- import { n as S } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
10
- import { E as ae } from "./chunks/error-message.8302a46c.js";
11
- import "./assets/index27.css";
12
- var m = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r.BOTH = "both", r.NONE = "none", r))(m || {}), u = /* @__PURE__ */ ((r) => (r.CLEARABLE = "clearable", r.DISABLED = "disabled", r.ERROR = "error", r.READONLY = "readonly", r))(u || {}), i = /* @__PURE__ */ ((r) => (r.BLUR = "blur", r.CHANGE = "change", r.CLEAR = "clear", r.ESCAPE_PRESSED = "escape-pressed", r.FOCUS = "focus", r.INPUT = "input", r))(i || {});
13
- let B = 0;
10
+ import { E as ae, F as le } from "./chunks/field-label.330edb60.js";
11
+ import "./assets/index26.css";
12
+ let A = 0;
14
13
  const re = {
15
14
  beforeCreate() {
16
- this.uuid = B.toString(), B += 1;
15
+ this.uuid = A.toString(), A += 1;
17
16
  }
18
17
  };
19
- var le = function() {
18
+ var se = function() {
20
19
  var e = this, a = e._self._c;
21
20
  return a("svg", e._b({ attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? a("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), a("path", { attrs: { fill: "#00112C", "fill-rule": "evenodd", d: "M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z", "clip-rule": "evenodd" } })]);
22
- }, se = [], oe = /* @__PURE__ */ S(
21
+ }, oe = [], ne = /* @__PURE__ */ I(
23
22
  re,
24
- le,
25
23
  se,
24
+ oe,
26
25
  !1,
27
26
  null,
28
27
  "3c9e4cfb",
29
28
  null,
30
29
  null
31
30
  );
32
- const ne = oe.exports, ie = {
31
+ const ie = ne.exports;
32
+ var y = /* @__PURE__ */ ((l) => (l.HORIZONTAL = "horizontal", l.VERTICAL = "vertical", l.BOTH = "both", l.NONE = "none", l))(y || {}), u = /* @__PURE__ */ ((l) => (l.CLEARABLE = "clearable", l.DISABLED = "disabled", l.ERROR = "error", l.READONLY = "readonly", l))(u || {}), i = /* @__PURE__ */ ((l) => (l.BLUR = "blur", l.CHANGE = "change", l.CLEAR = "clear", l.ESCAPE_PRESSED = "escape-pressed", l.FOCUS = "focus", l.INPUT = "input", l))(i || {});
33
+ const ce = {
33
34
  "en-US": {
34
35
  clearText: "Clear text",
35
- optional: "optional",
36
- required: "required",
37
36
  textarea: "textarea",
38
37
  yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
39
38
  }
40
- }, ce = {
41
- i18n: { messages: ie },
39
+ }, ue = {
40
+ i18n: { messages: ce },
42
41
  name: "bento-textarea"
43
- }, ue = /* @__PURE__ */ z({
44
- ...ce,
42
+ }, de = /* @__PURE__ */ z({
43
+ ...ue,
45
44
  props: {
46
45
  /**
47
46
  * Text that labels an the input element
@@ -92,72 +91,76 @@ const ne = oe.exports, ie = {
92
91
  */
93
92
  resizable: {
94
93
  type: String,
95
- default: m.BOTH,
96
- validator: (r) => Object.values(m).includes(r)
94
+ default: y.BOTH,
95
+ validator: (l) => Object.values(y).includes(l)
97
96
  },
98
97
  /**
99
98
  * Highlights the textarea is required.
100
99
  */
101
100
  required: { type: Boolean, default: !1 },
101
+ /**
102
+ * Adds a info icon next to the label to display the passed tooltip message.
103
+ */
104
+ tooltipText: { type: String, default: null },
102
105
  /**
103
106
  * Text displayed as the value of the textarea
104
107
  */
105
108
  value: { type: String, default: "" }
106
109
  },
107
- setup(r, { emit: e }) {
108
- const a = r, t = V(), { height: l } = A(a), I = K("textarea"), s = d(null), o = d(a.value), p = 44, _ = d(a.height || `${p}px`), g = d("100%"), { t: h } = X(), { isReadOnly: b } = te(Y(a, "readonly")), k = n(() => `${o.value.length} / ${a.characterLimit}`), v = n(
110
+ setup(l, { emit: e }) {
111
+ const a = l, t = V(), { height: r } = S(a), B = K("textarea"), s = d(null), o = d(a.value), p = 44, _ = d(a.height || `${p}px`), g = d("100%"), { t: h } = ee(), { isReadOnly: f } = te(Y(a, "readonly")), k = n(() => `${o.value.length} / ${a.characterLimit}`), v = n(
109
112
  () => a.characterLimit && o.value.length > a.characterLimit
110
- ), f = () => {
113
+ ), b = () => {
111
114
  s.value && s.value.scrollHeight > p && (_.value = `${s.value.scrollHeight + 3}px`);
112
115
  };
113
- y(l, () => {
114
- l.value ? _.value = l.value : f();
115
- }), y(
116
+ m(r, () => {
117
+ r.value ? _.value = r.value : b();
118
+ }), m(
116
119
  () => a.value,
117
120
  () => {
118
121
  o.value = a.value;
119
122
  },
120
123
  { immediate: !0 }
121
- ), y(
124
+ ), m(
122
125
  () => o.value,
123
126
  async () => {
124
- if (!l.value) {
127
+ if (!r.value) {
125
128
  if (_.value = `${p}px`, !o.value)
126
129
  return;
127
- await Z(), f();
130
+ await Z(), b();
128
131
  }
129
132
  },
130
133
  { immediate: !0 }
131
134
  );
132
135
  const C = n(() => !!a.errorMessage || v.value), O = n(() => ({
133
136
  [`b-textarea--${u.DISABLED}`]: a.disabled
134
- })), T = n(() => ({
137
+ })), F = n(() => ({
135
138
  [`b-textarea__input--${u.CLEARABLE}`]: a.clearable,
136
- [`b-textarea__input--${u.READONLY}`]: b.value,
139
+ [`b-textarea__input--${u.READONLY}`]: f.value,
137
140
  [`b-textarea__input--${u.ERROR}`]: C.value,
138
- ["b-textarea__input--dynamic-height"]: !l.value
139
- })), F = n(() => ({
140
- ["b-textarea__label-box--no-label"]: !a.label
141
+ ["b-textarea__input--dynamic-height"]: !r.value
141
142
  })), M = n(() => ({
143
+ ["b-textarea__label-box--no-label"]: !a.label
144
+ })), P = n(() => ({
142
145
  [`b-textarea__label-item--${u.ERROR}`]: v.value
143
- })), P = n(() => h("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), x = d(t["aria-label"]), { ariaLabel: L, label: E } = A(a), $ = ee({
146
+ })), T = n(() => h("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), x = d(t["aria-label"]), { ariaLabel: L, label: E } = S(a), $ = X({
144
147
  ariaLabel: x.value,
145
148
  // TODO: take this line away when the aria-label props is removed
146
149
  label: L,
147
150
  defaultFallback: E
148
151
  }), w = n(
149
- () => a.clearable && o.value && !a.disabled && !b.value
152
+ () => a.clearable && o.value && !a.disabled && !f.value
150
153
  ), H = () => {
151
154
  o.value = "", e(i.CLEAR), e(i.INPUT, "");
152
155
  }, N = (c) => {
153
- c.stopImmediatePropagation(), !a.disabled && !b.value && (o.value = c.target.value, e(i.INPUT, o.value));
156
+ c.stopImmediatePropagation(), !a.disabled && !f.value && (o.value = c.target.value, e(i.INPUT, o.value));
154
157
  }, U = () => {
155
158
  s.value.scrollTop = 0, e(i.BLUR);
156
159
  }, D = () => {
157
160
  s.value.focus(), e(i.FOCUS);
158
- }, q = () => {
159
- e(i.CHANGE);
160
161
  }, W = () => {
162
+ e(i.CHANGE);
163
+ }, q = () => {
161
164
  e(i.ESCAPE_PRESSED);
162
165
  };
163
166
  return G(() => {
@@ -165,33 +168,33 @@ const ne = oe.exports, ie = {
165
168
  var R;
166
169
  const c = (R = s == null ? void 0 : s.value) == null ? void 0 : R.offsetWidth;
167
170
  g.value = c ? `${c}px` : "100%";
168
- }), l.value || f();
169
- }), { __sfc: !0, attrs: t, props: a, emit: e, height: l, textareaId: I, textareaElement: s, textareaValue: o, defaultTextareaHeight: p, textareaHeight: _, textareaWidth: g, t: h, isReadOnly: b, counter: k, isOverCharacterLimit: v, calculateHeight: f, invalidInput: C, conditionalClasses: O, conditionalClassesInput: T, conditionalClassesLabelBox: F, conditionalClassesLabelItem: M, counterErrorText: P, ariaLabelAttribute: x, ariaLabel: L, label: E, computedAriaLabel: $, showClearButton: w, onClear: H, onInput: N, onBlur: U, onFocus: D, onChange: q, onPressEscape: W, BentoTypography: j, BentoButton: J, ErrorMessage: ae, CrossCircleFillSmallIcon: ne };
171
+ }), r.value || b();
172
+ }), { __sfc: !0, attrs: t, props: a, emit: e, height: r, textareaId: B, textareaElement: s, textareaValue: o, defaultTextareaHeight: p, textareaHeight: _, textareaWidth: g, t: h, isReadOnly: f, counter: k, isOverCharacterLimit: v, calculateHeight: b, invalidInput: C, conditionalClasses: O, conditionalClassesInput: F, conditionalClassesLabelBox: M, conditionalClassesLabelItem: P, counterErrorText: T, ariaLabelAttribute: x, ariaLabel: L, label: E, computedAriaLabel: $, showClearButton: w, onClear: H, onInput: N, onBlur: U, onFocus: D, onChange: W, onPressEscape: q, BentoButton: j, BentoTypography: J, ErrorMessage: ae, FieldLabel: le, CrossCircleFillSmallIcon: ie };
170
173
  }
171
174
  });
172
- var de = function() {
175
+ var pe = function() {
173
176
  var e = this, a = e._self._c, t = e._self._setupProxy;
174
- return a("div", { staticClass: "b-textarea", class: t.conditionalClasses, style: { width: t.textareaWidth } }, [a("div", { staticClass: "b-textarea__label-box", class: t.conditionalClassesLabelBox }, [t.label ? a("label", { staticClass: "b-textarea__label", attrs: { for: t.textareaId } }, [a(t.BentoTypography, { attrs: { el: "span", stronger: "" } }, [e._v(e._s(t.label))]), e.optional && !e.required ? a(t.BentoTypography, { staticClass: "b-textarea__label-item", attrs: { el: "span" } }, [e._v(" (" + e._s(t.t("optional")) + ") ")]) : e._e(), e.required ? a(t.BentoTypography, { staticClass: "b-textarea__label-item", attrs: { el: "span" } }, [e._v(" (" + e._s(t.t("required")) + ") ")]) : e._e()], 1) : e._e(), e.characterLimit ? a(t.BentoTypography, { staticClass: "b-textarea__label-item", class: t.conditionalClassesLabelItem, attrs: { el: "span" } }, [e._v(" " + e._s(t.counter) + " ")]) : e._e()], 1), a(t.BentoTypography, { staticClass: "b-textarea__input-box", attrs: { el: "div", "aria-disabled": e.disabled } }, [a("textarea", { ref: "textareaElement", staticClass: "b-textarea__input", class: t.conditionalClassesInput, style: { resize: e.resizable, height: t.textareaHeight }, attrs: { id: t.textareaId, "aria-label": t.computedAriaLabel, "aria-invalid": t.invalidInput, readonly: t.isReadOnly, disabled: e.disabled, placeholder: e.placeholder }, domProps: { value: t.textareaValue }, on: { blur: t.onBlur, change: t.onChange, focus: t.onFocus, input: t.onInput, keydown: function(l) {
175
- return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : t.onPressEscape.apply(null, arguments);
176
- } } }), t.showClearButton ? a("div", { staticClass: "b-textarea__clear-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", disabled: e.disabled }, on: { click: t.onClear, keypress: function(l) {
177
- return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : t.onClear.apply(null, arguments);
178
- }, keyup: function(l) {
179
- return !l.type.indexOf("key") && e._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : t.onClear.apply(null, arguments);
177
+ return a("div", { staticClass: "b-textarea", class: t.conditionalClasses, style: { width: t.textareaWidth } }, [a("div", { staticClass: "b-textarea__label-box", class: t.conditionalClassesLabelBox }, [t.label ? a(t.FieldLabel, { attrs: { for: t.textareaId, label: t.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), e.characterLimit ? a(t.BentoTypography, { staticClass: "b-textarea__label-item", class: t.conditionalClassesLabelItem, attrs: { el: "span" } }, [e._v(" " + e._s(t.counter) + " ")]) : e._e()], 1), a(t.BentoTypography, { staticClass: "b-textarea__input-box", attrs: { el: "div", "aria-disabled": e.disabled } }, [a("textarea", { ref: "textareaElement", staticClass: "b-textarea__input", class: t.conditionalClassesInput, style: { resize: e.resizable, height: t.textareaHeight }, attrs: { id: t.textareaId, "aria-label": t.computedAriaLabel, "aria-invalid": t.invalidInput, readonly: t.isReadOnly, disabled: e.disabled, placeholder: e.placeholder }, domProps: { value: t.textareaValue }, on: { blur: t.onBlur, change: t.onChange, focus: t.onFocus, input: t.onInput, keydown: function(r) {
178
+ return !r.type.indexOf("key") && e._k(r.keyCode, "esc", 27, r.key, ["Esc", "Escape"]) ? null : t.onPressEscape.apply(null, arguments);
179
+ } } }), t.showClearButton ? a("div", { staticClass: "b-textarea__clear-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", disabled: e.disabled }, on: { click: t.onClear, keypress: function(r) {
180
+ return !r.type.indexOf("key") && e._k(r.keyCode, "enter", 13, r.key, "Enter") ? null : t.onClear.apply(null, arguments);
181
+ }, keyup: function(r) {
182
+ return !r.type.indexOf("key") && e._k(r.keyCode, "space", 32, r.key, [" ", "Spacebar"]) ? null : t.onClear.apply(null, arguments);
180
183
  } }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
181
184
  return [a(t.CrossCircleFillSmallIcon, { attrs: { "svg-title": t.t("clearText") } })];
182
185
  }, proxy: !0 }], null, !1, 3119266621) })], 1) : e._e()]), t.isOverCharacterLimit ? a(t.ErrorMessage, { attrs: { "error-message": t.counterErrorText } }) : e._e(), e.errorMessage ? a(t.ErrorMessage, { attrs: { "error-message": e.errorMessage } }) : e._e(), e.description ? a(t.BentoTypography, { staticClass: "b-textarea__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1);
183
- }, pe = [], _e = /* @__PURE__ */ S(
184
- ue,
186
+ }, _e = [], fe = /* @__PURE__ */ I(
185
187
  de,
186
188
  pe,
189
+ _e,
187
190
  !1,
188
191
  null,
189
- "2d3b7b89",
192
+ "034f553e",
190
193
  null,
191
194
  null
192
195
  );
193
- const Ee = _e.exports;
196
+ const Re = fe.exports;
194
197
  export {
195
- Ee as BentoTextarea
198
+ Re as BentoTextarea
196
199
  };
197
200
  //# sourceMappingURL=textarea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","sources":["../src/components/textarea/textarea.types.ts","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../src/components/textarea/textarea.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z\" clip-rule=\"evenodd\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","<template>\n <div class=\"b-textarea\" :class=\"conditionalClasses\" :style=\"{ width: textareaWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <label v-if=\"label\" :for=\"textareaId\" class=\"b-textarea__label\">\n <bento-typography el=\"span\" stronger>{{ label }}</bento-typography>\n <bento-typography v-if=\"optional && !required\" el=\"span\" class=\"b-textarea__label-item\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" el=\"span\" class=\"b-textarea__label-item\">\n ({{ t('required') }})\n </bento-typography>\n </label>\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { ErrorMessage } from '@/components/internal';\n import { generateUid } from '@/utils/ts/unique-id';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.BLUR): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWidth = ref('100%');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (!height.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n const offsetWidth = textareaElement?.value?.offsetWidth;\n textareaWidth.value = offsetWidth ? `${offsetWidth}px` : '100%';\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","uuid","_sfc_main$1","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaValue","defaultTextareaHeight","textareaHeight","textareaWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onMounted","observeSizeOfElement","offsetWidth","_a"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA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EAAA,YAAA,CAAAW,EAAA;AAAA,IAC2D,GAGnFqB,IAAA,MAAA;AACI,MAAA3B,EAAA,QAAA,IACA4B,EAAA3C,EAAA,KAAA,GACA2C,EAAA3C,EAAA,OAAA,EAAA;AAAA,IAAiC,GAGrC4C,IAAA,CAAAC,MAAA;AACI,MAAAA,EAAA,yBAAA,GAEA,CAAAnC,EAAA,YAAA,CAAAW,EAAA,UACIN,EAAA,QAAA8B,EAAA,OAAA,OAOAF,EAAA3C,EAAA,OAAAe,EAAA,KAAA;AAAA,IACJ,GAGJ+B,IAAA,MAAA;AACI,MAAAjC,EAAA,MAAA,YAAA,GACA8B,EAAA3C,EAAA,IAAA;AAAA,IAA4B,GAGhC+C,IAAA,MAAA;AACI,MAAAlC,EAAA,MAAA,MAAA,GACA8B,EAAA3C,EAAA,KAAA;AAAA,IAA6B,GAGjCgD,IAAA,MAAA;AACI,MAAAL,EAAA3C,EAAA,MAAA;AAAA,IAA8B,GAGlCiD,IAAA,MAAA;AACI,MAAAN,EAAA3C,EAAA,cAAA;AAAA,IAAsC;AAG1C,WAAAkD,EAAA,MAAA;AACI,MAAAC,EAAAtC,EAAA,OAAA,MAAA;;AACI,cAAAuC,KAAAC,IAAAxC,KAAA,gBAAAA,EAAA,UAAA,gBAAAwC,EAAA;AACA,QAAAnC,EAAA,QAAAkC,IAAA,GAAAA,QAAA;AAAA,MAAyD,CAAA,GAG7D5C,EAAA,SACImB,EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"textarea.js","sources":["../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../src/components/textarea/textarea.types.ts","../src/components/textarea/textarea.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z\" clip-rule=\"evenodd\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","<template>\n <div class=\"b-textarea\" :class=\"conditionalClasses\" :style=\"{ width: textareaWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/utils/ts/unique-id';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.BLUR): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWidth = ref('100%');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (!height.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n const offsetWidth = textareaElement?.value?.offsetWidth;\n textareaWidth.value = offsetWidth ? `${offsetWidth}px` : '100%';\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["uuid","_sfc_main$1","BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaValue","defaultTextareaHeight","textareaHeight","textareaWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onMounted","observeSizeOfElement","offsetWidth","_a"],"mappings":";;;;;;;;;;;AAKA,IAAAA,IAAA;AAEA,MAAAC,KAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;ACTY,IAAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA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