forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopilot-chat-view-feather.ts
More file actions
44 lines (42 loc) · 1.2 KB
/
Copy pathcopilot-chat-view-feather.ts
File metadata and controls
44 lines (42 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {
Component,
input,
ChangeDetectionStrategy,
ViewEncapsulation,
} from "@angular/core";
import { CommonModule } from "@angular/common";
import { cn } from "../../utils";
/**
* Feather component for CopilotChatView
* Creates a gradient overlay effect between messages and input
* Matches React implementation exactly with same Tailwind classes
*/
@Component({
selector: "copilot-chat-view-feather",
standalone: true,
imports: [CommonModule],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: `
<div [class]="computedClass" [style]="style()"></div>
`,
})
export class CopilotChatViewFeather {
inputClass = input<string | undefined>();
style = input<{ [key: string]: any } | undefined>();
// Computed class matching React exactly
get computedClass(): string {
return cn(
// Positioning
"absolute bottom-0 left-0 right-4 h-24 pointer-events-none z-10",
// Gradient
"bg-gradient-to-t",
// Light mode colors
"from-white via-white to-transparent",
// Dark mode colors
"dark:from-[rgb(33,33,33)] dark:via-[rgb(33,33,33)]",
// Custom classes
this.inputClass(),
);
}
}