# Pull Request Template ## Description This PR includes the following updates: 1. Updated the design system color tokens by introducing new tokens for surfaces, overlays, buttons, labels, and cards, along with refinements to existing shades. 2. Refreshed both light and dark themes with adjusted background, border, and solid colors. 3. Replaced static Inter font files with the Inter variable font (including italic), supporting weights from 100–900. 4. Added custom font weights (420, 440, 460, 520) along with custom typography classes to enable more fine-grained and consistent typography control. ## Type of change - [x] New feature (non-breaking change which adds functionality) ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Pranav <pranav@chatwoot.com>
120 lines
2.5 KiB
Vue
120 lines
2.5 KiB
Vue
<script setup>
|
|
import Button from 'dashboard/components-next/button/Button.vue';
|
|
|
|
defineProps({
|
|
card: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
isDismissing: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(['readMore', 'dismiss', 'imgClick']);
|
|
|
|
const handleReadMore = () => {
|
|
emit('readMore');
|
|
};
|
|
|
|
const handleDismiss = () => {
|
|
emit('dismiss');
|
|
};
|
|
|
|
const handleImgClick = () => {
|
|
emit('imgClick');
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
data-testid="changelog-card"
|
|
class="flex flex-col justify-between p-3 w-full rounded-lg border shadow-sm transition-all duration-200 border-n-weak bg-n-card text-n-slate-12"
|
|
:class="{
|
|
'animate-fade-out pointer-events-none': isDismissing,
|
|
'hover:shadow': isActive,
|
|
}"
|
|
>
|
|
<div>
|
|
<h5
|
|
:title="card.meta_title"
|
|
class="mb-1 text-sm font-semibold line-clamp-1 text-n-slate-12"
|
|
>
|
|
{{ card.meta_title }}
|
|
</h5>
|
|
<p
|
|
:title="card.meta_description"
|
|
class="mb-0 text-xs leading-relaxed text-n-slate-11 line-clamp-2"
|
|
>
|
|
{{ card.meta_description }}
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
v-if="card.feature_image"
|
|
class="block overflow-hidden my-3 rounded-md border border-n-weak/40"
|
|
>
|
|
<img
|
|
:src="card.feature_image"
|
|
:alt="`${card.title} preview image`"
|
|
class="object-cover w-full h-24 rounded-md cursor-pointer"
|
|
loading="lazy"
|
|
@click.stop="handleImgClick"
|
|
/>
|
|
</div>
|
|
<div
|
|
v-else
|
|
class="block overflow-hidden my-3 rounded-md border border-n-weak/40"
|
|
>
|
|
<img
|
|
:src="card.feature_image"
|
|
:alt="`${card.title} preview image`"
|
|
class="object-cover w-full h-24 rounded-md cursor-pointer"
|
|
loading="lazy"
|
|
@click.stop="handleImgClick"
|
|
/>
|
|
</div>
|
|
|
|
<div class="flex justify-between items-center mt-1">
|
|
<Button
|
|
label="Read more"
|
|
color="slate"
|
|
link
|
|
sm
|
|
class="text-xs font-normal hover:!no-underline"
|
|
@click.stop="handleReadMore"
|
|
/>
|
|
<Button
|
|
label="Dismiss"
|
|
color="slate"
|
|
link
|
|
sm
|
|
class="text-xs font-normal hover:!no-underline"
|
|
@click.stop="handleDismiss"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
@keyframes fade-out {
|
|
from {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
transform: scale(0.95);
|
|
}
|
|
}
|
|
|
|
.animate-fade-out {
|
|
animation: fade-out 0.2s ease-out forwards;
|
|
}
|
|
</style>
|