From 268a3da128556c166584d83511c401c779e39267 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 16:48:51 +0000 Subject: [PATCH] feat(ui): guardrails/guardrail_optional_params to shadcn Button - antd Typography.Title + Button \u2192 plain

+ shadcn Button (variant=ghost with text-destructive for Remove). - Kept antd Form/Form.Item, Select (mode='multiple' and Option-based boolean/select renders), and AntInput/AntInput.Password (the file is driven by a parent antd Form context with initialValue + rules). - Swept all gray/white/gray-50 to semantic background/muted/border/ muted-foreground tokens. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../guardrails/guardrail_optional_params.tsx | 70 +++++++++++++------ 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_optional_params.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_optional_params.tsx index b352360e505..a59fbbdbea7 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_optional_params.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_optional_params.tsx @@ -1,9 +1,8 @@ import React from "react"; -import { Form, Select, Typography, Input, Button } from "antd"; +import { Form, Select, Input as AntInput } from "antd"; +import { Button } from "@/components/ui/button"; import NumericalInput from "../shared/numerical_input"; -const { Title } = Typography; - interface ProviderParam { param: string; description: string; @@ -19,6 +18,7 @@ interface ProviderParam { interface GuardrailOptionalParamsProps { optionalParams: ProviderParam; parentFieldKey: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any values?: Record; } @@ -26,9 +26,11 @@ interface DictFieldProps { field: ProviderParam; fieldKey: string; fullFieldKey: string | string[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any value: any | null; } +// eslint-disable-next-line @typescript-eslint/no-unused-vars const DictField: React.FC = ({ field, fieldKey, fullFieldKey, value }) => { const [selectedEntries, setSelectedEntries] = React.useState>([]); const [availableKeys, setAvailableKeys] = React.useState(field.dict_key_options || []); @@ -94,14 +96,14 @@ const DictField: React.FC = ({ field, fieldKey, fullFieldKey, va False ) : ( - + )}

+

+ {optionalParams.description || + "Configure additional settings for this guardrail provider"}