New ux dark (#3944)

This commit is contained in:
pablonyx 2025-02-09 21:14:32 -08:00 committed by GitHub
parent 6848337445
commit 1454e7e07d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 70 additions and 46 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

BIN
web/public/discord.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -62,6 +62,7 @@ import {
} from "@/lib/connectors/oauth"; } from "@/lib/connectors/oauth";
import { CreateStdOAuthCredential } from "@/components/credentials/actions/CreateStdOAuthCredential"; import { CreateStdOAuthCredential } from "@/components/credentials/actions/CreateStdOAuthCredential";
import { Spinner } from "@/components/Spinner"; import { Spinner } from "@/components/Spinner";
import { Button } from "@/components/ui/button";
export interface AdvancedConfig { export interface AdvancedConfig {
refreshFreq: number; refreshFreq: number;
pruneFreq: number; pruneFreq: number;
@ -464,8 +465,9 @@ export default function AddConnector({
{!createCredentialFormToggle && ( {!createCredentialFormToggle && (
<div className="mt-6 flex space-x-4"> <div className="mt-6 flex space-x-4">
{/* Button to pop up a form to manually enter credentials */} {/* Button to pop up a form to manually enter credentials */}
<button <Button
className="mt-6 text-sm bg-background-900 px-2 py-1.5 flex text-text-200 flex-none rounded mr-4" variant="secondary"
className="mt-6 text-sm mr-4"
onClick={async () => { onClick={async () => {
if (oauthDetails && oauthDetails.oauth_enabled) { if (oauthDetails && oauthDetails.oauth_enabled) {
if (oauthDetails.additional_kwargs.length > 0) { if (oauthDetails.additional_kwargs.length > 0) {
@ -495,7 +497,7 @@ export default function AddConnector({
}} }}
> >
Create New Create New
</button> </Button>
{/* Button to sign in via OAuth */} {/* Button to sign in via OAuth */}
{oauthSupportedSources.includes(connector) && {oauthSupportedSources.includes(connector) &&
(NEXT_PUBLIC_CLOUD_ENABLED || (NEXT_PUBLIC_CLOUD_ENABLED ||

View File

@ -23,7 +23,7 @@ import {
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/ui/select";
import { Monitor } from "lucide-react"; import { Monitor, Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
export function UserSettingsModal({ export function UserSettingsModal({
@ -239,14 +239,29 @@ export function UserSettingsModal({
> >
<SelectTrigger className="w-full"> <SelectTrigger className="w-full">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{theme === "system" ? (
<Monitor className="h-4 w-4" /> <Monitor className="h-4 w-4" />
) : theme === "light" ? (
<Sun className="h-4 w-4" />
) : (
<Moon className="h-4 w-4" />
)}
<SelectValue placeholder="Select theme" /> <SelectValue placeholder="Select theme" />
</div> </div>
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="system">System</SelectItem> <SelectItem
<SelectItem value="light">Light</SelectItem> icon={<Monitor className="h-4 w-4" />}
<SelectItem value="dark">Dark</SelectItem> value="system"
>
System
</SelectItem>
<SelectItem icon={<Sun className="h-4 w-4" />} value="light">
Light
</SelectItem>
<SelectItem icon={<Moon className="h-4 w-4" />} value="dark">
Dark
</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
</div> </div>

View File

@ -40,15 +40,12 @@ const CreateButton = ({
}) => ( }) => (
<div className="flex justify-end w-full"> <div className="flex justify-end w-full">
<Button <Button
className="enabled:cursor-pointer disabled:cursor-not-allowed disabled:bg-blue-200 bg-blue-400 flex gap-x-1 items-center text-white py-2.5 px-3.5 text-sm font-regular rounded-sm"
onClick={onClick} onClick={onClick}
type="button" type="button"
disabled={isSubmitting || (!isAdmin && groups.length === 0)} disabled={isSubmitting || (!isAdmin && groups.length === 0)}
> >
<div className="flex items-center gap-x-1"> <PlusCircleIcon className="h-4 w-4" />
<PlusCircleIcon size={16} className="text-indigo-100" />
Create Create
</div>
</Button> </Button>
</div> </div>
); );

View File

@ -62,12 +62,18 @@ const CredentialSelectionTable = ({
<div className="w-full max-h-[50vh] overflow-auto"> <div className="w-full max-h-[50vh] overflow-auto">
<table className="w-full text-sm border-collapse"> <table className="w-full text-sm border-collapse">
<thead className="sticky top-0 w-full"> <thead className="sticky top-0 w-full">
<tr className="bg-background-100"> <tr className="bg-neutral-100 dark:bg-neutral-900">
<th className="p-2 text-left font-medium text-text-600"></th> <th className="p-2 text-left font-medium text-neutral-600 dark:text-neutral-400"></th>
<th className="p-2 text-left font-medium text-text-600">ID</th> <th className="p-2 text-left font-medium text-neutral-600 dark:text-neutral-400">
<th className="p-2 text-left font-medium text-text-600">Name</th> ID
<th className="p-2 text-left font-medium text-text-600">Created</th> </th>
<th className="p-2 text-left font-medium text-text-600"> <th className="p-2 text-left font-medium text-neutral-600 dark:text-neutral-400">
Name
</th>
<th className="p-2 text-left font-medium text-neutral-600 dark:text-neutral-400">
Created
</th>
<th className="p-2 text-left font-medium text-neutral-600 dark:text-neutral-400">
Last Updated Last Updated
</th> </th>
<th /> <th />

View File

@ -36,15 +36,15 @@ export const ShortCut = ({
const [faviconError, setFaviconError] = useState(false); const [faviconError, setFaviconError] = useState(false);
return ( return (
<div className="w-24 h-24 flex-none rounded-xl shadow-lg relative group transition-all duration-300 ease-in-out hover:scale-105 bg-white/10 backdrop-blur-sm"> <div className="w-24 h-24 flex-none rounded-xl shadow-lg relative group transition-all duration-300 ease-in-out hover:scale-105 bg-[#fff]/10 backdrop-blur-sm">
<button <button
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
onEdit(shortCut); onEdit(shortCut);
}} }}
className="absolute top-1 right-1 p-1 bg-white/20 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" className="absolute top-1 right-1 p-1 bg-[#fff]/20 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200"
> >
<PencilIcon className="w-3 h-3 text-white" /> <PencilIcon className="w-3 h-3 text-[#fff]" />
</button> </button>
<div <div
onClick={() => window.open(shortCut.url, "_blank")} onClick={() => window.open(shortCut.url, "_blank")}
@ -61,10 +61,10 @@ export const ShortCut = ({
onError={() => setFaviconError(true)} onError={() => setFaviconError(true)}
/> />
) : ( ) : (
<QuestionMarkIcon size={32} className="text-white w-full h-full" /> <QuestionMarkIcon size={32} className="text-[#fff] w-full h-full" />
)} )}
</div> </div>
<h1 className="text-white w-full text-center font-semibold text-sm truncate px-2"> <h1 className="text-[#fff] w-full text-center font-semibold text-sm truncate px-2">
{shortCut.name} {shortCut.name}
</h1> </h1>
</div> </div>
@ -80,10 +80,10 @@ export const AddShortCut = ({
return ( return (
<button <button
onClick={openShortCutModal} onClick={openShortCutModal}
className="w-24 h-24 flex-none rounded-xl bg-white/10 hover:bg-white/20 backdrop-blur-sm transition-all duration-300 ease-in-out flex flex-col items-center justify-center" className="w-24 h-24 flex-none rounded-xl bg-[#fff]/10 hover:bg-[#fff]/20 backdrop-blur-sm transition-all duration-300 ease-in-out flex flex-col items-center justify-center"
> >
<PlusIcon className="w-8 h-8 text-white mb-2" /> <PlusIcon className="w-8 h-8 text-[#fff] mb-2" />
<h1 className="text-white text-xs font-medium">New Bookmark</h1> <h1 className="text-[#fff] text-xs font-medium">New Bookmark</h1>
</button> </button>
); );
}; };
@ -111,9 +111,11 @@ export const NewShortCutModal = ({
const handleSubmit = (e: React.FormEvent) => { const handleSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
if (isValidUrl) { if (isValidUrl) {
const faviconUrl = `https://www.google.com/s2/favicons?domain=${ const faviconUrl = isValidUrl
new URL(url).hostname ? `https://www.google.com/s2/favicons?domain=${new URL(
}&sz=64`; url
).hostname.replace(/^(cloud\.)?onyx\.app$/, "onyx.app")}&sz=64`
: "";
onAdd({ name, url, favicon: faviconUrl }); onAdd({ name, url, favicon: faviconUrl });
onClose(); onClose();
} else { } else {
@ -135,14 +137,15 @@ export const NewShortCutModal = ({
useEffect(() => { useEffect(() => {
setIsValidUrl(validateUrl(url)); setIsValidUrl(validateUrl(url));
}, [url]); }, [url]);
const faviconUrl = isValidUrl const faviconUrl = isValidUrl
? `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64` ? `https://www.google.com/s2/favicons?domain=${new URL(
url
).hostname.replace(/^(cloud\.)?onyx\.app$/, "onyx.app")}&sz=64`
: ""; : "";
return ( return (
<Dialog open={isOpen} onOpenChange={onClose}> <Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="max-w-[95%] sm:max-w-[425px] bg-background-900 border-none text-white"> <DialogContent className="max-w-[95%] sm:max-w-[425px] bg-background-900 border-none text-[#fff]">
<DialogHeader> <DialogHeader>
<DialogTitle> <DialogTitle>
{editingShortcut ? "Edit Shortcut" : "Add New Shortcut"} {editingShortcut ? "Edit Shortcut" : "Add New Shortcut"}
@ -166,7 +169,7 @@ export const NewShortCutModal = ({
id="name" id="name"
value={name} value={name}
onChange={(e) => setName(e.target.value)} onChange={(e) => setName(e.target.value)}
className="w-full bg-background-800 border-background-700 text-white" className="w-full bg-background-800 border-background-700 text-[#fff]"
placeholder="Enter shortcut name" placeholder="Enter shortcut name"
/> />
</div> </div>
@ -181,7 +184,7 @@ export const NewShortCutModal = ({
id="url" id="url"
value={url} value={url}
onChange={handleUrlChange} onChange={handleUrlChange}
className={`bg-background-800 border-background-700 text-white ${ className={`bg-background-800 border-background-700 text-[#fff] ${
!isValidUrl && url ? "border-red-500" : "" !isValidUrl && url ? "border-red-500" : ""
}`} }`}
placeholder="https://example.com" placeholder="https://example.com"
@ -213,7 +216,7 @@ export const NewShortCutModal = ({
<DialogFooter> <DialogFooter>
<Button <Button
type="submit" type="submit"
className="bg-blue-600 hover:bg-blue-700 text-white" className="bg-blue-600 hover:bg-blue-700 text-[#fff]"
disabled={!isValidUrl || !name} disabled={!isValidUrl || !name}
> >
{editingShortcut ? "Save Changes" : "Add Shortcut"} {editingShortcut ? "Save Changes" : "Add Shortcut"}

View File

@ -68,7 +68,7 @@ import zendeskIcon from "../../../public/Zendesk.svg";
import dropboxIcon from "../../../public/Dropbox.png"; import dropboxIcon from "../../../public/Dropbox.png";
import egnyteIcon from "../../../public/Egnyte.png"; import egnyteIcon from "../../../public/Egnyte.png";
import slackIcon from "../../../public/Slack.png"; import slackIcon from "../../../public/Slack.png";
import discordIcon from "../../../public/discord.png"; import discordIcon from "../../../public/discord.webp";
import airtableIcon from "../../../public/Airtable.svg"; import airtableIcon from "../../../public/Airtable.svg";
import s3Icon from "../../../public/S3.png"; import s3Icon from "../../../public/S3.png";

View File

@ -133,18 +133,19 @@ const SelectItem = React.forwardRef<
)} )}
{...props} {...props}
> >
{icon && ( {icon ? (
<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">
{typeof icon === "function" ? icon({ size: 16, className: "" }) : icon} {typeof icon === "function" ? icon({ size: 16, className: "" }) : icon}
</span> </span>
)} ) : (
!hideCheck &&
{!hideCheck && selected && ( selected && (
<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>
<Check className="h-4 w-4" /> <Check className="h-4 w-4" />
</SelectPrimitive.ItemIndicator> </SelectPrimitive.ItemIndicator>
</span> </span>
)
)} )}
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText> <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>