@adyen/bento-vue2 1.74.0 → 1.76.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 (139) hide show
  1. package/dist/@types/index.d.ts +1693 -616
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/button-actions.css +1 -1
  6. package/dist/assets/calendar.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/data-grid-template.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-picker.css +1 -1
  11. package/dist/assets/date-range-picker.css +1 -1
  12. package/dist/assets/dialog-page.css +1 -1
  13. package/dist/assets/dropdown-tag.css +1 -1
  14. package/dist/assets/file-uploader.css +1 -1
  15. package/dist/assets/filter-bar.css +1 -1
  16. package/dist/assets/header-meta.css +1 -1
  17. package/dist/assets/input-field-password.css +1 -1
  18. package/dist/assets/input-field.css +1 -1
  19. package/dist/assets/inspector.css +1 -1
  20. package/dist/assets/modal-fullscreen.css +1 -1
  21. package/dist/assets/selection-card-group.css +1 -1
  22. package/dist/assets/sidepanel.css +1 -1
  23. package/dist/assets/timeline-item.css +1 -1
  24. package/dist/assets/use-cached-selected-values.css +1 -1
  25. package/dist/checkbox.js +2 -2
  26. package/dist/chunks/calendar.Fm_dfQC5.js +1871 -0
  27. package/dist/chunks/calendar.Fm_dfQC5.js.map +1 -0
  28. package/dist/chunks/{checkbox-group.DETXTJqI.js → checkbox-group.CtNVRcmP.js} +2 -2
  29. package/dist/chunks/{checkbox-group.DETXTJqI.js.map → checkbox-group.CtNVRcmP.js.map} +1 -1
  30. package/dist/chunks/{checkbox.BPtHAAEa.js → checkbox.nyUc0gLb.js} +18 -18
  31. package/dist/chunks/{checkbox.BPtHAAEa.js.map → checkbox.nyUc0gLb.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.VtrsOTEC.js → code-snippet.DFf3KMSi.js} +2 -2
  33. package/dist/chunks/{code-snippet.VtrsOTEC.js.map → code-snippet.DFf3KMSi.js.map} +1 -1
  34. package/dist/chunks/constructNow.CHWWeLPc.js +8 -0
  35. package/dist/chunks/constructNow.CHWWeLPc.js.map +1 -0
  36. package/dist/chunks/{currency.DDB4G_A8.js → currency.AvvbekWO.js} +15 -14
  37. package/dist/chunks/{currency.DDB4G_A8.js.map → currency.AvvbekWO.js.map} +1 -1
  38. package/dist/chunks/{dashboard-section.jIpBvP6X.js → dashboard-section.D1l7wDX3.js} +2 -2
  39. package/dist/chunks/{dashboard-section.jIpBvP6X.js.map → dashboard-section.D1l7wDX3.js.map} +1 -1
  40. package/dist/chunks/{data-grid-template.CozTcWQ0.js → data-grid-template.DGUDqzjj.js} +2 -2
  41. package/dist/chunks/{data-grid-template.CozTcWQ0.js.map → data-grid-template.DGUDqzjj.js.map} +1 -1
  42. package/dist/chunks/{data-grid.DN9xml8y.js → data-grid.B5aCkT0o.js} +1257 -1223
  43. package/dist/chunks/data-grid.B5aCkT0o.js.map +1 -0
  44. package/dist/chunks/{date-picker.DoYYzWcA.js → date-picker.DImAYvoM.js} +14 -14
  45. package/dist/chunks/date-picker.DImAYvoM.js.map +1 -0
  46. package/dist/chunks/date-range-picker.DgZMERzx.js +914 -0
  47. package/dist/chunks/date-range-picker.DgZMERzx.js.map +1 -0
  48. package/dist/chunks/{get-date-locale.CAyOIbcp.js → differenceInMonths.C8FyCrav.js} +580 -364
  49. package/dist/chunks/differenceInMonths.C8FyCrav.js.map +1 -0
  50. package/dist/chunks/dropdown-tag.CpvU8eSZ.js +260 -0
  51. package/dist/chunks/dropdown-tag.CpvU8eSZ.js.map +1 -0
  52. package/dist/chunks/{dropdown.BOvtYKXS.js → dropdown.RxD2TqnP.js} +14 -14
  53. package/dist/chunks/{dropdown.BOvtYKXS.js.map → dropdown.RxD2TqnP.js.map} +1 -1
  54. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  55. package/dist/chunks/{filter-bar.DzHJi42d.js → filter-bar.C0S87JZD.js} +511 -486
  56. package/dist/chunks/filter-bar.C0S87JZD.js.map +1 -0
  57. package/dist/chunks/getRoundingMethod.C3eaeGLR.js +10 -0
  58. package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -0
  59. package/dist/chunks/{index.BrH1t1iu.js → getTimezoneOffsetInMilliseconds.BW7U6PxE.js} +254 -177
  60. package/dist/chunks/getTimezoneOffsetInMilliseconds.BW7U6PxE.js.map +1 -0
  61. package/dist/chunks/header-meta.D-6dL1Vg.js +170 -0
  62. package/dist/chunks/header-meta.D-6dL1Vg.js.map +1 -0
  63. package/dist/chunks/{header-with-views.t5Fr63SD.js → header-with-views.j16q5wEc.js} +4 -4
  64. package/dist/chunks/{header-with-views.t5Fr63SD.js.map → header-with-views.j16q5wEc.js.map} +1 -1
  65. package/dist/chunks/{header.DwSyDQ68.js → header.DoWKsA15.js} +2 -2
  66. package/dist/chunks/{header.DwSyDQ68.js.map → header.DoWKsA15.js.map} +1 -1
  67. package/dist/chunks/{input-field-password.Dm3HYonF.js → input-field-password.CSfXqEbT.js} +47 -38
  68. package/dist/chunks/input-field-password.CSfXqEbT.js.map +1 -0
  69. package/dist/chunks/{input-field-phone-number.bZauIuHJ.js → input-field-phone-number.oa4hXQdK.js} +3 -3
  70. package/dist/chunks/{input-field-phone-number.bZauIuHJ.js.map → input-field-phone-number.oa4hXQdK.js.map} +1 -1
  71. package/dist/chunks/input-field.DdQu3b1-.js +161 -0
  72. package/dist/chunks/input-field.DdQu3b1-.js.map +1 -0
  73. package/dist/chunks/{pagination.CKD9FDrA.js → pagination.C0YW_A_o.js} +2 -2
  74. package/dist/chunks/{pagination.CKD9FDrA.js.map → pagination.C0YW_A_o.js.map} +1 -1
  75. package/dist/chunks/radio-group.AcYMFudv.js.map +1 -1
  76. package/dist/chunks/{rich-text-editor.BZgQ578S.js → rich-text-editor.eYW8X_YP.js} +354 -352
  77. package/dist/chunks/{rich-text-editor.BZgQ578S.js.map → rich-text-editor.eYW8X_YP.js.map} +1 -1
  78. package/dist/chunks/{search-bar.c-w7Uky2.js → search-bar.DJVfPz-f.js} +3 -3
  79. package/dist/chunks/{search-bar.c-w7Uky2.js.map → search-bar.DJVfPz-f.js.map} +1 -1
  80. package/dist/chunks/{secondary-nav.D69COlqF.js → secondary-nav.BFiTQaag.js} +2 -2
  81. package/dist/chunks/{secondary-nav.D69COlqF.js.map → secondary-nav.BFiTQaag.js.map} +1 -1
  82. package/dist/chunks/{selection-card-group.8UIir78G.js → selection-card-group.D4rcUyvV.js} +58 -120
  83. package/dist/chunks/{selection-card-group.8UIir78G.js.map → selection-card-group.D4rcUyvV.js.map} +1 -1
  84. package/dist/chunks/textarea.CIQuLWQ8.js.map +1 -1
  85. package/dist/chunks/{timeline-item.VSw9vKdO.js → timeline-item.CZBuknZ_.js} +156 -168
  86. package/dist/chunks/timeline-item.CZBuknZ_.js.map +1 -0
  87. package/dist/chunks/{use-cached-selected-values.IsfhJHxQ.js → use-cached-selected-values.BZd3CTeP.js} +334 -314
  88. package/dist/chunks/use-cached-selected-values.BZd3CTeP.js.map +1 -0
  89. package/dist/code-snippet.js +1 -1
  90. package/dist/currency.js +1 -1
  91. package/dist/dashboard-template.js +1 -1
  92. package/dist/data-grid-template.js +1 -1
  93. package/dist/data-grid.js +1 -1
  94. package/dist/date-picker.js +2 -2
  95. package/dist/date-range-picker.js +2 -2
  96. package/dist/dropdown.js +3 -3
  97. package/dist/filter-bar.js +1 -1
  98. package/dist/header-with-views.js +1 -1
  99. package/dist/header.js +1 -1
  100. package/dist/index.js +221 -220
  101. package/dist/input-field-password.js +1 -1
  102. package/dist/input-field-phone-number.js +1 -1
  103. package/dist/input-field.js +1 -1
  104. package/dist/internal.js +3 -3
  105. package/dist/pagination.js +1 -1
  106. package/dist/rich-text-editor.js +1 -1
  107. package/dist/search-bar.js +2 -2
  108. package/dist/secondary-nav.js +1 -1
  109. package/dist/selection-card.js +1 -1
  110. package/dist/styles/bento-dark.css +7 -5
  111. package/dist/styles/bento-light.css +7 -5
  112. package/dist/styles/bento.css +7 -5
  113. package/dist/styles/legacy.css +7 -5
  114. package/dist/styles/styleguide.css +7 -5
  115. package/dist/timeline.js +1 -1
  116. package/dist/web-types.json +692 -1390
  117. package/package.json +12 -27
  118. package/dist/chunks/_commonjsHelpers.C6fGbg64.js +0 -7
  119. package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +0 -1
  120. package/dist/chunks/calendar.EfqJlztU.js +0 -2093
  121. package/dist/chunks/calendar.EfqJlztU.js.map +0 -1
  122. package/dist/chunks/data-grid.DN9xml8y.js.map +0 -1
  123. package/dist/chunks/date-picker.DoYYzWcA.js.map +0 -1
  124. package/dist/chunks/date-range-picker.C_pJ8yH5.js +0 -917
  125. package/dist/chunks/date-range-picker.C_pJ8yH5.js.map +0 -1
  126. package/dist/chunks/dropdown-tag.DBnurtCQ.js +0 -245
  127. package/dist/chunks/dropdown-tag.DBnurtCQ.js.map +0 -1
  128. package/dist/chunks/filter-bar.DzHJi42d.js.map +0 -1
  129. package/dist/chunks/get-date-locale.CAyOIbcp.js.map +0 -1
  130. package/dist/chunks/header-meta.uiIO1wHP.js +0 -185
  131. package/dist/chunks/header-meta.uiIO1wHP.js.map +0 -1
  132. package/dist/chunks/index.BrH1t1iu.js.map +0 -1
  133. package/dist/chunks/index.BxBB1rsx.js +0 -15
  134. package/dist/chunks/index.BxBB1rsx.js.map +0 -1
  135. package/dist/chunks/input-field-password.Dm3HYonF.js.map +0 -1
  136. package/dist/chunks/input-field.D52XYEzU.js +0 -157
  137. package/dist/chunks/input-field.D52XYEzU.js.map +0 -1
  138. package/dist/chunks/timeline-item.VSw9vKdO.js.map +0 -1
  139. package/dist/chunks/use-cached-selected-values.IsfhJHxQ.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as h, provide as _, toRef as b, useAttrs as C, ref as l, watch as v } from "vue";
2
2
  import { d as y } from "./debounce.DUTu11PS.js";
3
3
  import { u as I } from "./index.B6WW_F-J.js";
4
- import { I as S } from "./dropdown.BOvtYKXS.js";
5
- import { B as k } from "./input-field.D52XYEzU.js";
4
+ import { I as S } from "./dropdown.RxD2TqnP.js";
5
+ import { B as k } from "./input-field.DdQu3b1-.js";
6
6
  import { S as T } from "./search.D53Ia3rC.js";
7
7
  import { C as E } from "./cross-circle-fill.DTDtgLMf.js";
8
8
  import { n as A } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
@@ -95,4 +95,4 @@ export {
95
95
  i as a,
96
96
  F as b
97
97
  };
98
- //# sourceMappingURL=search-bar.c-w7Uky2.js.map
98
+ //# sourceMappingURL=search-bar.DJVfPz-f.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-bar.c-w7Uky2.js","sources":["../../src/components/search-bar/search-bar.types.ts","../../src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n\nexport interface BentoSearchBarProps {\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: string;\n\n /**\n * Reduces height of the search bar. Default: false\n */\n condensed?: boolean;\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * Disables the text input.\n */\n disabled?: boolean;\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint?: string;\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: string;\n\n /**\n * Text displayed as the value being searched\n */\n value?: string;\n}\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, useAttrs, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent, type BentoSearchBarProps } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n import BentoInputField from '@/components/input-field/input-field.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n inputFieldAriaLabel: null,\n condensed: { type: Boolean, default: false },\n debounceTime: { default: 300 },\n disabled: { type: Boolean, default: false },\n hint: { default: '' },\n placeholder: { default: '' },\n value: { default: undefined }\n});\n\n const emit = defineEmits([\"input\", \"clear\", \"escape-pressed\", \"blur\", \"focus\"]);\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n // bentoInputField.value?.focusInput();\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","useI18n","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","props","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","emit","debouncedEmit","debounce","onInputEvent","value","focus","expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;GCiJRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;iBAvGA,EAAA,EAAA,IAAAC,EAAA;AAcA,IAAAC,EAAAC,GAAAC,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAJ,EAAA,KAAA,GACAK,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAN,EAAA;AAAA,MACgB,MAAA;AAER,QAAAG,EAAA,QAAAH,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAO,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAK,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBC,IAAAC,EAAA,MAAA;AACI,MAAAF,EAAA,SAAAL,EAAA,KAAA;AAAA,IAA8B,GAAAH,EAAA,YAAA,GAGlCW,IAAA,CAAAC,MAAA;AACI,MAAAT,EAAA,QAAAS,GACAH,EAAA;AAAA,IAAc,GAGlBI,IAAA,MAAA;AAEI,MAAAR,EAAA,MAAA,WAAA;AAAA,IAAiC;AAIrC,WAAAS,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OAAAD;AAAA,IAIT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"search-bar.DJVfPz-f.js","sources":["../../src/components/search-bar/search-bar.types.ts","../../src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n\nexport interface BentoSearchBarProps {\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: string;\n\n /**\n * Reduces height of the search bar. Default: false\n */\n condensed?: boolean;\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * Disables the text input.\n */\n disabled?: boolean;\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint?: string;\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: string;\n\n /**\n * Text displayed as the value being searched\n */\n value?: string;\n}\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, useAttrs, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent, type BentoSearchBarProps } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n import BentoInputField from '@/components/input-field/input-field.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n inputFieldAriaLabel: null,\n condensed: { type: Boolean, default: false },\n debounceTime: { default: 300 },\n disabled: { type: Boolean, default: false },\n hint: { default: '' },\n placeholder: { default: '' },\n value: { default: undefined }\n});\n\n const emit = defineEmits([\"input\", \"clear\", \"escape-pressed\", \"blur\", \"focus\"]);\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n // bentoInputField.value?.focusInput();\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","useI18n","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","props","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","emit","debouncedEmit","debounce","onInputEvent","value","focus","expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;GCiJRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;iBAvGA,EAAA,EAAA,IAAAC,EAAA;AAcA,IAAAC,EAAAC,GAAAC,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAJ,EAAA,KAAA,GACAK,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAN,EAAA;AAAA,MACgB,MAAA;AAER,QAAAG,EAAA,QAAAH,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAO,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAK,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBC,IAAAC,EAAA,MAAA;AACI,MAAAF,EAAA,SAAAL,EAAA,KAAA;AAAA,IAA8B,GAAAH,EAAA,YAAA,GAGlCW,IAAA,CAAAC,MAAA;AACI,MAAAT,EAAA,QAAAS,GACAH,EAAA;AAAA,IAAc,GAGlBI,IAAA,MAAA;AAEI,MAAAR,EAAA,MAAA,WAAA;AAAA,IAAiC;AAIrC,WAAAS,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OAAAD;AAAA,IAIT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, inject as C, computed as r, ref as g, readonly as I, watch as h, provide as S } from "vue";
2
- import { B as k } from "./dropdown.BOvtYKXS.js";
2
+ import { B as k } from "./dropdown.RxD2TqnP.js";
3
3
  import { g as w } from "./index.BDK4hwK_.js";
4
4
  import { u as $ } from "./index.B6WW_F-J.js";
5
5
  import { a as B } from "./es6.MoTTyETW.js";
@@ -109,4 +109,4 @@ const X = Q.exports;
109
109
  export {
110
110
  X as s
111
111
  };
112
- //# sourceMappingURL=secondary-nav.D69COlqF.js.map
112
+ //# sourceMappingURL=secondary-nav.BFiTQaag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"secondary-nav.D69COlqF.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" :aria-selected=\"isItemSelected\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps({\n label: null,\n value: null\n});\n\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': isItemSelected.value,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { type BentoSecondaryNavItems, type BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null\n});\n\n const emit = defineEmits([\"change\"]);\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","isItemSelected","computed","props","conditionalClasses","e","emit","__default__$1","__default__","messages","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,GCmCTC,IAAA,CAAA;;;;;;;;;iBAzBA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAOAK,IAAAC,EAAA,MAAAJ,EAAA,UAAAK,EAAA,KAAA,GAEAC,IAAAF,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA;4IAKnD,CAAAI,MAAA;AACI,MAAAC,EAAA,SAAAD,CAAA,GACAN,EAAAI,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;qBCFrCI,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC+EAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBA1EA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,GAGPC,IAAAH,EAAA,eAAA,GAAA,GAQAI,IAAAb,EAAA,MAAAC,EAAA,MAAA,KAAA,CAAAa,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAf,EAAA,MAAAC,EAAA,KAAA,GAEAe,IAAAhB,EAAA,MAAA;AACI,YAAAiB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJrB,IAAAsB,EAAAjB,EAAA,SAAAe,EAAA,KAAA,GACAnB,IAAA,CAAAsB,MAAA;AACI,MAAAvB,EAAA,QAAAuB,GACAf,EAAA,UAAAe,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAAzB,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAAyB;AAAA,MAAA,MAAArB,EAAA;AAAA,MACgB,CAAAkB,MAAA;AAER,QAAAvB,EAAA,QAAAuB;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAA7B,GAAA0B,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"secondary-nav.BFiTQaag.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" :aria-selected=\"isItemSelected\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps({\n label: null,\n value: null\n});\n\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': isItemSelected.value,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { type BentoSecondaryNavItems, type BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null\n});\n\n const emit = defineEmits([\"change\"]);\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","isItemSelected","computed","props","conditionalClasses","e","emit","__default__$1","__default__","messages","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,GCmCTC,IAAA,CAAA;;;;;;;;;iBAzBA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAOAK,IAAAC,EAAA,MAAAJ,EAAA,UAAAK,EAAA,KAAA,GAEAC,IAAAF,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA;4IAKnD,CAAAI,MAAA;AACI,MAAAC,EAAA,SAAAD,CAAA,GACAN,EAAAI,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;qBCFrCI,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC+EAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBA1EA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,GAGPC,IAAAH,EAAA,eAAA,GAAA,GAQAI,IAAAb,EAAA,MAAAC,EAAA,MAAA,KAAA,CAAAa,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAf,EAAA,MAAAC,EAAA,KAAA,GAEAe,IAAAhB,EAAA,MAAA;AACI,YAAAiB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJrB,IAAAsB,EAAAjB,EAAA,SAAAe,EAAA,KAAA,GACAnB,IAAA,CAAAsB,MAAA;AACI,MAAAvB,EAAA,QAAAuB,GACAf,EAAA,UAAAe,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAAzB,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAAyB;AAAA,MAAA,MAAArB,EAAA;AAAA,MACgB,CAAAkB,MAAA;AAER,QAAAvB,EAAA,QAAAuB;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAA7B,GAAA0B,CAAA;;;;;;;;;;;;;;;;;"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as G, useSlots as O, computed as n, inject as z, ref as m, watch as P, provide as W, onMounted as Y } from "vue";
1
+ import { defineComponent as A, useSlots as O, computed as l, inject as j, ref as m, watch as P, provide as W, onMounted as Y } from "vue";
2
2
  import { b as F } from "./index.BDK4hwK_.js";
3
3
  import { a as Q, b as U } from "./es6.MoTTyETW.js";
4
4
  import { B as H } from "./typography.hlOAxsEn.js";
5
- import { u as J } from "./aria-label.CaUURpnB.js";
5
+ import { C as J } from "./checkbox-input.B0NsfSNR.js";
6
+ import { u as K } from "./aria-label.CaUURpnB.js";
6
7
  import { g as M } from "./generate-uid.NJ8tVoha.js";
7
- import { u as K } from "./use-has-slot.C9lQZ6nz.js";
8
- import { a as X } from "./radio-input.kzb4gxLW.js";
9
- import { C as Z } from "./checkbox-input.B0NsfSNR.js";
8
+ import { u as X } from "./use-has-slot.C9lQZ6nz.js";
9
+ import { a as Z } from "./radio-input.kzb4gxLW.js";
10
10
  import { n as D } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
11
11
  import { G as ee } from "./grid-layout.1aIiz2N_.js";
12
12
  import { E as te } from "./field-label.Auq-Pzho.js";
@@ -15,7 +15,7 @@ import "../assets/selection-card-group.css";
15
15
  var B = /* @__PURE__ */ ((c) => (c.DISABLED = "disabled", c.READONLY = "readonly", c.ERROR = "error", c))(B || {});
16
16
  const N = Symbol("selection card radio input injection key"), ae = {
17
17
  name: "bento-selection-card"
18
- }, ne = /* @__PURE__ */ G({
18
+ }, le = /* @__PURE__ */ A({
19
19
  ...ae,
20
20
  props: {
21
21
  /**
@@ -78,35 +78,35 @@ const N = Symbol("selection card radio input injection key"), ae = {
78
78
  },
79
79
  emits: ["input", "update:model-value"],
80
80
  setup(c, { emit: e }) {
81
- const t = c, o = O(), a = K(o), v = M("selection-card-input-id"), s = M("selection-card-description"), C = n(
81
+ const t = c, o = O(), a = X(o), v = M("selection-card-input-id"), s = M("selection-card-description"), C = l(
82
82
  () => t.modelValue
83
- ), E = n(
83
+ ), E = l(
84
84
  () => t.modelValue
85
- ), x = n(() => ({
85
+ ), S = l(() => ({
86
86
  "b-selection-card--checked": p.value,
87
87
  "b-selection-card--fully-clickable": t.fullyClickable
88
- })), _ = n(() => ({
88
+ })), _ = l(() => ({
89
89
  [`b-selection-card--${B.DISABLED}`]: t.disabled,
90
90
  [`b-selection-card--${B.ERROR}`]: t.hasError,
91
91
  [`b-selection-card--${B.READONLY}`]: t.readonly,
92
- "b-selection-card--center-aligned": b.value
93
- })), h = n(() => ({
94
- "b-selection-card__checkbox-container--center-aligned": b.value
95
- })), R = n(() => ({
96
- "b-selection-card__checkbox-container-text--center-aligned": b.value
97
- })), y = n(() => ({
92
+ "b-selection-card--center-aligned": y.value
93
+ })), h = l(() => ({
94
+ "b-selection-card__checkbox-container--center-aligned": y.value
95
+ })), R = l(() => ({
96
+ "b-selection-card__checkbox-container-text--center-aligned": y.value
97
+ })), b = l(() => ({
98
98
  "b-selection-card__slot--with-icon": a("icon")
99
- })), r = J({
99
+ })), r = K({
100
100
  ariaLabel: t.title,
101
101
  label: t.value
102
- }), g = n(() => Array.isArray(t.modelValue)), p = n(() => k.value ? t.value === t.modelValue : g.value ? t.modelValue.some((i) => i === t.value) : t.modelValue), k = z(N, m(!1)), b = n(() => !t.subtitle && !t.description), u = m(null), l = m(null), d = m(null), q = (i) => {
103
- var f, S, $, L, T, A;
102
+ }), g = l(() => Array.isArray(t.modelValue)), p = l(() => k.value ? t.value === t.modelValue : g.value ? t.modelValue.some((i) => i === t.value) : t.modelValue), k = j(N, m(!1)), y = l(() => !t.subtitle && !t.description), u = m(null), n = m(null), d = m(null), q = (i) => {
103
+ var f, x, $, L, T, G;
104
104
  if (u.value.$refs.inputRef === i.target) {
105
- const j = V();
106
- w(j);
105
+ const z = V();
106
+ w(z);
107
107
  return;
108
108
  }
109
- if (t.disabled && t.readonly || !t.fullyClickable && (l.value && ((S = (f = l.value) == null ? void 0 : f.$el) != null && S.contains(i.target)) || d.value && ((L = ($ = d.value) == null ? void 0 : $.$el) != null && L.contains(i.target)) || u.value && ((A = (T = u.value) == null ? void 0 : T.$el) != null && A.contains(i.target))))
109
+ if (t.disabled && t.readonly || !t.fullyClickable && (n.value && ((x = (f = n.value) == null ? void 0 : f.$el) != null && x.contains(i.target)) || d.value && ((L = ($ = d.value) == null ? void 0 : $.$el) != null && L.contains(i.target)) || u.value && ((G = (T = u.value) == null ? void 0 : T.$el) != null && G.contains(i.target))))
110
110
  return;
111
111
  const I = V();
112
112
  w(I);
@@ -114,115 +114,53 @@ const N = Symbol("selection card radio input injection key"), ae = {
114
114
  var I;
115
115
  const i = ((I = u.value) == null ? void 0 : I.$refs.inputRef).checked;
116
116
  if (g.value) {
117
- const f = [...t.modelValue], S = f.indexOf(t.value);
118
- return S === -1 ? f.push(t.value) : f.splice(S, 1), f;
117
+ const f = [...t.modelValue], x = f.indexOf(t.value);
118
+ return x === -1 ? f.push(t.value) : f.splice(x, 1), f;
119
119
  }
120
120
  return k.value ? t.value : i;
121
121
  }, w = (i) => {
122
122
  !t.disabled && !t.readonly && (e("update:model-value", i), e("input", i));
123
123
  };
124
- return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: v, descriptionId: s, computedRadioInputModelValue: C, computedCheckboxInputModelValue: E, conditionalClasses: x, containerConditionalClasses: _, checkboxContainerConditionalClasses: h, checkboxContainerTextConditionalClasses: R, slotConditionalClasses: y, ariaLabel: r, isCheckboxGroup: g, isChecked: p, isRadioInput: k, isTitleOnly: b, inputRef: u, slotRef: l, dynamicSlotRef: d, handleCardClick: q, toggleInput: V, onChange: w, BentoTypography: H, CheckboxInput: Z, RadioInput: X };
124
+ return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: v, descriptionId: s, computedRadioInputModelValue: C, computedCheckboxInputModelValue: E, conditionalClasses: S, containerConditionalClasses: _, checkboxContainerConditionalClasses: h, checkboxContainerTextConditionalClasses: R, slotConditionalClasses: b, ariaLabel: r, isCheckboxGroup: g, isChecked: p, isRadioInput: k, isTitleOnly: y, inputRef: u, slotRef: n, dynamicSlotRef: d, handleCardClick: q, toggleInput: V, onChange: w, BentoTypography: H, CheckboxInput: J, RadioInput: Z };
125
125
  }
126
126
  });
127
- var le = function() {
127
+ var ne = function() {
128
128
  var e = this, t = e._self._c, o = e._self._setupProxy;
129
129
  return t("div", { staticClass: "b-selection-card", class: o.conditionalClasses, on: { click: o.handleCardClick } }, [t("div", { staticClass: "b-selection-card__container", class: o.containerConditionalClasses }, [t("div", { staticClass: "b-selection-card__checkbox-container", class: o.checkboxContainerConditionalClasses }, [t("div", { staticClass: "b-selection-card__checkbox-container-text", class: o.checkboxContainerTextConditionalClasses }, [o.hasSlot("icon") ? t("div", { staticClass: "b-selection-card__icon", attrs: { role: "presentation" } }, [e._t("icon")], 2) : e._e(), t("label", { staticClass: "b-selection-card__text", attrs: { for: o.inputId }, on: { click: function(a) {
130
130
  return a.stopPropagation(), a.preventDefault(), o.handleCardClick.apply(null, arguments);
131
131
  } } }, [e.subtitle ? t(o.BentoTypography, { staticClass: "b-selection-card__description", attrs: { el: "span", variant: "caption" } }, [e._v(" " + e._s(e.subtitle) + " ")]) : e._e(), t(o.BentoTypography, { attrs: { el: "span", variant: "title" } }, [e._v(e._s(e.title))]), e.description ? t(o.BentoTypography, { staticClass: "b-selection-card__description", attrs: { id: "descriptionId", el: "span", variant: "body" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1)]), o.isRadioInput ? t(o.RadioInput, { ref: "inputRef", attrs: { id: o.inputId, "aria-label": o.ariaLabel, "aria-describedby": e.description ? o.descriptionId : void 0, disabled: e.disabled, "has-error": e.hasError, "aria-readonly": e.readonly ?? void 0, value: e.value, readonly: e.readonly, "model-value": o.computedRadioInputModelValue } }) : t(o.CheckboxInput, { ref: "inputRef", attrs: { id: o.inputId, "aria-label": o.ariaLabel, "aria-describedby": e.description ? o.descriptionId : void 0, disabled: e.disabled, "has-error": e.hasError, "aria-readonly": e.readonly ?? void 0, value: e.value, readonly: e.readonly, "model-value": o.computedCheckboxInputModelValue } })], 1), o.hasSlot("content") ? t(o.BentoTypography, { ref: "slotRef", staticClass: "b-selection-card__slot", class: o.slotConditionalClasses, attrs: { el: "div" } }, [e._t("content")], 2) : e._e(), o.hasSlot("dynamicContent") && o.isChecked ? t(o.BentoTypography, { ref: "dynamicSlotRef", staticClass: "b-selection-card__slot", class: o.slotConditionalClasses, attrs: { el: "div" } }, [e._t("dynamicContent")], 2) : e._e()], 1)]);
132
132
  }, re = [], se = /* @__PURE__ */ D(
133
- ne,
134
133
  le,
134
+ ne,
135
135
  re,
136
136
  !1,
137
137
  null,
138
138
  "e98bb71b"
139
139
  );
140
- const ie = se.exports, ce = {}, ue = /* @__PURE__ */ G({
140
+ const ie = se.exports, ce = {}, ue = /* @__PURE__ */ A({
141
141
  ...ce,
142
142
  __name: "selection-card-group",
143
143
  props: {
144
- /**
145
- * Descriptive supporting text visbile underneath the label.
146
- */
147
- description: { type: String, default: null },
148
- /**
149
- * If set to true, renders all cards in the group in a disabled state.
150
- */
144
+ description: { default: null },
151
145
  disabled: { type: Boolean, default: !1 },
152
- /**
153
- * Renders all cards in an error state with an error message.
154
- */
155
- errorMessage: { type: String, default: null },
156
- /**
157
- * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.
158
- */
159
- formId: { type: String, default: null },
160
- /**
161
- * Shows/hides the group label.
162
- */
163
- hideLabel: { type: Boolean, default: null },
164
- /**
165
- * Label of the group. Required for accessibility purposes, even if it's not shown
166
- */
167
- label: {
168
- type: String,
169
- required: !0
170
- },
171
- /**
172
- * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.
173
- * @values horizontal, vertical
174
- */
175
- layout: {
176
- type: String,
177
- default: "vertical"
178
- },
179
- /**
180
- * The selection card group's items.
181
- */
182
- items: {
183
- type: Array,
184
- required: !0
185
- },
186
- /**
187
- * Sets the responsive number of items rendered in each row.
188
- */
189
- itemsPerRow: {
190
- type: Object,
191
- default: void 0
192
- },
193
- /**
194
- * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.
195
- * Defaults to no value selected.
196
- */
197
- modelValue: {
198
- type: [Array, String, Number],
199
- default: null
200
- },
201
- /**
202
- * Indicates the field is optional.
203
- */
146
+ errorMessage: { default: null },
147
+ label: { default: null },
204
148
  optional: { type: Boolean, default: !1 },
205
- /**
206
- * Indicates the field is required.
207
- */
208
- required: { type: Boolean, default: !1 },
209
- /**
210
- * Tooltip message.
211
- */
212
- tooltipText: { type: String, default: null },
213
- /**
214
- * If set to true, renders all cards in the group in a readonly state.
215
- */
149
+ placeholder: null,
216
150
  readonly: { type: Boolean, default: !1 },
217
- /**
218
- * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.
219
- * @values checkbox, radio
220
- */
221
- variant: { type: String, default: "checkbox" }
151
+ required: { type: Boolean, default: !1 },
152
+ tooltipText: { default: null },
153
+ formId: { default: null },
154
+ hideLabel: { type: Boolean, default: null },
155
+ layout: { default: "vertical" },
156
+ items: null,
157
+ itemsPerRow: { default: void 0 },
158
+ modelValue: { default: null },
159
+ variant: { default: "checkbox" }
222
160
  },
223
161
  emits: ["input", "update:model-value"],
224
162
  setup(c, { emit: e }) {
225
- const t = c, o = O(), a = (l) => !!o[l], v = n(() => ({
163
+ const t = c, o = O(), a = (n) => !!o[n], v = l(() => ({
226
164
  "b-selection-card-group__items--horizontal": t.layout === "horizontal"
227
165
  })), s = m(t.modelValue);
228
166
  P(
@@ -231,32 +169,32 @@ const ie = se.exports, ce = {}, ue = /* @__PURE__ */ G({
231
169
  s.value = t.modelValue;
232
170
  }
233
171
  );
234
- const C = M("error"), E = n(() => !t.disabled && !t.readonly && !!t.errorMessage), x = m(null), { width: _ } = F(x), h = n(() => Q.split("px")[0]), R = n(() => U.split("px")[0]), y = n(() => _.value < h.value ? "small" : _.value >= h.value && _.value < R.value ? "medium" : "large"), r = n(() => {
235
- var l;
236
- return ((l = t.itemsPerRow) == null ? void 0 : l[y == null ? void 0 : y.value]) || t.items.length;
237
- }), g = n(() => {
172
+ const C = M("error"), E = l(() => !t.disabled && !t.readonly && !!t.errorMessage), S = m(null), { width: _ } = F(S), h = l(() => Q.split("px")[0]), R = l(() => U.split("px")[0]), b = l(() => _.value < h.value ? "small" : _.value >= h.value && _.value < R.value ? "medium" : "large"), r = l(() => {
173
+ var n;
174
+ return ((n = t.itemsPerRow) == null ? void 0 : n[b == null ? void 0 : b.value]) || t.items.length;
175
+ }), g = l(() => {
238
176
  if (!t.itemsPerRow)
239
177
  return [];
240
- const l = [];
178
+ const n = [];
241
179
  for (let d = 0; d < t.items.length; d += r == null ? void 0 : r.value)
242
- l.push(t.items.slice(d, d + (r == null ? void 0 : r.value)));
243
- return l;
244
- }), p = n(() => 12 / (r == null ? void 0 : r.value)), k = n(() => r != null && r.value ? new Array(r == null ? void 0 : r.value).fill({
180
+ n.push(t.items.slice(d, d + (r == null ? void 0 : r.value)));
181
+ return n;
182
+ }), p = l(() => 12 / (r == null ? void 0 : r.value)), k = l(() => r != null && r.value ? new Array(r == null ? void 0 : r.value).fill({
245
183
  // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy
246
184
  small: p.value,
247
185
  medium: p.value,
248
186
  large: p.value
249
- }) : []), b = (l) => {
250
- s.value = l, e("update:model-value", l), e("input", l);
251
- }, u = n(() => t.variant === "radio");
187
+ }) : []), y = (n) => {
188
+ s.value = n, e("update:model-value", n), e("input", n);
189
+ }, u = l(() => t.variant === "radio");
252
190
  return W(N, u), Y(() => {
253
- t.itemsPerRow && Object.values(t.itemsPerRow).forEach((l) => {
254
- if (l && (l < 2 || l > 6))
191
+ t.itemsPerRow && Object.values(t.itemsPerRow).forEach((n) => {
192
+ if (n && (n < 2 || n > 6))
255
193
  throw new Error(
256
194
  "itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information."
257
195
  );
258
196
  });
259
- }), { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, conditionalItemsClasses: v, inputValue: s, errorMessageId: C, shouldShowGroupError: E, containerRef: x, width: _, smallBreakpoint: h, mediumBreakpoint: R, currentBreakpoint: y, computedItemsPerRow: r, computedRows: g, itemColumnWidth: p, computedColumnWidth: k, onInput: b, isRadioVariant: u, BentoSelectionCard: ie, ControlsGroup: oe, ErrorMessage: te, GridLayout: ee };
197
+ }), { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, conditionalItemsClasses: v, inputValue: s, errorMessageId: C, shouldShowGroupError: E, containerRef: S, width: _, smallBreakpoint: h, mediumBreakpoint: R, currentBreakpoint: b, computedItemsPerRow: r, computedRows: g, itemColumnWidth: p, computedColumnWidth: k, onInput: y, isRadioVariant: u, BentoSelectionCard: ie, ControlsGroup: oe, ErrorMessage: te, GridLayout: ee };
260
198
  }
261
199
  });
262
200
  var de = function() {
@@ -288,7 +226,7 @@ var de = function() {
288
226
  pe,
289
227
  !1,
290
228
  null,
291
- "1c7341ef"
229
+ "b5cb85fc"
292
230
  );
293
231
  const Be = fe.exports;
294
232
  export {
@@ -296,4 +234,4 @@ export {
296
234
  B as a,
297
235
  Be as s
298
236
  };
299
- //# sourceMappingURL=selection-card-group.8UIir78G.js.map
237
+ //# sourceMappingURL=selection-card-group.D4rcUyvV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection-card-group.8UIir78G.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '../checkbox/checkbox.types';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { type BentoCheckboxType, type BentoMultiCheckboxType, CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${columnIndex+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, type PropType, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import {\n type BentoSelectionCardGroupItemsPerRow,\n type BentoSelectionCardGroupLayout,\n type BentoSelectionCardGroupVariant,\n } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { type BentoSelectionCardItem, type BentoSelectionCardModelValue } from '../../selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all cards in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * Label of the group. Required for accessibility purposes, even if it's not shown\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @values horizontal, vertical\n */\n layout: {\n type: String as PropType<BentoSelectionCardGroupLayout>,\n default: 'vertical',\n },\n\n /**\n * The selection card group's items.\n */\n items: {\n type: Array as PropType<Array<BentoSelectionCardItem>>,\n required: true,\n },\n\n /**\n * Sets the responsive number of items rendered in each row.\n */\n itemsPerRow: {\n type: Object as PropType<BentoSelectionCardGroupItemsPerRow>,\n default: undefined,\n },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Array, String, Number] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.\n * @values checkbox, radio\n */\n variant: { type: String as PropType<BentoSelectionCardGroupVariant>, default: 'checkbox' },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emit('update:model-value', value);\n emit('input', value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","_b","_a","_d","_c","_f","_e","newValue","currentValue","newCheckedList","index","emit","__default__","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;AAIY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJC,MAAAE,IAAA,OAAA,0CAAA,GCmTTC,KAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI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OAK,IAAAxD,EAAA,MACImD,KAAA,QAAAA,EAAA,QAAA,IAAA,MAAAA,KAAA,gBAAAA,EAAA,KAAA,EAAA,KAAA;AAAA;AAAA,MACiD,OAAAI,EAAA;AAAA,MAEhB,QAAAA,EAAA;AAAA,MACC,OAAAA,EAAA;AAAA,IACD,CAAA,IAAA,CAAA,CAE1B,GAGXE,IAAA,CAAAC,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAA,sBAAAuB,CAAA,GACAvB,EAAA,SAAAuB,CAAA;AAAA,IAAmB,GAGvBC,IAAA3D,EAAA,MAAAC,EAAA,YAAA,OAAA;AAEA,WAAA2D,EAAAtE,GAAAqE,CAAA,GAEAE,EAAA,MAAA;AACI,MAAA5D,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAA6D,MAAA;AACI,YAAAA,MAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"selection-card-group.D4rcUyvV.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '../checkbox/checkbox.types';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { type BentoCheckboxType, type BentoMultiCheckboxType, CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${columnIndex+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { type BentoSelectionCardModelValue } from '../../selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hideLabel: { type: Boolean, default: null },\n layout: { default: 'vertical' },\n items: null,\n itemsPerRow: { default: undefined },\n modelValue: { default: null },\n variant: { default: 'checkbox' }\n});\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emit('update:model-value', value);\n emit('input', value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","_b","_a","_d","_c","_f","_e","newValue","currentValue","newCheckedList","index","emit","__default__","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;AAIY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJC,MAAAE,IAAA,OAAA,0CAAA,GCmTTC,KAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,yBAAA,GACAC,IAAAD,EAAA,4BAAA,GAEAE,IAAAC;AAAA,MAAmE,MAAAC,EAAA;AAAA,IACnD,GAEhBC,IAAAF;AAAA,MAAwE,MAAAC,EAAA;AAAA,IACxD,GAGhBE,IAAAH,EAAA,OAAA;AAAA,MAA2C,6BAAAI,EAAA;AAAA,MACA,qCAAAH,EAAA;AAAA,IACI,EAAA,GAG/CI,IAAAL,EAAA,OAAA;AAAA,MAAoD,CAAA,qBAAAZ,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACiB,CAAA,qBAAAb,EAAA,KAAA,EAAA,GAAAa,EAAA;AAAA,MACH,CAAA,qBAAAb,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACG,oCAAAK,EAAA;AAAA,IACjB,EAAA,GAGpDC,IAAAP,EAAA,OAAA;AAAA,MAA4D,wDAAAM,EAAA;AAAA,IACY,EAAA,GAGxEE,IAAAR,EAAA,OAAA;AAAA,MAAgE,6DAAAM,EAAA;AAAA,IACa,EAAA,GAG7EG,IAAAT,EAAA,OAAA;AAAA,MAA+C,qCAAAN,EAAA,MAAA;AAAA,IACQ,EA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