|
5 | 5 | createEventDispatcher,
|
6 | 6 | tick
|
7 | 7 | } from "svelte";
|
8 |
| - import { BlockTitle } from "@gradio/atoms"; |
| 8 | + import { BlockTitle, IconButton, IconButtonWrapper } from "@gradio/atoms"; |
9 | 9 | import { Copy, Check, Send, Square } from "@gradio/icons";
|
10 | 10 | import { fade } from "svelte/transition";
|
11 | 11 | import type { SelectData, CopyData } from "@gradio/utils";
|
|
238 | 238 | <!-- svelte-ignore a11y-autofocus -->
|
239 | 239 | <label class:container class:show_textbox_border>
|
240 | 240 | {#if show_label && show_copy_button}
|
241 |
| - {#if copied} |
242 |
| - <button |
243 |
| - in:fade={{ duration: 300 }} |
244 |
| - class="copy-button" |
245 |
| - aria-label="Copied" |
246 |
| - aria-roledescription="Text copied"><Check /></button |
247 |
| - > |
248 |
| - {:else} |
249 |
| - <button |
| 241 | + <IconButtonWrapper> |
| 242 | + <IconButton |
| 243 | + Icon={copied ? Check : Copy} |
250 | 244 | on:click={handle_copy}
|
251 |
| - class="copy-button" |
252 |
| - aria-label="Copy" |
253 |
| - aria-roledescription="Copy text"><Copy /></button |
254 |
| - > |
255 |
| - {/if} |
| 245 | + label={copied ? "Copied" : "Copy"} |
| 246 | + /> |
| 247 | + </IconButtonWrapper> |
256 | 248 | {/if}
|
257 | 249 | <BlockTitle {show_label} {info}>{label}</BlockTitle>
|
258 | 250 |
|
|
449 | 441 | color: var(--input-placeholder-color);
|
450 | 442 | }
|
451 | 443 |
|
452 |
| - .copy-button { |
453 |
| - display: flex; |
454 |
| - position: absolute; |
455 |
| - top: var(--block-label-margin); |
456 |
| - right: var(--block-label-margin); |
457 |
| - align-items: center; |
458 |
| - box-shadow: var(--shadow-drop); |
459 |
| - border: 1px solid var(--border-color-primary); |
460 |
| - border-top: none; |
461 |
| - border-right: none; |
462 |
| - border-radius: var(--block-label-right-radius); |
463 |
| - background: var(--block-label-background-fill); |
464 |
| - padding: 5px; |
465 |
| - width: 22px; |
466 |
| - height: 22px; |
467 |
| - overflow: hidden; |
468 |
| - color: var(--block-label-color); |
469 |
| - font: var(--font-sans); |
470 |
| - font-size: var(--button-small-text-size); |
471 |
| - } |
472 |
| -
|
473 | 444 | /* Same submit button style as MultimodalTextbox for the consistent UI */
|
474 | 445 | .input-container {
|
475 | 446 | display: flex;
|
|
0 commit comments