Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"assist": {
"enabled": false
},
"linter": {
"enabled": true,
"domains": {
"react": "all",
"next": "all"
},
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noEmptyInterface": "off",
"useIterableCallbackReturn": "off",
"noThenProperty": "off",
"noConfusingVoidType": "off",
"noImplicitAnyLet": "off",
"noAssignInExpressions": "off",
"noRedeclare": "off",
"noConfusingLabels": {
"level": "error",
"options": {
"allowedLabels": ["DEV"]
}
},
"noDoubleEquals": "off",
"noPrototypeBuiltins": "off",
"noDocumentCookie": "off"
},
"style": {
"noNamespace": "off",
"useImportType": "off",
"noNonNullAssertion": "off",
"useComponentExportOnlyModules": "off"
},
"correctness": {
"noUnusedVariables": {
"level": "warn",
"options": {
"ignoreRestSiblings": true
}
},
"useExhaustiveDependencies": "off",
"useHookAtTopLevel": "off",
"noSwitchDeclarations": "off",
"noUnsafeOptionalChaining": "off",
"useUniqueElementIds": "off"
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "off",
"noUselessConstructor": "off",
"noStaticOnlyClass": "off",
"useArrowFunction": "off",
"noThisInStatic": "off",
"useFlatMap": "off",
"useLiteralKeys": "off"
},
"a11y": {
"useKeyWithClickEvents": "off",
"noSvgWithoutTitle": "off",
"noStaticElementInteractions": "off",
"useFocusableInteractive": "off",
"useButtonType": "off",
"useSemanticElements": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
},
"performance": {
"noImgElement": "off"
},
"nursery": {
"useSortedClasses": {
"fix": "safe",
"level": "error",
"options": {
"attributes": ["className"],
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
}
}
}
}
},
"javascript": {
"formatter": {
"enabled": true,
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"attributePosition": "auto"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"json": {
"formatter": {
"enabled": true,
"trailingCommas": "none"
},
"parser": {
"allowComments": true,
"allowTrailingCommas": false
}
},
"css": {
"parser": {
"cssModules": false,
"tailwindDirectives": true
},
"formatter": {
"enabled": false
},
"linter": {
"enabled": false
}
},
"files": {
"includes": [
"**",
"!**/dist",
"!**/node_modules",
"!**/.next",
"!**/.vercel",
"!**/out",
"!**/.source",
"!**/next-env.d.ts"
]
}
}
6 changes: 3 additions & 3 deletions components/assistant-ui/attachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const AttachmentPreviewDialog: FC<PropsWithChildren> = ({ children }) => {
>
{children}
</DialogTrigger>
<DialogContent className="aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&_svg]:text-background [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:!ring-0 [&>button]:hover:[&_svg]:text-destructive">
<DialogContent className="aui-attachment-preview-dialog-content [&>button]:!ring-0 p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive">
<DialogTitle className="aui-sr-only sr-only">
Image Attachment Preview
</DialogTitle>
Expand Down Expand Up @@ -190,7 +190,7 @@ const AttachmentRemove: FC = () => {
<AttachmentPrimitive.Remove asChild>
<TooltipIconButton
tooltip="Remove file"
className="aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:!bg-white [&_svg]:text-black hover:[&_svg]:text-destructive"
className="aui-attachment-tile-remove hover:!bg-white absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm [&_svg]:text-black hover:[&_svg]:text-destructive"
side="top"
>
<XIcon className="aui-attachment-remove-icon size-3 dark:stroke-[2.5px]" />
Expand Down Expand Up @@ -225,7 +225,7 @@ export const ComposerAddAttachment: FC = () => {
side="bottom"
variant="ghost"
size="icon"
className="aui-composer-add-attachment size-[34px] rounded-full p-1 text-xs font-semibold hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30"
className="aui-composer-add-attachment size-[34px] rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30"
aria-label="Add Attachment"
>
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
Expand Down
14 changes: 7 additions & 7 deletions components/assistant-ui/markdown-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CodeHeader: FC<CodeHeaderProps> = ({ language, code }) => {
};

return (
<div className="aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 text-sm font-semibold text-foreground dark:bg-muted-foreground/20">
<div className="aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20">
<span className="aui-code-header-language lowercase [&>span]:text-xs">
{language}
</span>
Expand Down Expand Up @@ -70,7 +70,7 @@ const defaultComponents = memoizeMarkdownComponents({
h1: ({ className, ...props }) => (
<h1
className={cn(
"aui-md-h1 mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",
"aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",
className,
)}
{...props}
Expand All @@ -79,7 +79,7 @@ const defaultComponents = memoizeMarkdownComponents({
h2: ({ className, ...props }) => (
<h2
className={cn(
"aui-md-h2 mt-8 mb-4 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -88,7 +88,7 @@ const defaultComponents = memoizeMarkdownComponents({
h3: ({ className, ...props }) => (
<h3
className={cn(
"aui-md-h3 mt-6 mb-4 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -97,7 +97,7 @@ const defaultComponents = memoizeMarkdownComponents({
h4: ({ className, ...props }) => (
<h4
className={cn(
"aui-md-h4 mt-6 mb-4 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -106,7 +106,7 @@ const defaultComponents = memoizeMarkdownComponents({
h5: ({ className, ...props }) => (
<h5
className={cn(
"aui-md-h5 my-4 text-lg font-semibold first:mt-0 last:mb-0",
"aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",
className,
)}
{...props}
Expand Down Expand Up @@ -205,7 +205,7 @@ const defaultComponents = memoizeMarkdownComponents({
pre: ({ className, ...props }) => (
<pre
className={cn(
"aui-md-pre overflow-x-auto !rounded-t-none rounded-b-lg bg-black p-4 text-white",
"aui-md-pre !rounded-t-none overflow-x-auto rounded-b-lg bg-black p-4 text-white",
className,
)}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions components/assistant-ui/reasoning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const GradientFade: FC<{ className?: string }> = ({ className }) => (
className={cn(
"aui-reasoning-fade pointer-events-none absolute inset-x-0 bottom-0 z-10 h-16",
"bg-[linear-gradient(to_top,var(--color-background),transparent)]",
"animate-in fade-in-0",
"fade-in-0 animate-in",
"group-data-[state=open]/collapsible-content:animate-out",
"group-data-[state=open]/collapsible-content:fade-out-0",
"group-data-[state=open]/collapsible-content:delay-[calc(var(--animation-duration)*0.75)]", // calc for timing the delay
Expand All @@ -102,7 +102,7 @@ const ReasoningTrigger: FC<{ active: boolean; className?: string }> = ({
}) => (
<CollapsibleTrigger
className={cn(
"aui-reasoning-trigger group/trigger -mb-2 flex max-w-[75%] items-center gap-2 py-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
"aui-reasoning-trigger group/trigger -mb-2 flex max-w-[75%] items-center gap-2 py-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
className,
)}
>
Expand Down Expand Up @@ -147,7 +147,7 @@ const ReasoningContent: FC<
> = ({ className, children, "aria-busy": ariaBusy }) => (
<CollapsibleContent
className={cn(
"aui-reasoning-content relative overflow-hidden text-sm text-muted-foreground outline-none",
"aui-reasoning-content relative overflow-hidden text-muted-foreground text-sm outline-none",
"group/collapsible-content ease-out",
"data-[state=closed]:animate-collapsible-up",
"data-[state=open]:animate-collapsible-down",
Expand Down
2 changes: 1 addition & 1 deletion components/assistant-ui/thread-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ThreadListSkeleton: FC = () => {

const ThreadListItem: FC = () => {
return (
<ThreadListItemPrimitive.Root className="aui-thread-list-item flex items-center gap-2 rounded-lg transition-all hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none data-active:bg-muted">
<ThreadListItemPrimitive.Root className="aui-thread-list-item flex items-center gap-2 rounded-lg transition-all hover:bg-muted focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-active:bg-muted">
<ThreadListItemPrimitive.Trigger className="aui-thread-list-item-trigger flex-grow px-3 py-2 text-start">
<ThreadListItemTitle />
</ThreadListItemPrimitive.Trigger>
Expand Down
30 changes: 15 additions & 15 deletions components/assistant-ui/thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ThreadScrollToBottom: FC = () => {
<TooltipIconButton
tooltip="Scroll to bottom"
variant="outline"
className="aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent"
className="aui-thread-scroll-to-bottom -top-12 absolute z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent"
>
<ArrowDownIcon />
</TooltipIconButton>
Expand All @@ -94,7 +94,7 @@ const ThreadWelcome: FC = () => {
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 10 }}
className="aui-thread-welcome-message-motion-1 text-2xl font-semibold"
className="aui-thread-welcome-message-motion-1 font-semibold text-2xl"
>
Hello there!
</m.div>
Expand All @@ -116,7 +116,7 @@ const ThreadWelcome: FC = () => {

const ThreadSuggestions: FC = () => {
return (
<div className="aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2">
<div className="aui-thread-welcome-suggestions grid w-full @md:grid-cols-2 gap-2 pb-4">
{[
{
title: "What's the weather",
Expand Down Expand Up @@ -145,7 +145,7 @@ const ThreadSuggestions: FC = () => {
exit={{ opacity: 0, y: 20 }}
transition={{ delay: 0.05 * index }}
key={`suggested-action-${suggestedAction.title}-${index}`}
className="aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block"
className="aui-thread-welcome-suggestion-display @md:[&:nth-child(n+3)]:block [&:nth-child(n+3)]:hidden"
>
<ThreadPrimitive.Suggestion
prompt={suggestedAction.action}
Expand All @@ -154,7 +154,7 @@ const ThreadSuggestions: FC = () => {
>
<Button
variant="ghost"
className="aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60"
className="aui-thread-welcome-suggestion h-auto w-full flex-1 @md:flex-col flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm dark:hover:bg-accent/60"
aria-label={suggestedAction.action}
>
<span className="aui-thread-welcome-suggestion-text-1 font-medium">
Expand All @@ -176,7 +176,7 @@ const Composer: FC = () => {
<div className="aui-composer-wrapper sticky bottom-0 mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6">
<ThreadScrollToBottom />
<ComposerPrimitive.Root className="aui-composer-root relative flex w-full flex-col">
<ComposerPrimitive.AttachmentDropzone className="aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background">
<ComposerPrimitive.AttachmentDropzone className="aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs outline-none transition-[color,box-shadow] has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-ring data-[dragging=true]:border-dashed data-[dragging=true]:bg-accent/50 dark:bg-background">
<ComposerAttachments />
<ComposerPrimitive.Input
placeholder="Send a message..."
Expand Down Expand Up @@ -233,7 +233,7 @@ const ComposerAction: FC = () => {
const MessageError: FC = () => {
return (
<MessagePrimitive.Error>
<ErrorPrimitive.Root className="aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200">
<ErrorPrimitive.Root className="aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-destructive text-sm dark:bg-destructive/5 dark:text-red-200">
<ErrorPrimitive.Message className="aui-message-error-message line-clamp-2" />
</ErrorPrimitive.Root>
</MessagePrimitive.Error>
Expand All @@ -244,10 +244,10 @@ const AssistantMessage: FC = () => {
return (
<MessagePrimitive.Root asChild>
<div
className="aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 last:mb-24"
className="aui-assistant-message-root fade-in slide-in-from-bottom-1 relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out last:mb-24"
data-role="assistant"
>
<div className="aui-assistant-message-content mx-2 leading-7 break-words text-foreground">
<div className="aui-assistant-message-content mx-2 break-words text-foreground leading-7">
<MessagePrimitive.Parts
components={{
Text: MarkdownText,
Expand All @@ -274,7 +274,7 @@ const AssistantActionBar: FC = () => {
hideWhenRunning
autohide="not-last"
autohideFloat="single-branch"
className="aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm"
className="aui-assistant-action-bar-root -ml-1 col-start-3 row-start-2 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm"
>
<ActionBarPrimitive.Copy asChild>
<TooltipIconButton tooltip="Copy">
Expand All @@ -299,21 +299,21 @@ const UserMessage: FC = () => {
return (
<MessagePrimitive.Root asChild>
<div
className="aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 first:mt-3 last:mb-5 [&:where(>*)]:col-start-2"
className="aui-user-message-root fade-in slide-in-from-bottom-1 mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-2 px-2 py-4 duration-150 ease-out first:mt-3 last:mb-5 [&:where(>*)]:col-start-2"
data-role="user"
>
<UserMessageAttachments />

<div className="aui-user-message-content-wrapper relative col-start-2 min-w-0">
<div className="aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground">
<div className="aui-user-message-content break-words rounded-3xl bg-muted px-5 py-2.5 text-foreground">
<MessagePrimitive.Parts />
</div>
<div className="aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2">
<div className="aui-user-action-bar-wrapper -translate-x-full -translate-y-1/2 absolute top-1/2 left-0 pr-2">
<UserActionBar />
</div>
</div>

<BranchPicker className="aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end" />
<BranchPicker className="aui-user-branch-picker -mr-1 col-span-full col-start-1 row-start-3 justify-end" />
</div>
</MessagePrimitive.Root>
);
Expand Down Expand Up @@ -369,7 +369,7 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
<BranchPickerPrimitive.Root
hideWhenSingleBranch
className={cn(
"aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",
"aui-branch-picker-root -ml-2 mr-2 inline-flex items-center text-muted-foreground text-xs",
className,
)}
{...rest}
Expand Down
Loading