From 0f899c31c73ebb4b0a9c785a0be346dd447e30c0 Mon Sep 17 00:00:00 2001 From: Ryan Hopper-Lowe Date: Tue, 7 Jan 2025 14:50:32 -0600 Subject: [PATCH] chore: refactor to embrace dom typographical elements Signed-off-by: Ryan Hopper-Lowe --- ui/admin/app/components/TruncatedText.tsx | 29 --- ui/admin/app/components/Typography.tsx | 208 ------------------ ui/admin/app/components/agent/Agent.tsx | 19 +- ui/admin/app/components/agent/AgentForm.tsx | 5 +- .../components/agent/AgentPublishStatus.tsx | 7 +- ui/admin/app/components/agent/PastThreads.tsx | 9 +- ui/admin/app/components/agent/Publish.tsx | 18 +- ui/admin/app/components/agent/ToolEntry.tsx | 4 +- ui/admin/app/components/agent/ToolForm.tsx | 17 +- .../shared/EnvironmentVariableSection.tsx | 5 +- ui/admin/app/components/branding/ObotLogo.tsx | 5 +- ui/admin/app/components/chat/Message.tsx | 7 +- .../chat/chat-actions/KnowledgeInfo.tsx | 7 +- .../chat/chat-actions/ToolsInfo.tsx | 12 +- ui/admin/app/components/composed/CopyText.tsx | 5 +- .../composed/FirstModelProviderBanner.tsx | 9 +- .../app/components/composed/typography.tsx | 41 ++++ .../knowledge/AgentKnowledgePanel.tsx | 5 +- .../ModelProviderDeconfigure.tsx | 9 +- .../model-providers/ModelProviderForm.tsx | 9 +- .../components/oauth-apps/OAuthAppDetail.tsx | 37 ++-- .../components/oauth-apps/OAuthAppList.tsx | 3 +- .../components/oauth-apps/OAuthAppTile.tsx | 5 +- .../oauth-apps/custom/CustomOAuthAppForm.tsx | 3 +- .../oauth-apps/custom/CustomOAuthAppTile.tsx | 15 +- .../oauth-apps/custom/CustomOAuthApps.tsx | 3 +- ui/admin/app/components/sidebar/Sidebar.tsx | 7 +- .../tools/toolGrid/CategoryHeader.tsx | 5 +- .../components/tools/toolGrid/ToolCard.tsx | 27 +-- .../components/tools/toolGrid/ToolGrid.tsx | 3 +- .../webhooks/WebhookConfirmation.tsx | 9 +- .../app/components/webhooks/WebhookForm.tsx | 5 +- .../DeleteWorkflowTrigger.tsx | 7 +- .../workflow-triggers/ScheduleForm.tsx | 5 +- .../workflow/DeleteWorkflowWebhook.tsx | 5 +- ui/admin/app/components/workflow/Workflow.tsx | 25 +-- .../workflow/WorkflowSchedulePanel.tsx | 5 +- .../workflow/WorkflowWebhookPanel.tsx | 7 +- ui/admin/app/routes/_auth.agents._index.tsx | 7 +- ui/admin/app/routes/_auth.debug.tsx | 15 +- ui/admin/app/routes/_auth.model-providers.tsx | 5 +- ui/admin/app/routes/_auth.oauth-apps.tsx | 3 +- ui/admin/app/routes/_auth.threads._index.tsx | 11 +- ui/admin/app/routes/_auth.tools._index.tsx | 3 +- ui/admin/app/routes/_auth.users.tsx | 13 +- .../routes/_auth.workflow-triggers._index.tsx | 3 +- .../app/routes/_auth.workflows._index.tsx | 11 +- ui/admin/app/tailwind.css | 39 ++++ 48 files changed, 241 insertions(+), 475 deletions(-) delete mode 100644 ui/admin/app/components/TruncatedText.tsx delete mode 100644 ui/admin/app/components/Typography.tsx create mode 100644 ui/admin/app/components/composed/typography.tsx diff --git a/ui/admin/app/components/TruncatedText.tsx b/ui/admin/app/components/TruncatedText.tsx deleted file mode 100644 index 18dbf2977..000000000 --- a/ui/admin/app/components/TruncatedText.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { cn } from "~/lib/utils"; - -import { TypographyP } from "~/components/Typography"; -import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from "~/components/ui/tooltip"; - -export function TruncatedText({ - content, - className, -}: { - content: React.ReactNode; - className?: string; -}) { - return ( - - -
- {content} -
-
- -

{content}

-
-
- ); -} diff --git a/ui/admin/app/components/Typography.tsx b/ui/admin/app/components/Typography.tsx deleted file mode 100644 index fcac44c10..000000000 --- a/ui/admin/app/components/Typography.tsx +++ /dev/null @@ -1,208 +0,0 @@ -import React, { ReactNode } from "react"; - -import { cn } from "~/lib/utils"; - -type TypographyElement = keyof JSX.IntrinsicElements; - -type TypographyProps = { - children: ReactNode; - className?: string; -} & React.JSX.IntrinsicElements[T]; - -export function TypographyH1({ - children, - className, - ...props -}: TypographyProps<"h1">) { - return ( -

- {children} -

- ); -} - -export function TypographyH2({ - children, - className, - ...props -}: TypographyProps<"h2">) { - return ( -

- {children} -

- ); -} - -export function TypographyH3({ - children, - className, - ...props -}: TypographyProps<"h3">) { - return ( -

- {children} -

- ); -} - -export function TypographyH4({ - children, - className, - ...props -}: TypographyProps<"h4">) { - return ( -

- {children} -

- ); -} - -export function TypographyP({ - children, - className, - ...props -}: TypographyProps<"p">) { - return ( -

- {children} -

- ); -} - -export function TypographyPAccent({ - children, - className, - ...props -}: TypographyProps<"p">) { - return ( - - {children} - - ); -} - -export function TypographyBlockquote({ - children, - className, - ...props -}: TypographyProps<"blockquote">) { - return ( -
- {children} -
- ); -} - -export function TypographyInlineCode({ - children, - className, - ...props -}: TypographyProps<"code">) { - return ( - - {children} - - ); -} - -export function TypographyLead({ - children, - className, - ...props -}: TypographyProps<"p">) { - return ( -

- {children} -

- ); -} - -export function TypographyLarge({ - children, - className, - ...props -}: TypographyProps<"div">) { - return ( -
- {children} -
- ); -} - -export function TypographySmall({ - children, - className, - ...props -}: TypographyProps<"small">) { - return ( - - {children} - - ); -} - -export function TypographyMuted({ - children, - className, - ...props -}: TypographyProps<"p">) { - return ( -

- {children} -

- ); -} - -export function TypographyMutedAccent({ - children, - className, - ...props -}: TypographyProps<"p">) { - return ( -

- {children} -

- ); -} diff --git a/ui/admin/app/components/agent/Agent.tsx b/ui/admin/app/components/agent/Agent.tsx index 5b9979458..bc1fd9c3d 100644 --- a/ui/admin/app/components/agent/Agent.tsx +++ b/ui/admin/app/components/agent/Agent.tsx @@ -7,7 +7,6 @@ import { AssistantNamespace } from "~/lib/model/assistants"; import { AgentService } from "~/lib/service/api/agentService"; import { cn } from "~/lib/utils"; -import { TypographyH4, TypographyP } from "~/components/Typography"; import { useAgent } from "~/components/agent/AgentContext"; import { AgentForm } from "~/components/agent/AgentForm"; import { AgentPublishStatus } from "~/components/agent/AgentPublishStatus"; @@ -111,10 +110,10 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
- +

Tools - +

Add tools the allow the agent to perform useful actions @@ -132,10 +131,10 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {
- +

Environment Variables - +

- +

Knowledge - +

Provide knowledge to the agent in the form of files, website, or external links in order to give it context @@ -172,11 +171,11 @@ export function Agent({ className, currentThreadId, onRefresh }: AgentProps) {