Skip to content

Commit

Permalink
feat: animate composer border color on focus (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Sep 3, 2024
1 parent e52f337 commit c8b98b6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/long-seahorses-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@assistant-ui/react-playground": patch
"@assistant-ui/react": patch
---

feat: animate composer border color on focus
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const Composer: FC = () => {
};

return (
<ComposerPrimitive.Root className="flex w-full flex-col rounded-lg border transition-shadow focus-within:shadow-sm">
<ComposerPrimitive.Root className="focus-within:border-aui-ring/20 flex w-full flex-col rounded-lg border shadow-sm transition-colors ease-in">
<ComposerPrimitive.Input
autoFocus
placeholder="Write a message..."
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/styles/tailwindcss/thread.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
/* composer */

.aui-composer-root {
@apply flex w-full flex-wrap items-end rounded-lg border px-2.5 transition-shadow focus-within:shadow-sm;
@apply focus-within:border-aui-ring/20 flex w-full flex-wrap items-end rounded-lg border px-2.5 shadow-sm transition-colors ease-in;
}

.aui-composer-input {
Expand All @@ -54,7 +54,7 @@

.aui-composer-send,
.aui-composer-cancel {
@apply my-2.5 size-8 p-2 transition-opacity;
@apply my-2.5 size-8 p-2 transition-opacity ease-in;
}

/* user message */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const MyThreadWelcome: FC = () => {

const MyComposer: FC = () => {
return (
<ComposerPrimitive.Root className="flex w-full flex-wrap items-end rounded-lg border px-2.5 transition-shadow focus-within:shadow-sm">
<ComposerPrimitive.Root className="focus-within:border-aui-ring/20 flex w-full flex-wrap items-end rounded-lg border px-2.5 shadow-sm transition-colors ease-in">
<ComposerPrimitive.Input
autoFocus
placeholder="Write a message..."
Expand All @@ -92,7 +92,7 @@ const MyComposer: FC = () => {
<TooltipIconButton
tooltip="Send"
variant="default"
className="my-2.5 size-8 p-2 transition-opacity"
className="my-2.5 size-8 p-2 transition-opacity ease-in"
>
<SendHorizontalIcon />
</TooltipIconButton>
Expand All @@ -103,7 +103,7 @@ const MyComposer: FC = () => {
<TooltipIconButton
tooltip="Cancel"
variant="default"
className="my-2.5 size-8 p-2 transition-opacity"
className="my-2.5 size-8 p-2 transition-opacity ease-in"
>
<CircleStopIcon />
</TooltipIconButton>
Expand Down
4 changes: 2 additions & 2 deletions packages/shadcn-registry/registry/assistant-ui/thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const MyThreadWelcome: FC = () => {

const MyComposer: FC = () => {
return (
<ComposerPrimitive.Root className="flex w-full flex-wrap items-end rounded-lg border px-2.5 transition-shadow focus-within:shadow-sm">
<ComposerPrimitive.Root className="focus-within:border-aui-ring/20 flex w-full flex-wrap items-end rounded-lg border px-2.5 shadow-sm transition-colors ease-in">
<ComposerPrimitive.Input
autoFocus
placeholder="Write a message..."
Expand All @@ -58,7 +58,7 @@ const MyComposer: FC = () => {
<TooltipIconButton
tooltip="Send"
variant="default"
className="my-2.5 size-8 p-2 transition-opacity"
className="my-2.5 size-8 p-2 transition-opacity ease-in"
>
<SendHorizontalIcon />
</TooltipIconButton>
Expand Down

0 comments on commit c8b98b6

Please sign in to comment.