@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
1 lines • 1.24 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-base-component/index.ts"],"sourcesContent":["import { computed, unref } from 'vue'\nimport { vuesaxColors } from '@vuesax-alpha/constants'\nimport { useNamespace } from '../use-namespace'\nimport type { MaybeRef } from '@vuesax-alpha/utils'\n\nexport const useVuesaxBaseComponent = (\n color?: MaybeRef<string | undefined>\n) => {\n const ns = useNamespace('component')\n\n const className = computed(() => {\n return vuesaxColors.includes(unref(color) as any) ? ns.m(unref(color)) : ''\n })\n\n const isColor = computed(() => (!!unref(color) && ns.m(ns.is('color'))) || '')\n\n return [unref(className), unref(isColor)]\n}\n"],"names":[],"mappings":";;;;;AAKa,MAAA,sBAAA,GAAyB,CACpC,KACG,KAAA;AACH,EAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,EAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAC/B,IAAO,OAAA,YAAA,CAAa,QAAS,CAAA,KAAA,CAAM,KAAK,CAAQ,CAAI,GAAA,EAAA,CAAG,CAAE,CAAA,KAAA,CAAM,KAAK,CAAC,CAAI,GAAA,EAAA,CAAA;AAAA,GAC1E,CAAA,CAAA;AAED,EAAA,MAAM,OAAU,GAAA,QAAA,CAAS,MAAO,CAAC,CAAC,KAAM,CAAA,KAAK,CAAK,IAAA,EAAA,CAAG,EAAE,EAAG,CAAA,EAAA,CAAG,OAAO,CAAC,KAAM,EAAE,CAAA,CAAA;AAE7E,EAAA,OAAO,CAAC,KAAM,CAAA,SAAS,CAAG,EAAA,KAAA,CAAM,OAAO,CAAC,CAAA,CAAA;AAC1C;;;;"}