bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 1.29 kB
Source Map (JSON)
{"version":3,"file":"useColorVariantClasses-B6Me_Kx6.mjs","names":[],"sources":["../src/composables/useColorVariantClasses.ts"],"sourcesContent":["import {computed, type MaybeRefOrGetter, toValue} from 'vue'\nimport type {BorderColorVariant, ColorExtendables} from '../types/ColorTypes'\n\nexport const useColorVariantClasses = (\n obj: MaybeRefOrGetter<ColorExtendables & {borderVariant?: BorderColorVariant | null}>\n) =>\n computed(() => {\n let props = toValue(obj)\n props = {\n variant: props.variant ?? null,\n bgVariant: props.bgVariant ?? null,\n textVariant: props.textVariant ?? null,\n borderVariant: props.borderVariant ?? null,\n }\n return {\n [`text-bg-${props.variant}`]: props.variant !== null,\n [`text-${props.textVariant}`]: props.textVariant !== null,\n [`bg-${props.bgVariant}`]: props.bgVariant !== null,\n [`border-${props.borderVariant}`]: props.borderVariant !== null,\n }\n })\n"],"mappings":";;AAGA,IAAa,0BACX,QAEA,eAAe;CACb,IAAI,QAAQ,QAAQ,IAAI;AACxB,SAAQ;EACN,SAAS,MAAM,WAAW;EAC1B,WAAW,MAAM,aAAa;EAC9B,aAAa,MAAM,eAAe;EAClC,eAAe,MAAM,iBAAiB;EACvC;AACD,QAAO;GACJ,WAAW,MAAM,YAAY,MAAM,YAAY;GAC/C,QAAQ,MAAM,gBAAgB,MAAM,gBAAgB;GACpD,MAAM,MAAM,cAAc,MAAM,cAAc;GAC9C,UAAU,MAAM,kBAAkB,MAAM,kBAAkB;EAC5D;EACD"}