Skip to content

Commit 411237f

Browse files
committed
Adds highlight support to card component
Introduces a new highlighted prop to enable visual highlighting of cards, useful for indicating selection anchors or drawing attention to specific items. Applies a subtle box shadow when the card is highlighted to provide clear visual feedback without being intrusive.
1 parent 84dd721 commit 411237f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client/src/components/Common/GCard.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ interface Props {
176176
* @default "Last updated"
177177
*/
178178
updateTimeTitle?: string;
179+
180+
/** Whether this card is highlighted (for example, as a range selection anchor)
181+
* @default false
182+
*/
183+
highlighted?: boolean;
179184
}
180185
181186
const props = withDefaults(defineProps<Props>(), {
@@ -207,6 +212,7 @@ const props = withDefaults(defineProps<Props>(), {
207212
updateTime: "",
208213
updateTimeIcon: () => faEdit,
209214
updateTimeTitle: "Last updated",
215+
highlighted: false,
210216
});
211217
212218
/**
@@ -310,7 +316,7 @@ function onKeyDown(event: KeyboardEvent) {
310316
<div
311317
:id="`g-card-content-${props.id}`"
312318
class="g-card-content d-flex flex-column justify-content-between h-100 p-2"
313-
:class="contentClass">
319+
:class="[{ 'g-card-highlighted': props.highlighted }, contentClass]">
314320
<slot>
315321
<div class="d-flex flex-column flex-gapy-1">
316322
<div
@@ -701,6 +707,10 @@ function onKeyDown(event: KeyboardEvent) {
701707
border-left: 0.25rem solid $brand-primary;
702708
}
703709
710+
&.g-card-highlighted .g-card-content {
711+
box-shadow: 0 0 0 0.2rem transparentize($brand-primary, 0.75);
712+
}
713+
704714
&.g-card-clickable {
705715
cursor: pointer;
706716

0 commit comments

Comments
 (0)