victor HF staff commited on
Commit
9c0f4e3
1 Parent(s): a1b30a9
src/lib/components/Playground/Playground.svelte CHANGED
@@ -129,7 +129,7 @@
129
  <svelte:window on:keydown={onKeydown} />
130
 
131
  <div
132
- class="grid h-dvh max-h-dvh divide-gray-200 overflow-hidden max-md:grid-cols-1 max-md:divide-y md:grid-cols-[260px,1fr,260px] md:divide-x"
133
  >
134
  <div class="relative flex flex-col overflow-y-auto p-5 pb-24">
135
  <div class="pb-2 text-sm font-semibold">SYSTEM</div>
@@ -142,9 +142,9 @@
142
  class="absolute inset-x-0 bottom-0 h-full resize-none bg-transparent p-2 pl-5 pr-3 pt-12 outline-none"
143
  ></textarea>
144
  </div>
145
- <div class="relative divide-y divide-gray-200">
146
  <div
147
- class="flex max-h-[calc(100dvh-5rem)] flex-col divide-y divide-gray-200 overflow-y-auto"
148
  bind:this={messageContainer}
149
  >
150
  {#each messages as message, i}
@@ -152,7 +152,7 @@
152
  {/each}
153
 
154
  <button
155
- class="grid w-full grid-cols-[130px,1fr] items-center py-6 hover:bg-gray-50"
156
  on:click={addMessage}
157
  >
158
  <div class="button !p-0 text-sm font-semibold">Add message</div>
@@ -185,7 +185,7 @@
185
  <button
186
  on:click={submit}
187
  type="button"
188
- class="flex h-[42px] w-24 items-center justify-center rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700"
189
  >
190
  {#if loading}
191
  <div class="flex flex-none items-center gap-[3px]">
 
129
  <svelte:window on:keydown={onKeydown} />
130
 
131
  <div
132
+ class="grid h-dvh max-h-dvh divide-gray-200 overflow-hidden max-md:grid-cols-1 max-md:divide-y md:grid-cols-[260px,1fr,260px] md:divide-x dark:divide-gray-800 dark:bg-gray-900 dark:text-gray-300"
133
  >
134
  <div class="relative flex flex-col overflow-y-auto p-5 pb-24">
135
  <div class="pb-2 text-sm font-semibold">SYSTEM</div>
 
142
  class="absolute inset-x-0 bottom-0 h-full resize-none bg-transparent p-2 pl-5 pr-3 pt-12 outline-none"
143
  ></textarea>
144
  </div>
145
+ <div class="relative divide-y divide-gray-200 dark:divide-gray-800">
146
  <div
147
+ class="flex max-h-[calc(100dvh-5rem)] flex-col divide-y divide-gray-200 overflow-y-auto dark:divide-gray-800"
148
  bind:this={messageContainer}
149
  >
150
  {#each messages as message, i}
 
152
  {/each}
153
 
154
  <button
155
+ class="grid w-full grid-cols-[130px,1fr] items-center py-6 hover:bg-gray-50 dark:hover:bg-gray-800"
156
  on:click={addMessage}
157
  >
158
  <div class="button !p-0 text-sm font-semibold">Add message</div>
 
185
  <button
186
  on:click={submit}
187
  type="button"
188
+ class="flex h-[42px] w-24 items-center justify-center rounded-lg bg-black px-5 py-2.5 text-sm font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-gray-700"
189
  >
190
  {#if loading}
191
  <div class="flex flex-none items-center gap-[3px]">
src/lib/components/Playground/PlaygroundMessage.svelte CHANGED
@@ -12,14 +12,14 @@
12
  </script>
13
 
14
  <div
15
- class="group/message group grid grid-cols-[130px,1fr,2.5rem] items-start gap-4 px-6 pb-6 pt-4 hover:bg-gray-50"
16
  >
17
  <div class="pb-2 pt-3 text-sm font-semibold uppercase">{message.role}</div>
18
  <textarea
19
  autofocus={message.role === 'user'}
20
  bind:value={message.content}
21
  placeholder="Enter {message.role} message"
22
- class="resize-none rounded px-3 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y focus:resize-y focus:ring group-hover:ring"
23
  rows="1"
24
  ></textarea>
25
  <button
 
12
  </script>
13
 
14
  <div
15
+ class="group/message group grid grid-cols-[130px,1fr,2.5rem] items-start gap-4 px-6 pb-6 pt-4 hover:bg-gray-50 dark:hover:bg-gray-800"
16
  >
17
  <div class="pb-2 pt-3 text-sm font-semibold uppercase">{message.role}</div>
18
  <textarea
19
  autofocus={message.role === 'user'}
20
  bind:value={message.content}
21
  placeholder="Enter {message.role} message"
22
+ class="resize-none rounded bg-transparent px-3 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y hover:bg-white focus:resize-y focus:bg-white focus:ring group-hover/message:ring dark:ring-gray-600 dark:hover:bg-gray-900 dark:focus:bg-gray-900"
23
  rows="1"
24
  ></textarea>
25
  <button
src/lib/components/Playground/PlaygroundOptions.svelte CHANGED
@@ -29,7 +29,7 @@
29
  >
30
  <input
31
  type="number"
32
- class="w-16 rounded border px-1 py-0.5 text-right text-sm"
33
  bind:value={temperature}
34
  min="0"
35
  max="1"
@@ -43,7 +43,7 @@
43
  min="0"
44
  max="1"
45
  step="0.1"
46
- class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700"
47
  />
48
  </div>
49
  <div>
@@ -54,7 +54,7 @@
54
  >
55
  <input
56
  type="number"
57
- class="w-20 rounded border px-1 py-0.5 text-right text-sm"
58
  bind:value={maxTokens}
59
  min="0"
60
  max="4096"
@@ -68,7 +68,7 @@
68
  min="0"
69
  max="4096"
70
  step="512"
71
- class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700"
72
  />
73
  </div>
74
  <div class="mt-2">
@@ -76,7 +76,7 @@
76
  <input type="checkbox" bind:checked={streaming} class="peer sr-only" />
77
  <span class="text-sm font-medium text-gray-900 dark:text-gray-300">Streaming</span>
78
  <div
79
- class="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700"
80
  ></div>
81
  </label>
82
  </div>
@@ -85,12 +85,12 @@
85
  <input type="checkbox" value="" class="peer sr-only" disabled />
86
  <span class="text-sm font-medium text-gray-900 dark:text-gray-300">JSON Mode</span>
87
  <div
88
- class="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700"
89
  ></div>
90
  </label>
91
  </div>
92
  <div
93
- class="mt-auto flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:bg-gray-800 dark:text-gray-400"
94
  role="alert"
95
  >
96
  <span class="text-sm font-semibold text-gray-900 dark:text-white">Get more usage</span>
@@ -123,9 +123,9 @@
123
  >Free</span
124
  >
125
 
126
- <input type="text" class="ml-auto w-12 text-right text-sm" value="76%" />
127
  </div>
128
  <div class="h-2 w-full rounded-full bg-gray-200 dark:bg-gray-700">
129
- <div class="h-2 rounded-full bg-black" style="width: 75%"></div>
130
  </div>
131
  </div>
 
29
  >
30
  <input
31
  type="number"
32
+ class="w-16 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"
33
  bind:value={temperature}
34
  min="0"
35
  max="1"
 
43
  min="0"
44
  max="1"
45
  step="0.1"
46
+ class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700 dark:accent-blue-500"
47
  />
48
  </div>
49
  <div>
 
54
  >
55
  <input
56
  type="number"
57
+ class="w-20 rounded border bg-transparent px-1 py-0.5 text-right text-sm dark:border-gray-700"
58
  bind:value={maxTokens}
59
  min="0"
60
  max="4096"
 
68
  min="0"
69
  max="4096"
70
  step="512"
71
+ class="h-2 w-full cursor-pointer appearance-none rounded-lg bg-gray-200 accent-black dark:bg-gray-700 dark:accent-blue-500"
72
  />
73
  </div>
74
  <div class="mt-2">
 
76
  <input type="checkbox" bind:checked={streaming} class="peer sr-only" />
77
  <span class="text-sm font-medium text-gray-900 dark:text-gray-300">Streaming</span>
78
  <div
79
+ class="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:peer-checked:bg-blue-600"
80
  ></div>
81
  </label>
82
  </div>
 
85
  <input type="checkbox" value="" class="peer sr-only" disabled />
86
  <span class="text-sm font-medium text-gray-900 dark:text-gray-300">JSON Mode</span>
87
  <div
88
+ class="peer relative h-5 w-9 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-black peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:peer-checked:bg-blue-600"
89
  ></div>
90
  </label>
91
  </div>
92
  <div
93
+ class="mt-auto flex max-w-xs flex-col items-start gap-2.5 rounded-lg border bg-white p-4 text-gray-500 shadow dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400"
94
  role="alert"
95
  >
96
  <span class="text-sm font-semibold text-gray-900 dark:text-white">Get more usage</span>
 
123
  >Free</span
124
  >
125
 
126
+ <div class="ml-auto w-12 text-right text-sm">76%</div>
127
  </div>
128
  <div class="h-2 w-full rounded-full bg-gray-200 dark:bg-gray-700">
129
+ <div class="h-2 rounded-full bg-black dark:bg-gray-400" style="width: 75%"></div>
130
  </div>
131
  </div>