@adyen/bento-vue2 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.
Files changed (145) hide show
  1. package/dist/@types/index.d.ts +300 -35
  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/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/date-picker.css +1 -1
  9. package/dist/assets/date-range-picker.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown-default-textbox.css +1 -1
  12. package/dist/assets/dropdown-tag.css +1 -1
  13. package/dist/assets/dropdown.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/input-field-phone-number.css +1 -1
  17. package/dist/assets/input-field.css +1 -1
  18. package/dist/assets/inspector.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/pagination.css +1 -1
  21. package/dist/assets/payment-method.css +1 -1
  22. package/dist/assets/secondary-nav.css +1 -1
  23. package/dist/assets/sidepanel.css +1 -1
  24. package/dist/assets/tag.css +1 -1
  25. package/dist/assets/textarea.css +1 -1
  26. package/dist/assets/timeline-item.css +1 -1
  27. package/dist/checkbox.js +2 -2
  28. package/dist/chunks/{checkbox-group.CtNVRcmP.js → checkbox-group.C3RH5Gcg.js} +2 -2
  29. package/dist/chunks/{checkbox-group.CtNVRcmP.js.map → checkbox-group.C3RH5Gcg.js.map} +1 -1
  30. package/dist/chunks/{checkbox.nyUc0gLb.js → checkbox.itbBlXev.js} +3 -3
  31. package/dist/chunks/{checkbox.nyUc0gLb.js.map → checkbox.itbBlXev.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.DFf3KMSi.js → code-snippet.BEbA1bIn.js} +2 -2
  33. package/dist/chunks/{code-snippet.DFf3KMSi.js.map → code-snippet.BEbA1bIn.js.map} +1 -1
  34. package/dist/chunks/{currency.AvvbekWO.js → currency.Cwhzzxw2.js} +2 -2
  35. package/dist/chunks/{currency.AvvbekWO.js.map → currency.Cwhzzxw2.js.map} +1 -1
  36. package/dist/chunks/{data-grid.C07AmPwV.js → data-grid.B-kBw540.js} +7 -7
  37. package/dist/chunks/{data-grid.C07AmPwV.js.map → data-grid.B-kBw540.js.map} +1 -1
  38. package/dist/chunks/date-picker.CKaQJcPa.js +168 -0
  39. package/dist/chunks/date-picker.CKaQJcPa.js.map +1 -0
  40. package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
  41. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
  42. package/dist/chunks/date-range-picker.BtPxkPN0.js +942 -0
  43. package/dist/chunks/date-range-picker.BtPxkPN0.js.map +1 -0
  44. package/dist/chunks/{dropdown-default-textbox.yLeN0E2z.js → dropdown-default-textbox.BCOVaw-a.js} +10 -10
  45. package/dist/chunks/dropdown-default-textbox.BCOVaw-a.js.map +1 -0
  46. package/dist/chunks/dropdown-tag.BXMgDH3v.js +294 -0
  47. package/dist/chunks/dropdown-tag.BXMgDH3v.js.map +1 -0
  48. package/dist/chunks/{dropdown.RxD2TqnP.js → dropdown.-3x2IBDg.js} +305 -297
  49. package/dist/chunks/{dropdown.RxD2TqnP.js.map → dropdown.-3x2IBDg.js.map} +1 -1
  50. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  51. package/dist/chunks/{file-uploader.BGoCYrnw.js → file-uploader.BkTtqgvQ.js} +296 -295
  52. package/dist/chunks/{file-uploader.BGoCYrnw.js.map → file-uploader.BkTtqgvQ.js.map} +1 -1
  53. package/dist/chunks/{filter-bar.DVqgwt2p.js → filter-bar.BLnSnOlj.js} +201 -201
  54. package/dist/chunks/filter-bar.BLnSnOlj.js.map +1 -0
  55. package/dist/chunks/form-field.BBqLu-vs.js +10 -0
  56. package/dist/chunks/form-field.BBqLu-vs.js.map +1 -0
  57. package/dist/chunks/get-slot-text.Bjb9dTSV.js +12 -0
  58. package/dist/chunks/get-slot-text.Bjb9dTSV.js.map +1 -0
  59. package/dist/chunks/{header-with-views.jnhILkoQ.js → header-with-views.C6Y7mAkq.js} +3 -3
  60. package/dist/chunks/{header-with-views.jnhILkoQ.js.map → header-with-views.C6Y7mAkq.js.map} +1 -1
  61. package/dist/chunks/{input-field-password.CHn2GUcL.js → input-field-password.sthICA2L.js} +3 -3
  62. package/dist/chunks/{input-field-password.CHn2GUcL.js.map → input-field-password.sthICA2L.js.map} +1 -1
  63. package/dist/chunks/{input-field-phone-number.CpnfVw6w.js → input-field-phone-number.BjinuvOl.js} +5 -5
  64. package/dist/chunks/{input-field-phone-number.CpnfVw6w.js.map → input-field-phone-number.BjinuvOl.js.map} +1 -1
  65. package/dist/chunks/{input-field.sGmuIXiw.js → input-field.CwKD3p3q.js} +34 -34
  66. package/dist/chunks/input-field.CwKD3p3q.js.map +1 -0
  67. package/dist/chunks/link.D8qpqg3W.js.map +1 -1
  68. package/dist/chunks/{listbox-option-tag.Dl8GwHLT.js → listbox-option-tag.DkPz3wPc.js} +2 -2
  69. package/dist/chunks/{listbox-option-tag.Dl8GwHLT.js.map → listbox-option-tag.DkPz3wPc.js.map} +1 -1
  70. package/dist/chunks/{pagination.C0YW_A_o.js → pagination.BzyyZJy6.js} +7 -7
  71. package/dist/chunks/pagination.BzyyZJy6.js.map +1 -0
  72. package/dist/chunks/{payment-method.DtvfUnit.js → payment-method.CcASYR3B.js} +12 -12
  73. package/dist/chunks/payment-method.CcASYR3B.js.map +1 -0
  74. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  75. package/dist/chunks/{radio-group.AcYMFudv.js → radio-group.B8ukv-pw.js} +3 -3
  76. package/dist/chunks/{radio-group.AcYMFudv.js.map → radio-group.B8ukv-pw.js.map} +1 -1
  77. package/dist/chunks/{rich-text-editor.eYW8X_YP.js → rich-text-editor.DzH-Z5oi.js} +2 -2
  78. package/dist/chunks/{rich-text-editor.eYW8X_YP.js.map → rich-text-editor.DzH-Z5oi.js.map} +1 -1
  79. package/dist/chunks/{search-bar.D8SJsbze.js → search-bar.CgzPXP8r.js} +3 -3
  80. package/dist/chunks/{search-bar.D8SJsbze.js.map → search-bar.CgzPXP8r.js.map} +1 -1
  81. package/dist/chunks/{secondary-nav.BFiTQaag.js → secondary-nav.3eZKyb8K.js} +4 -4
  82. package/dist/chunks/secondary-nav.3eZKyb8K.js.map +1 -0
  83. package/dist/chunks/{summary-grid.types.B80533d1.js → summary-grid.types.CaYrtyVO.js} +2 -2
  84. package/dist/chunks/{summary-grid.types.B80533d1.js.map → summary-grid.types.CaYrtyVO.js.map} +1 -1
  85. package/dist/chunks/tag.BltIbSh3.js +44 -0
  86. package/dist/chunks/tag.BltIbSh3.js.map +1 -0
  87. package/dist/chunks/textarea.h-WF62HP.js +173 -0
  88. package/dist/chunks/textarea.h-WF62HP.js.map +1 -0
  89. package/dist/chunks/{timeline-item.CZBuknZ_.js → timeline-item.BLhS7uNF.js} +5 -5
  90. package/dist/chunks/timeline-item.BLhS7uNF.js.map +1 -0
  91. package/dist/chunks/{toggle.BJMXpHRu.js → toggle.D2wmNu7m.js} +2 -2
  92. package/dist/chunks/{toggle.BJMXpHRu.js.map → toggle.D2wmNu7m.js.map} +1 -1
  93. package/dist/code-snippet.js +1 -1
  94. package/dist/currency.js +1 -1
  95. package/dist/data-grid.js +1 -1
  96. package/dist/date-picker.js +7 -6
  97. package/dist/date-picker.js.map +1 -1
  98. package/dist/date-range-picker.js +1 -1
  99. package/dist/dropdown.js +3 -3
  100. package/dist/file-uploader.js +1 -1
  101. package/dist/filter-bar.js +1 -1
  102. package/dist/header-with-views.js +1 -1
  103. package/dist/index.js +247 -246
  104. package/dist/index.js.map +1 -1
  105. package/dist/input-field-password.js +1 -1
  106. package/dist/input-field-phone-number.js +1 -1
  107. package/dist/input-field.js +1 -1
  108. package/dist/internal.js +1 -1
  109. package/dist/pagination.js +1 -1
  110. package/dist/payment-method.js +1 -1
  111. package/dist/radio-group.js +1 -1
  112. package/dist/rich-text-editor.js +1 -1
  113. package/dist/search-bar.js +2 -2
  114. package/dist/secondary-nav.js +1 -1
  115. package/dist/styles/bento-dark.css +4 -0
  116. package/dist/styles/bento-light.css +4 -0
  117. package/dist/styles/bento.css +4 -0
  118. package/dist/styles/legacy.css +4 -0
  119. package/dist/styles/styleguide.css +4 -0
  120. package/dist/summary-grid.js +1 -1
  121. package/dist/tag.js +1 -1
  122. package/dist/textarea.js +1 -1
  123. package/dist/timeline.js +1 -1
  124. package/dist/toggle.js +1 -1
  125. package/dist/web-types.json +144 -6
  126. package/package.json +6 -6
  127. package/dist/chunks/date-picker.DImAYvoM.js +0 -158
  128. package/dist/chunks/date-picker.DImAYvoM.js.map +0 -1
  129. package/dist/chunks/date-range-picker.NAG_5i8I.js +0 -914
  130. package/dist/chunks/date-range-picker.NAG_5i8I.js.map +0 -1
  131. package/dist/chunks/dropdown-default-textbox.yLeN0E2z.js.map +0 -1
  132. package/dist/chunks/dropdown-tag.CpvU8eSZ.js +0 -260
  133. package/dist/chunks/dropdown-tag.CpvU8eSZ.js.map +0 -1
  134. package/dist/chunks/filter-bar.DVqgwt2p.js.map +0 -1
  135. package/dist/chunks/get-slot-text.BQS5Olxm.js +0 -12
  136. package/dist/chunks/get-slot-text.BQS5Olxm.js.map +0 -1
  137. package/dist/chunks/input-field.sGmuIXiw.js.map +0 -1
  138. package/dist/chunks/pagination.C0YW_A_o.js.map +0 -1
  139. package/dist/chunks/payment-method.DtvfUnit.js.map +0 -1
  140. package/dist/chunks/secondary-nav.BFiTQaag.js.map +0 -1
  141. package/dist/chunks/tag.BwKc2d2E.js +0 -44
  142. package/dist/chunks/tag.BwKc2d2E.js.map +0 -1
  143. package/dist/chunks/textarea.CIQuLWQ8.js +0 -165
  144. package/dist/chunks/textarea.CIQuLWQ8.js.map +0 -1
  145. package/dist/chunks/timeline-item.CZBuknZ_.js.map +0 -1
@@ -1,12 +0,0 @@
1
- import "./index.Cl4_42j5.js";
2
- const n = (r, i) => {
3
- var t;
4
- return i > 5 ? "" : Array.isArray(r) ? r != null && r[0].text ? r == null ? void 0 : r[0].text : n((t = r == null ? void 0 : r[0]) == null ? void 0 : t.children, i + 1) : r == null ? void 0 : r.text;
5
- }, u = (r) => (i) => {
6
- var t;
7
- return n((t = r[i]) == null ? void 0 : t.call(r), 1);
8
- };
9
- export {
10
- u as g
11
- };
12
- //# sourceMappingURL=get-slot-text.BQS5Olxm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-slot-text.BQS5Olxm.js","sources":["../../src/utils/ts/get-slot-text/get-slot-text.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi';\nimport type { Slots } from 'vue/types/v3-setup-context';\n\n// TODO: remove these types when vue 2 support has been removed\ntype vue2VNode = { text?: string; children?: vue2VNode };\n\nconst getTextFromChildren = (vNode: Array<vue2VNode> | vue2VNode, nestedLevel: number): string => {\n // We should not be checking for slot text more than 5 layers. If we are end the recursion.\n if (nestedLevel > 5) {\n return '';\n }\n if (Array.isArray(vNode)) {\n if (isVue2 && (vNode as Array<vue2VNode>)?.[0].text) {\n return vNode?.[0].text;\n }\n return getTextFromChildren(vNode?.[0]?.children, nestedLevel + 1);\n }\n return isVue2 ? (vNode as vue2VNode)?.text : vNode?.toString();\n};\n\n/**\n * Get text recursively from slot by giving slot name.\n * This recursion will only occur 5 times before the method gives up and returns an empty string.\n * @param slots - the slots provided the the component's setup function\n * @returns A function who's first parameter is the name of the slot.\n */\nexport const getSlotText = (slots: Slots) => (name: string) =>\n getTextFromChildren(slots[name]?.() as Array<vue2VNode> | vue2VNode, 1);\n\nexport default getSlotText;\n"],"names":["getTextFromChildren","vNode","nestedLevel","_a","getSlotText","slots","name"],"mappings":";AAMA,MAAMA,IAAsB,CAACC,GAAqCC,MAAgC;;AAE9F,SAAIA,IAAc,IACP,KAEP,MAAM,QAAQD,CAAK,IACJA,KAAA,QAAAA,EAA6B,GAAG,OACpCA,KAAA,gBAAAA,EAAQ,GAAG,OAEfD,GAAoBG,IAAAF,KAAA,gBAAAA,EAAQ,OAAR,gBAAAE,EAAY,UAAUD,IAAc,CAAC,IAEnDD,KAAA,gBAAAA,EAAqB;AAC1C,GAQaG,IAAc,CAACC,MAAiB,CAACC,MAAA;;AAC1C,SAAAN,GAAoBG,IAAAE,EAAMC,OAAN,gBAAAH,EAAA,KAAAE,IAAiD,CAAC;AAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-field.sGmuIXiw.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = BentoDropdownProps;\nexport type BentoInputDropdownProps = {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n /**\n * List of available items\n */\n items: DropdownProps['items'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: DropdownProps['readonly'];\n /**\n * Selected value of the dropdown\n */\n value?: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Text that labels an the input element\n *\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n ariaLabel?: string;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `aria-label`: Text that labels the dropdown element\n * - `dynamicFiltering`: Enables dynamic filtering\n * - `items`: List of available items\n * - `readonly`: Sets the dropdown in read-only mode\n * - `value`: Selected value of the dropdown\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error?: boolean;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldValue;\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n ariaHidden: { type: Boolean, default: true },\n ariaLabel: { default: undefined },\n condensed: { type: Boolean, default: false },\n dropdown: { default: undefined },\n dropdownPosition: { default: BentoInputFieldElementPosition.START },\n error: { type: Boolean, default: false },\n slashedZero: { type: Boolean, default: false },\n staticValue: { default: '' },\n staticValuePosition: { default: BentoInputFieldElementPosition.START },\n type: { default: BentoInputFieldType.TEXT },\n value: { default: undefined },\n variant: { default: BentoInputFieldVariant.DEFAULT }\n});\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: computedLabel.value || computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","isDropdownReadOnly","computed","_a","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","focus","expose","inputFieldParentComponent","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAMY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAqCAE,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,UAAA,WARQA,IAAAD,MAAA,CAAA,CAAA;;;;;;GC2WRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzOAC,IAAAC,GAAA,GACAC,IAAAC,GAAA,GA4BA,EAAA,GAAAC,EAAA,IAAAC,GAAA,GACAC,IAAAC,GAAAL,CAAA,GACAM,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAC,EAAA,OAAA,GACAC,IAAAD,EAAA,gBAAA,GACAE,IAAAF,EAAA,oBAAA,GACAG,IAAAH,EAAA,mBAAA,GACAI,IAAAJ,EAAA,aAAA,GACAK,IAAAR,EAAA,EAAA;AAGA,IAAA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AA,YAAA,CAAAH,EAAA,SACIF,EAAA,SAAAkC,EAAA;AAAA,IACJ,GAGJC,KAAA,CAAAC,MAAA;AACI,MAAApC,EAAA,kBAAAoC,CAAA,GACApC,EAAA,mBAAA,EAAA,GAAAK,KAAA,gBAAAA,EAAA,UAAA,OAAA+B,EAAA,CAAA;AAAA,IAAoE,GAGxEC,IAAA,MAAA;AACI,MAAArD,EAAA,MAAA,MAAA;AAAA,IAA8B,GAGlCsD,IAAA,MAAA;AACI,MAAAjC,EAAA,YAAA,aACInB,EAAA,MAAA,MAAA,IAEAmD,EAAA;AAAA,IACJ;AAIJ,IAAAE,EAAA;AAAA,MAAa,YAAAF;AAAA,MACT,OAAAC;AAAA,IACA,CAAA;AAGJ,UAAAE,IAAA3C,EAAA4C,IAAA,EAAA;AAEA,WAAA,CAAA,OAAA,OAAAvE,CAAA,EAAA,SAAAmC,EAAA,IAAA,KAAA,CAAAmC,MACInC,EAAA,SAAA,QACIqC;AAAA,MAAA,2DAAArC,EAAA,IAAA;AAAA,IACyE,IACzEA,EAAA,SAAA,aAEAqC;AAAA,MAAA,2DAAArC,EAAA,IAAA;AAAA,IACyE,IAGzEqC,EAAA,2DAAArC,EAAA,IAAA,GAAA,IAORA,EAAA,SACIsC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIR7D,EAAA,mBAAA,KACI6D;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.C0YW_A_o.js","sources":["../../src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue","../../src/components/pagination/components/pagination-context/pagination-context.vue","../../../ui-assets/icons-16/dist/vue/skip-left.vue","../../../ui-assets/icons-16/dist/vue/skip-right.vue","../../../ui-assets/icons-16/dist/vue/chevron-left-small.vue","../../../ui-assets/icons-16/dist/vue/chevron-right-small.vue","../../src/components/pagination/components/pagination-controls/pagination-controls.vue","../../src/components/pagination/pagination.vue"],"sourcesContent":["<template>\n <div class=\"b-pagination-results-per-page\">\n <bento-typography el=\"div\">\n <component\n :is=\"i18nComponent\"\n v-bind=\"getI18nProps(translationPathKey)\"\n class=\"b-pagination-results-per-page__dropdown-container\"\n tag=\"div\"\n :plural=\"totalCount\"\n >\n <template #itemCount>\n <bento-dropdown\n :id=\"dropdownId\"\n :aria-label=\"t(translationPathKey, { itemCount: itemsPerPage, totalCount })\"\n class=\"b-pagination-results-per-page__dropdown\"\n condensed\n :items=\"predefinedDropdownOptions\"\n :value=\"itemsPerPage\"\n @input=\"onSelectChange\"\n />\n </template>\n <template v-if=\"!!totalCount\" #totalCount>{{ totalCount }}</template>\n </component>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoDropdown } from '@/components/dropdown';\n import { generateUid } from '@/core/utils/ts';\n import { getI18nComponent, getI18nProps, useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n itemsPerPage: { default: 50 },\n totalCount: { default: null }\n});\n\n const emit = defineEmits([\"select\"]);\n\n const dropdownId = generateUid('b-pagination-context-number-elements');\n const predefinedDropdownOptions = computed(() => [\n { label: n(10), value: 10 },\n { label: n(20), value: 20 },\n { label: n(50), value: 50 },\n { label: n(75), value: 75 },\n { label: n(100), value: 100 },\n ]);\n const i18nComponent = getI18nComponent();\n\n const onSelectChange = (selectedNumberOfResults: number) => {\n emit('select', selectedNumberOfResults);\n };\n\n const translationPathKey = computed(() => (props.totalCount ? 'showingItemsWithTotal' : 'showingItems'));\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-results-per-page.scss\" />\n","<template>\n <div class=\"b-pagination-context\">\n <bento-typography v-if=\"totalPages > 1\" el=\"div\">\n <component :is=\"i18nComponent\" v-bind=\"getI18nProps('pageNumber')\" tag=\"div\">\n <template #page>\n <bento-dropdown\n :id=\"dropdownId\"\n :aria-label=\"t('pageNumber', { page: n(page) })\"\n class=\"b-pagination-context__dropdown\"\n condensed\n :items=\"listOfAvailablePages\"\n :value=\"page\"\n :virtual-scroll=\"virtualScroll\"\n @input=\"onPageSelectChange\"\n />\n </template>\n </component>\n </bento-typography>\n <bento-typography v-else-if=\"totalPages === 1\" el=\"span\">\n {{ t('pageOneOfOne') }}\n </bento-typography>\n <bento-typography v-else el=\"span\">\n {{ t('pageNumber', { page: n(page) }) }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoDropdown } from '@/components/dropdown';\n import { type BentoListboxOptionItem } from '@/types/listbox';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n import { getI18nComponent, getI18nProps, useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n page: { default: 1 },\n totalPages: { default: null },\n virtualScroll: { type: Boolean, default: false }\n});\n const emit = defineEmits([\"page-selected\"]);\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n const dropdownId = generateUid('bento-pagination-context-current-page');\n const onPageSelectChange = (selectedPage: string | number) => emit('page-selected', selectedPage);\n const i18nComponent = getI18nComponent();\n\n // Generate a list of pages from 1 to \"totalPages\"\n const transformIntoOption = (value: number): BentoListboxOptionItem => ({\n label: n(value),\n value,\n });\n const transformToPageNumber = (_, index) => index + 1;\n const listOfAvailablePages = computed(() =>\n Array.from(new Array(props.totalPages), transformToPageNumber).map(transformIntoOption)\n );\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-context.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M9.06055 8.00011L12.0605 5.00011L10.9999 3.93945L6.93923 8.00011L10.9999 12.0608L12.0605 11.0001L9.06055 8.00011Z\"/><path fill=\"#001222\" d=\"M4.25 4.25L4.25 11.75H5.75L5.75 4.25L4.25 4.25Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M6.93945 7.99962L3.93945 10.9996L5.00011 12.0603L9.06077 7.99963L5.00011 3.93896L3.93945 4.99963L6.93945 7.99962Z\"/><path fill=\"#001222\" d=\"M11.75 11.7497V4.24974L10.25 4.24974V11.7497H11.75Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10.5608 5.00011L7.56077 8.00011L10.5608 11.0001L9.50011 12.0608L5.43945 8.00011L9.50011 3.93945L10.5608 5.00011Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M5.43924 10.9999L8.43924 7.99989L5.43924 4.99989L6.4999 3.93923L10.5606 7.99989L6.4999 12.0605L5.43924 10.9999Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <ul class=\"b-pagination-controls\">\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the first page -->\n <bento-button :disabled=\"isCurrentPageFirst\" variant=\"tertiary\" condensed @click=\"navigate(1)\">\n <template #iconLeft>\n <skip-left :svg-title=\"t('navigateToTheFirstPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the previous page -->\n <bento-button :disabled=\"isCurrentPageFirst\" variant=\"tertiary\" condensed @click=\"navigate(page - 1)\">\n <template #iconLeft>\n <chevron-left :svg-title=\"t('navigateToThePreviousPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the next page -->\n <bento-button :disabled=\"isNextButtonDisabled\" variant=\"tertiary\" condensed @click=\"navigate(page + 1)\">\n <template #iconLeft>\n <chevron-right :svg-title=\"t('navigateToTheNextPage')\" />\n </template>\n </bento-button>\n </li>\n <li class=\"b-pagination-controls__item\">\n <!-- Navigate to the last page -->\n <bento-button\n :disabled=\"isLastPageButtonDisabled\"\n variant=\"tertiary\"\n condensed\n @click=\"navigate(totalPages)\"\n >\n <template #iconLeft>\n <skip-right :svg-title=\"t('navigateToTheLastPage')\" />\n </template>\n </bento-button>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoButton } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import SkipLeft from '@adyen/ui-assets-icons-16/vue/skip-left';\n import SkipRight from '@adyen/ui-assets-icons-16/vue/skip-right';\n import ChevronLeft from '@adyen/ui-assets-icons-16/vue/chevron-left-small';\n import ChevronRight from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n hasNext: { type: Boolean, default: null },\n page: null,\n totalPages: { default: null }\n});\n\n const emit = defineEmits([\"navigate\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const isCurrentPageFirst = computed(() => props.page === 1);\n const isCurrentPageLast = computed(() => props.page === props.totalPages);\n const isNextButtonDisabled = computed(() => {\n const hasNoNextPage = !props.hasNext;\n return hasNoNextPage || isCurrentPageLast.value;\n });\n const isLastPageButtonDisabled = computed(() => {\n const hasNoNextPage = !props.hasNext;\n const hasNoTotalPagesNumber = !props.totalPages;\n\n return hasNoNextPage || isCurrentPageLast.value || hasNoTotalPagesNumber;\n });\n\n const navigate = (pageArg: number) => {\n emit('navigate', pageArg);\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination-controls.scss\" />\n","<template>\n <div class=\"b-pagination\">\n <nav :aria-label=\"computedAriaLabel\" class=\"b-pagination__navigation\" :class=\"navigationConditionalClasses()\">\n <bento-pagination-results-per-page\n v-if=\"!hidePageSize\"\n class=\"b-pagination__results-per-page\"\n :items-per-page=\"size\"\n :total-count=\"totalCount\"\n @select=\"onItemsPerPageChange\"\n />\n <bento-typography v-else-if=\"hasSlot('default')\"><slot /></bento-typography>\n\n <div class=\"b-pagination__page-navigator\">\n <bento-pagination-context\n class=\"b-pagination__context\"\n :total-pages=\"totalPages\"\n :page=\"page\"\n :total-count=\"totalCount\"\n :virtual-scroll=\"virtualScroll\"\n @page-selected=\"onPageSelected\"\n />\n\n <div class=\"b-pagination__divider\"></div>\n\n <bento-pagination-controls\n class=\"b-pagination__controls\"\n :has-next=\"hasNext\"\n :page=\"page\"\n :total-pages=\"totalPages\"\n @navigate=\"navigate\"\n />\n </div>\n </nav>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRefs, useAttrs, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import BentoPaginationResultsPerPage from './components/pagination-results-per-page/pagination-results-per-page.vue';\n import BentoPaginationContext from './components/pagination-context/pagination-context.vue';\n import BentoPaginationControls from './components/pagination-controls/pagination-controls.vue';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useHasSlot } from '@/composables';\n import type { BentoPaginationProps } from './pagination.types';\n\n const props = defineProps({\n ariaLabel: { default: null },\n hasNext: { type: Boolean, default: null },\n hidePageSize: { type: Boolean, default: false },\n page: { default: 1 },\n size: { default: 20 },\n totalCount: { default: null },\n virtualScroll: { type: Boolean, default: false }\n});\n\n const emit = defineEmits([\"navigate\", \"items-page\", \"update:page\", \"update:size\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const attrs = useAttrs();\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n });\n\n const totalPages = computed(() =>\n !props.totalCount || !props.size ? null : Math.ceil(props.totalCount / props.size)\n );\n\n const navigate = (pageArg: number, itemsPerPage?: number) => {\n if (props.hidePageSize) {\n emit('navigate', pageArg);\n } else {\n emit('navigate', pageArg, itemsPerPage ?? props?.size);\n }\n emit('update:page', pageArg);\n };\n\n const onPageSelected = (pageNumber: number) => {\n navigate(pageNumber);\n };\n\n const onItemsPerPageChange = (elements: number) => {\n emit('items-page', elements);\n emit('update:size', elements);\n\n // Always go to first page when the\n // number of items page changes\n navigate(1, elements);\n };\n\n const navigationConditionalClasses = () => ({\n 'b-pagination__navigation--only-page-navigator': !hasSlot('default') && props.hidePageSize,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Paginiation component to help users page through data sets.\n *\n * There are two ways of doing navigation in this component:\n * 1. (Basic) You tell the component if there is a next page (hasNext)\n * 2. (Enhanced) You tell the component:\n * - How many total items exist (totalCount)\n * - The max number of items that you show/fetch per page (size)\n * - In this case you should not set the hasNext props\n *\n * If you have the data available and opt to use the Enhanced way you get extra controls:\n * - Page dropdown selector\n * - Last page button\n * - \"Showing 10 of 200 items\" text\n *\n * @usage\n * import { BentoPagination } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoPagination },\n * template: `\n * <bento-pagination :has-next=\"isNextPage\" />\n * `,\n * }\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./pagination.scss\" />\n"],"names":["__default__$3","messages$2","t","useI18n","dropdownId","generateUid","predefinedDropdownOptions","computed","i18nComponent","getI18nComponent","onSelectChange","selectedNumberOfResults","emit","translationPathKey","props","__default__$2","messages$1","onPageSelectChange","selectedPage","transformIntoOption","value","transformToPageNumber","_","index","listOfAvailablePages","uuid$3","_sfc_main$5","uuid$2","_sfc_main$4","uuid$1","_sfc_main$3","uuid","_sfc_main$2","__default__$1","messages","isCurrentPageFirst","isCurrentPageLast","isNextButtonDisabled","isLastPageButtonDisabled","hasNoNextPage","hasNoTotalPagesNumber","pageArg","__default__","slots","useSlots","hasSlot","useHasSlot","attrs","useAttrs","ariaLabelAttribute","ref","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","totalPages","navigate","itemsPerPage","pageNumber","elements"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBA7BA,EAAA,GAAAC,GAAA,EAAA,IAAAC,EAAA,GASAC,IAAAC,EAAA,sCAAA,GACAC,IAAAC,EAAA,MAAA;AAAA,MAAiD,EAAA,OAAA,EAAA,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,EAAA,eACIF,EAAA,YAAA6B,CAAA,IAEA7B,EAAA,YAAA6B,GAAAgB,MAAA3C,KAAA,gBAAAA,EAAA,KAAA,GAEJF,EAAA,eAAA6B,CAAA;AAAA,IAA2B;kLAG/B,CAAAiB,MAAA;AACI,MAAAF,EAAAE,CAAA;AAAA,IAAmB,yBAGvB,CAAAC,MAAA;AACI,MAAA/C,EAAA,cAAA+C,CAAA,GACA/C,EAAA,eAAA+C,CAAA,GAIAH,EAAA,GAAAG,CAAA;AAAA,IAAoB,iCAGxB,OAAA;AAAA,MAA4C,iDAAA,CAAAd,EAAA,SAAA,KAAA/B,EAAA;AAAA,IACsC;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-method.DtvfUnit.js","sources":["../../src/components/payment-method/composables/use-payment-icon/use-payment-icon.ts","../../../ui-assets/icons-pm/dist/vue/unknowncard.vue","../../src/components/payment-method/payment-method.vue"],"sourcesContent":["import { ref, type Ref, watch } from 'vue';\n\n/**\n * Generates the payment icon URl from a payment icons string.\n * @param paymentType - the payment icon you wish to generate a URL for.\n * @returns the payment icon URL to the SVG for a specific payment icon.\n */\nexport const paymentMethodToCdnUrl = (paymentType: string) =>\n `https://checkoutshopper-live.cdn.adyen.com/checkoutshopper/images/logos/${paymentType}.svg`;\n/**\n * Dynamically retrieves the payment method icon SVG from the @adyen/ui-assets-payment-method-icons package.\n *\n * @param type the type of payment method\n * @param useFallback if fallback icon should be used in case of error\n * @returns\n */\nexport const usePaymentIcon = (type: Ref<string>) => {\n const paymentType = ref(type);\n const paymentIconSrc = ref<string>();\n\n watch(\n paymentType,\n newPaymentType => {\n if (newPaymentType == null || newPaymentType === 'Unknowncard') {\n return;\n }\n // TODO: what about when to use checkoutshopper-test? Should we add this to the config of Bento?\n paymentIconSrc.value = paymentMethodToCdnUrl(newPaymentType);\n },\n { immediate: true }\n );\n\n return paymentIconSrc;\n};\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-pm\" xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g :clip-path=\"'url(#uia-ui-assets/icons-pm-unknowncard__a' + uuid + ')'\"><path fill=\"#fff\" d=\"M0 0H40V26H0V0Z\"/><path fill=\"#00112C\" d=\"M32 9V8C32 7.20435 31.6839 6.44129 31.1213 5.87868C30.5587 5.31607 29.7956 5 29 5H11C10.2044 5 9.44129 5.31607 8.87868 5.87868C8.31607 6.44129 8 7.20435 8 8V9H32Z\"/><path fill=\"#00112C\" d=\"M8 12V18C8 18.7956 8.31607 19.5587 8.87868 20.1213C9.44129 20.6839 10.2044 21 11 21H29C29.7956 21 30.5587 20.6839 31.1213 20.1213C31.6839 19.5587 32 18.7956 32 18V12H8Z\"/><rect width=\"5\" height=\"2\" x=\"24\" y=\"16\" fill=\"#fff\" rx=\".5\"/></g><defs><clipPath :id=\"'uia-ui-assets/icons-pm-unknowncard__a' + uuid\"><rect width=\"40\" height=\"26\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <div class=\"b-payment-method\">\n <div class=\"b-payment-method__icon-container\">\n <img\n v-if=\"type !== 'Unknowncard' && !hasErroredOnImage\"\n aria-hidden=\"true\"\n class=\"b-payment-method__icon\"\n :class=\"conditionalIconClasses\"\n :alt=\"label\"\n :src=\"paymentMethodIconSrc\"\n @error=\"onSrcError\"\n />\n <unknown-card-icon v-else :svg-title=\"label\" aria-hidden=\"true\" />\n </div>\n <div class=\"b-payment-method__label\">\n <span v-if=\"isSummaryGridLayout\">{{ label }}</span>\n <bento-typography v-else el=\"span\">{{ label }}</bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SUMMARY_GRID_LAYOUT_INJECTION_KEY } from '@/components/summary-grid/summary-grid.keys';\n import { type BentoSummaryGridLayout } from '@/components/summary-grid';\n import { usePaymentIcon } from './composables/use-payment-icon/use-payment-icon';\n import type { BentoPaymentMethodProps } from './payment-method.types';\n import UnknownCardIcon from '@adyen/ui-assets-payment-method-icons/vue/unknowncard';\n\n const props = defineProps({\n label: null,\n small: { type: Boolean, default: false },\n type: { default: 'Unknowncard' }\n});\n const type = toRef(props, 'type');\n const hasErroredOnImage = ref(false);\n const paymentMethodIconSrc = usePaymentIcon(type);\n const conditionalIconClasses = computed(() => ({\n 'b-payment-method__icon--small': props.small,\n }));\n\n /* == Summary-grid styles == */\n const registerPaymentMethodInSummaryGrid: BentoSummaryGridLayout = inject(\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n () => ({\n isSummaryGridLayout: false,\n })\n );\n\n const { isSummaryGridLayout } = registerPaymentMethodInSummaryGrid();\n\n /**\n * This funciton is fired if the payment image source is not valid and has thrown an error.\n */\n const onSrcError = () => {\n hasErroredOnImage.value = true;\n };\n\n // Reset the image error to be able to load the new payment type\n watch(\n () => type.value,\n (newType, oldType) => {\n if (newType !== oldType) {\n hasErroredOnImage.value = false;\n }\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A payment method type component to display the type's icon and label.\n *\n * @example\n * import { BentoPaymentMethod} from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoPaymentMethod },\n * template: `\n * <bento-payment-method type=\"ideal\" />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-payment-method',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./payment-method.scss\" />\n"],"names":["paymentMethodToCdnUrl","paymentType","usePaymentIcon","type","ref","paymentIconSrc","watch","newPaymentType","uuid","_sfc_main$1","__default__","defineComponent","toRef","props","hasErroredOnImage","paymentMethodIconSrc","conditionalIconClasses","computed","registerPaymentMethodInSummaryGrid","inject","SUMMARY_GRID_LAYOUT_INJECTION_KEY","isSummaryGridLayout","onSrcError","newType","oldType"],"mappings":";;;;;AAOO,MAAAA,IAAA,CAAAC,MAAA,2EAAAA,CAAA,QASMC,IAAA,CAAAC,MAAA;AACT,QAAAF,IAAAG,EAAAD,CAAA,GACAE,IAAAD,EAAA;AAEA,SAAAE;AAAA,IAAAL;AAAA,IACI,CAAAM,MAAA;AAEI,MAAAA,KAAA,QAAAA,MAAA,kBAIAF,EAAA,QAAAL,EAAAO,CAAA;AAAA,IAA2D;AAAA,IAC/D,EAAA,WAAA,GAAA;AAAA,EACkB,GAGtBF;AACJ;AC1BA,IAAAG,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;qBCsEIE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;iBAnDAR,IAAAS,EAAAC,GAAA,MAAA,GACAC,IAAAV,EAAA,EAAA,GACAW,IAAAb,EAAAC,CAAA,GACAa,IAAAC,EAAA,OAAA;AAAA,MAA+C,iCAAAJ,EAAA;AAAA,IACJ,EAAA,GAI3CK,IAAAC;AAAA,MAAmEC;AAAA,MAC/D,OAAA;AAAA,QACO,qBAAA;AAAA,MACkB;AAAA,IACzB,GAGJ,EAAA,qBAAAC,EAAA,IAAAH,EAAA,GAKAI,IAAA,MAAA;AACI,MAAAR,EAAA,QAAA;AAAA,IAA0B;AAI9B,WAAAR;AAAA,MAAA,MAAAH,EAAA;AAAA,MACe,CAAAoB,GAAAC,MAAA;AAEP,QAAAD,MAAAC,MACIV,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"secondary-nav.BFiTQaag.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" :aria-selected=\"isItemSelected\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps({\n label: null,\n value: null\n});\n\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': isItemSelected.value,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { type BentoSecondaryNavItems, type BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null\n});\n\n const emit = defineEmits([\"change\"]);\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","isItemSelected","computed","props","conditionalClasses","e","emit","__default__$1","__default__","messages","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,GCmCTC,IAAA,CAAA;;;;;;;;;iBAzBA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAOAK,IAAAC,EAAA,MAAAJ,EAAA,UAAAK,EAAA,KAAA,GAEAC,IAAAF,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA;4IAKnD,CAAAI,MAAA;AACI,MAAAC,EAAA,SAAAD,CAAA,GACAN,EAAAI,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;qBCFrCI,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC+EAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBA1EA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,GAGPC,IAAAH,EAAA,eAAA,GAAA,GAQAI,IAAAb,EAAA,MAAAC,EAAA,MAAA,KAAA,CAAAa,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAf,EAAA,MAAAC,EAAA,KAAA,GAEAe,IAAAhB,EAAA,MAAA;AACI,YAAAiB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJrB,IAAAsB,EAAAjB,EAAA,SAAAe,EAAA,KAAA,GACAnB,IAAA,CAAAsB,MAAA;AACI,MAAAvB,EAAA,QAAAuB,GACAf,EAAA,UAAAe,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAAzB,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAAyB;AAAA,MAAA,MAAArB,EAAA;AAAA,MACgB,CAAAkB,MAAA;AAER,QAAAvB,EAAA,QAAAuB;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAA7B,GAAA0B,CAAA;;;;;;;;;;;;;;;;;"}
@@ -1,44 +0,0 @@
1
- import { defineComponent as p, useSlots as m, computed as r } from "vue";
2
- import { B as d } from "./typography.hlOAxsEn.js";
3
- import { u as _ } from "./aria-label.CaUURpnB.js";
4
- import { g as n } from "./get-slot-text.BQS5Olxm.js";
5
- import { b as f } from "./tooltip.D3SDcRef.js";
6
- import { n as v } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
7
- import "../assets/tag.css";
8
- var i = /* @__PURE__ */ ((e) => (e.GREY = "grey", e.BLUE = "blue", e.GREEN = "green", e.ORANGE = "orange", e.RED = "red", e.WHITE = "white", e))(i || {});
9
- const b = {
10
- name: "bento-tag"
11
- }, g = /* @__PURE__ */ p({
12
- ...b,
13
- props: {
14
- label: { default: null },
15
- truncate: { default: null },
16
- variant: { default: i.GREY }
17
- },
18
- setup(e) {
19
- const t = e, a = m(), o = _({
20
- label: t.label || n(a)("default"),
21
- defaultFallback: "tag"
22
- }), u = r(() => ({
23
- [`b-tag--${t.variant}`]: t.variant
24
- })), l = r(() => t.label ?? n(a)("default") ?? "tag"), s = r(() => t.truncate && l.value.length > t.truncate), c = r(() => t.truncate && s.value ? `${l.value.slice(0, t.truncate)}...` : l.value);
25
- return { __sfc: !0, props: t, slots: a, computedAriaLabel: o, tagConditionalClasses: u, textFromSlot: l, shouldShowTooltip: s, formattedText: c, BentoTypography: d, vBentoTooltipDirective: f };
26
- }
27
- });
28
- var h = function() {
29
- var t = this, a = t._self._c, o = t._self._setupProxy;
30
- return a("span", { directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive", value: o.shouldShowTooltip ? o.textFromSlot : null, expression: "shouldShowTooltip ? textFromSlot : null" }], staticClass: "b-tag", class: o.tagConditionalClasses, attrs: { "data-testid": "tag", "aria-label": o.computedAriaLabel } }, [a(o.BentoTypography, { staticClass: "b-tag__label", attrs: { el: "span", variant: "caption", stronger: "" } }, [t._v(" " + t._s(o.formattedText) + " ")])], 1);
31
- }, x = [], C = /* @__PURE__ */ v(
32
- g,
33
- h,
34
- x,
35
- !1,
36
- null,
37
- "04ecbe5b"
38
- );
39
- const F = C.exports;
40
- export {
41
- F as B,
42
- i as a
43
- };
44
- //# sourceMappingURL=tag.BwKc2d2E.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.BwKc2d2E.js","sources":["../../src/components/tag/tag.types.ts","../../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 <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 = defineProps({\n label: { default: null },\n truncate: { default: null },\n variant: { default: BentoTagVariant.GREY }\n});\n\n const slots = useSlots();\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__","slots","useSlots","computedAriaLabel","useAriaLabel","props","getSlotText","tagConditionalClasses","computed","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;ACkCR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;iBA1BAC,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAuC,OAAAC,EAAA,SAAAC,EAAAL,CAAA,EAAA,SAAA;AAAA,MACe,iBAAA;AAAA,IACjC,CAAA,GAGrBM,IAAAC,EAAA,OAAA;AAAA,MAA8C,CAAA,UAAAH,EAAA,OAAA,EAAA,GAAAA,EAAA;AAAA,IACP,EAAA,GAGvCI,IAAAD,EAAA,MAAAH,EAAA,SAAAC,EAAAL,CAAA,EAAA,SAAA,KAAA,KAAA,GACAS,IAAAF,EAAA,MAAAH,EAAA,YAAAI,EAAA,MAAA,SAAAJ,EAAA,QAAA,GAEAM,IAAAH,EAAA,MACIH,EAAA,YAIAK,EAAA,QAAA,GAAAD,EAAA,MAAA,MAAA,GAAAJ,EAAA,QAAA,CAAA,QAHII,EAAA,KAGgG;;;;;;;;;;;;;;;;"}
@@ -1,165 +0,0 @@
1
- import { defineComponent as oe, useAttrs as se, toRefs as S, ref as c, toRef as ne, computed as i, watch as A, nextTick as ie, onMounted as ue, onUnmounted as ce } from "vue";
2
- import { B as de } from "./button.CS_kdxYh.js";
3
- import { B as pe } from "./typography.hlOAxsEn.js";
4
- import { C as fe } from "./cross-circle-fill-small.DfxDedRr.js";
5
- import { g as be } from "./generate-uid.NJ8tVoha.js";
6
- import { o as w } from "./resize.Bqks3WUm.js";
7
- import { u as me } from "./aria-label.CaUURpnB.js";
8
- import { u as _e } from "./index.B6WW_F-J.js";
9
- import { u as he } from "./use-form-layout-loading.D3lALhtC.js";
10
- import { B as ye } from "./es6.MoTTyETW.js";
11
- import { F as ve, E as xe } from "./field-label.Auq-Pzho.js";
12
- import { n as ge } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
13
- import "../assets/textarea.css";
14
- var p = /* @__PURE__ */ ((l) => (l.CLEARABLE = "clearable", l.DISABLED = "disabled", l.ERROR = "error", l.READONLY = "readonly", l))(p || {}), u = /* @__PURE__ */ ((l) => (l.BLUR = "blur", l.CHANGE = "change", l.CLEAR = "clear", l.ESCAPE_PRESSED = "escape-pressed", l.FOCUS = "focus", l.INPUT = "input", l.KEYDOWN = "keydown", l.KEYUP = "keyup", l))(u || {});
15
- const Ce = {
16
- "en-US": {
17
- clearText: "Clear text",
18
- textarea: "textarea",
19
- yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
20
- }
21
- }, T = parseFloat(ye), Le = {
22
- i18n: { messages: Ce },
23
- name: "bento-textarea"
24
- }, Ee = /* @__PURE__ */ oe({
25
- ...Le,
26
- props: {
27
- description: { default: "" },
28
- disabled: { type: Boolean, default: !1 },
29
- errorMessage: { default: "" },
30
- label: { default: "" },
31
- optional: { type: Boolean, default: !1 },
32
- placeholder: { default: "" },
33
- readonly: { type: Boolean, default: !1 },
34
- required: { type: Boolean, default: !1 },
35
- tooltipText: { default: null },
36
- ariaLabel: { default: void 0 },
37
- characterLimit: { default: void 0 },
38
- clearable: { type: Boolean, default: !1 },
39
- height: { default: null },
40
- resizable: { default: "both" },
41
- value: { default: "" }
42
- },
43
- emits: [],
44
- setup(l, { expose: a, emit: t }) {
45
- const e = l, o = se(), { height: y } = S(e), H = be("textarea"), s = c(null), f = c(null), n = c(e.value), d = 44, b = c(e.height || `${d}px`), L = c(0), E = c("100%"), v = c(!1);
46
- let m = null, _ = null;
47
- const { t: k, n: R } = _e(), { isReadOnly: x } = he(ne(e, "readonly")), W = i(() => {
48
- var r;
49
- return `${R(((r = n == null ? void 0 : n.value) == null ? void 0 : r.length) ?? 0)} / ${R(e.characterLimit)}`;
50
- }), h = i(() => !y.value), B = i(
51
- () => e.characterLimit && n.value.length > e.characterLimit
52
- ), g = () => {
53
- if (s.value) {
54
- const r = Math.max(
55
- s.value.scrollHeight <= d ? d : s.value.scrollHeight + T * 2,
56
- L.value,
57
- d
58
- );
59
- b.value = `${r}px`;
60
- }
61
- };
62
- A(y, () => {
63
- h.value ? g() : b.value = y.value;
64
- }), A(
65
- () => e.value,
66
- () => {
67
- n.value = e.value;
68
- },
69
- { immediate: !0 }
70
- ), A(
71
- () => n.value,
72
- async () => {
73
- if (h.value) {
74
- if (b.value = `${d}px`, !n.value)
75
- return;
76
- await ie(), g();
77
- }
78
- },
79
- { immediate: !0 }
80
- );
81
- const D = i(() => !!e.errorMessage || B.value), N = i(() => ({
82
- [`b-textarea--${p.DISABLED}`]: e.disabled
83
- })), K = i(() => ({
84
- [`b-textarea__input--${p.CLEARABLE}`]: e.clearable,
85
- [`b-textarea__input--${p.READONLY}`]: x.value,
86
- [`b-textarea__input--${p.ERROR}`]: D.value,
87
- "b-textarea__input--dynamic-height": h.value
88
- })), z = i(() => ({
89
- "b-textarea__label-box--no-label": !e.label
90
- })), Y = i(() => ({
91
- [`b-textarea__label-item--${p.ERROR}`]: B.value
92
- })), q = i(() => k("yourTextCanBenAtMost", { characterLimit: e.characterLimit })), U = c(o["aria-label"]), { ariaLabel: O, label: P } = S(e), $ = me({
93
- ariaLabel: U.value,
94
- // TODO: take this line away when the aria-label props is removed
95
- label: O,
96
- defaultFallback: P
97
- }), G = i(
98
- () => e.clearable && n.value && !e.disabled && !x.value
99
- ), X = () => {
100
- n.value = "", t(u.CLEAR), t(u.INPUT, "");
101
- }, j = (r) => {
102
- r.stopImmediatePropagation(), !e.disabled && !x.value && (n.value = r.target.value, t(u.INPUT, n.value));
103
- }, J = () => {
104
- s.value.scrollTop = 0, t(u.BLUR);
105
- }, Q = () => {
106
- s.value.focus(), t(u.FOCUS);
107
- }, V = () => {
108
- t(u.CHANGE);
109
- }, Z = () => {
110
- t(u.ESCAPE_PRESSED);
111
- }, ee = (r) => {
112
- r.stopPropagation(), t(u.KEYDOWN, r);
113
- }, ae = (r) => {
114
- r.stopPropagation(), t(u.KEYUP, r);
115
- }, te = () => {
116
- v.value = !0;
117
- }, le = () => {
118
- v.value = !1;
119
- }, I = (r = !1) => {
120
- var M;
121
- const C = s.value.style.width;
122
- if (s.value.style.height && (v.value && (L.value = parseInt(s.value.style.height, 10)), b.value = s.value.style.height), r && !C)
123
- return;
124
- const re = (M = f == null ? void 0 : f.value) == null ? void 0 : M.offsetWidth;
125
- !C || parseInt(C, 10) > re ? E.value = "100%" : E.value = C;
126
- }, F = () => {
127
- s.value.focus();
128
- };
129
- return a({
130
- focus: F
131
- }), ue(() => {
132
- m = w(s.value, () => {
133
- I(!0);
134
- }), _ = w(f.value, () => {
135
- I();
136
- }), h.value && g();
137
- }), ce(() => {
138
- m == null || m.disconnect(), _ == null || _.disconnect();
139
- }), { __sfc: !0, TEXTAREA_BORDER_WIDTH: T, attrs: o, props: e, emit: t, height: y, textareaId: H, textareaElement: s, textareaComponent: f, textareaValue: n, defaultTextareaHeight: d, textareaHeight: b, userSetHeight: L, textareaWrapperWidth: E, isUserResizing: v, textareaElementObserver: m, textareaComponentObserver: _, t: k, n: R, isReadOnly: x, counter: W, isDynamicHeight: h, isOverCharacterLimit: B, calculateHeight: g, invalidInput: D, conditionalClasses: N, conditionalClassesInput: K, conditionalClassesLabelBox: z, conditionalClassesLabelItem: Y, counterErrorText: q, ariaLabelAttribute: U, ariaLabel: O, label: P, computedAriaLabel: $, showClearButton: G, onClear: X, onInput: j, onBlur: J, onFocus: Q, onChange: V, onPressEscape: Z, onKeyDown: ee, onKeyUp: ae, onMouseDown: te, onMouseUp: le, resizeTextareaWrapper: I, focus: F, BentoButton: de, BentoTypography: pe, ErrorMessage: xe, FieldLabel: ve, CrossCircleFillSmallIcon: fe };
140
- }
141
- });
142
- var Re = function() {
143
- var a = this, t = a._self._c, e = a._self._setupProxy;
144
- return t("div", { ref: "textareaComponent", staticClass: "b-textarea", class: e.conditionalClasses }, [t("div", { style: { width: e.textareaWrapperWidth } }, [t("div", { staticClass: "b-textarea__label-box", class: e.conditionalClassesLabelBox }, [e.label ? t(e.FieldLabel, { attrs: { for: e.textareaId, label: e.label, "tooltip-text": a.tooltipText, optional: a.optional, required: a.required } }) : a._e(), a.characterLimit ? t(e.BentoTypography, { staticClass: "b-textarea__label-item", class: e.conditionalClassesLabelItem, attrs: { el: "span" } }, [a._v(" " + a._s(e.counter) + " ")]) : a._e()], 1), t(e.BentoTypography, { staticClass: "b-textarea__input-box", attrs: { el: "div", "aria-disabled": a.disabled } }, [t("textarea", { ref: "textareaElement", staticClass: "b-textarea__input", class: e.conditionalClassesInput, style: { resize: a.resizable, height: e.textareaHeight }, attrs: { id: e.textareaId, "aria-label": e.computedAriaLabel, "aria-invalid": e.invalidInput, readonly: e.isReadOnly, required: a.required, disabled: a.disabled, placeholder: a.placeholder }, domProps: { value: e.textareaValue }, on: { blur: e.onBlur, change: e.onChange, focus: e.onFocus, input: e.onInput, keydown: [function(o) {
145
- return !o.type.indexOf("key") && a._k(o.keyCode, "esc", 27, o.key, ["Esc", "Escape"]) ? null : e.onPressEscape.apply(null, arguments);
146
- }, e.onKeyDown], keyup: e.onKeyUp, mousedown: e.onMouseDown, mouseup: e.onMouseUp } }), e.showClearButton ? t("div", { staticClass: "b-textarea__clear-button" }, [t(e.BentoButton, { attrs: { variant: "tertiary", disabled: a.disabled }, on: { click: e.onClear, keypress: function(o) {
147
- return !o.type.indexOf("key") && a._k(o.keyCode, "enter", 13, o.key, "Enter") ? null : e.onClear.apply(null, arguments);
148
- }, keyup: function(o) {
149
- return !o.type.indexOf("key") && a._k(o.keyCode, "space", 32, o.key, [" ", "Spacebar"]) ? null : e.onClear.apply(null, arguments);
150
- } }, scopedSlots: a._u([{ key: "iconLeft", fn: function() {
151
- return [t(e.CrossCircleFillSmallIcon, { attrs: { "svg-title": e.t("clearText") } })];
152
- }, proxy: !0 }], null, !1, 3119266621) })], 1) : a._e()]), e.isOverCharacterLimit ? t(e.ErrorMessage, { attrs: { "error-message": e.counterErrorText } }) : a._e(), a.errorMessage ? t(e.ErrorMessage, { attrs: { "error-message": a.errorMessage } }) : a._e(), a.description ? t(e.BentoTypography, { staticClass: "b-textarea__description", attrs: { el: "span" } }, [a._v(" " + a._s(a.description) + " ")]) : a._e()], 1)]);
153
- }, Be = [], Ie = /* @__PURE__ */ ge(
154
- Ee,
155
- Re,
156
- Be,
157
- !1,
158
- null,
159
- "231103da"
160
- );
161
- const We = Ie.exports;
162
- export {
163
- We as B
164
- };
165
- //# sourceMappingURL=textarea.CIQuLWQ8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textarea.CIQuLWQ8.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n */\n value?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :required=\"required\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BTextareaInputFocusBorderWidth } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: '' },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n ariaLabel: { default: undefined },\n characterLimit: { default: undefined },\n clearable: { type: Boolean, default: false },\n height: { default: null },\n resizable: { default: 'both' },\n value: { default: '' }\n});\n\n const emit = defineEmits([]);\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: isDynamicHeight.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BTextareaInputFocusBorderWidth);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BTextareaInputFocusBorderWidth","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","_a","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","focus","expose","onMounted","observeSizeOfElement","onUnmounted"],"mappings":";;;;;;;;;;;;;AAYY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA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AG3ByC,KAAA,MAAA;AACI,MAAAzC,EAAA,QAAA;AAAA,IAAuB,GAO3B0C,IAAA,CAAAC,IAAA,OAAA;;AAEI,YAAAC,IAAApD,EAAA,MAAA,MAAA;AAYA,UATAA,EAAA,MAAA,MAAA,WACIQ,EAAA,UACIF,EAAA,QAAA,SAAAN,EAAA,MAAA,MAAA,QAAA,EAAA,IAEJK,EAAA,QAAAL,EAAA,MAAA,MAAA,SAKJmD,KAAA,CAAAC;AACI;AAIJ,YAAAC,MAAAlC,IAAAjB,KAAA,gBAAAA,EAAA,UAAA,gBAAAiB,EAAA;AAGA,MAAA,CAAAiC,KAAA,SAAAA,GAAA,EAAA,IAAAC,KACI9C,EAAA,QAAA,SAGAA,EAAA,QAAA6C;AAAA,IACJ,GAGJE,IAAA,MAAA;AACI,MAAAtD,EAAA,MAAA,MAAA;AAAA,IAA4B;AAGhC,WAAAuD,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA,GAGJE,GAAA,MAAA;AACI,MAAA/C,IAAAgD,EAAAzD,EAAA,OAAA,MAAA;AACI,QAAAkD,EAAA,EAAA;AAAA,MAA0B,CAAA,GAG9BxC,IAAA+C,EAAAvD,EAAA,OAAA,MAAA;AACI,QAAAgD,EAAA;AAAA,MAAsB,CAAA,GAG1B9B,EAAA,SACIE,EAAA;AAAA,IACJ,CAAA,GAGJoC,GAAA,MAAA;AACI,MAAAjD,KAAA,QAAAA,EAAA,cACAC,KAAA,QAAAA,EAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeline-item.CZBuknZ_.js","sources":["../../src/components/timeline/timeline.types.ts","../../src/components/timeline/timeline.keys.ts","../../src/components/timeline/timeline.vue","../../../ui-assets/icons-16/dist/vue/square-small-fill.vue","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js","../../src/components/timeline/components/timeline-item/timeline-item.vue"],"sourcesContent":["import { type BentoDateFormat } from '@/components/date/date.types';\nimport { type BentoTag } from '@/components/tag';\nimport { type Ref } from 'vue';\nimport type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\nexport enum BentoTimelineShowMorePlacement {\n BOTTOM = 'bottom',\n AFTER_FIRST = 'after-first',\n BEFORE_LAST = 'before-last',\n}\n\nexport interface BentoTimelineShowMoreObject {\n limit: number;\n placement?: BentoTimelineShowMorePlacement;\n}\n\nexport enum BentoTimelineGapUnit {\n SECOND = 'second',\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\nexport interface BentoTimelineGapObject {\n amount: number;\n unit: BentoTimelineGapUnit;\n}\n\n/**\n * @deprecated \"variant\" prop was deprecated. Use \"status\" modifier instead.\n */\nexport enum BentoTimelineItemVariant {\n DEFAULT = 'SquareSmallIcon',\n SUCCESS = 'CheckedCircleIcon',\n CRITICAL = 'CrossCircleIcon',\n}\n\nexport enum BentoTimelineStatus {\n BLACK = 'black',\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoTimelineItemTitle extends RouterLinkProps {\n /**\n * Link label.\n */\n title: string;\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n // This has been added to allow users to add HTML and Aria attribute\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [name: string]: any;\n}\n\nexport interface BentoTimelineTimestamp {\n date: Date | number;\n format?: BentoDateFormat;\n value?: string;\n}\n\nexport interface BentoTimelineDataListObject {\n label: string;\n value: string;\n}\n\nexport type BentoTimelineDataList = Array<BentoTimelineDataListObject>;\n\nexport type BentoTimelineTagProps = InstanceType<typeof BentoTag>['$props'];\n\nexport interface BentoTimelineEntry {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}\n\n/**\n * @deprecated from version 2.0.0.\n */\nexport type BentoTimelineRegisterEntry = (props: {\n title?: string | BentoTimelineItemTitle;\n description?: string;\n date: Date | number;\n}) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; index: number; unregisterTimelineEntry: () => void };\n\n/**\n * @private\n */\nexport type BentoInternalTimelineRegisterEntry = (\n entry: BentoTimelineEntry\n) => { timelineEntries: Ref<Array<BentoTimelineEntry>>; unregisterTimelineEntry: () => void };\n\nexport interface BentoTimelineConfigData {\n showAll: Ref<boolean>;\n showMoreIndex: Ref<number>;\n hiddenItems: Ref<number>;\n visibleIndexes: Ref<Array<number>>;\n timegapLimit: Ref<BentoTimelineGapObject>;\n timelineEntries: Ref<Array<BentoTimelineEntry>>;\n}\n","export const TIMELINE_REGISTER_ENTRY_INJECTION_KEY = Symbol('timeline register entry injection key');\nexport const TIMELINE_CONFIG_INJECTION_KEY = Symbol('timeline config obj injection key');\n","<template>\n <div class=\"b-timeline\">\n <div v-if=\"addNote\" class=\"b-timeline__add-note-section\">\n <bento-button\n v-if=\"!showAddNoteTextArea\"\n ref=\"addNoteButtonRef\"\n variant=\"tertiary\"\n @click=\"toggleAddNote\"\n >{{ addNoteLabel }}</bento-button\n >\n <div v-if=\"showAddNoteTextArea\">\n <bento-textarea\n ref=\"addNoteTextareaRef\"\n :label=\"addNoteLabel\"\n :character-limit=\"150\"\n resizable=\"vertical\"\n @input=\"updateNoteContent\"\n />\n <bento-button-actions\n :actions=\"[\n { title: addNoteLabel, event: addNoteToTimeline },\n { title: cancelLabel, event: toggleAddNote },\n ]\"\n />\n </div>\n </div>\n <ol class=\"b-timeline__items\">\n <slot />\n </ol>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, type PropType, provide, ref, type Ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions } from '@/components/button';\n import { BentoTextarea } from '@/components/textarea';\n import {\n type BentoInternalTimelineRegisterEntry,\n type BentoTimelineConfigData,\n type BentoTimelineEntry,\n type BentoTimelineGapObject,\n type BentoTimelineShowMoreObject,\n BentoTimelineShowMorePlacement,\n } from './timeline.types';\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from './timeline.keys';\n import messages from './messages.json';\n import { useI18n } from '@/utils/ts/i18n';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Timeline displays a collection of events in a reverse chronological order (newest event is displayed on the top).\n *\n * @example\n * import { BentoDateFormat, BentoTimeline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimeline },\n * template: `\n * <bento-timeline>\n * <bento-timeline-item\n * title=\"Milestone 1\"\n * :timestamp=\"{ date: new Date(), value: 'Created at' }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * <bento-timeline-item\n * title=\"Milestone 2\"\n * :timestamp=\"{\n * date: new Date(),\n * value: 'Created at',\n * format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD\n * }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * />\n * </bento-timeline>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-timeline',\n components: { BentoButton, BentoButtonActions, BentoTextarea },\n props: {\n /**\n * If set to true, gives the possibility to manually add notes to the timeline via a textarea\n */\n addNote: {\n type: Boolean,\n default: false,\n },\n /**\n * Object that determines the max number of items to show without clicking the show more button\n * and where in the timeline is the show more button placed\n */\n showMore: {\n type: Object as PropType<BentoTimelineShowMoreObject>,\n default: null,\n },\n /**\n * Object that determines minimum amount of time for the automatic timegap indicator;\n * Define a unit (hour, day, month) and an amount (e.g. { amount: 7, unit: 'days' }).\n * If null, automatic timegap detection will be turned off\n */\n timegapLimit: {\n type: Object as PropType<BentoTimelineGapObject>,\n default: null,\n },\n },\n\n emits: ['add-timeline-note'],\n\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const addNoteLabel = computed(() => t('addNote') as string);\n const cancelLabel = computed(() => t('cancel') as string);\n\n const newNoteContent: Ref<string> = ref();\n const updateNoteContent = (newTimelineNoteContent: string): void => {\n newNoteContent.value = newTimelineNoteContent;\n };\n\n const addNoteTextareaRef: Ref<InstanceType<typeof BentoTextarea>> = ref(null);\n const addNoteButtonRef: Ref<InstanceType<typeof BentoButton>> = ref(null);\n const showAddNoteTextArea = ref(false);\n const toggleAddNote = async () => {\n showAddNoteTextArea.value = !showAddNoteTextArea.value;\n\n await nextTick();\n\n if (showAddNoteTextArea.value) {\n (addNoteTextareaRef.value.$refs.textareaElement as HTMLTextAreaElement)?.focus();\n } else {\n (addNoteButtonRef.value.$el as HTMLButtonElement)?.focus();\n }\n };\n const addNoteToTimeline = () => {\n emit('add-timeline-note', {\n description: newNoteContent.value,\n timestamp: { date: new Date() },\n type: 'note',\n });\n toggleAddNote();\n };\n\n const timelineEntries = ref<Array<BentoTimelineEntry>>([]);\n const hiddenItems = computed(() =>\n props.showMore && timelineEntries.value.length > props.showMore.limit\n ? timelineEntries.value.length - props.showMore.limit\n : null\n );\n const showAll = ref(false);\n const { timegapLimit } = toRefs(props);\n\n const timelineIndexes = computed(() => Array.from(timelineEntries.value.keys()));\n\n const visibleIndexes = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.BEFORE_LAST) {\n return [\n ...timelineIndexes.value.slice(0, props.showMore.limit - 1),\n timelineIndexes.value[timelineIndexes.value.length - 1],\n ];\n }\n\n if (props.showMore.placement === BentoTimelineShowMorePlacement.AFTER_FIRST) {\n return [timelineIndexes.value[0], ...timelineIndexes.value.slice(-(props.showMore.limit - 1))];\n }\n\n return timelineIndexes.value.slice(0, props.showMore.limit);\n });\n\n const showMoreIndex = computed(() => {\n if (!props.showMore) {\n return null;\n }\n\n switch (props.showMore.placement) {\n case BentoTimelineShowMorePlacement.BEFORE_LAST:\n return props.showMore.limit - 2;\n case BentoTimelineShowMorePlacement.AFTER_FIRST:\n return 0;\n case BentoTimelineShowMorePlacement.BOTTOM:\n default:\n return props.showMore.limit - 1;\n }\n });\n\n const sortEntries = () => {\n // Sorts timeline entries based on date in reverse chronological order (newest first).\n timelineEntries.value.sort((a, b) => {\n return new Date(b.date).getTime() - new Date(a.date).getTime();\n });\n };\n\n const unregisterTimelineEntry = (entryToRemove: BentoTimelineEntry) => () => {\n const index = timelineEntries.value.indexOf(entryToRemove);\n // The index can be -1 if the entry has already been removed by a parent re-render.\n if (index > -1) {\n timelineEntries.value.splice(index, 1);\n }\n };\n\n const registerTimelineEntry: BentoInternalTimelineRegisterEntry = entry => {\n timelineEntries.value.push(entry);\n return { timelineEntries, unregisterTimelineEntry: unregisterTimelineEntry(entry) };\n };\n\n watch(\n () => timelineEntries.value.length,\n () => sortEntries()\n );\n\n const configData: BentoTimelineConfigData = {\n showAll,\n showMoreIndex,\n hiddenItems,\n visibleIndexes,\n timegapLimit,\n timelineEntries,\n };\n\n // provide register timeline entry and config data timeline items\n provide(TIMELINE_REGISTER_ENTRY_INJECTION_KEY, registerTimelineEntry);\n provide(TIMELINE_CONFIG_INJECTION_KEY, configData);\n\n return {\n addNoteLabel,\n cancelLabel,\n toggleAddNote,\n updateNoteContent,\n addNoteToTimeline,\n showAddNoteTextArea,\n\n // refs\n addNoteTextareaRef,\n addNoteButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M10 3.25C11.5188 3.25 12.75 4.48122 12.75 6V10C12.75 11.5188 11.5188 12.75 10 12.75H6C4.48122 12.75 3.25 11.5188 3.25 10V6C3.25 4.48122 4.48122 3.25 6 3.25H10Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","<template>\n <li v-if=\"isVisible\" class=\"b-timeline-item\" :class=\"conditionalClasses\">\n <div v-if=\"timegap\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__icon b-timeline-item__icon--timegap\"></div>\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography class=\"b-timeline-item__timegap\" :aria-label=\"timegapAriaLabel\">\n {{ timegap }}\n </bento-typography>\n </div>\n </div>\n <div class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <square-small-icon class=\"b-timeline-item__icon\" :class=\"iconConditionalClasses\" />\n <div\n v-if=\"!isLastItem\"\n class=\"b-timeline-item__separator\"\n data-testid=\"last-timeline-item-separator\"\n ></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-typography\n v-if=\"!isNoteType\"\n el=\"div\"\n variant=\"body\"\n strongest\n class=\"b-timeline-item__title\"\n role=\"heading\"\n aria-level=\"2\"\n >\n <bento-link v-if=\"isLinkTitle\" v-bind=\"linkTitleProps\" disable-typography>{{\n linkTitleProps.title\n }}</bento-link>\n <span v-else>{{ title }}</span>\n </bento-typography>\n\n <bento-typography\n v-if=\"isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <bento-typography v-if=\"timestamp\" class=\"b-timeline-item__timestamp\" el=\"div\" variant=\"caption\">\n <bento-date :date=\"timestamp.date\" :format=\"timestamp.format\" disable-typography />\n {{ timestamp.value }}\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && additionalTimestamp\"\n class=\"b-timeline-item__timestamp\"\n el=\"div\"\n variant=\"caption\"\n >\n <bento-date\n :date=\"additionalTimestamp.date\"\n :format=\"additionalTimestamp.format\"\n disable-typography\n />\n {{ additionalTimestamp.value }}\n </bento-typography>\n\n <bento-typography\n v-if=\"!isNoteType && (description || hasSlot('default'))\"\n el=\"div\"\n variant=\"body\"\n class=\"b-timeline-item__description\"\n >\n <slot>{{ description }}</slot>\n </bento-typography>\n\n <div v-if=\"!isNoteType && dataList\" class=\"b-timeline-item__data-list\">\n <bento-structured-list>\n <bento-structured-list-item\n v-for=\"entry in dataList\"\n :key=\"generateUid(entry.label)\"\n :label=\"entry.label\"\n >\n <bento-typography variant=\"caption\">{{ entry.value }}</bento-typography>\n </bento-structured-list-item>\n </bento-structured-list>\n </div>\n <bento-tag v-if=\"!isNoteType && tag\" v-bind=\"tag\" class=\"b-timeline-item__tag\" />\n </div>\n </div>\n <div v-if=\"displayShowMoreButton\" class=\"b-timeline-item__row\">\n <div class=\"b-timeline-item__marker\" aria-hidden=\"true\">\n <div class=\"b-timeline-item__separator\"></div>\n </div>\n <div class=\"b-timeline-item__content\">\n <bento-button class=\"b-timeline__show-more\" variant=\"tertiary\" @click=\"showAll = !showAll\">\n <template v-if=\"!showAll\">{{ t('showMore', { items: hiddenItems }) }}</template>\n <template v-else>{{ t('showLess') }}</template>\n </bento-button>\n </div>\n </div>\n </li>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, onUnmounted, type PropType, provide } from 'vue';\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoDate } from '@/components/date';\n import { BentoLink } from '@/components/link';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { BentoStructuredList, BentoStructuredListItem } from '@/components/structured-list';\n import SquareSmallIcon from '@adyen/ui-assets-icons-16/vue/square-small-fill';\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { useHasSlot } from '@/composables';\n import { formatDistanceStrict } from 'date-fns/formatDistanceStrict';\n // Types\n import {\n type BentoTimelineConfigData,\n type BentoTimelineDataList,\n type BentoTimelineEntry,\n type BentoTimelineItemTitle,\n BentoTimelineItemVariant,\n type BentoTimelineRegisterEntry,\n BentoTimelineStatus,\n type BentoTimelineTagProps,\n type BentoTimelineTimestamp,\n } from '../../timeline.types';\n // Keys\n import { TIMELINE_CONFIG_INJECTION_KEY, TIMELINE_REGISTER_ENTRY_INJECTION_KEY } from '../../timeline.keys';\n import { STRUCTURED_LIST_CONDENSED_INJECTION_KEY } from '@/components/structured-list/structured-list.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n /**\n * BentoTimelineItem renders each event in the Timeline component\n *\n * @example\n * import { BentoDateFormat, BentoTimelineItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoTimelineItem },\n * template: `\n * <bento-timeline-item\n * title=\"Milestone\"\n * :timestamp=\"{ date: new Date(), value: 'Created at', format: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD }\"\n * :additional-timestamp=\"{ date: new Date(), value: 'Modified at' }\"\n * description=\"Milestone description\"\n * :data-list=\"[\n * { label: 'Label', value: 'Value' },\n * { label: 'Label', value: 'Value' },\n * ]\"\n * :tag=\"{ label: 'Tag'}\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-timeline-item',\n components: {\n BentoButton,\n BentoDate,\n BentoLink,\n BentoTag,\n BentoTypography,\n BentoStructuredList,\n BentoStructuredListItem,\n SquareSmallIcon,\n },\n i18n: { messages },\n props: {\n /**\n * Additional timestamp of the event\n */\n additionalTimestamp: {\n type: Object as PropType<BentoTimelineTimestamp>,\n default: null,\n },\n /**\n * Relevant key-value pair data to display in the event\n */\n dataList: {\n type: Array as PropType<BentoTimelineDataList>,\n default: null,\n },\n /**\n * Description of the event\n */\n description: {\n type: String,\n default: null,\n },\n /**\n * Modifier that changes the color of the timeline icon\n * @values blue, black, green, grey, orange, red, yellow\n */\n status: {\n type: String as PropType<`${BentoTimelineStatus}`>,\n default: 'black',\n validator: (value: BentoTimelineStatus) => Object.values(BentoTimelineStatus).includes(value),\n },\n /**\n * Tag props that will be passed down to inner tag component\n */\n tag: {\n type: Object as PropType<BentoTimelineTagProps>,\n default: undefined,\n },\n /**\n * Main timestamp of the event. Used for timegap detection.\n */\n timestamp: {\n type: Object as PropType<BentoTimelineTimestamp>,\n required: true,\n },\n /**\n * Title of the event\n */\n title: {\n type: [Object, String] as PropType<BentoTimelineItemTitle | string>,\n default: null,\n },\n /**\n * Type of the timeline item. If set to 'note', it renders a note item in the timeline. Defaults to 'milestone'.\n * @values milestone, note\n */\n type: {\n type: String,\n default: 'milestone',\n validator: (value: string) => ['milestone', 'note'].includes(value),\n },\n /**\n * Variant for the timeline item\n * @values DEFAULT, SUCCESS, CRITICAL\n *\n * @deprecated Use \"status\" prop instead\n */\n variant: {\n type: String as PropType<BentoTimelineItemVariant | `${BentoTimelineItemVariant}`>,\n default: null,\n validator: (value: BentoTimelineItemVariant) => Object.values(BentoTimelineItemVariant).includes(value),\n },\n },\n setup(props, { slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const isNoteType = computed(() => props.type === 'note');\n\n // Handle variant deprecation, by setting `critical` and `success` variants to their respective colors\n const computedStatus = computed(() => {\n if (props.variant === BentoTimelineItemVariant.CRITICAL) {\n return 'red';\n }\n\n if (props.variant === BentoTimelineItemVariant.SUCCESS) {\n return 'green';\n }\n\n return props.status;\n });\n\n if (props.variant) {\n deprecate(\n 'BentoTimelineItem \"variant\" property',\n `Use the BentoTimelineItem \"status\" modifier instead to modify the color of the timeline icon.\n <bento-timeline-item status=\"red\" />`,\n '2.0.0'\n );\n }\n\n const iconConditionalClasses = computed(() => ({\n [`b-timeline-item__icon--${computedStatus.value}`]: computedStatus.value && !isNoteType.value,\n }));\n const conditionalClasses = computed(() => ({\n 'b-timeline-item--note': isNoteType.value,\n }));\n\n // Provide STRUCTURED_LIST_CONDENSED_INJECTION_KEY as true, to set the internal condensed style in the BentoStructuredList comp\n provide(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, true);\n\n const entry: BentoTimelineEntry = {\n title: props.title,\n date: props.timestamp.date,\n };\n\n // Register timeline entry to the timeline entries array\n const registerTimelineEntry: BentoTimelineRegisterEntry = inject(TIMELINE_REGISTER_ENTRY_INJECTION_KEY);\n const { timelineEntries, unregisterTimelineEntry } = registerTimelineEntry(entry);\n\n // On unmounting timeline item, unregister it from the parent timeline component\n onUnmounted(() => unregisterTimelineEntry());\n\n // Get timeline config data from the parent Timeline comp\n const { showAll, showMoreIndex, hiddenItems, visibleIndexes, timegapLimit }: BentoTimelineConfigData =\n inject(TIMELINE_CONFIG_INJECTION_KEY);\n\n const index = computed(() => timelineEntries.value.indexOf(entry));\n\n const allItemsShowing = computed(() => showAll.value || !visibleIndexes.value);\n const isVisible = computed(() =>\n allItemsShowing.value ? true : visibleIndexes.value.includes(index.value)\n );\n const isLinkTitle = computed(() => typeof props.title === 'object');\n const linkTitleProps = computed(() => props.title as BentoTimelineItemTitle);\n const timegap = computed(() => {\n if (!timegapLimit.value) {\n return null;\n }\n const previousDate = timelineEntries.value[index.value - 1]?.date;\n const isPreviousItemVisible = allItemsShowing.value || visibleIndexes.value.includes(index.value - 1);\n if (!previousDate || !isPreviousItemVisible) {\n return null;\n }\n const { date } = timelineEntries.value[index.value];\n const timegapInSelectedUnit = parseInt(\n formatDistanceStrict(previousDate, date, { unit: timegapLimit.value.unit }),\n 10\n );\n return timegapLimit.value.amount < timegapInSelectedUnit\n ? formatDistanceStrict(previousDate, date, { roundingMethod: 'floor' })\n : null;\n });\n const timegapAriaLabel = computed(() => (timegap.value ? t('timegap', { timegap: timegap.value }) : ''));\n const displayShowMoreButton = computed(() => hiddenItems.value && showMoreIndex.value === index.value);\n const isLastItem = computed(() => {\n // The index can be -1 before the parent has had a chance to sort the array.\n return index.value !== -1 && index.value === timelineEntries.value.length - 1;\n });\n\n return {\n // Values\n isNoteType,\n iconConditionalClasses,\n conditionalClasses,\n displayShowMoreButton,\n showAll,\n hiddenItems,\n isVisible,\n isLinkTitle,\n linkTitleProps,\n timegap,\n timegapAriaLabel,\n isLastItem,\n\n // Methods\n generateUid,\n hasSlot: useHasSlot(slots),\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./timeline-item.scss\" />\n"],"names":["BentoTimelineShowMorePlacement","BentoTimelineShowMorePlacement2","BentoTimelineGapUnit","BentoTimelineGapUnit2","BentoTimelineItemVariant","BentoTimelineItemVariant2","BentoTimelineStatus","BentoTimelineStatus2","TIMELINE_REGISTER_ENTRY_INJECTION_KEY","TIMELINE_CONFIG_INJECTION_KEY","_sfc_main$2","defineComponent","messages$1","BentoButton","BentoButtonActions","BentoTextarea","props","emit","t","useI18n","addNoteLabel","computed","cancelLabel","newNoteContent","ref","updateNoteContent","newTimelineNoteContent","addNoteTextareaRef","addNoteButtonRef","showAddNoteTextArea","toggleAddNote","nextTick","_a","_b","addNoteToTimeline","timelineEntries","hiddenItems","showAll","timegapLimit","toRefs","timelineIndexes","visibleIndexes","showMoreIndex","sortEntries","a","b","unregisterTimelineEntry","entryToRemove","index","registerTimelineEntry","entry","watch","configData","provide","uuid","_sfc_main$1","formatDistanceStrict","laterDate","earlierDate","options","defaultOptions","getDefaultOptions","locale","enUS","comparison","compareAsc","localizeOptions","laterDate_","earlierDate_","normalizeDates","roundingMethod","getRoundingMethod","milliseconds","minutes","millisecondsInMinute","timezoneOffset","getTimezoneOffsetInMilliseconds","dstNormalizedMinutes","defaultUnit","unit","minutesInDay","minutesInMonth","minutesInYear","seconds","roundedMinutes","hours","days","months","years","_sfc_main","BentoDate","BentoLink","BentoTag","BentoTypography","BentoStructuredList","BentoStructuredListItem","SquareSmallIcon","messages","value","slots","isNoteType","computedStatus","deprecate","iconConditionalClasses","conditionalClasses","STRUCTURED_LIST_CONDENSED_INJECTION_KEY","inject","onUnmounted","allItemsShowing","isVisible","isLinkTitle","linkTitleProps","timegap","previousDate","isPreviousItemVisible","date","timegapInSelectedUnit","timegapAriaLabel","displayShowMoreButton","isLastItem","generateUid","useHasSlot"],"mappings":";;;;;;;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,cAAA,eACAA,EAAA,cAAA,eAHQA,IAAAD,KAAA,CAAA,CAAA,GAWAE,KAAA,kBAAAC,OACRA,EAAA,S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