@adyen/bento-vue2 1.77.0 → 1.78.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 (65) hide show
  1. package/dist/@types/index.d.ts +137 -98
  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/checkbox-group.css +1 -1
  8. package/dist/assets/data-grid.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/file-uploader.css +1 -1
  12. package/dist/assets/filter-bar.css +1 -1
  13. package/dist/assets/index.css +1 -0
  14. package/dist/assets/inspector.css +1 -1
  15. package/dist/assets/modal-fullscreen.css +1 -1
  16. package/dist/assets/radio-group.css +1 -1
  17. package/dist/assets/selection-card-group.css +1 -1
  18. package/dist/assets/sidepanel.css +1 -1
  19. package/dist/checkbox.js +2 -2
  20. package/dist/chunks/checkbox-group.HqNbZx2y.js +141 -0
  21. package/dist/chunks/checkbox-group.HqNbZx2y.js.map +1 -0
  22. package/dist/chunks/{checkbox.itbBlXev.js → checkbox.CqF5Dank.js} +18 -18
  23. package/dist/chunks/{checkbox.itbBlXev.js.map → checkbox.CqF5Dank.js.map} +1 -1
  24. package/dist/chunks/{data-grid.B-kBw540.js → data-grid.BhwTkhfk.js} +508 -503
  25. package/dist/chunks/data-grid.BhwTkhfk.js.map +1 -0
  26. package/dist/chunks/date-range-picker.CmKA76Yu.js +898 -0
  27. package/dist/chunks/date-range-picker.CmKA76Yu.js.map +1 -0
  28. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js +5 -0
  29. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -0
  30. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  31. package/dist/chunks/{filter-bar.BLnSnOlj.js → filter-bar.Bj4LgjzJ.js} +5 -5
  32. package/dist/chunks/filter-bar.Bj4LgjzJ.js.map +1 -0
  33. package/dist/chunks/{header-with-views.C6Y7mAkq.js → header-with-views.D6JUlnEf.js} +2 -2
  34. package/dist/chunks/{header-with-views.C6Y7mAkq.js.map → header-with-views.D6JUlnEf.js.map} +1 -1
  35. package/dist/chunks/link.D8qpqg3W.js.map +1 -1
  36. package/dist/chunks/{radio-group.B8ukv-pw.js → radio-group.0JNwgkZa.js} +64 -63
  37. package/dist/chunks/radio-group.0JNwgkZa.js.map +1 -0
  38. package/dist/chunks/{rich-text-editor.DzH-Z5oi.js → rich-text-editor.NFLhgVJo.js} +2 -2
  39. package/dist/chunks/{rich-text-editor.DzH-Z5oi.js.map → rich-text-editor.NFLhgVJo.js.map} +1 -1
  40. package/dist/chunks/{selection-card-group.D4rcUyvV.js → selection-card-group.u-2Y_9o2.js} +97 -94
  41. package/dist/chunks/{selection-card-group.D4rcUyvV.js.map → selection-card-group.u-2Y_9o2.js.map} +1 -1
  42. package/dist/data-grid.js +1 -1
  43. package/dist/date-range-picker.js +5 -4
  44. package/dist/date-range-picker.js.map +1 -1
  45. package/dist/filter-bar.js +1 -1
  46. package/dist/header-with-views.js +1 -1
  47. package/dist/index.js +382 -357
  48. package/dist/index.js.map +1 -1
  49. package/dist/radio-group.js +1 -1
  50. package/dist/rich-text-editor.js +1 -1
  51. package/dist/selection-card.js +1 -1
  52. package/dist/styles/bento-dark.css +5 -0
  53. package/dist/styles/bento-light.css +5 -0
  54. package/dist/styles/bento.css +5 -0
  55. package/dist/styles/legacy.css +5 -0
  56. package/dist/styles/styleguide.css +5 -0
  57. package/dist/web-types.json +44 -16
  58. package/package.json +6 -6
  59. package/dist/chunks/checkbox-group.C3RH5Gcg.js +0 -152
  60. package/dist/chunks/checkbox-group.C3RH5Gcg.js.map +0 -1
  61. package/dist/chunks/data-grid.B-kBw540.js.map +0 -1
  62. package/dist/chunks/date-range-picker.BtPxkPN0.js +0 -942
  63. package/dist/chunks/date-range-picker.BtPxkPN0.js.map +0 -1
  64. package/dist/chunks/filter-bar.BLnSnOlj.js.map +0 -1
  65. package/dist/chunks/radio-group.B8ukv-pw.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"link.D8qpqg3W.js","sources":["../../src/components/link/link.types.ts","../../../ui-assets/icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["// TODO: revert to import once fully migrated to Vue 3\n// import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\n/**\n * Manually defined RouterLinkProps to ensure compatibility\n * with Vue Macros and Vue 2.7 / 3 monorepos.\n */\nexport interface RouterLinkProps {\n /**\n * Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to\n * `router.push()` internally, so the value can be either a string or a location descriptor object.\n */\n to: string | Location;\n /**\n * Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will\n * not create a new history record.\n *\n * @default false\n */\n replace?: boolean;\n /**\n * Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating\n * from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at\n * `/a/b`.\n *\n * @default false\n */\n append?: boolean;\n /**\n * Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to\n * render to, and it will still listen to click events for navigation.\n *\n * @default \"a\"\n */\n tag?: string;\n /**\n * Configure the active CSS class applied when the link is active. Note the default value can also be configured\n * globally via the `linkActiveClass` router constructor option.\n *\n * @default \"router-link-active\"\n */\n activeClass?: string;\n /**\n * The default active class matching behavior is **inclusive match**. For example, `<RouterLink to=\"/a\">` will get\n * this class applied as long as the current path starts with `/a/` or is `/a`.\n *\n * @default false\n */\n exact?: boolean;\n /**\n * Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections.\n *\n * @default false\n */\n exactPath?: boolean;\n /**\n * Configure the active CSS class applied when the link is active with exact path match. Note the default value can\n * also be configured globally via the `linkExactPathActiveClass` router constructor option.\n *\n * @default \"router-link-exact-path-active\"\n */\n exactPathActiveClass?: string;\n\n /**\n * Specify the event(s) that can trigger the link navigation.\n *\n * @default 'click'\n */\n event?: string | ReadonlyArray<string>;\n /**\n * Configure the active CSS class applied when the link is active with exact match. Note the default value can also be\n * configured globally via the `linkExactActiveClass` router constructor option.\n *\n * @default \"router-link-exact-active\"\n */\n exactActiveClass?: string;\n /**\n * Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed\n * values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the\n * default of page should be the best fit.\n *\n * @default \"page\"\n */\n ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n\nexport type BentoLinkProps = RouterLinkProps & {\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n};\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=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.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 <a\n v-if=\"external || isNotRouting\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :aria-describedby=\"externalLinkId\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" aria-hidden=\"true\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n <span v-if=\"external\" :id=\"externalLinkId\" class=\"b-link--visually-hidden\">{{ t('opensInNewTab') }}</span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props, ...nonForwardedProps }\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { generateUid } from '@/core/utils/ts';\n import { BentoTypography } from '@/components/typography';\n import { type BentoLinkProps, BentoLinkVariant } from './link.types';\n import { useI18n } from '@/utils/ts/i18n';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router.d.ts';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n to: null,\n replace: { type: Boolean },\n append: { type: Boolean },\n tag: null,\n activeClass: null,\n exact: { type: Boolean },\n exactPath: { type: Boolean },\n exactPathActiveClass: null,\n event: null,\n exactActiveClass: null,\n ariaCurrentValue: null,\n disableTypography: { type: Boolean },\n external: { type: Boolean },\n isButton: { type: Boolean },\n isNotRouting: { type: Boolean },\n target: { default: null },\n truncate: { type: Boolean },\n variant: { default: BentoLinkVariant.DEFAULT }\n});\n\n // Props that should not be forwarded to the underlying anchor element\n const nonForwardedProps = {\n variant: undefined,\n isButton: undefined,\n truncate: undefined,\n disableTypography: undefined,\n external: undefined,\n isNotRouting: undefined,\n };\n\n const externalLinkId = generateUid('external-link');\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n 'b-link': !props.isButton,\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? (props.target ?? '_blank') : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/link/link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","uuid","_sfc_main$1","__default__","messages","t","useI18n","nonForwardedProps","externalLinkId","generateUid","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;;;;AAyFY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;AClFZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;GC2GIE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,MAAA,EAAA,UAAAC,EAAA;AAElB;;;;;;;;;;;;;;;;;;;;;;;;iBA5EA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAwBAC,IAAA;AAAA,MAA0B,SAAA;AAAA,MACb,UAAA;AAAA,MACC,UAAA;AAAA,MACA,mBAAA;AAAA,MACS,UAAA;AAAA,MACT,cAAA;AAAA,IACI,GAGlBC,IAAAC,EAAA,eAAA,GAEAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,UAAA,CAAAC,EAAA;AAAA,MACtB,CAAA,WAAAf,EAAA,KAAA,EAAA,GAAAe,EAAA,YAAAf,EAAA;AAAA,MACyD,oBAAAe,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;4LAIA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"link.D8qpqg3W.js","sources":["../../src/components/link/link.types.ts","../../../ui-assets/icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["import type { Location } from 'vue-router/types/router.d.ts';\n// TODO: revert to import once fully migrated to Vue 3\n// import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\n/**\n * Manually defined RouterLinkProps to ensure compatibility\n * with Vue Macros and Vue 2.7 / 3 monorepos.\n */\nexport interface RouterLinkProps {\n /**\n * Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to\n * `router.push()` internally, so the value can be either a string or a location descriptor object.\n */\n to: string | Location;\n /**\n * Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will\n * not create a new history record.\n *\n * @default false\n */\n replace?: boolean;\n /**\n * Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating\n * from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at\n * `/a/b`.\n *\n * @default false\n */\n append?: boolean;\n /**\n * Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to\n * render to, and it will still listen to click events for navigation.\n *\n * @default \"a\"\n */\n tag?: string;\n /**\n * Configure the active CSS class applied when the link is active. Note the default value can also be configured\n * globally via the `linkActiveClass` router constructor option.\n *\n * @default \"router-link-active\"\n */\n activeClass?: string;\n /**\n * The default active class matching behavior is **inclusive match**. For example, `<RouterLink to=\"/a\">` will get\n * this class applied as long as the current path starts with `/a/` or is `/a`.\n *\n * @default false\n */\n exact?: boolean;\n /**\n * Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections.\n *\n * @default false\n */\n exactPath?: boolean;\n /**\n * Configure the active CSS class applied when the link is active with exact path match. Note the default value can\n * also be configured globally via the `linkExactPathActiveClass` router constructor option.\n *\n * @default \"router-link-exact-path-active\"\n */\n exactPathActiveClass?: string;\n\n /**\n * Specify the event(s) that can trigger the link navigation.\n *\n * @default 'click'\n */\n event?: string | ReadonlyArray<string>;\n /**\n * Configure the active CSS class applied when the link is active with exact match. Note the default value can also be\n * configured globally via the `linkExactActiveClass` router constructor option.\n *\n * @default \"router-link-exact-active\"\n */\n exactActiveClass?: string;\n /**\n * Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed\n * values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the\n * default of page should be the best fit.\n *\n * @default \"page\"\n */\n ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n\nexport type BentoLinkProps = RouterLinkProps & {\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n};\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=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.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 <a\n v-if=\"external || isNotRouting\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :aria-describedby=\"externalLinkId\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" aria-hidden=\"true\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n <span v-if=\"external\" :id=\"externalLinkId\" class=\"b-link--visually-hidden\">{{ t('opensInNewTab') }}</span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props, ...nonForwardedProps }\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { generateUid } from '@/core/utils/ts';\n import { BentoTypography } from '@/components/typography';\n import { type BentoLinkProps, BentoLinkVariant } from './link.types';\n import { useI18n } from '@/utils/ts/i18n';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router.d.ts';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n to: null,\n replace: { type: Boolean },\n append: { type: Boolean },\n tag: null,\n activeClass: null,\n exact: { type: Boolean },\n exactPath: { type: Boolean },\n exactPathActiveClass: null,\n event: null,\n exactActiveClass: null,\n ariaCurrentValue: null,\n disableTypography: { type: Boolean },\n external: { type: Boolean },\n isButton: { type: Boolean },\n isNotRouting: { type: Boolean },\n target: { default: null },\n truncate: { type: Boolean },\n variant: { default: BentoLinkVariant.DEFAULT }\n});\n\n // Props that should not be forwarded to the underlying anchor element\n const nonForwardedProps = {\n variant: undefined,\n isButton: undefined,\n truncate: undefined,\n disableTypography: undefined,\n external: undefined,\n isNotRouting: undefined,\n };\n\n const externalLinkId = generateUid('external-link');\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n 'b-link': !props.isButton,\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? (props.target ?? '_blank') : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/link/link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","uuid","_sfc_main$1","__default__","messages","t","useI18n","nonForwardedProps","externalLinkId","generateUid","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;;;;AA0FY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;ACnFZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;GC2GIE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,MAAA,EAAA,UAAAC,EAAA;AAElB;;;;;;;;;;;;;;;;;;;;;;;;iBA5EA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAwBAC,IAAA;AAAA,MAA0B,SAAA;AAAA,MACb,UAAA;AAAA,MACC,UAAA;AAAA,MACA,mBAAA;AAAA,MACS,UAAA;AAAA,MACT,cAAA;AAAA,IACI,GAGlBC,IAAAC,EAAA,eAAA,GAEAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,UAAA,CAAAC,EAAA;AAAA,MACtB,CAAA,WAAAf,EAAA,KAAA,EAAA,GAAAe,EAAA,YAAAf,EAAA;AAAA,MACyD,oBAAAe,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;4LAIA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;"}
@@ -1,22 +1,23 @@
1
- import { defineComponent as S, useSlots as E, toRefs as x, ref as I, computed as l, toRef as C, watch as L } from "vue";
1
+ import { defineComponent as E, useSlots as I, toRefs as L, ref as R, computed as s, toRef as B, watch as V } from "vue";
2
2
  import { u as O } from "./use-form-layout-loading.D3lALhtC.js";
3
- import { u as R } from "./use-has-slot.C9lQZ6nz.js";
4
- import { g as h } from "./generate-uid.NJ8tVoha.js";
5
- import { B as N, d as V } from "./typography.hlOAxsEn.js";
6
- import { B as w } from "./tag.BltIbSh3.js";
7
- import { u as k } from "./aria-label.CaUURpnB.js";
8
- import { u as A } from "./use-default-slot-validator.BDn0wkYP.js";
9
- import { g as $ } from "./get-slot-text.Bjb9dTSV.js";
10
- import { R as B, a as F } from "./radio-input.kzb4gxLW.js";
3
+ import { u as M } from "./use-has-slot.C9lQZ6nz.js";
4
+ import { g as y } from "./generate-uid.NJ8tVoha.js";
5
+ import { B as N, d as w } from "./typography.hlOAxsEn.js";
6
+ import { u as k } from "./form-field.BBqLu-vs.js";
7
+ import { B as A } from "./tag.BltIbSh3.js";
8
+ import { u as F } from "./aria-label.CaUURpnB.js";
9
+ import { u as $ } from "./use-default-slot-validator.BDn0wkYP.js";
10
+ import { g as q } from "./get-slot-text.Bjb9dTSV.js";
11
+ import { R as S, a as D } from "./radio-input.kzb4gxLW.js";
11
12
  import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
12
- import { C as q } from "./controls-group.82mB_GDw.js";
13
- import { E as D } from "./field-label.Auq-Pzho.js";
13
+ import { C as G } from "./controls-group.82mB_GDw.js";
14
+ import { E as H } from "./field-label.Auq-Pzho.js";
14
15
  import "../assets/radio-group.css";
15
- const G = {
16
+ const P = {
16
17
  name: "bento-radio-button",
17
18
  model: { prop: "modelValue" }
18
- }, H = /* @__PURE__ */ S({
19
- ...G,
19
+ }, U = /* @__PURE__ */ E({
20
+ ...P,
20
21
  props: {
21
22
  /**
22
23
  * Disable the radio button (optional)
@@ -61,42 +62,42 @@ const G = {
61
62
  },
62
63
  emits: ["input", "update:model-value"],
63
64
  setup(r, { expose: o, emit: t }) {
64
- const e = r, a = E(), i = R(a), { value: d } = x(e), c = h("bento-radio-button"), f = h("description"), n = I(null);
65
- A("bento-radio-button", a.default, a.description);
66
- const u = l(() => ({
67
- [`b-radio-button--${B.DISABLED}`]: e.disabled,
68
- [`b-radio-button--${B.READONLY}`]: e.readonly
69
- })), _ = k({
70
- ariaLabel: $(a)("default"),
71
- label: d.value
72
- }), b = l(() => e.value === e.modelValue), m = () => {
65
+ const e = r, a = I(), d = M(a), { value: n } = L(e), f = y("bento-radio-button"), _ = y("description"), l = R(null);
66
+ $("bento-radio-button", a.default, a.description);
67
+ const i = s(() => ({
68
+ [`b-radio-button--${S.DISABLED}`]: e.disabled,
69
+ [`b-radio-button--${S.READONLY}`]: e.readonly
70
+ })), u = F({
71
+ ariaLabel: q(a)("default"),
72
+ label: n.value
73
+ }), b = s(() => e.value === e.modelValue), m = () => {
73
74
  !e.disabled && !e.readonly && (t("update:model-value", e.value), t("input", e.value));
74
- }, s = () => {
75
- n.value.focus();
75
+ }, p = () => {
76
+ l.value.focus();
76
77
  };
77
78
  return o({
78
- focus: s
79
- }), { __sfc: !0, slots: a, hasSlot: i, props: e, emit: t, value: d, radioButtonId: c, descriptionId: f, radioInputRef: n, conditionalClassContainer: u, ariaLabel: _, isChecked: b, onChange: m, focus: s, BentoTag: w, BentoTypography: N, RadioInput: F };
79
+ focus: p
80
+ }), { __sfc: !0, slots: a, hasSlot: d, props: e, emit: t, value: n, radioButtonId: f, descriptionId: _, radioInputRef: l, conditionalClassContainer: i, ariaLabel: u, isChecked: b, onChange: m, focus: p, BentoTag: A, BentoTypography: N, RadioInput: D };
80
81
  }
81
82
  });
82
- var P = function() {
83
+ var z = function() {
83
84
  var o = this, t = o._self._c, e = o._self._setupProxy;
84
85
  return t("div", { staticClass: "b-radio-button", class: e.conditionalClassContainer, attrs: { "data-testid": "radio-button-container" } }, [t(e.RadioInput, { ref: "radioInputRef", attrs: { id: e.radioButtonId, "aria-label": e.ariaLabel, "aria-describedby": e.hasSlot("description") ? e.descriptionId : "", checked: e.isChecked, disabled: o.disabled, readonly: o.readonly, "has-error": o.hasError, value: e.value, "model-value": o.modelValue, name: o.name }, on: { "update:model-value": e.onChange } }), t("div", [e.hasSlot("default") ? t("label", { staticClass: "b-radio-button__label-container", attrs: { for: e.radioButtonId } }, [e.hasSlot("default") ? t("span", { staticClass: "b-radio-button__primary-label" }, [t(e.BentoTypography, { staticClass: "b-radio-button__label", attrs: { el: "span", variant: "body" } }, [o._t("default")], 2), o.tag ? t(e.BentoTag, o._b({ staticClass: "b-radio-button__label-tag" }, "bento-tag", o.tag, !1)) : o._e()], 1) : o._e(), e.hasSlot("default") && e.hasSlot("description") ? t(e.BentoTypography, { staticClass: "b-radio-button__description", attrs: { id: e.descriptionId, el: "span", variant: "body" } }, [o._t("description")], 2) : o._e()], 1) : o._e(), e.hasSlot("content") && e.isChecked ? t(e.BentoTypography, { staticClass: "b-radio-button__content", attrs: { el: "div" } }, [o._t("content")], 2) : o._e()], 1)], 1);
85
- }, z = [], U = /* @__PURE__ */ T(
86
- H,
87
- P,
86
+ }, Z = [], j = /* @__PURE__ */ T(
87
+ U,
88
88
  z,
89
+ Z,
89
90
  !1,
90
91
  null,
91
92
  "0cfaad5f"
92
93
  );
93
- const Z = U.exports;
94
- var y = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r))(y || {});
95
- const j = {
94
+ const Y = j.exports;
95
+ var v = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r))(v || {});
96
+ const J = {
96
97
  name: "bento-radio-group",
97
98
  model: { prop: "modelValue" }
98
- }, Y = /* @__PURE__ */ S({
99
- ...j,
99
+ }, K = /* @__PURE__ */ E({
100
+ ...J,
100
101
  props: {
101
102
  description: { default: null },
102
103
  disabled: { type: Boolean, default: !1 },
@@ -112,47 +113,47 @@ const j = {
112
113
  hideLabel: { type: Boolean, default: null },
113
114
  items: null,
114
115
  modelValue: { default: null },
115
- variant: { default: y.VERTICAL }
116
+ variant: { default: v.VERTICAL }
116
117
  },
117
- emits: ["input", "update:model-value"],
118
+ emits: ["update:model-value", "input"],
118
119
  setup(r, { expose: o, emit: t }) {
119
- const e = r, a = "bento-radio-group", i = E(), d = R(i), c = C(e, "modelValue"), f = h("error"), { isReadOnly: n } = O(C(e, "readonly")), u = I(null), _ = l(
120
- () => !e.disabled && !n.value && (!!e.errorMessage || e.hasError)
121
- ), b = l(() => !e.disabled && !n.value && !!e.errorMessage), m = l(() => ({
122
- "b-radio-group__buttons--horizontal": e.variant === y.HORIZONTAL
123
- })), s = l(() => e.variant === "vertical"), v = l(() => d("content") && !(s != null && s.value)), M = (p) => {
124
- t("update:model-value", p), t("input", p);
120
+ const e = r, a = "bento-radio-group", d = I(), n = M(d), f = B(e, "modelValue"), _ = y("error"), { isReadOnly: l } = O(B(e, "readonly")), { emitValue: i } = k(t), u = R(null), b = s(
121
+ () => !e.disabled && !l.value && (!!e.errorMessage || e.hasError)
122
+ ), m = s(() => !e.disabled && !l.value && !!e.errorMessage), p = s(() => ({
123
+ "b-radio-group__buttons--horizontal": e.variant === v.HORIZONTAL
124
+ })), c = s(() => e.variant === "vertical"), g = s(() => n("content") && !(c != null && c.value)), x = (h) => {
125
+ i(h);
125
126
  };
126
- e.hasError && V(
127
+ e.hasError && w(
127
128
  'BentoRadioGroup "hasError" property',
128
129
  `Use the BentoRadioGroup "errorMessage" property instead to indicate that there is a modifier error.
129
130
  Having the field as "undefined" will hide/remove the error.
130
131
  <bento-radio-group errorMessage="Error message text" />`,
131
132
  "2.0.0"
132
- ), L(
133
- v,
134
- (p) => {
135
- if (p)
133
+ ), V(
134
+ g,
135
+ (h) => {
136
+ if (h)
136
137
  throw new Error("The content slot is only available for the vertical radio group layout");
137
138
  },
138
139
  {
139
140
  immediate: !0
140
141
  }
141
142
  );
142
- const g = () => {
143
+ const C = () => {
143
144
  u.value[0].focus();
144
145
  };
145
146
  return o({
146
- focus: g
147
- }), { __sfc: !0, COMPONENT_NAME: a, slots: i, hasSlot: d, emit: t, props: e, inputValue: c, errorId: f, isReadOnly: n, radioButton: u, shouldShowError: _, shouldShowErrorMessage: b, conditionalClasses: m, isVertical: s, shouldShowSlotError: v, onInput: M, focus: g, ControlsGroup: q, ErrorMessage: D, BentoRadioButton: Z };
147
+ focus: C
148
+ }), { __sfc: !0, COMPONENT_NAME: a, slots: d, hasSlot: n, emit: t, props: e, inputValue: f, errorId: _, isReadOnly: l, emitValue: i, radioButton: u, shouldShowError: b, shouldShowErrorMessage: m, conditionalClasses: p, isVertical: c, shouldShowSlotError: g, onUpdateModelValue: x, focus: C, ControlsGroup: G, ErrorMessage: H, BentoRadioButton: Y };
148
149
  }
149
150
  });
150
- var J = function() {
151
+ var Q = function() {
151
152
  var o = this, t = o._self._c, e = o._self._setupProxy;
152
153
  return t("div", { staticClass: "b-radio-group" }, [t(e.ControlsGroup, { staticClass: "b-radio-group__buttons", class: e.conditionalClasses, attrs: { "aria-describedby": e.shouldShowErrorMessage ? e.errorId : "", "component-name": e.COMPONENT_NAME, description: o.description, disabled: o.disabled, form: o.formId, label: o.label, optional: o.optional, required: o.required, "hide-label": o.hideLabel, "tooltip-text": o.tooltipText, role: "radiogroup", "aria-readonly": e.isReadOnly }, scopedSlots: o._u([e.hasSlot("description") ? { key: "description", fn: function() {
153
154
  return [o._t("description")];
154
155
  }, proxy: !0 } : null], null, !0) }, o._l(o.items, function(a) {
155
- return t(e.BentoRadioButton, { key: a.value, ref: "radioButton", refInFor: !0, attrs: { "model-value": e.inputValue, value: a.value, disabled: o.disabled || a.disabled, readonly: e.isReadOnly || a.readonly, "has-error": e.shouldShowError || a.hasError, tag: a.tag, name: o.formId || o.label }, on: { "update:model-value": e.onInput }, scopedSlots: o._u([{ key: "default", fn: function() {
156
+ return t(e.BentoRadioButton, { key: a.value, ref: "radioButton", refInFor: !0, attrs: { "model-value": e.inputValue, value: a.value, disabled: o.disabled || a.disabled, readonly: e.isReadOnly || a.readonly, "has-error": e.shouldShowError || a.hasError, tag: a.tag, name: o.formId || o.label }, on: { "update:model-value": e.onUpdateModelValue }, scopedSlots: o._u([{ key: "default", fn: function() {
156
157
  return [o._v(o._s(a.label))];
157
158
  }, proxy: !0 }, a.description ? { key: "description", fn: function() {
158
159
  return [o._v(o._s(a.description))];
@@ -160,18 +161,18 @@ var J = function() {
160
161
  return [o._t("content")];
161
162
  }, proxy: !0 } : null], null, !0) });
162
163
  }), 1), e.shouldShowErrorMessage ? t(e.ErrorMessage, { staticClass: "b-radio-group__error-message", attrs: { id: e.errorId, "error-message": o.errorMessage } }) : o._e()], 1);
163
- }, K = [], Q = /* @__PURE__ */ T(
164
- Y,
165
- J,
164
+ }, W = [], X = /* @__PURE__ */ T(
166
165
  K,
166
+ Q,
167
+ W,
167
168
  !1,
168
169
  null,
169
- "40c21bb8"
170
+ "d4febb9d"
170
171
  );
171
- const pe = Q.exports;
172
+ const _e = X.exports;
172
173
  export {
173
- pe as B,
174
- y as a,
175
- Z as b
174
+ _e as B,
175
+ v as a,
176
+ Y as b
176
177
  };
177
- //# sourceMappingURL=radio-group.B8ukv-pw.js.map
178
+ //# sourceMappingURL=radio-group.0JNwgkZa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.0JNwgkZa.js","sources":["../../src/components/radio-group/components/radio-button/radio-button.vue","../../src/components/radio-group/radio-group.types.ts","../../src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n ref=\"radioInputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, type PropType, ref, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, type BentoRadioButtonTag, type BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n const radioInputRef = ref(null);\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n\n const focus = () => {\n radioInputRef.value.focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { FormField, FormFieldEmits } from '../../types/form-field';\nimport type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport type BentoRadioGroupEmits = FormFieldEmits<BentoRadioGroupValue>;\n\nexport interface BentoRadioGroupProps extends FormField {\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n * @default null\n */\n formId?: string | null;\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n * @deprecated Use \"errorMessage\" prop instead\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Shows/hides the group label.\n * @default null\n */\n hideLabel?: boolean | null;\n\n /**\n * The radio group's items.\n * Required.\n */\n items: BentoRadioGroupItems;\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * Required.\n */\n label: string;\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n * @default null\n */\n modelValue?: BentoRadioGroupValue | null;\n\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @default BentoRadioGroupVariant.VERTICAL\n */\n variant?: BentoRadioGroupVariant | `${BentoRadioGroupVariant}`;\n}\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n role=\"radiogroup\"\n :aria-readonly=\"isReadOnly\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n ref=\"radioButton\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onUpdateModelValue\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n <template v-if=\"hasSlot('description')\" #description>\n <slot name=\"description\" />\n </template>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { type BentoRadioGroupEmits, type BentoRadioGroupProps, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"update:model-value\", \"input\"]);\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: null,\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hasError: { type: Boolean, default: false },\n hideLabel: { type: Boolean, default: null },\n items: null,\n modelValue: { default: null },\n variant: { default: BentoRadioGroupVariant.VERTICAL }\n});\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits(emit);\n const radioButton = ref(null);\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onUpdateModelValue = value => {\n emitValue(value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n\n const focus = () => {\n radioButton.value[0].focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","value","toRefs","props","radioButtonId","generateUid","descriptionId","radioInputRef","ref","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","onChange","emit","focus","expose","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","emitValue","useFormFieldEmits","radioButton","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onUpdateModelValue","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;;AA4KI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7HAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAoDA,EAAA,OAAAI,EAAA,IAAAC,EAAAC,CAAA,GACAC,IAAAC,EAAA,oBAAA,GACAC,IAAAD,EAAA,aAAA,GACAE,IAAAC,EAAA,IAAA;AAEA,IAAAC,EAAA,sBAAAZ,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAa,IAAAC,EAAA,OAAA;AAAA,MAAkD,CAAA,mBAAAC,EAAA,QAAA,EAAA,GAAAT,EAAA;AAAA,MACoB,CAAA,mBAAAS,EAAA,QAAA,EAAA,GAAAT,EAAA;AAAA,IACA,EAAA,GAGtEU,IAAAC,EAAA;AAAA,MAA+B,WAAAC,EAAAlB,CAAA,EAAA,SAAA;AAAA,MACY,OAAAI,EAAA;AAAA,IAC1B,CAAA,GAGjBe,IAAAL,EAAA,MAAAR,EAAA,UAAAA,EAAA,UAAA,GAEAc,IAAA,MAAA;AACI,MAAA,CAAAd,EAAA,YAAA,CAAAA,EAAA,aACIe,EAAA,sBAAAf,EAAA,KAAA,GACAe,EAAA,SAAAf,EAAA,KAAA;AAAA,IACJ,GAGJgB,IAAA,MAAA;AACI,MAAAZ,EAAA,MAAA,MAAA;AAAA,IAA0B;AAG9B,WAAAa,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA;;;;;;;;;;;;;;;AChII,IAAAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;AC8JR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;iBAvGAC,IAAA,qBAEA3B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAsBA4B,IAAAC,EAAAvB,GAAA,YAAA,GACAwB,IAAAtB,EAAA,OAAA,GACA,EAAA,YAAAuB,EAAA,IAAAC,EAAAH,EAAAvB,GAAA,UAAA,CAAA,GACA,EAAA,WAAA2B,EAAA,IAAAC,EAAAb,CAAA,GACAc,IAAAxB,EAAA,IAAA,GAEAyB,IAAAtB;AAAA,MAAwB,MAAA,CAAAR,EAAA,YAAA,CAAAyB,EAAA,UAAA,CAAA,CAAAzB,EAAA,gBAAAA,EAAA;AAAA,IACyD,GAEjF+B,IAAAvB,EAAA,MAAA,CAAAR,EAAA,YAAA,CAAAyB,EAAA,SAAA,CAAA,CAAAzB,EAAA,YAAA,GAEAgC,IAAAxB,EAAA,OAAA;AAAA,MAA2C,sCAAAR,EAAA,YAAAkB,EAAA;AAAA,IACwC,EAAA,GAInFe,IAAAzB,EAAA,MAAAR,EAAA,YAAA,UAAA,GACAkC,IAAA1B,EAAA,MAAAZ,EAAA,SAAA,KAAA,EAAAqC,KAAA,QAAAA,EAAA,MAAA,GAEAE,IAAA,CAAArC,MAAA;AACI,MAAA6B,EAAA7B,CAAA;AAAA,IAAe;AAGnB,IAAAE,EAAA,YACIoC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRC;AAAA,MAAAH;AAAA,MACI,CAAAI,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA,MAAA,wEAAA;AAAA,MACJ;AAAA,MACJ;AAAA,QACA,WAAA;AAAA,MACe;AAAA,IACf;AAGJ,UAAAtB,IAAA,MAAA;AACI,MAAAa,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,IAA2B;AAG/B,WAAAZ,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,7 @@ import { B as tr } from "./alert.SZPP58tl.js";
5
5
  import { n as yt } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
6
  import "./index.Cl4_42j5.js";
7
7
  import { B as er } from "./link.D8qpqg3W.js";
8
- import { B as nr } from "./checkbox.itbBlXev.js";
8
+ import { B as nr } from "./checkbox.CqF5Dank.js";
9
9
  import { u as rr } from "./index.B6WW_F-J.js";
10
10
  import { u as ir } from "./aria-label.CaUURpnB.js";
11
11
  import { g as _e } from "./generate-uid.NJ8tVoha.js";
@@ -6200,4 +6200,4 @@ const To = xo.exports;
6200
6200
  export {
6201
6201
  To as r
6202
6202
  };
6203
- //# sourceMappingURL=rich-text-editor.DzH-Z5oi.js.map
6203
+ //# sourceMappingURL=rich-text-editor.NFLhgVJo.js.map