Misc color clean up (#3026)

* misc color clean up

* additional nits

* nit

* nit

* additional minor nits

* ensure tailwind config evaluates properly + update textarea -> input

* ensure tool call renders

* formatting
This commit is contained in:
pablodanswer 2024-11-03 15:57:11 -08:00 committed by GitHub
parent c6e8bf2d28
commit bafb95d920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 56 additions and 58 deletions

15
web/package-lock.json generated
View File

@ -14851,21 +14851,6 @@
"type": "github", "type": "github",
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
},
"node_modules/@next/swc-win32-ia32-msvc": {
"version": "14.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.3.tgz",
"integrity": "sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==",
"cpu": [
"ia32"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
} }
} }
} }

View File

@ -370,6 +370,7 @@ export const SlackBotCreationForm = ({
<div className="flex"> <div className="flex">
<Button <Button
type="submit" type="submit"
variant="submit"
disabled={isSubmitting} disabled={isSubmitting}
className="mx-auto w-64" className="mx-auto w-64"
> >

View File

@ -122,7 +122,7 @@ function LLMProviderDisplay({
<div className="ml-auto"> <div className="ml-auto">
<Button <Button
variant={existingLlmProvider ? "outline" : "next"} variant={existingLlmProvider ? "success-reverse" : "navigate"}
onClick={() => setFormIsVisible(true)} onClick={() => setFormIsVisible(true)}
> >
{existingLlmProvider ? "Edit" : "Set up"} {existingLlmProvider ? "Edit" : "Set up"}

View File

@ -206,7 +206,6 @@ export function IndexingAttemptsTable({ ccPair }: { ccPair: CCPairFullInfo }) {
<Callout <Callout
className="mt-4" className="mt-4"
title="No indexing attempts scheduled yet" title="No indexing attempts scheduled yet"
icon={"info"}
type="notice" type="notice"
> >
Index attempts are scheduled in the background, and may take some time Index attempts are scheduled in the background, and may take some time

View File

@ -104,7 +104,6 @@ const RenderField: FC<RenderFieldProps> = ({
type={field.type} type={field.type}
label={label} label={label}
name={field.name} name={field.name}
isTextArea={true}
/> />
)} )}
</> </>

View File

@ -207,13 +207,17 @@ const DocumentSetTable = ({
</TableCell> </TableCell>
<TableCell> <TableCell>
{documentSet.is_public ? ( {documentSet.is_public ? (
<Badge size="md" variant="success" icon={FiUnlock}> <Badge
size="md"
variant={isEditable ? "success" : "default"}
icon={FiUnlock}
>
Public Public
</Badge> </Badge>
) : ( ) : (
<Badge <Badge
size="md" size="md"
variant={isEditable ? "purple" : "outline"} variant={isEditable ? "in_progress" : "outline"}
icon={FiLock} icon={FiLock}
> >
Private Private

View File

@ -168,7 +168,7 @@ function ConnectorRow({
); );
case "not_started": case "not_started":
return ( return (
<Badge circle variant="secondary"> <Badge circle variant="purple">
Scheduled Scheduled
</Badge> </Badge>
); );
@ -183,7 +183,7 @@ function ConnectorRow({
return ( return (
<TableRow <TableRow
className={`border hover:bg-hover-light ${ className={`hover:bg-hover-light ${
invisible ? "invisible !h-0 !-mb-10" : "!border !border-border" invisible ? "invisible !h-0 !-mb-10" : "!border !border-border"
} w-full cursor-pointer relative `} } w-full cursor-pointer relative `}
onClick={() => { onClick={() => {
@ -202,21 +202,19 @@ function ConnectorRow({
{isPaidEnterpriseFeaturesEnabled && ( {isPaidEnterpriseFeaturesEnabled && (
<TableCell> <TableCell>
{ccPairsIndexingStatus.access_type === "public" ? ( {ccPairsIndexingStatus.access_type === "public" ? (
<Badge variant="success" icon={FiUnlock}> <Badge variant={isEditable ? "success" : "default"} icon={FiUnlock}>
Public Public
</Badge> </Badge>
) : ccPairsIndexingStatus.access_type === "sync" ? ( ) : ccPairsIndexingStatus.access_type === "sync" ? (
<Badge <Badge
variant="outline" variant={isEditable ? "orange" : "default"}
color={isEditable ? "orange" : "gray"}
icon={FiRefreshCw} icon={FiRefreshCw}
> >
Sync Sync
</Badge> </Badge>
) : ( ) : (
<Badge <Badge
size="md" variant={isEditable ? "in_progress" : "default"}
variant={isEditable ? "outline" : "default"}
icon={FiLock} icon={FiLock}
> >
Private Private
@ -419,7 +417,7 @@ export function CCPairIndexingStatusTable({
placeholder="Search connectors..." placeholder="Search connectors..."
value={searchTerm} value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)} onChange={(e) => setSearchTerm(e.target.value)}
className="ml-1 w-96 h-9 flex-none rounded-md border border-border bg-background-50 px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" className="ml-1 w-96 h-9 flex-none rounded-md bg-background-50 px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
/> />
<Button className="h-9" onClick={() => toggleSources()}> <Button className="h-9" onClick={() => toggleSources()}>

View File

@ -179,7 +179,8 @@ export function AssistantsGallery() {
<div className="grid grid-cols-2 gap-4 mt-4 mb-6"> <div className="grid grid-cols-2 gap-4 mt-4 mb-6">
<Button <Button
onClick={() => router.push("/assistants/new")} onClick={() => router.push("/assistants/new")}
className="w-full py-3 text-lg rounded-full bg-background-800 text-white hover:bg-background-800 transition duration-300 ease-in-out" variant="default"
className="p-6 text-base"
icon={FiPlus} icon={FiPlus}
> >
Create New Assistant Create New Assistant
@ -187,7 +188,8 @@ export function AssistantsGallery() {
<Button <Button
onClick={() => router.push("/assistants/mine")} onClick={() => router.push("/assistants/mine")}
className="w-full hover:border-border-strong py-3 text-lg rounded-full bg-white border border-border shadow text-text-700 hover:bg-background-50 transition duration-300 ease-in-out" variant="outline"
className="text-base py-6"
icon={FiList} icon={FiList}
> >
Your Assistants Your Assistants

View File

@ -394,8 +394,9 @@ export function AssistantsList() {
<div className="grid grid-cols-2 gap-4 mt-4 mb-8"> <div className="grid grid-cols-2 gap-4 mt-4 mb-8">
<Button <Button
variant="default"
className="p-6 text-base"
onClick={() => router.push("/assistants/new")} onClick={() => router.push("/assistants/new")}
className="w-full py-3 text-lg rounded-full bg-background-800 text-white hover:bg-background-800 transition duration-300 ease-in-out"
icon={FiPlus} icon={FiPlus}
> >
Create New Assistant Create New Assistant
@ -403,7 +404,8 @@ export function AssistantsList() {
<Button <Button
onClick={() => router.push("/assistants/gallery")} onClick={() => router.push("/assistants/gallery")}
className="w-full hover:border-border-strong py-3 text-lg rounded-full bg-white border !border-border shadow text-text-700 hover:bg-background-50 transition duration-300 ease-in-out" variant="outline"
className="text-base py-6"
icon={FiList} icon={FiList}
> >
Assistant Gallery Assistant Gallery

View File

@ -1355,7 +1355,7 @@ export function ChatPage({
finalMessage?.context_docs?.top_documents || documents, finalMessage?.context_docs?.top_documents || documents,
citations: finalMessage?.citations || {}, citations: finalMessage?.citations || {},
files: finalMessage?.files || aiMessageImages || [], files: finalMessage?.files || aiMessageImages || [],
toolCall: finalMessage?.tool_call || null, toolCall: finalMessage?.tool_call || toolCall,
parentMessageId: regenerationRequest parentMessageId: regenerationRequest
? regenerationRequest?.parentMessage?.messageId! ? regenerationRequest?.parentMessage?.messageId!
: initialFetchDetails.user_message_id, : initialFetchDetails.user_message_id,

View File

@ -97,7 +97,7 @@ export function RegenerateDropdown({
) : ( ) : (
<Hoverable <Hoverable
size={16} size={16}
icon={StarFeedback as IconType} icon={FiRefreshCw as IconType}
hoverText={getDisplayNameForModel(alternate)} hoverText={getDisplayNameForModel(alternate)}
/> />
)} )}

View File

@ -594,7 +594,6 @@ export function SelectorFormField({
label, label,
options, options,
subtext, subtext,
includeDefault = false,
side = "bottom", side = "bottom",
maxHeight, maxHeight,
onSelect, onSelect,
@ -615,26 +614,34 @@ export function SelectorFormField({
{subtext && <SubLabel>{subtext}</SubLabel>} {subtext && <SubLabel>{subtext}</SubLabel>}
<div className="mt-2"> <div className="mt-2">
<Select <Select
value={field.value} value={field.value || defaultValue}
onValueChange={ onValueChange={
onSelect || ((selected) => setFieldValue(name, selected)) onSelect || ((selected) => setFieldValue(name, selected))
} }
defaultValue={defaultValue} defaultValue={defaultValue}
> >
<SelectTrigger> <SelectTrigger>
<SelectValue <SelectValue placeholder="Select...">
placeholder={includeDefault ? "Select..." : undefined} {field.value || defaultValue || ""}
/> </SelectValue>
</SelectTrigger> </SelectTrigger>
<SelectContent <SelectContent
side={side} side={side}
className={maxHeight ? `max-h-[${maxHeight}]` : undefined} className={maxHeight ? `max-h-[${maxHeight}]` : undefined}
> >
{includeDefault && ( {options.length == 0 && (
<SelectItem value="default">Select...</SelectItem> <SelectItem value="default">Select...</SelectItem>
)} )}
{defaultValue && (
<SelectItem value={defaultValue}>{defaultValue}</SelectItem>
)}
{options.map((option) => ( {options.map((option) => (
<SelectItem key={option.value} value={String(option.value)}> <SelectItem
icon={option.icon}
key={option.value}
value={String(option.value)}
selected={field.value === option.value}
>
{option.name} {option.name}
</SelectItem> </SelectItem>
))} ))}

View File

@ -12,7 +12,7 @@ const buttonVariants = cva(
success: success:
"bg-green-100 text-green-600 hover:bg-green-500/90 dark:bg-blue-500 dark:text-neutral-50 dark:hover:bg-green-900/90", "bg-green-100 text-green-600 hover:bg-green-500/90 dark:bg-blue-500 dark:text-neutral-50 dark:hover:bg-green-900/90",
"success-reverse": "success-reverse":
"bg-green-500 text-green-100 hover:bg-green-600/90 dark:bg-neutral-50 dark:text-blue-500 dark:hover:bg-green-100/90", "bg-green-500 text-white hover:bg-green-600/90 dark:bg-neutral-50 dark:text-blue-500 dark:hover:bg-green-100/90",
default: default:
"bg-neutral-900 border-border text-neutral-50 hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90", "bg-neutral-900 border-border text-neutral-50 hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",

View File

@ -115,8 +115,9 @@ const SelectItem = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Item>, React.ElementRef<typeof SelectPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & { React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
icon?: React.ElementType; icon?: React.ElementType;
selected?: boolean;
} }
>(({ className, children, icon: Icon, ...props }, ref) => ( >(({ className, children, icon: Icon, selected, ...props }, ref) => (
<SelectPrimitive.Item <SelectPrimitive.Item
ref={ref} ref={ref}
className={cn( className={cn(
@ -127,9 +128,14 @@ const SelectItem = React.forwardRef<
> >
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectPrimitive.ItemIndicator> <SelectPrimitive.ItemIndicator>
{Icon ? <Icon className="h-4 w-4" /> : <Check className="h-4 w-4" />} <Check className="h-4 w-4" />
</SelectPrimitive.ItemIndicator> </SelectPrimitive.ItemIndicator>
</span> </span>
{!selected && Icon && (
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<Icon className="h-4 w-4" />
</span>
)}
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText> <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item> </SelectPrimitive.Item>

View File

@ -950,7 +950,6 @@ For example, specifying .*-support.* as a "channel" will cause the connector to
values: [], values: [],
advanced_values: [], advanced_values: [],
}, },
}; };
export function createConnectorInitialValues( export function createConnectorInitialValues(
connector: ConfigurableSources connector: ConfigurableSources
@ -1210,7 +1209,6 @@ export interface AsanaConfig {
export interface FreshdeskConfig {} export interface FreshdeskConfig {}
export interface MediaWikiConfig extends MediaWikiBaseConfig { export interface MediaWikiConfig extends MediaWikiBaseConfig {
hostname: string; hostname: string;
} }

View File

@ -3,16 +3,13 @@ var merge = require("lodash/merge");
// Use relative paths for imports // Use relative paths for imports
const baseThemes = require("./tailwind-themes/tailwind.config.js"); const baseThemes = require("./tailwind-themes/tailwind.config.js");
let customThemes = null; const customThemes = process.env.NEXT_PUBLIC_THEME
try { ? require(
if (process.env.NEXT_PUBLIC_THEME) { process.env.NEXT_PUBLIC_THEME
customThemes = require( ? `./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js`
`./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js` : "./tailwind-themes/custom/default/tailwind.config.js"
); )
} : null;
} catch (error) {
console.warn(`Custom theme not found for: ${process.env.NEXT_PUBLIC_THEME}`);
}
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = customThemes ? merge(baseThemes, customThemes) : baseThemes; module.exports = customThemes ? merge(baseThemes, customThemes) : baseThemes;