@adyen/bento-vue3 1.76.2 → 1.77.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.
- package/dist/@types/index.d.ts +216 -33
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/payment-method.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tag.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.COUx8Ne8.js} +2 -2
- package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.COUx8Ne8.js.map} +1 -1
- package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.SffuKyNj.js} +3 -3
- package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.SffuKyNj.js.map} +1 -1
- package/dist/chunks/{code-snippet.Bjf1ma1L.js → code-snippet.ByoBEM00.js} +2 -2
- package/dist/chunks/{code-snippet.Bjf1ma1L.js.map → code-snippet.ByoBEM00.js.map} +1 -1
- package/dist/chunks/{currency.CBZMwm21.js → currency.WmvQjX7l.js} +2 -2
- package/dist/chunks/{currency.CBZMwm21.js.map → currency.WmvQjX7l.js.map} +1 -1
- package/dist/chunks/{data-grid.VBEJO94f.js → data-grid.CMIG82Xt.js} +7 -7
- package/dist/chunks/{data-grid.VBEJO94f.js.map → data-grid.CMIG82Xt.js.map} +1 -1
- package/dist/chunks/date-picker.CsGq3iSK.js +244 -0
- package/dist/chunks/date-picker.CsGq3iSK.js.map +1 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
- package/dist/chunks/date-range-picker.C19CWG27.js +1149 -0
- package/dist/chunks/date-range-picker.C19CWG27.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.MkU0tMf1.js → dropdown-default-textbox._KEBXjKT.js} +88 -86
- package/dist/chunks/dropdown-default-textbox._KEBXjKT.js.map +1 -0
- package/dist/chunks/dropdown-tag.B90dpg8J.js +301 -0
- package/dist/chunks/dropdown-tag.B90dpg8J.js.map +1 -0
- package/dist/chunks/dropdown.DYDHM__3.js +833 -0
- package/dist/chunks/{dropdown.KStrJVoP.js.map → dropdown.DYDHM__3.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{file-uploader.By0MTfKk.js → file-uploader.BDXQ7Ccv.js} +416 -415
- package/dist/chunks/{file-uploader.By0MTfKk.js.map → file-uploader.BDXQ7Ccv.js.map} +1 -1
- package/dist/chunks/{filter-bar.JXmlFnHV.js → filter-bar.CmF92iAr.js} +303 -303
- package/dist/chunks/filter-bar.CmF92iAr.js.map +1 -0
- package/dist/chunks/form-field.BBqLu-vs.js +10 -0
- package/dist/chunks/form-field.BBqLu-vs.js.map +1 -0
- package/dist/chunks/get-slot-text.CQRAP2_q.js +12 -0
- package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -0
- package/dist/chunks/{header-with-views.Dg2usaMY.js → header-with-views.xPfeOz0Y.js} +3 -3
- package/dist/chunks/{header-with-views.Dg2usaMY.js.map → header-with-views.xPfeOz0Y.js.map} +1 -1
- package/dist/chunks/{input-field-password.B6nJ7ygZ.js → input-field-password.BZBYVyAb.js} +3 -3
- package/dist/chunks/{input-field-password.B6nJ7ygZ.js.map → input-field-password.BZBYVyAb.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.D_UBAN2s.js → input-field-phone-number.a8Mw5PAW.js} +5 -5
- package/dist/chunks/{input-field-phone-number.D_UBAN2s.js.map → input-field-phone-number.a8Mw5PAW.js.map} +1 -1
- package/dist/chunks/{input-field.C29FCI4j.js → input-field.CYGGIK48.js} +48 -48
- package/dist/chunks/input-field.CYGGIK48.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.uHSB7MO6.js → listbox-option-tag.Cwe9Bn-R.js} +2 -2
- package/dist/chunks/{listbox-option-tag.uHSB7MO6.js.map → listbox-option-tag.Cwe9Bn-R.js.map} +1 -1
- package/dist/chunks/{pagination.BaBWNlIF.js → pagination.CYdGcyMA.js} +49 -49
- package/dist/chunks/pagination.CYdGcyMA.js.map +1 -0
- package/dist/chunks/{payment-method.CDnn1bjo.js → payment-method.D6PeTYWq.js} +45 -42
- package/dist/chunks/payment-method.D6PeTYWq.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/{radio-group.DWNqrkZ3.js → radio-group.B_8R6vGx.js} +3 -3
- package/dist/chunks/{radio-group.DWNqrkZ3.js.map → radio-group.B_8R6vGx.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Bh7KS617.js → rich-text-editor.B6Ftqv55.js} +2 -2
- package/dist/chunks/{rich-text-editor.Bh7KS617.js.map → rich-text-editor.B6Ftqv55.js.map} +1 -1
- package/dist/chunks/{search-bar.RS02IcLc.js → search-bar.D3Ri_RUK.js} +3 -3
- package/dist/chunks/{search-bar.RS02IcLc.js.map → search-bar.D3Ri_RUK.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DXsgUTqk.js → secondary-nav.CAb20jWW.js} +24 -24
- package/dist/chunks/secondary-nav.CAb20jWW.js.map +1 -0
- package/dist/chunks/{summary-grid.types.ByQ4u19J.js → summary-grid.types.cE1fyLvC.js} +2 -2
- package/dist/chunks/{summary-grid.types.ByQ4u19J.js.map → summary-grid.types.cE1fyLvC.js.map} +1 -1
- package/dist/chunks/tag.CjaB9DxL.js +57 -0
- package/dist/chunks/tag.CjaB9DxL.js.map +1 -0
- package/dist/chunks/textarea.C_gnXj6b.js +254 -0
- package/dist/chunks/textarea.C_gnXj6b.js.map +1 -0
- package/dist/chunks/{timeline-item.DNjubXL2.js → timeline-item.rSY0Xce3.js} +48 -48
- package/dist/chunks/timeline-item.rSY0Xce3.js.map +1 -0
- package/dist/chunks/{toggle.Dd_NA8eH.js → toggle.BHCUjMpp.js} +2 -2
- package/dist/chunks/{toggle.Dd_NA8eH.js.map → toggle.BHCUjMpp.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +7 -6
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +246 -245
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/payment-method.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/styles/bento-dark.css +4 -0
- package/dist/styles/bento-light.css +4 -0
- package/dist/styles/bento.css +4 -0
- package/dist/styles/legacy.css +4 -0
- package/dist/styles/styleguide.css +4 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/date-picker.OI-sQ232.js +0 -234
- package/dist/chunks/date-picker.OI-sQ232.js.map +0 -1
- package/dist/chunks/date-range-picker.D7IwIR5V.js +0 -1114
- package/dist/chunks/date-range-picker.D7IwIR5V.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.MkU0tMf1.js.map +0 -1
- package/dist/chunks/dropdown-tag.DFeoXIgH.js +0 -242
- package/dist/chunks/dropdown-tag.DFeoXIgH.js.map +0 -1
- package/dist/chunks/dropdown.KStrJVoP.js +0 -825
- package/dist/chunks/filter-bar.JXmlFnHV.js.map +0 -1
- package/dist/chunks/get-slot-text.DQlZEsId.js +0 -12
- package/dist/chunks/get-slot-text.DQlZEsId.js.map +0 -1
- package/dist/chunks/input-field.C29FCI4j.js.map +0 -1
- package/dist/chunks/pagination.BaBWNlIF.js.map +0 -1
- package/dist/chunks/payment-method.CDnn1bjo.js.map +0 -1
- package/dist/chunks/secondary-nav.DXsgUTqk.js.map +0 -1
- package/dist/chunks/tag.CEmpyuYX.js +0 -50
- package/dist/chunks/tag.CEmpyuYX.js.map +0 -1
- package/dist/chunks/textarea.C1jkfowf.js +0 -246
- package/dist/chunks/textarea.C1jkfowf.js.map +0 -1
- package/dist/chunks/timeline-item.DNjubXL2.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.
|
|
5
|
-
import { B as w } from "./input-field.
|
|
4
|
+
import { I as R } from "./dropdown.DYDHM__3.js";
|
|
5
|
+
import { B as w } from "./input-field.CYGGIK48.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.
|
|
116
|
+
//# sourceMappingURL=search-bar.D3Ri_RUK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.
|
|
1
|
+
{"version":3,"file":"search-bar.D3Ri_RUK.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,13 +1,13 @@
|
|
|
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.
|
|
3
|
-
import { g as
|
|
4
|
-
import { u as
|
|
5
|
-
import { a as
|
|
2
|
+
import { B as F } from "./dropdown.DYDHM__3.js";
|
|
3
|
+
import { g as U } from "./index.E60QniEu.js";
|
|
4
|
+
import { u as q } from "./index.pdBj0KQU.js";
|
|
5
|
+
import { a as z } from "./es6.MoTTyETW.js";
|
|
6
6
|
import { B as S } from "./typography.yBEME_Gu.js";
|
|
7
7
|
import { _ as h } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
8
|
import "../assets/secondary-nav.css";
|
|
9
|
-
const C = Symbol("secondary nav state"),
|
|
10
|
-
...
|
|
9
|
+
const C = Symbol("secondary nav state"), Q = ["aria-selected"], R = {}, Y = /* @__PURE__ */ g({
|
|
10
|
+
...R,
|
|
11
11
|
__name: "secondary-nav-item",
|
|
12
12
|
props: {
|
|
13
13
|
label: {},
|
|
@@ -15,15 +15,15 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
15
15
|
},
|
|
16
16
|
emits: ["click"],
|
|
17
17
|
setup(m, { emit: o }) {
|
|
18
|
-
const { activeItemValue:
|
|
18
|
+
const { activeItemValue: d, updateActiveItemValue: n } = E(C), _ = m, l = u(() => d.value === _.value), p = u(() => ({
|
|
19
19
|
"b-secondary-nav-item--active": l.value
|
|
20
|
-
})), b = o,
|
|
21
|
-
b("click", r), n(
|
|
20
|
+
})), b = o, v = (r) => {
|
|
21
|
+
b("click", r), n(_.value);
|
|
22
22
|
};
|
|
23
23
|
return (r, i) => (a(), s("button", {
|
|
24
24
|
class: O(["b-secondary-nav-item", p.value]),
|
|
25
25
|
"aria-selected": l.value,
|
|
26
|
-
onClick:
|
|
26
|
+
onClick: v
|
|
27
27
|
}, [
|
|
28
28
|
f(t(S), {
|
|
29
29
|
class: "b-secondary-nav-item__title",
|
|
@@ -35,7 +35,7 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
35
35
|
]),
|
|
36
36
|
_: 1
|
|
37
37
|
})
|
|
38
|
-
], 10,
|
|
38
|
+
], 10, Q));
|
|
39
39
|
}
|
|
40
40
|
}), A = /* @__PURE__ */ h(Y, [["__scopeId", "data-v-94bb0de2"]]), G = ["aria-label"], H = { class: "b-secondary-nav__list" }, J = {}, K = /* @__PURE__ */ g({
|
|
41
41
|
...J,
|
|
@@ -45,7 +45,7 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
45
45
|
items: {}
|
|
46
46
|
},
|
|
47
47
|
setup(m) {
|
|
48
|
-
return (o,
|
|
48
|
+
return (o, d) => (a(), s("section", {
|
|
49
49
|
class: "b-secondary-nav-category",
|
|
50
50
|
"aria-label": o.label
|
|
51
51
|
}, [
|
|
@@ -90,10 +90,10 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
90
90
|
},
|
|
91
91
|
emits: ["change"],
|
|
92
92
|
setup(m, { emit: o }) {
|
|
93
|
-
const { t:
|
|
94
|
-
s:
|
|
95
|
-
}).smallerOrEqual("s"), l = m, p = o, b = u(() => l.items.some((e) => Object.hasOwn(e, "items"))),
|
|
96
|
-
const e =
|
|
93
|
+
const { t: d } = q({ messages: $ }), _ = U({
|
|
94
|
+
s: z
|
|
95
|
+
}).smallerOrEqual("s"), l = m, p = o, b = u(() => l.items.some((e) => Object.hasOwn(e, "items"))), v = u(() => l.items), r = u(() => {
|
|
96
|
+
const e = v.value[0];
|
|
97
97
|
return "items" in e ? e.items[0].value : e.value;
|
|
98
98
|
}), i = x(l.value ?? r.value), k = (e) => {
|
|
99
99
|
i.value = e, p("change", e);
|
|
@@ -107,14 +107,14 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
107
107
|
i.value = e;
|
|
108
108
|
}
|
|
109
109
|
), j(C, D), (e, ae) => (a(), s("nav", W, [
|
|
110
|
-
t(
|
|
110
|
+
t(_) ? (a(), y(t(F), {
|
|
111
111
|
key: 0,
|
|
112
|
-
"aria-label": t(
|
|
113
|
-
items:
|
|
112
|
+
"aria-label": t(d)("mobileDropdownAriaLabel"),
|
|
113
|
+
items: v.value,
|
|
114
114
|
"static-categories": b.value,
|
|
115
|
-
value: i.value,
|
|
116
|
-
|
|
117
|
-
}, null, 8, ["aria-label", "items", "static-categories", "value"])) : (a(), s("ul", X, [
|
|
115
|
+
"model-value": i.value,
|
|
116
|
+
"onUpdate:modelValue": k
|
|
117
|
+
}, null, 8, ["aria-label", "items", "static-categories", "model-value"])) : (a(), s("ul", X, [
|
|
118
118
|
(a(!0), s(B, null, N(e.items, (c) => (a(), s("li", {
|
|
119
119
|
key: c.label
|
|
120
120
|
}, [
|
|
@@ -131,8 +131,8 @@ const C = Symbol("secondary nav state"), R = ["aria-selected"], U = {}, Y = /* @
|
|
|
131
131
|
]))
|
|
132
132
|
]));
|
|
133
133
|
}
|
|
134
|
-
}), ie = /* @__PURE__ */ h(ee, [["__scopeId", "data-v-
|
|
134
|
+
}), ie = /* @__PURE__ */ h(ee, [["__scopeId", "data-v-7cc545aa"]]);
|
|
135
135
|
export {
|
|
136
136
|
ie as s
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=secondary-nav.
|
|
138
|
+
//# sourceMappingURL=secondary-nav.CAb20jWW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary-nav.CAb20jWW.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 :model-value=\"activeItemValue\"\n @update:model-value=\"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;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import { u as ee } from "./index.pdBj0KQU.js";
|
|
|
7
7
|
import { B as te } from "./dashed-underline.r62L_XBr.js";
|
|
8
8
|
import { B as oe } from "./info-icon.BhOm72U4.js";
|
|
9
9
|
import { B as N } from "./typography.yBEME_Gu.js";
|
|
10
|
-
import { B as A } from "./tag.
|
|
10
|
+
import { B as A } from "./tag.CjaB9DxL.js";
|
|
11
11
|
import { C as ne } from "./copy.ClKnDjMI.js";
|
|
12
12
|
import "../assets/summary-grid.css";
|
|
13
13
|
const ie = { class: "b-summary-grid" }, re = {}, le = /* @__PURE__ */ b({
|
|
@@ -487,4 +487,4 @@ export {
|
|
|
487
487
|
be as e,
|
|
488
488
|
Be as s
|
|
489
489
|
};
|
|
490
|
-
//# sourceMappingURL=summary-grid.types.
|
|
490
|
+
//# sourceMappingURL=summary-grid.types.cE1fyLvC.js.map
|
package/dist/chunks/{summary-grid.types.ByQ4u19J.js.map → summary-grid.types.cE1fyLvC.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary-grid.types.ByQ4u19J.js","sources":["../../../vue2/src/components/summary-grid/summary-grid.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../../vue2/src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = withDefaults(defineProps<BentoSummaryGridProps>(), {\n columnWidth: null,\n slashedZero: false,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n itemType: 'custom',\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <div v-if=\"secondaryLabel\" class=\"b-summary-grid-item-amount__secondary-label\">{{ secondaryLabel }}</div>\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemAmountProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryLabel: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemNumericProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemPercentageProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemTextProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemCustomProps>(), {\n copy: undefined,\n infoIconTooltipText: null,\n fitContent: false,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","props","__props","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"summary-grid.types.cE1fyLvC.js","sources":["../../../vue2/src/components/summary-grid/summary-grid.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../../vue2/src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = withDefaults(defineProps<BentoSummaryGridProps>(), {\n columnWidth: null,\n slashedZero: false,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n itemType: 'custom',\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <div v-if=\"secondaryLabel\" class=\"b-summary-grid-item-amount__secondary-label\">{{ secondaryLabel }}</div>\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemAmountProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryLabel: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemNumericProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemPercentageProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemTextProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits<{\n /**\n * Emitted when the copy button is clicked.\n */\n (e: 'copy-click', event: MouseEvent): void;\n\n /**\n * Emitted when the mouse pointer enters the info icon component.\n */\n (e: 'info-icon-mouseenter', event: MouseEvent): void;\n }>();\n\n withDefaults(defineProps<BentoSummaryGridItemCustomProps>(), {\n copy: undefined,\n infoIconTooltipText: null,\n fitContent: false,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","props","__props","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":"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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as b, useSlots as g, computed as o, withDirectives as h, createElementBlock as u, openBlock as i, unref as s, normalizeClass as E, createCommentVNode as x, createVNode as C, renderSlot as S, withCtx as y, createTextVNode as N, toDisplayString as R } from "vue";
|
|
2
|
+
import { B as k } from "./typography.yBEME_Gu.js";
|
|
3
|
+
import { b as w } from "./tooltip.Dp9_ESm_.js";
|
|
4
|
+
import { u as D } from "./aria-label.CaUURpnB.js";
|
|
5
|
+
import { g as n } from "./get-slot-text.CQRAP2_q.js";
|
|
6
|
+
import { _ as G } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import "../assets/tag.css";
|
|
8
|
+
var d = /* @__PURE__ */ ((t) => (t.GREY = "grey", t.BLUE = "blue", t.GREEN = "green", t.ORANGE = "orange", t.RED = "red", t.WHITE = "white", t))(d || {});
|
|
9
|
+
const T = ["aria-label"], A = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "b-tag__icon",
|
|
12
|
+
role: "presentation"
|
|
13
|
+
}, B = {
|
|
14
|
+
name: "bento-tag"
|
|
15
|
+
}, L = /* @__PURE__ */ b({
|
|
16
|
+
...B,
|
|
17
|
+
props: {
|
|
18
|
+
label: { default: null },
|
|
19
|
+
truncate: { default: null },
|
|
20
|
+
variant: { default: d.GREY }
|
|
21
|
+
},
|
|
22
|
+
setup(t) {
|
|
23
|
+
const e = t, l = g(), p = (r) => !!l[r], m = o(() => !!(e.label || n(l)("default"))), f = D({
|
|
24
|
+
label: e.label || n(l)("default"),
|
|
25
|
+
defaultFallback: "tag"
|
|
26
|
+
}), _ = o(() => ({
|
|
27
|
+
[`b-tag--${e.variant}`]: e.variant
|
|
28
|
+
})), a = o(() => e.label ?? n(l)("default") ?? "tag"), c = o(() => e.truncate && a.value.length > e.truncate), v = o(() => e.truncate && c.value ? `${a.value.slice(0, e.truncate)}...` : a.value);
|
|
29
|
+
return (r, $) => h((i(), u("span", {
|
|
30
|
+
"data-testid": "tag",
|
|
31
|
+
class: E(["b-tag", _.value]),
|
|
32
|
+
"aria-label": s(f)
|
|
33
|
+
}, [
|
|
34
|
+
m.value && p("icon") ? (i(), u("div", A, [
|
|
35
|
+
S(r.$slots, "icon", {}, void 0, !0)
|
|
36
|
+
])) : x("", !0),
|
|
37
|
+
C(s(k), {
|
|
38
|
+
class: "b-tag__label",
|
|
39
|
+
el: "span",
|
|
40
|
+
variant: "caption",
|
|
41
|
+
stronger: ""
|
|
42
|
+
}, {
|
|
43
|
+
default: y(() => [
|
|
44
|
+
N(R(v.value), 1)
|
|
45
|
+
]),
|
|
46
|
+
_: 1
|
|
47
|
+
})
|
|
48
|
+
], 10, T)), [
|
|
49
|
+
[s(w), c.value ? a.value : null]
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
}), U = /* @__PURE__ */ G(L, [["__scopeId", "data-v-9387c673"]]);
|
|
53
|
+
export {
|
|
54
|
+
U as B,
|
|
55
|
+
d as a
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=tag.CjaB9DxL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.CjaB9DxL.js","sources":["../../../vue2/src/components/tag/tag.types.ts","../../../vue2/src/components/tag/tag.vue"],"sourcesContent":["export interface BentoTagProps {\n /**\n * The label text content of the Tag.\n */\n label?: string;\n\n /**\n * The number of characters to limit the number of displayed characters for the tag text, truncating it with an ellipsis of three dots \"...\".\n */\n truncate?: number;\n\n /**\n * The variant variant of tag\n */\n variant?: BentoTagVariant | `${BentoTagVariant}`;\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTagVariant {\n GREY = 'grey',\n BLUE = 'blue',\n GREEN = 'green',\n ORANGE = 'orange',\n RED = 'red',\n WHITE = 'white',\n}\n","<template>\n <span\n v-bento-tooltip-directive=\"shouldShowTooltip ? textFromSlot : null\"\n data-testid=\"tag\"\n class=\"b-tag\"\n :class=\"tagConditionalClasses\"\n :aria-label=\"computedAriaLabel\"\n >\n <div v-if=\"hasTextContent && hasSlot('icon')\" class=\"b-tag__icon\" role=\"presentation\">\n <slot name=\"icon\"></slot>\n </div>\n <bento-typography class=\"b-tag__label\" el=\"span\" variant=\"caption\" stronger>\n {{ formattedText }}\n </bento-typography>\n </span>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n // Use relative paths otherwise the interface won't be correctly detected\n // TODO: Use alias once the support is added to work with the betterDefine macro\n import { type BentoTagProps, BentoTagVariant } from './tag.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const props = withDefaults(defineProps<BentoTagProps>(), {\n label: null,\n truncate: null,\n variant: BentoTagVariant.GREY,\n });\n\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 hasTextContent = computed(() => !!(props.label || getSlotText(slots)('default')));\n\n const computedAriaLabel = useAriaLabel({\n label: props.label || getSlotText(slots)('default'),\n defaultFallback: 'tag',\n });\n\n const tagConditionalClasses = computed(() => ({\n [`b-tag--${props.variant}`]: props.variant,\n }));\n\n const textFromSlot = computed(() => props.label ?? getSlotText(slots)('default') ?? 'tag');\n const shouldShowTooltip = computed(() => props.truncate && textFromSlot.value.length > props.truncate);\n\n const formattedText = computed(() => {\n if (!props.truncate) {\n return textFromSlot.value;\n }\n\n return shouldShowTooltip.value ? `${textFromSlot.value.slice(0, props.truncate)}...` : textFromSlot.value;\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n name: 'bento-tag',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./tag.scss\" />\n"],"names":["BentoTagVariant","BentoTagVariant2","__default__","props","__props","slots","useSlots","hasSlot","name","hasTextContent","computed","getSlotText","computedAriaLabel","useAriaLabel","tagConditionalClasses","textFromSlot","shouldShowTooltip","formattedText"],"mappings":";;;;;;;AAoBY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;;;;;GC2CRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;AAtCA,UAAAC,IAAAC,GAMAC,IAAAC,EAAA,GAIAC,IAAA,CAAAC,MAAA,CAAA,CAAAH,EAAAG,CAAA,GAEAC,IAAAC,EAAA,MAAA,CAAA,EAAAP,EAAA,SAAAQ,EAAAN,CAAA,EAAA,SAAA,EAAA,GAEAO,IAAAC,EAAA;AAAA,MAAuC,OAAAV,EAAA,SAAAQ,EAAAN,CAAA,EAAA,SAAA;AAAA,MACe,iBAAA;AAAA,IACjC,CAAA,GAGrBS,IAAAJ,EAAA,OAAA;AAAA,MAA8C,CAAA,UAAAP,EAAA,OAAA,EAAA,GAAAA,EAAA;AAAA,IACP,EAAA,GAGvCY,IAAAL,EAAA,MAAAP,EAAA,SAAAQ,EAAAN,CAAA,EAAA,SAAA,KAAA,KAAA,GACAW,IAAAN,EAAA,MAAAP,EAAA,YAAAY,EAAA,MAAA,SAAAZ,EAAA,QAAA,GAEAc,IAAAP,EAAA,MACIP,EAAA,YAIAa,EAAA,QAAA,GAAAD,EAAA,MAAA,MAAA,GAAAZ,EAAA,QAAA,CAAA,QAHIY,EAAA,KAGgG;;;;;;;;;;;;;;;;;;;;;;;;;"}
|