@adyen/bento-vue3 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 (138) hide show
  1. package/dist/@types/index.d.ts +1660 -614
  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.Tm7Cvpwu.js +2001 -0
  27. package/dist/chunks/calendar.Tm7Cvpwu.js.map +1 -0
  28. package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.8J29fVna.js} +2 -2
  29. package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.8J29fVna.js.map} +1 -1
  30. package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.CfNYUty6.js} +18 -18
  31. package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.CfNYUty6.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.CO78Nfj0.js → code-snippet.EeIcRV20.js} +2 -2
  33. package/dist/chunks/{code-snippet.CO78Nfj0.js.map → code-snippet.EeIcRV20.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/{dashboard-section.CVttsom5.js → dashboard-section.Cqi0PWeJ.js} +2 -2
  37. package/dist/chunks/{dashboard-section.CVttsom5.js.map → dashboard-section.Cqi0PWeJ.js.map} +1 -1
  38. package/dist/chunks/{data-grid-template.CFt1NV_4.js → data-grid-template.D7kB3S1u.js} +2 -2
  39. package/dist/chunks/{data-grid-template.CFt1NV_4.js.map → data-grid-template.D7kB3S1u.js.map} +1 -1
  40. package/dist/chunks/data-grid.DJIxBwCa.js +4143 -0
  41. package/dist/chunks/data-grid.DJIxBwCa.js.map +1 -0
  42. package/dist/chunks/{date-picker.DSkvT_CA.js → date-picker.CobmiKaJ.js} +16 -16
  43. package/dist/chunks/date-picker.CobmiKaJ.js.map +1 -0
  44. package/dist/chunks/date-range-picker.B6UKl1_N.js +1114 -0
  45. package/dist/chunks/date-range-picker.B6UKl1_N.js.map +1 -0
  46. package/dist/chunks/{get-date-locale.CAyOIbcp.js → differenceInMonths.C8FyCrav.js} +580 -364
  47. package/dist/chunks/differenceInMonths.C8FyCrav.js.map +1 -0
  48. package/dist/chunks/dropdown-tag.CMjilUQb.js +242 -0
  49. package/dist/chunks/dropdown-tag.CMjilUQb.js.map +1 -0
  50. package/dist/chunks/{dropdown.bLsoTZbw.js → dropdown.DG_EnV8g.js} +18 -18
  51. package/dist/chunks/{dropdown.bLsoTZbw.js.map → dropdown.DG_EnV8g.js.map} +1 -1
  52. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  53. package/dist/chunks/{filter-bar.nX73NKNC.js → filter-bar.dmC284Po.js} +737 -710
  54. package/dist/chunks/filter-bar.dmC284Po.js.map +1 -0
  55. package/dist/chunks/getRoundingMethod.C3eaeGLR.js +10 -0
  56. package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -0
  57. package/dist/chunks/{index.BrH1t1iu.js → getTimezoneOffsetInMilliseconds.BW7U6PxE.js} +254 -177
  58. package/dist/chunks/getTimezoneOffsetInMilliseconds.BW7U6PxE.js.map +1 -0
  59. package/dist/chunks/header-meta.BE6QfUNi.js +221 -0
  60. package/dist/chunks/header-meta.BE6QfUNi.js.map +1 -0
  61. package/dist/chunks/{header-with-views.BLW817ZC.js → header-with-views.BZ16v5-m.js} +4 -4
  62. package/dist/chunks/{header-with-views.BLW817ZC.js.map → header-with-views.BZ16v5-m.js.map} +1 -1
  63. package/dist/chunks/{header.DARVAeE9.js → header.3It50Clh.js} +2 -2
  64. package/dist/chunks/{header.DARVAeE9.js.map → header.3It50Clh.js.map} +1 -1
  65. package/dist/chunks/{input-field-password.BtM3-txc.js → input-field-password.BVnZWBAV.js} +185 -167
  66. package/dist/chunks/input-field-password.BVnZWBAV.js.map +1 -0
  67. package/dist/chunks/{input-field-phone-number.oaNB69nM.js → input-field-phone-number.CWhPGQ1U.js} +3 -3
  68. package/dist/chunks/{input-field-phone-number.oaNB69nM.js.map → input-field-phone-number.CWhPGQ1U.js.map} +1 -1
  69. package/dist/chunks/{input-field.D_tADgPG.js → input-field.A-dEZZfC.js} +124 -119
  70. package/dist/chunks/input-field.A-dEZZfC.js.map +1 -0
  71. package/dist/chunks/{pagination.D1Gdo5to.js → pagination.B4qBK4pM.js} +2 -2
  72. package/dist/chunks/{pagination.D1Gdo5to.js.map → pagination.B4qBK4pM.js.map} +1 -1
  73. package/dist/chunks/radio-group.DWNqrkZ3.js.map +1 -1
  74. package/dist/chunks/{rich-text-editor.BK9AivIm.js → rich-text-editor.BA6_k4Vv.js} +354 -352
  75. package/dist/chunks/{rich-text-editor.BK9AivIm.js.map → rich-text-editor.BA6_k4Vv.js.map} +1 -1
  76. package/dist/chunks/{search-bar.BD_R-vgA.js → search-bar.dZ7UCMxb.js} +3 -3
  77. package/dist/chunks/{search-bar.BD_R-vgA.js.map → search-bar.dZ7UCMxb.js.map} +1 -1
  78. package/dist/chunks/{secondary-nav.Du2PL7Ok.js → secondary-nav.CE082cQ_.js} +2 -2
  79. package/dist/chunks/{secondary-nav.Du2PL7Ok.js.map → secondary-nav.CE082cQ_.js.map} +1 -1
  80. package/dist/chunks/selection-card-group.NnTbPQjj.js +412 -0
  81. package/dist/chunks/{selection-card-group._RgLiMyQ.js.map → selection-card-group.NnTbPQjj.js.map} +1 -1
  82. package/dist/chunks/textarea.C1jkfowf.js.map +1 -1
  83. package/dist/chunks/timeline-item.DNjubXL2.js +556 -0
  84. package/dist/chunks/timeline-item.DNjubXL2.js.map +1 -0
  85. package/dist/chunks/{use-cached-selected-values.C32tjNKy.js → use-cached-selected-values.8MdrR9wt.js} +501 -467
  86. package/dist/chunks/use-cached-selected-values.8MdrR9wt.js.map +1 -0
  87. package/dist/code-snippet.js +1 -1
  88. package/dist/dashboard-template.js +1 -1
  89. package/dist/data-grid-template.js +1 -1
  90. package/dist/data-grid.js +1 -1
  91. package/dist/date-picker.js +2 -2
  92. package/dist/date-range-picker.js +2 -2
  93. package/dist/dropdown.js +3 -3
  94. package/dist/filter-bar.js +1 -1
  95. package/dist/header-with-views.js +1 -1
  96. package/dist/header.js +1 -1
  97. package/dist/index.js +24 -24
  98. package/dist/input-field-password.js +1 -1
  99. package/dist/input-field-phone-number.js +1 -1
  100. package/dist/input-field.js +1 -1
  101. package/dist/internal.js +3 -3
  102. package/dist/pagination.js +1 -1
  103. package/dist/rich-text-editor.js +1 -1
  104. package/dist/search-bar.js +2 -2
  105. package/dist/secondary-nav.js +1 -1
  106. package/dist/selection-card.js +1 -1
  107. package/dist/styles/bento-dark.css +7 -5
  108. package/dist/styles/bento-light.css +7 -5
  109. package/dist/styles/bento.css +7 -5
  110. package/dist/styles/legacy.css +7 -5
  111. package/dist/styles/styleguide.css +7 -5
  112. package/dist/timeline.js +1 -1
  113. package/dist/web-types.json +1 -1
  114. package/package.json +8 -23
  115. package/dist/chunks/_commonjsHelpers.C6fGbg64.js +0 -7
  116. package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +0 -1
  117. package/dist/chunks/calendar.Cqjyxc69.js +0 -2223
  118. package/dist/chunks/calendar.Cqjyxc69.js.map +0 -1
  119. package/dist/chunks/data-grid.BjPdbx50.js +0 -4071
  120. package/dist/chunks/data-grid.BjPdbx50.js.map +0 -1
  121. package/dist/chunks/date-picker.DSkvT_CA.js.map +0 -1
  122. package/dist/chunks/date-range-picker.cmg75lC-.js +0 -1117
  123. package/dist/chunks/date-range-picker.cmg75lC-.js.map +0 -1
  124. package/dist/chunks/dropdown-tag.DvQQIJsw.js +0 -308
  125. package/dist/chunks/dropdown-tag.DvQQIJsw.js.map +0 -1
  126. package/dist/chunks/filter-bar.nX73NKNC.js.map +0 -1
  127. package/dist/chunks/get-date-locale.CAyOIbcp.js.map +0 -1
  128. package/dist/chunks/header-meta.C4iaUsfq.js +0 -236
  129. package/dist/chunks/header-meta.C4iaUsfq.js.map +0 -1
  130. package/dist/chunks/index.BrH1t1iu.js.map +0 -1
  131. package/dist/chunks/index.BxBB1rsx.js +0 -15
  132. package/dist/chunks/index.BxBB1rsx.js.map +0 -1
  133. package/dist/chunks/input-field-password.BtM3-txc.js.map +0 -1
  134. package/dist/chunks/input-field.D_tADgPG.js.map +0 -1
  135. package/dist/chunks/selection-card-group._RgLiMyQ.js +0 -474
  136. package/dist/chunks/timeline-item.C8PA_w7m.js +0 -568
  137. package/dist/chunks/timeline-item.C8PA_w7m.js.map +0 -1
  138. package/dist/chunks/use-cached-selected-values.C32tjNKy.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as A, provide as P, toRef as T, useAttrs as y, ref as p, watch as F, createElementBlock as N, openBlock as S, createVNode as n, mergeProps as g, unref as o, createSlots as L, withCtx as m, createElementVNode as U, withKeys as f } from "vue";
2
2
  import { d as k } from "./debounce.DUTu11PS.js";
3
3
  import { u as K } from "./index.pdBj0KQU.js";
4
- import { I as R } from "./dropdown.bLsoTZbw.js";
5
- import { B as w } from "./input-field.D_tADgPG.js";
4
+ import { I as R } from "./dropdown.DG_EnV8g.js";
5
+ import { B as w } from "./input-field.A-dEZZfC.js";
6
6
  import { S as B } from "./search.PczW-onY.js";
7
7
  import { C as D } from "./cross-circle-fill.CYLL7jfC.js";
8
8
  import { _ as $ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
@@ -113,4 +113,4 @@ export {
113
113
  b as a,
114
114
  x as b
115
115
  };
116
- //# sourceMappingURL=search-bar.BD_R-vgA.js.map
116
+ //# sourceMappingURL=search-bar.dZ7UCMxb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-bar.BD_R-vgA.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/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 = withDefaults(defineProps<BentoSearchBarProps>(), {\n condensed: false,\n debounceTime: 300,\n disabled: false,\n hint: '',\n placeholder: '',\n value: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\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","t","useI18n","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__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;;;;;;;;;;;;;;kCCyKRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;AA/HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GASAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AASlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OANb,MAAA;AAEI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"search-bar.dZ7UCMxb.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/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 = withDefaults(defineProps<BentoSearchBarProps>(), {\n condensed: false,\n debounceTime: 300,\n disabled: false,\n hint: '',\n placeholder: '',\n value: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\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","t","useI18n","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__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;;;;;;;;;;;;;;kCCyKRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;AA/HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GASAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AASlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OANb,MAAA;AAEI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as g, inject as E, computed as u, createElementBlock as s, openBlock as a, normalizeClass as O, createVNode as f, unref as t, withCtx as I, createTextVNode as V, toDisplayString as w, createElementVNode as T, Fragment as B, renderList as N, ref as x, readonly as L, watch as M, provide as j, createBlock as y } from "vue";
2
- import { B as F } from "./dropdown.bLsoTZbw.js";
2
+ import { B as F } from "./dropdown.DG_EnV8g.js";
3
3
  import { g as q } from "./index.E60QniEu.js";
4
4
  import { u as z } from "./index.pdBj0KQU.js";
5
5
  import { a as Q } from "./es6.MoTTyETW.js";
@@ -135,4 +135,4 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
135
135
  export {
136
136
  ie as s
137
137
  };
138
- //# sourceMappingURL=secondary-nav.Du2PL7Ok.js.map
138
+ //# sourceMappingURL=secondary-nav.CE082cQ_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"secondary-nav.Du2PL7Ok.js","sources":["../../../vue2/src/components/secondary-nav/secondary-nav.keys.ts","../../../vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../../vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../../vue2/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 /**\n * The display name of the navigation item\n */\n label: string;\n /**\n * The value of this item.\n */\n value: string;\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<{\n /**\n * Event emitted when this element is clicked\n */\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\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 /**\n * The display name of the category\n */\n label: string;\n /**\n * A list of {@see BentoSecondaryNavItemsItem} that belongs to this category\n */\n items: Array<BentoSecondaryNavItemsItem>;\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 /**\n * An array containing all the items on the nav. The array can have either {@see BentoSecondaryNavItemsCategory },\n * which is used to group different items or {@see BentoSecondaryNavItemsItem } if you don't need to group them.\n */\n items: BentoSecondaryNavItems;\n /**\n * The value of the selected item.\n * If nothing is passed, it defaults to the first item value in items.\n */\n value?: string;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emmited when the current selected item changes\n */\n (e: 'change', category: string): void;\n }>();\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","props","__props","isItemSelected","computed","conditionalClasses","emit","__emit","onClick","e","__default__$1","__default__","messages","t","useI18n","isMobile","useBreakpoints","BMediaQuerySMax","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,0BC8CTC,IAAA,CAAA;;;;;;;;;AApCA,UAAA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAEAK,IAAAC,GAWAC,IAAAC,EAAA,MAAAN,EAAA,UAAAG,EAAA,KAAA,GAEAI,IAAAD,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA,GAGnDG,IAAAC,GAOAC,IAAA,CAAAC,MAAA;AACI,MAAAH,EAAA,SAAAG,CAAA,GACAV,EAAAE,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;;;;;8HCPrCS,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCsFAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;AAvFA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAMAG,IAJAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,EAGP,eAAA,GAAA,GACAhB,IAAAC,GAaAI,IAAAC,GAOAW,IAAAd,EAAA,MAAAH,EAAA,MAAA,KAAA,CAAAkB,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAhB,EAAA,MAAAH,EAAA,KAAA,GAEAoB,IAAAjB,EAAA,MAAA;AACI,YAAAkB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJxB,IAAAyB,EAAAtB,EAAA,SAAAoB,EAAA,KAAA,GACAtB,IAAA,CAAAyB,MAAA;AACI,MAAA1B,EAAA,QAAA0B,GACAlB,EAAA,UAAAkB,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAA5B,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAA4B;AAAA,MAAA,MAAA1B,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAA1B,EAAA,QAAA0B;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAAhC,GAAA6B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"secondary-nav.CE082cQ_.js","sources":["../../../vue2/src/components/secondary-nav/secondary-nav.keys.ts","../../../vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../../vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../../vue2/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 /**\n * The display name of the navigation item\n */\n label: string;\n /**\n * The value of this item.\n */\n value: string;\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<{\n /**\n * Event emitted when this element is clicked\n */\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\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 /**\n * The display name of the category\n */\n label: string;\n /**\n * A list of {@see BentoSecondaryNavItemsItem} that belongs to this category\n */\n items: Array<BentoSecondaryNavItemsItem>;\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 /**\n * An array containing all the items on the nav. The array can have either {@see BentoSecondaryNavItemsCategory },\n * which is used to group different items or {@see BentoSecondaryNavItemsItem } if you don't need to group them.\n */\n items: BentoSecondaryNavItems;\n /**\n * The value of the selected item.\n * If nothing is passed, it defaults to the first item value in items.\n */\n value?: string;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emmited when the current selected item changes\n */\n (e: 'change', category: string): void;\n }>();\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","props","__props","isItemSelected","computed","conditionalClasses","emit","__emit","onClick","e","__default__$1","__default__","messages","t","useI18n","isMobile","useBreakpoints","BMediaQuerySMax","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,0BC8CTC,IAAA,CAAA;;;;;;;;;AApCA,UAAA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAEAK,IAAAC,GAWAC,IAAAC,EAAA,MAAAN,EAAA,UAAAG,EAAA,KAAA,GAEAI,IAAAD,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA,GAGnDG,IAAAC,GAOAC,IAAA,CAAAC,MAAA;AACI,MAAAH,EAAA,SAAAG,CAAA,GACAV,EAAAE,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;;;;;8HCPrCS,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCsFAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;AAvFA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAMAG,IAJAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,EAGP,eAAA,GAAA,GACAhB,IAAAC,GAaAI,IAAAC,GAOAW,IAAAd,EAAA,MAAAH,EAAA,MAAA,KAAA,CAAAkB,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAhB,EAAA,MAAAH,EAAA,KAAA,GAEAoB,IAAAjB,EAAA,MAAA;AACI,YAAAkB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJxB,IAAAyB,EAAAtB,EAAA,SAAAoB,EAAA,KAAA,GACAtB,IAAA,CAAAyB,MAAA;AACI,MAAA1B,EAAA,QAAA0B,GACAlB,EAAA,UAAAkB,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAA5B,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAA4B;AAAA,MAAA,MAAA1B,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAA1B,EAAA,QAAA0B;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAAhC,GAAA6B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,412 @@
1
+ import { defineComponent as ae, useSlots as le, computed as t, inject as ne, ref as V, createElementBlock as E, openBlock as i, normalizeClass as g, createElementVNode as G, createBlock as f, createCommentVNode as $, unref as o, renderSlot as b, withModifiers as ie, createVNode as se, withCtx as u, createTextVNode as Y, toDisplayString as Q, watch as de, provide as ue, onMounted as ce, Fragment as Z, renderList as W, mergeProps as m, createSlots as F } from "vue";
2
+ import { b as fe } from "./index.E60QniEu.js";
3
+ import { a as ve, b as be } from "./es6.MoTTyETW.js";
4
+ import { B as A } from "./typography.yBEME_Gu.js";
5
+ import { u as ye } from "./aria-label.CaUURpnB.js";
6
+ import { g as H } from "./generate-uid.NJ8tVoha.js";
7
+ import { u as me } from "./use-has-slot.B7eQSabc.js";
8
+ import { a as pe } from "./radio-input.CBNE-AkM.js";
9
+ import { C as he } from "./checkbox-input.BXNGT9U0.js";
10
+ import { _ as oe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
11
+ import { C as ke } from "./controls-group.cbGiHr7n.js";
12
+ import { G as ge } from "./grid-layout.DDaRNz4-.js";
13
+ import { E as Ce } from "./field-label.C97CrBI_.js";
14
+ import "../assets/selection-card-group.css";
15
+ var x = /* @__PURE__ */ ((l) => (l.DISABLED = "disabled", l.READONLY = "readonly", l.ERROR = "error", l))(x || {});
16
+ const te = Symbol("selection card radio input injection key"), _e = {
17
+ key: 0,
18
+ class: "b-selection-card__icon",
19
+ role: "presentation"
20
+ }, Re = ["for"], $e = {
21
+ name: "bento-selection-card"
22
+ }, Ve = /* @__PURE__ */ ae({
23
+ ...$e,
24
+ props: {
25
+ /**
26
+ * The description of the selection card
27
+ */
28
+ description: {
29
+ type: String,
30
+ default: void 0
31
+ },
32
+ /**
33
+ * Disables the selection card
34
+ */
35
+ disabled: { type: Boolean, default: !1 },
36
+ /**
37
+ * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.
38
+ */
39
+ fullyClickable: { type: Boolean, default: !1 },
40
+ /**
41
+ * Shows the selection card in error state
42
+ */
43
+ hasError: { type: Boolean, default: !1 },
44
+ /**
45
+ * This property should not be used directly.
46
+ * It will be used by v-model directive on selection card component.
47
+ *
48
+ * When handling a single input, use a string or a number.
49
+ *
50
+ * When handling multiple inputs, use an array of keys.
51
+ * These keys exist as a set "value" prop for each input.
52
+ */
53
+ modelValue: {
54
+ type: [Boolean, String, Array],
55
+ default: null
56
+ },
57
+ /**
58
+ * Sets the selection card to readonly
59
+ */
60
+ readonly: { type: Boolean, default: !1 },
61
+ /**
62
+ * The subtitle of the selection card
63
+ */
64
+ subtitle: {
65
+ type: String,
66
+ default: void 0
67
+ },
68
+ /**
69
+ * The title of the selection card
70
+ */
71
+ title: {
72
+ type: String,
73
+ required: !0
74
+ },
75
+ /**
76
+ * Indicates the value of the input that will be returned when it's checked.
77
+ */
78
+ value: {
79
+ type: [String, Number],
80
+ required: !0
81
+ }
82
+ },
83
+ emits: ["input", "update:model-value"],
84
+ setup(l, { emit: z }) {
85
+ const a = l, B = z, U = le(), c = me(U), S = H("selection-card-input-id"), p = H("selection-card-description"), N = t(
86
+ () => a.modelValue
87
+ ), C = t(
88
+ () => a.modelValue
89
+ ), O = t(() => ({
90
+ "b-selection-card--checked": _.value,
91
+ "b-selection-card--fully-clickable": a.fullyClickable
92
+ })), w = t(() => ({
93
+ [`b-selection-card--${x.DISABLED}`]: a.disabled,
94
+ [`b-selection-card--${x.ERROR}`]: a.hasError,
95
+ [`b-selection-card--${x.READONLY}`]: a.readonly,
96
+ "b-selection-card--center-aligned": R.value
97
+ })), D = t(() => ({
98
+ "b-selection-card__checkbox-container--center-aligned": R.value
99
+ })), j = t(() => ({
100
+ "b-selection-card__checkbox-container-text--center-aligned": R.value
101
+ })), h = t(() => ({
102
+ "b-selection-card__slot--with-icon": c("icon")
103
+ })), r = ye({
104
+ ariaLabel: a.title,
105
+ label: a.value
106
+ }), T = t(() => Array.isArray(a.modelValue)), _ = t(() => M.value ? a.value === a.modelValue : T.value ? a.modelValue.some((n) => n === a.value) : a.modelValue), M = ne(te, V(!1)), R = t(() => !a.subtitle && !a.description), y = V(null), e = V(null), v = V(null), s = (n) => {
107
+ var k, L, J, K, P, X;
108
+ if (y.value.$refs.inputRef === n.target) {
109
+ const re = q();
110
+ d(re);
111
+ return;
112
+ }
113
+ if (a.disabled && a.readonly || !a.fullyClickable && (e.value && ((L = (k = e.value) == null ? void 0 : k.$el) != null && L.contains(n.target)) || v.value && ((K = (J = v.value) == null ? void 0 : J.$el) != null && K.contains(n.target)) || y.value && ((X = (P = y.value) == null ? void 0 : P.$el) != null && X.contains(n.target))))
114
+ return;
115
+ const I = q();
116
+ d(I);
117
+ }, q = () => {
118
+ var I;
119
+ const n = ((I = y.value) == null ? void 0 : I.$refs.inputRef).checked;
120
+ if (T.value) {
121
+ const k = [...a.modelValue], L = k.indexOf(a.value);
122
+ return L === -1 ? k.push(a.value) : k.splice(L, 1), k;
123
+ }
124
+ return M.value ? a.value : n;
125
+ }, d = (n) => {
126
+ !a.disabled && !a.readonly && (B("update:model-value", n), B("input", n));
127
+ };
128
+ return (n, I) => (i(), E("div", {
129
+ class: g(["b-selection-card", O.value]),
130
+ onClick: s
131
+ }, [
132
+ G("div", {
133
+ class: g(["b-selection-card__container", w.value])
134
+ }, [
135
+ G("div", {
136
+ class: g(["b-selection-card__checkbox-container", D.value])
137
+ }, [
138
+ G("div", {
139
+ class: g(["b-selection-card__checkbox-container-text", j.value])
140
+ }, [
141
+ o(c)("icon") ? (i(), E("div", _e, [
142
+ b(n.$slots, "icon", {}, void 0, !0)
143
+ ])) : $("", !0),
144
+ G("label", {
145
+ for: o(S),
146
+ class: "b-selection-card__text",
147
+ onClick: ie(s, ["stop", "prevent"])
148
+ }, [
149
+ l.subtitle ? (i(), f(o(A), {
150
+ key: 0,
151
+ class: "b-selection-card__description",
152
+ el: "span",
153
+ variant: "caption"
154
+ }, {
155
+ default: u(() => [
156
+ Y(Q(l.subtitle), 1)
157
+ ]),
158
+ _: 1
159
+ })) : $("", !0),
160
+ se(o(A), {
161
+ el: "span",
162
+ variant: "title"
163
+ }, {
164
+ default: u(() => [
165
+ Y(Q(l.title), 1)
166
+ ]),
167
+ _: 1
168
+ }),
169
+ l.description ? (i(), f(o(A), {
170
+ key: 1,
171
+ id: "descriptionId",
172
+ class: "b-selection-card__description",
173
+ el: "span",
174
+ variant: "body"
175
+ }, {
176
+ default: u(() => [
177
+ Y(Q(l.description), 1)
178
+ ]),
179
+ _: 1
180
+ })) : $("", !0)
181
+ ], 8, Re)
182
+ ], 2),
183
+ o(M) ? (i(), f(o(pe), {
184
+ key: 0,
185
+ id: o(S),
186
+ ref_key: "inputRef",
187
+ ref: y,
188
+ "aria-label": o(r),
189
+ "aria-describedby": l.description ? o(p) : void 0,
190
+ disabled: l.disabled,
191
+ "has-error": l.hasError,
192
+ "aria-readonly": l.readonly ?? void 0,
193
+ value: l.value,
194
+ readonly: l.readonly,
195
+ "model-value": N.value
196
+ }, null, 8, ["id", "aria-label", "aria-describedby", "disabled", "has-error", "aria-readonly", "value", "readonly", "model-value"])) : (i(), f(o(he), {
197
+ key: 1,
198
+ id: o(S),
199
+ ref_key: "inputRef",
200
+ ref: y,
201
+ "aria-label": o(r),
202
+ "aria-describedby": l.description ? o(p) : void 0,
203
+ disabled: l.disabled,
204
+ "has-error": l.hasError,
205
+ "aria-readonly": l.readonly ?? void 0,
206
+ value: l.value,
207
+ readonly: l.readonly,
208
+ "model-value": C.value
209
+ }, null, 8, ["id", "aria-label", "aria-describedby", "disabled", "has-error", "aria-readonly", "value", "readonly", "model-value"]))
210
+ ], 2),
211
+ o(c)("content") ? (i(), f(o(A), {
212
+ key: 0,
213
+ ref_key: "slotRef",
214
+ ref: e,
215
+ el: "div",
216
+ class: g(["b-selection-card__slot", h.value])
217
+ }, {
218
+ default: u(() => [
219
+ b(n.$slots, "content", {}, void 0, !0)
220
+ ]),
221
+ _: 3
222
+ }, 8, ["class"])) : $("", !0),
223
+ o(c)("dynamicContent") && _.value ? (i(), f(o(A), {
224
+ key: 1,
225
+ ref_key: "dynamicSlotRef",
226
+ ref: v,
227
+ el: "div",
228
+ class: g(["b-selection-card__slot", h.value])
229
+ }, {
230
+ default: u(() => [
231
+ b(n.$slots, "dynamicContent", {}, void 0, !0)
232
+ ]),
233
+ _: 3
234
+ }, 8, ["class"])) : $("", !0)
235
+ ], 2)
236
+ ], 2));
237
+ }
238
+ }), ee = /* @__PURE__ */ oe(Ve, [["__scopeId", "data-v-925457bd"]]), Ee = {}, Be = /* @__PURE__ */ ae({
239
+ ...Ee,
240
+ __name: "selection-card-group",
241
+ props: {
242
+ formId: { default: null },
243
+ hideLabel: { type: Boolean, default: null },
244
+ layout: { default: "vertical" },
245
+ items: {},
246
+ itemsPerRow: { default: void 0 },
247
+ modelValue: { type: [Boolean, Array, String, Number], default: null },
248
+ variant: { default: "checkbox" },
249
+ description: { default: null },
250
+ disabled: { type: Boolean, default: !1 },
251
+ errorMessage: { default: null },
252
+ label: { default: null },
253
+ optional: { type: Boolean, default: !1 },
254
+ placeholder: {},
255
+ readonly: { type: Boolean, default: !1 },
256
+ required: { type: Boolean, default: !1 },
257
+ tooltipText: { default: null }
258
+ },
259
+ emits: ["input", "update:model-value"],
260
+ setup(l, { emit: z }) {
261
+ const a = l, B = z, U = le(), c = (e) => !!U[e], S = t(() => ({
262
+ "b-selection-card-group__items--horizontal": a.layout === "horizontal"
263
+ })), p = V(a.modelValue);
264
+ de(
265
+ () => a.modelValue,
266
+ () => {
267
+ p.value = a.modelValue;
268
+ }
269
+ );
270
+ const N = H("error"), C = t(() => !a.disabled && !a.readonly && !!a.errorMessage), O = V(null), { width: w } = fe(O), D = t(() => ve.split("px")[0]), j = t(() => be.split("px")[0]), h = t(() => w.value < D.value ? "small" : w.value >= D.value && w.value < j.value ? "medium" : "large"), r = t(() => {
271
+ var e;
272
+ return ((e = a.itemsPerRow) == null ? void 0 : e[h == null ? void 0 : h.value]) || a.items.length;
273
+ }), T = t(() => {
274
+ if (!a.itemsPerRow)
275
+ return [];
276
+ const e = [];
277
+ for (let v = 0; v < a.items.length; v += r == null ? void 0 : r.value)
278
+ e.push(a.items.slice(v, v + (r == null ? void 0 : r.value)));
279
+ return e;
280
+ }), _ = t(() => 12 / (r == null ? void 0 : r.value)), M = t(() => r != null && r.value ? new Array(r == null ? void 0 : r.value).fill({
281
+ // 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
282
+ small: _.value,
283
+ medium: _.value,
284
+ large: _.value
285
+ }) : []), R = (e) => {
286
+ p.value = e, B("update:model-value", e), B("input", e);
287
+ }, y = t(() => a.variant === "radio");
288
+ return ue(te, y), ce(() => {
289
+ a.itemsPerRow && Object.values(a.itemsPerRow).forEach((e) => {
290
+ if (e && (e < 2 || e > 6))
291
+ throw new Error(
292
+ "itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information."
293
+ );
294
+ });
295
+ }), (e, v) => (i(), f(o(ke), {
296
+ ref_key: "containerRef",
297
+ ref: O,
298
+ "aria-describedby": C.value ? o(N) : null,
299
+ label: e.label,
300
+ "hide-label": e.hideLabel,
301
+ description: e.description,
302
+ disabled: e.disabled,
303
+ "tooltip-text": e.tooltipText,
304
+ readonly: e.readonly,
305
+ required: e.required,
306
+ optional: e.optional,
307
+ class: "b-selection-card-group",
308
+ "component-name": "selection-card-group"
309
+ }, {
310
+ default: u(() => [
311
+ !e.itemsPerRow || e.layout === "vertical" ? (i(), E("div", {
312
+ key: 0,
313
+ class: g(["b-selection-card-group__items", S.value])
314
+ }, [
315
+ (i(!0), E(Z, null, W(e.items, (s) => (i(), f(ee, m({
316
+ key: `selection-card-${s.value}`,
317
+ class: "b-selection-card-group__item",
318
+ ref_for: !0
319
+ }, s, {
320
+ "model-value": p.value,
321
+ readonly: e.readonly || s.readonly,
322
+ "has-error": C.value,
323
+ disabled: e.disabled || s.disabled,
324
+ "onUpdate:modelValue": R
325
+ }), F({ _: 2 }, [
326
+ c("icon") && s.icon ? {
327
+ name: "icon",
328
+ fn: u(() => [
329
+ b(e.$slots, "icon", m({ ref_for: !0 }, s), void 0, !0)
330
+ ]),
331
+ key: "0"
332
+ } : void 0,
333
+ c("content") && s.content ? {
334
+ name: "content",
335
+ fn: u(() => [
336
+ b(e.$slots, "content", m({ ref_for: !0 }, s), void 0, !0)
337
+ ]),
338
+ key: "1"
339
+ } : void 0,
340
+ c("dynamicContent") && s.dynamicContent ? {
341
+ name: "dynamicContent",
342
+ fn: u(() => [
343
+ b(e.$slots, "dynamicContent", m({ ref_for: !0 }, s), void 0, !0)
344
+ ]),
345
+ key: "2"
346
+ } : void 0
347
+ ]), 1040, ["model-value", "readonly", "has-error", "disabled"]))), 128))
348
+ ], 2)) : (i(), E("div", {
349
+ key: `selection-card-group-layout-breakpoint-${h.value}`
350
+ }, [
351
+ (i(!0), E(Z, null, W(T.value, (s, q) => (i(), f(o(ge), {
352
+ key: `selection-card-group-row-${q}-cols-${r.value}`,
353
+ class: "b-selection-card-group__items--wrap",
354
+ "column-width": M.value
355
+ }, F({ _: 2 }, [
356
+ W(s, (d, n) => ({
357
+ name: `col-${n + 1}`,
358
+ fn: u(() => [
359
+ (i(), f(ee, m({
360
+ key: `selection-card-${d.value}`,
361
+ class: "b-selection-card-group__item b-selection-card-group__item--full-height",
362
+ ref_for: !0
363
+ }, d, {
364
+ "model-value": p.value,
365
+ readonly: e.readonly || d.readonly,
366
+ "has-error": C.value,
367
+ disabled: e.disabled || d.disabled,
368
+ "onUpdate:modelValue": R
369
+ }), F({ _: 2 }, [
370
+ c("icon") && d.icon ? {
371
+ name: "icon",
372
+ fn: u(() => [
373
+ b(e.$slots, "icon", m({ ref_for: !0 }, d), void 0, !0)
374
+ ]),
375
+ key: "0"
376
+ } : void 0,
377
+ c("content") && d.content ? {
378
+ name: "content",
379
+ fn: u(() => [
380
+ b(e.$slots, "content", m({ ref_for: !0 }, d), void 0, !0)
381
+ ]),
382
+ key: "1"
383
+ } : void 0,
384
+ c("dynamicContent") && d.dynamicContent ? {
385
+ name: "dynamicContent",
386
+ fn: u(() => [
387
+ b(e.$slots, "dynamicContent", m({ ref_for: !0 }, d), void 0, !0)
388
+ ]),
389
+ key: "2"
390
+ } : void 0
391
+ ]), 1040, ["model-value", "readonly", "has-error", "disabled"]))
392
+ ])
393
+ }))
394
+ ]), 1032, ["column-width"]))), 128))
395
+ ])),
396
+ C.value ? (i(), f(o(Ce), {
397
+ key: 2,
398
+ id: o(N),
399
+ "error-message": e.errorMessage,
400
+ class: "b-selection-card-group__error-message"
401
+ }, null, 8, ["id", "error-message"])) : $("", !0)
402
+ ]),
403
+ _: 3
404
+ }, 8, ["aria-describedby", "label", "hide-label", "description", "disabled", "tooltip-text", "readonly", "required", "optional"]));
405
+ }
406
+ }), ze = /* @__PURE__ */ oe(Be, [["__scopeId", "data-v-d0bfbc60"]]);
407
+ export {
408
+ ee as B,
409
+ x as a,
410
+ ze as s
411
+ };
412
+ //# sourceMappingURL=selection-card-group.NnTbPQjj.js.map