-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdditionalContext.svelte
More file actions
76 lines (69 loc) · 1.92 KB
/
AdditionalContext.svelte
File metadata and controls
76 lines (69 loc) · 1.92 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script lang="ts">
// biome-ignore lint/style/useConst: Svelte 5 $props() pattern
let { additionalContext = $bindable(''), expanded = $bindable(false) } = $props()
</script>
<details class="context-details" bind:open={expanded}>
<summary>add more context</summary>
<textarea
class="context-input"
rows="4"
bind:value={additionalContext}
placeholder="anything else we should know about?"
></textarea>
{#if additionalContext.trim() !== ''}
<div class="button-container">
<button
type="button"
class="clear-button"
onclick={() => {
additionalContext = ''
}}
>
clear
</button>
</div>
{/if}
</details>
<style>
details.context-details {
text-align: left;
border: 1px solid var(--light);
background-color: var(--white);
border-radius: var(--border-radius);
padding: 1rem;
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
details summary {
cursor: pointer;
font-weight: 500;
}
textarea.context-input {
font-family: var(--label-font);
width: 100%;
margin-top: 0.75rem;
padding: 0.75rem;
border: 1px solid var(--light);
border-radius: var(--border-radius);
resize: vertical;
min-height: 80px;
color: var(--primary-dark);
}
.clear-button {
border: none;
background-color: var(--light);
color: var(--primary-dark);
border-radius: var(--border-radius);
padding: 0.25rem 0.75rem;
cursor: pointer;
}
.clear-button:hover {
background-color: var(--primary-dark);
color: var(--white);
}
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 0.5rem;
}
</style>