diff --git a/webapp/src/app/shared/ui/chip/chip.component.scss b/webapp/src/app/shared/ui/chip/chip.component.scss index 3989651b..13e7508d 100644 --- a/webapp/src/app/shared/ui/chip/chip.component.scss +++ b/webapp/src/app/shared/ui/chip/chip.component.scss @@ -18,6 +18,15 @@ font-weight: 600; line-height: 1.2; white-space: nowrap; + gap: 2px; + cursor: pointer; + &:hover { + background: color-mix( + in srgb, + var(--chip-color) 20%, + var(--sg-color-mix-base) + ); + } } :host(.outlined) { @@ -28,3 +37,9 @@ ); background: var(--sg-surface); } + +:host(.active) { + border-color: var(--chip-color); + box-shadow: 0 0 0 1px var(--chip-color); + background: color-mix(in srgb, var(--chip-color) 8%, var(--sg-surface)); +} diff --git a/webapp/src/app/shared/ui/chip/chip.component.ts b/webapp/src/app/shared/ui/chip/chip.component.ts index a858905a..d51f5c94 100644 --- a/webapp/src/app/shared/ui/chip/chip.component.ts +++ b/webapp/src/app/shared/ui/chip/chip.component.ts @@ -32,12 +32,17 @@ const CHIP_COLORS: Record = { export class ChipComponent { @Input() variant: ChipVariant = 'normal'; @Input() color: ChipColor = 'primary'; - + @Input() active: boolean = false; @HostBinding('class.outlined') get outlined(): boolean { return this.variant === 'outlined'; } + @HostBinding('class.active') + get isActive(): boolean { + return this.active; + } + @HostBinding('style.--chip-color') get chipColor(): string { return CHIP_COLORS[this.color] ?? this.color;