| 1 |
<template> |
| 2 |
<div |
| 3 |
:class="[ |
| 4 |
'ivyforms-pro-badge', |
| 5 |
'ivyforms-flex', |
| 6 |
'ivyforms-justify-content-center', |
| 7 |
'ivyforms-align-items-center', |
| 8 |
`ivyforms-pro-badge--size-${props.size}`, |
| 9 |
`ivyforms-pro-badge--image-${props.image}`, |
| 10 |
]" |
| 11 |
> |
| 12 |
<component :is="currentProBolt" v-if="props.image === 'pro-bolt'" /> |
| 13 |
<component :is="currentProText" v-if="props.image === 'pro-text'" /> |
| 14 |
<component :is="currentProTextWithBolt" v-if="props.image === 'pro-text-with-bolt'" /> |
| 15 |
<component :is="currentProBoltNoBackground" v-if="props.image === 'pro-bolt-no-background'" /> |
| 16 |
<component :is="currentProTextNoBackground" v-if="props.image === 'pro-text-no-background'" /> |
| 17 |
<component |
| 18 |
:is="currentProTextWithBoltNoBackground" |
| 19 |
v-if="props.image === 'pro-text-with-bolt-no-background'" |
| 20 |
/> |
| 21 |
</div> |
| 22 |
</template> |
| 23 |
|
| 24 |
<script setup lang="ts"> |
| 25 |
import { computed } from 'vue' |
| 26 |
import ProBoltLight from '@/assets/images/pro-badge/pro-bolt.svg?component' |
| 27 |
import ProBoltDark from '@/assets/images/pro-badge/pro-bolt-dark.svg?component' |
| 28 |
import ProTextLight from '@/assets/images/pro-badge/pro-text.svg?component' |
| 29 |
import ProTextDark from '@/assets/images/pro-badge/pro-text-dark.svg?component' |
| 30 |
import ProTextWithBoltLight from '@/assets/images/pro-badge/pro-text-with-bolt.svg?component' |
| 31 |
import ProTextWithBoltDark from '@/assets/images/pro-badge/pro-text-with-bolt-dark.svg?component' |
| 32 |
import ProBoltNoBackground from '@/assets/images/pro-badge/pro-bolt-no-background.svg?component' |
| 33 |
import ProTextNoBackground from '@/assets/images/pro-badge/pro-text-no-background.svg?component' |
| 34 |
import ProTextWithBoltNoBackground from '@/assets/images/pro-badge/pro-text-with-bolt-no-background.svg?component' |
| 35 |
import { useTheme } from '@/composables/useTheme' |
| 36 |
|
| 37 |
const { isDark } = useTheme() |
| 38 |
interface Props { |
| 39 |
image?: |
| 40 |
| 'pro-bolt' |
| 41 |
| 'pro-text' |
| 42 |
| 'pro-text-with-bolt' |
| 43 |
| 'pro-bolt-no-background' |
| 44 |
| 'pro-text-no-background' |
| 45 |
| 'pro-text-with-bolt-no-background' |
| 46 |
size?: 's' | 'd' | 'l' |
| 47 |
} |
| 48 |
|
| 49 |
const props = withDefaults(defineProps<Props>(), { |
| 50 |
image: 'pro-text-with-bolt', |
| 51 |
size: 'd', |
| 52 |
}) |
| 53 |
|
| 54 |
const currentProBolt = computed(() => (isDark() ? ProBoltDark : ProBoltLight)) |
| 55 |
const currentProText = computed(() => (isDark() ? ProTextDark : ProTextLight)) |
| 56 |
const currentProTextWithBolt = computed(() => |
| 57 |
isDark() ? ProTextWithBoltDark : ProTextWithBoltLight, |
| 58 |
) |
| 59 |
|
| 60 |
const currentProBoltNoBackground = computed(() => ProBoltNoBackground) |
| 61 |
const currentProTextNoBackground = computed(() => ProTextNoBackground) |
| 62 |
const currentProTextWithBoltNoBackground = computed(() => ProTextWithBoltNoBackground) |
| 63 |
</script> |
| 64 |
|
| 65 |
<style scoped lang="scss"> |
| 66 |
.ivyforms-pro-badge { |
| 67 |
&--size-s { |
| 68 |
height: 16px; |
| 69 |
svg { |
| 70 |
transform: scale(0.8); |
| 71 |
border-radius: 50%; |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
&--size-d { |
| 76 |
height: 28px; |
| 77 |
svg { |
| 78 |
border-radius: 50%; |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
&--size-l { |
| 83 |
height: 24px; |
| 84 |
svg { |
| 85 |
transform: scale(1.2); |
| 86 |
} |
| 87 |
} |
| 88 |
} |
| 89 |
</style> |
| 90 |
|