Skip to content

Commit

Permalink
Misc color clean up (#3026)
Browse files Browse the repository at this point in the history
* misc color clean up

* additional nits

* nit

* nit

* additional minor nits

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

* ensure tool call renders

* formatting
  • Loading branch information
pablonyx authored Nov 3, 2024
1 parent c6e8bf2 commit bafb95d
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 58 deletions.
2 changes: 1 addition & 1 deletion web/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
17 changes: 1 addition & 16 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/src/app/admin/bot/SlackBotConfigCreationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export const SlackBotCreationForm = ({
<div className="flex">
<Button
type="submit"
variant="submit"
disabled={isSubmitting}
className="mx-auto w-64"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function LLMProviderDisplay({

<div className="ml-auto">
<Button
variant={existingLlmProvider ? "outline" : "next"}
variant={existingLlmProvider ? "success-reverse" : "navigate"}
onClick={() => setFormIsVisible(true)}
>
{existingLlmProvider ? "Edit" : "Set up"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ export function IndexingAttemptsTable({ ccPair }: { ccPair: CCPairFullInfo }) {
<Callout
className="mt-4"
title="No indexing attempts scheduled yet"
icon={"info"}
type="notice"
>
Index attempts are scheduled in the background, and may take some time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const RenderField: FC<RenderFieldProps> = ({
type={field.type}
label={label}
name={field.name}
isTextArea={true}
/>
)}
</>
Expand Down
8 changes: 6 additions & 2 deletions web/src/app/admin/documents/sets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,17 @@ const DocumentSetTable = ({
</TableCell>
<TableCell>
{documentSet.is_public ? (
<Badge size="md" variant="success" icon={FiUnlock}>
<Badge
size="md"
variant={isEditable ? "success" : "default"}
icon={FiUnlock}
>
Public
</Badge>
) : (
<Badge
size="md"
variant={isEditable ? "purple" : "outline"}
variant={isEditable ? "in_progress" : "outline"}
icon={FiLock}
>
Private
Expand Down
14 changes: 6 additions & 8 deletions web/src/app/admin/indexing/status/CCPairIndexingStatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function ConnectorRow({
);
case "not_started":
return (
<Badge circle variant="secondary">
<Badge circle variant="purple">
Scheduled
</Badge>
);
Expand All @@ -183,7 +183,7 @@ function ConnectorRow({

return (
<TableRow
className={`border hover:bg-hover-light ${
className={`hover:bg-hover-light ${
invisible ? "invisible !h-0 !-mb-10" : "!border !border-border"
} w-full cursor-pointer relative `}
onClick={() => {
Expand All @@ -202,21 +202,19 @@ function ConnectorRow({
{isPaidEnterpriseFeaturesEnabled && (
<TableCell>
{ccPairsIndexingStatus.access_type === "public" ? (
<Badge variant="success" icon={FiUnlock}>
<Badge variant={isEditable ? "success" : "default"} icon={FiUnlock}>
Public
</Badge>
) : ccPairsIndexingStatus.access_type === "sync" ? (
<Badge
variant="outline"
color={isEditable ? "orange" : "gray"}
variant={isEditable ? "orange" : "default"}
icon={FiRefreshCw}
>
Sync
</Badge>
) : (
<Badge
size="md"
variant={isEditable ? "outline" : "default"}
variant={isEditable ? "in_progress" : "default"}
icon={FiLock}
>
Private
Expand Down Expand Up @@ -419,7 +417,7 @@ export function CCPairIndexingStatusTable({
placeholder="Search connectors..."
value={searchTerm}
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()}>
Expand Down
6 changes: 4 additions & 2 deletions web/src/app/assistants/gallery/AssistantsGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,17 @@ export function AssistantsGallery() {
<div className="grid grid-cols-2 gap-4 mt-4 mb-6">
<Button
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}
>
Create New Assistant
</Button>

<Button
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}
>
Your Assistants
Expand Down
6 changes: 4 additions & 2 deletions web/src/app/assistants/mine/AssistantsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,18 @@ export function AssistantsList() {

<div className="grid grid-cols-2 gap-4 mt-4 mb-8">
<Button
variant="default"
className="p-6 text-base"
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}
>
Create New Assistant
</Button>

<Button
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}
>
Assistant Gallery
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ export function ChatPage({
finalMessage?.context_docs?.top_documents || documents,
citations: finalMessage?.citations || {},
files: finalMessage?.files || aiMessageImages || [],
toolCall: finalMessage?.tool_call || null,
toolCall: finalMessage?.tool_call || toolCall,
parentMessageId: regenerationRequest
? regenerationRequest?.parentMessage?.messageId!
: initialFetchDetails.user_message_id,
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/chat/RegenerateOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function RegenerateDropdown({
) : (
<Hoverable
size={16}
icon={StarFeedback as IconType}
icon={FiRefreshCw as IconType}
hoverText={getDisplayNameForModel(alternate)}
/>
)}
Expand Down
21 changes: 14 additions & 7 deletions web/src/components/admin/connectors/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ export function SelectorFormField({
label,
options,
subtext,
includeDefault = false,
side = "bottom",
maxHeight,
onSelect,
Expand All @@ -615,26 +614,34 @@ export function SelectorFormField({
{subtext && <SubLabel>{subtext}</SubLabel>}
<div className="mt-2">
<Select
value={field.value}
value={field.value || defaultValue}
onValueChange={
onSelect || ((selected) => setFieldValue(name, selected))
}
defaultValue={defaultValue}
>
<SelectTrigger>
<SelectValue
placeholder={includeDefault ? "Select..." : undefined}
/>
<SelectValue placeholder="Select...">
{field.value || defaultValue || ""}
</SelectValue>
</SelectTrigger>
<SelectContent
side={side}
className={maxHeight ? `max-h-[${maxHeight}]` : undefined}
>
{includeDefault && (
{options.length == 0 && (
<SelectItem value="default">Select...</SelectItem>
)}
{defaultValue && (
<SelectItem value={defaultValue}>{defaultValue}</SelectItem>
)}
{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}
</SelectItem>
))}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const buttonVariants = cva(
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",
"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:
"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",
Expand Down
10 changes: 8 additions & 2 deletions web/src/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ const SelectItem = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
icon?: React.ElementType;
selected?: boolean;
}
>(({ className, children, icon: Icon, ...props }, ref) => (
>(({ className, children, icon: Icon, selected, ...props }, ref) => (
<SelectPrimitive.Item
ref={ref}
className={cn(
Expand All @@ -127,9 +128,14 @@ const SelectItem = React.forwardRef<
>
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectPrimitive.ItemIndicator>
{Icon ? <Icon className="h-4 w-4" /> : <Check className="h-4 w-4" />}
<Check className="h-4 w-4" />
</SelectPrimitive.ItemIndicator>
</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.Item>
Expand Down
2 changes: 0 additions & 2 deletions web/src/lib/connectors/connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ For example, specifying .*-support.* as a "channel" will cause the connector to
values: [],
advanced_values: [],
},

};
export function createConnectorInitialValues(
connector: ConfigurableSources
Expand Down Expand Up @@ -1210,7 +1209,6 @@ export interface AsanaConfig {

export interface FreshdeskConfig {}


export interface MediaWikiConfig extends MediaWikiBaseConfig {
hostname: string;
}
Expand Down
17 changes: 7 additions & 10 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ var merge = require("lodash/merge");
// Use relative paths for imports
const baseThemes = require("./tailwind-themes/tailwind.config.js");

let customThemes = null;
try {
if (process.env.NEXT_PUBLIC_THEME) {
customThemes = require(
`./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js`
);
}
} catch (error) {
console.warn(`Custom theme not found for: ${process.env.NEXT_PUBLIC_THEME}`);
}
const customThemes = process.env.NEXT_PUBLIC_THEME
? require(
process.env.NEXT_PUBLIC_THEME
? `./tailwind-themes/custom/${process.env.NEXT_PUBLIC_THEME}/tailwind.config.js`
: "./tailwind-themes/custom/default/tailwind.config.js"
)
: null;

/** @type {import('tailwindcss').Config} */
module.exports = customThemes ? merge(baseThemes, customThemes) : baseThemes;

0 comments on commit bafb95d

Please sign in to comment.