Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): remove hardcoded badge capitalisation (#40970)

Danny Whitefea4053458b6
diff --git a/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx b/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx
index 1b192abf3b4..0d408e1c83f 100644
--- a/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx
+++ b/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx
@@ -47,7 +47,7 @@ export function useApiKeysCommands() {
badge: () => (
<span className="flex items-center gap-x-1">
<Badge>Project: {project?.name}</Badge>
- <Badge className="capitalize">{publishableKey.type}</Badge>
+ <Badge>{publishableKey.type}</Badge>
</span>
),
icon: () => <Key />,
@@ -63,7 +63,7 @@ export function useApiKeysCommands() {
badge: () => (
<span className="flex items-center gap-x-1">
<Badge>Project: {project?.name}</Badge>
- <Badge className="capitalize">{key.type}</Badge>
+ <Badge>{key.type}</Badge>
</span>
),
icon: () => <Key />,
@@ -81,7 +81,7 @@ export function useApiKeysCommands() {
<span className="flex items-center gap-x-1">
<Badge>Project: {project?.name}</Badge>
<Badge>Public</Badge>
- <Badge className="capitalize">{anonKey.type}</Badge>
+ <Badge>{anonKey.type}</Badge>
</span>
),
icon: () => <Key />,
@@ -98,7 +98,7 @@ export function useApiKeysCommands() {
<span className="flex items-center gap-x-1">
<Badge>Project: {project?.name}</Badge>
<Badge variant="destructive">Secret</Badge>
- <Badge className="capitalize">{serviceKey.type}</Badge>
+ <Badge>{serviceKey.type}</Badge>
</span>
),
icon: () => <Key />,
diff --git a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
index 62c1d19864e..1b65332cb5f 100644
--- a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
+++ b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
@@ -1,10 +1,10 @@
+import { BASE_PATH } from 'lib/constants'
import { Check, ChevronLeft, ChevronRight } from 'lucide-react'
import Image from 'next/image'
import Link from 'next/link'
import { useEffect, useState } from 'react'
-import { cn, Button, Card, CardContent, Badge } from 'ui'
-import { GettingStartedStep, GettingStartedAction } from './GettingStarted.types'
-import { BASE_PATH } from 'lib/constants'
+import { Badge, Button, Card, CardContent, cn } from 'ui'
+import { GettingStartedAction, GettingStartedStep } from './GettingStarted.types'
// Determine action type for tracking
const getActionType = (action: GettingStartedAction): 'primary' | 'ai_assist' | 'external_link' => {
@@ -186,7 +186,7 @@ export function GettingStarted({ steps, onStepClick }: GettingStartedProps) {
<h3>{activeStep.title}</h3>
<Badge
variant={activeStep.status === 'complete' ? 'success' : 'default'}
- className="capitalize hidden @2xl:inline-flex"
+ className="hidden @2xl:inline-flex"
>
{activeStep.status}
</Badge>
diff --git a/apps/studio/components/interfaces/Integrations/VercelGithub/IntegrationPanels.tsx b/apps/studio/components/interfaces/Integrations/VercelGithub/IntegrationPanels.tsx
index 4e28f74b065..061b5a5528f 100644
--- a/apps/studio/components/interfaces/Integrations/VercelGithub/IntegrationPanels.tsx
+++ b/apps/studio/components/interfaces/Integrations/VercelGithub/IntegrationPanels.tsx
@@ -105,7 +105,7 @@ export const IntegrationInstallation = forwardRef<HTMLLIElement, IntegrationInst
integration.metadata?.gitHubConnectionOwner)}
</span>
- <Badge className="capitalize">{integration.metadata?.account.type}</Badge>
+ <Badge>{integration.metadata?.account.type}</Badge>
</div>
<div className="flex flex-col gap-0">
<span className="text-foreground-lighter text-xs">
diff --git a/apps/studio/components/interfaces/JwtSecrets/algorithm-hover-card.tsx b/apps/studio/components/interfaces/JwtSecrets/algorithm-hover-card.tsx
index 1d69c0051a0..0a2d40f6a10 100644
--- a/apps/studio/components/interfaces/JwtSecrets/algorithm-hover-card.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/algorithm-hover-card.tsx
@@ -1,6 +1,6 @@
-import { LockKeyholeOpen, RectangleEllipsis } from 'lucide-react'
+import { ExternalLink, HelpCircle, LockKeyholeOpen, RectangleEllipsis } from 'lucide-react'
-import { InfoPill } from 'components/ui/InfoPill'
+import { HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
import { AlgorithmDetail, algorithmDetails } from './algorithm-details'
interface AlgorithmHoverCardProps {
@@ -12,39 +12,57 @@ export const AlgorithmHoverCard = ({ algorithm, legacy }: AlgorithmHoverCardProp
const details: AlgorithmDetail = algorithmDetails[algorithm]
return (
- <InfoPill
- label={<span className="pt-1 h-6">{legacy ? `Legacy ${details.label}` : details.label}</span>}
- icon={
- algorithm === 'HS256' ? (
- <RectangleEllipsis className="size-4 flex-shrink-0" />
- ) : (
- <LockKeyholeOpen className="size-4 flex-shrink-0" />
- )
- }
- title={details.name}
- description={
- <div className="flex flex-col gap-2">
- <p>{details.description}</p>
- <p>
- Pros:
- <ul className="list-disc">
- {details.pros.map((pro, i) => (
- <li key={i}>{pro}</li>
+ <div className="flex items-center gap-x-2">
+ {algorithm === 'HS256' ? (
+ <RectangleEllipsis className="flex-shrink-0" size={14} />
+ ) : (
+ <LockKeyholeOpen className="flex-shrink-0" size={14} />
+ )}
+ <p>{legacy ? `Legacy ${details.label}` : details.label}</p>
+ <HoverCard closeDelay={50} openDelay={300}>
+ <HoverCardTrigger className="min-w-0">
+ <HelpCircle size={14} className="text-foreground-lighter" />
+ </HoverCardTrigger>
+ <HoverCardContent className="w-[22rem] flex items-start gap-3" side="right" align="center">
+ <div className="flex-1">
+ <h4 className="font-semibold truncate">{details.name}</h4>
+ <div className="flex flex-col gap-2 text-sm text-foreground-light">
+ <p>{details.description}</p>
+ <p>
+ Pros:
+ <ul className="list-disc pl-6">
+ {details.pros.map((pro, i) => (
+ <li key={i}>{pro}</li>
+ ))}
+ </ul>
+ </p>
+ <p>
+ Cons:{' '}
+ <ul className="list-disc pl-6">
+ {details.cons.map((con, i) => (
+ <li key={i}>{con}</li>
+ ))}
+ </ul>
+ <br />
+ </p>
+ </div>
+ <div className="space-y-1 mt-2">
+ {details.links.map((link, index) => (
+ <a
+ key={index}
+ href={link.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-xs text-brand hover:text-brand-600 flex items-center"
+ >
+ <ExternalLink className="w-3 h-3 mr-1 flex-shrink-0" />
+ <span className="truncate">{link.label}</span>
+ </a>
))}
- </ul>
- </p>
- <p>
- Cons:{' '}
- <ul className="list-disc">
- {details.cons.map((con, i) => (
- <li key={i}>{con}</li>
- ))}
- </ul>
- <br />
- </p>
- </div>
- }
- links={details.links}
- />
+ </div>
+ </div>
+ </HoverCardContent>
+ </HoverCard>
+ </div>
)
}
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx
index 786f48eea0e..44615179bdd 100644
--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx
@@ -236,6 +236,7 @@ export const JWTSecretKeysTable = () => {
<TableHead className="text-left font-mono uppercase text-xs text-foreground-muted h-auto py-2">
Type
</TableHead>
+ <TableHead />
<TableHead className="text-right font-mono uppercase text-xs text-foreground-muted h-auto py-2">
Actions
</TableHead>
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
index 3a12789a6c9..3f99b86acc8 100644
--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
@@ -1,19 +1,18 @@
-import { useMemo } from 'react'
import { FileKey } from 'lucide-react'
+import { useMemo } from 'react'
+
+import { JWTSigningKey } from 'data/jwt-signing-keys/jwt-signing-keys-query'
import {
- DialogContent,
- DialogDescription,
+ Button,
DialogFooter,
DialogHeader,
DialogSection,
DialogSectionSeparator,
DialogTitle,
Input,
- Textarea,
Label_Shadcn_,
- Button,
+ Textarea,
} from 'ui'
-import { JWTSigningKey } from 'data/jwt-signing-keys/jwt-signing-keys-query'
export function KeyDetailsDialog({
selectedKey,
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/rotate-key-dialog.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/rotate-key-dialog.tsx
index 40ae299dc8f..68002a01837 100644
--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/rotate-key-dialog.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/rotate-key-dialog.tsx
@@ -1,10 +1,11 @@
+import { ArrowRight, ExternalLink, Info, Key, Timer } from 'lucide-react'
+import { useState } from 'react'
+import { toast } from 'sonner'
+
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
import { useJWTSigningKeyUpdateMutation } from 'data/jwt-signing-keys/jwt-signing-key-update-mutation'
import { JWTSigningKey } from 'data/jwt-signing-keys/jwt-signing-keys-query'
-import { ArrowRight, ExternalLink, Info, Key, Timer } from 'lucide-react'
-import { useState } from 'react'
-import { toast } from 'sonner'
import {
Badge,
Button,
@@ -71,7 +72,7 @@ export function RotateKeyDialog({
'px-4 py-1 gap-2 flex flex-row items-center uppercase'
)}
>
- <Timer className="size-4" />
+ <Timer size={14} />
Standby key
</Badge>
<div>
@@ -84,7 +85,7 @@ export function RotateKeyDialog({
'px-4 py-1 gap-2 flex flex-row items-center uppercase'
)}
>
- <Key className="size-4" />
+ <Key size={14} />
Current key
</Badge>
</div>
@@ -102,7 +103,7 @@ export function RotateKeyDialog({
'px-4 py-1 gap-2 flex flex-row items-center uppercase'
)}
>
- <Key className="size-4" />
+ <Key size={14} />
Current key
</Badge>
<div>
@@ -114,7 +115,7 @@ export function RotateKeyDialog({
'px-4 py-1 gap-2 flex flex-row items-center uppercase'
)}
>
- <Timer className="size-4" />
+ <Timer size={14} />
Previous key
</Badge>
<div />
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/signing-key-row.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/signing-key-row.tsx
index cd0ded6d0dd..838a20af78b 100644
--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/signing-key-row.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/signing-key-row.tsx
@@ -1,4 +1,3 @@
-import dayjs from 'dayjs'
import { motion } from 'framer-motion'
import {
CircleArrowDown,
@@ -14,6 +13,7 @@ import {
import { components } from 'api-types'
import { DropdownMenuItemTooltip } from 'components/ui/DropdownMenuItemTooltip'
import { JWTSigningKey } from 'data/jwt-signing-keys/jwt-signing-keys-query'
+import dayjs from 'dayjs'
import {
Badge,
Button,
@@ -25,6 +25,7 @@ import {
TableCell,
TableRow,
} from 'ui'
+import { TimestampInfo } from 'ui-patterns'
import { AlgorithmHoverCard } from '../algorithm-hover-card'
import { statusColors, statusLabels } from '../jwt.constants'
@@ -77,15 +78,15 @@ export const SigningKeyRow = ({
)}
>
{signingKey.status === 'standby' ? (
- <Timer className="size-4 flex-shrink-0" />
+ <Timer className="flex-shrink-0" size={14} />
) : (
- <Key className="size-4 flex-shrink-0" />
+ <Key className="flex-shrink-0" size={14} />
)}
- <span className="truncate">{statusLabels[signingKey.status]}</span>
+ <span className="truncate text-xs">{statusLabels[signingKey.status]}</span>
</Badge>
</div>
</TableCell>
- <TableCell className="font-mono truncate max-w-[100px] pl-0 py-2">
+ <TableCell className="font-mono truncate w-[315px] pl-0 py-2">
<div className="min-w-0 flex">
<Badge
className={cn(
@@ -94,22 +95,28 @@ export const SigningKeyRow = ({
'gap-2 py-2 h-6 min-w-0 overflow-hidden flex items-center flex-1'
)}
>
- <span className="truncate flex-1" title={signingKey.id}>
+ <span className="truncate flex-1 text-xs" title={signingKey.id}>
{signingKey.id}
</span>
</Badge>
</div>
</TableCell>
- <TableCell className="truncate max-w-[100px] py-2">
+ <TableCell className="truncate py-2">
<AlgorithmHoverCard
algorithm={signingKey.algorithm}
legacy={signingKey.id === legacyKey?.id}
/>
</TableCell>
- {(signingKey.status === 'previously_used' || signingKey.status === 'revoked') && (
- <TableCell className="text-right py-2 text-sm text-foreground-light whitespace-nowrap hidden lg:table-cell">
- {dayjs(signingKey.updated_at).fromNow()}
+ {signingKey.status === 'previously_used' || signingKey.status === 'revoked' ? (
+ <TableCell className="max-w-[100px] text-right py-2 text-sm text-foreground-light whitespace-nowrap hidden lg:table-cell">
+ <TimestampInfo
+ className="text-sm"
+ utcTimestamp={signingKey.updated_at}
+ label={dayjs(signingKey.updated_at).fromNow()}
+ />
</TableCell>
+ ) : (
+ <TableCell />
)}
<TableCell className="text-right py-2">
{(signingKey.status !== 'in_use' || signingKey.algorithm !== 'HS256') && (
diff --git a/apps/studio/components/ui/InfoPill.tsx b/apps/studio/components/ui/InfoPill.tsx
deleted file mode 100644
index d1ff71ae968..00000000000
--- a/apps/studio/components/ui/InfoPill.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { ExternalLink } from 'lucide-react'
-import React, { ReactNode } from 'react'
-
-import { Badge } from 'ui/src/components/shadcn/ui/badge'
-import {
- HoverCard,
- HoverCardContent,
- HoverCardTrigger,
-} from 'ui/src/components/shadcn/ui/hover-card'
-
-interface Link {
- url: string
- label: string
-}
-
-interface InfoPillProps {
- label: string | ReactNode
- icon: ReactNode
- title: string
- description: string | ReactNode
- links?: Link[]
-}
-
-export const InfoPill = ({ label, icon, title, description, links }: InfoPillProps) => {
- return (
- <HoverCard closeDelay={50} openDelay={300}>
- <HoverCardTrigger className="min-w-0">
- <Badge className="gap-2 py-2 h-6 min-w-0 overflow-hidden">
- <span className="flex-1 flex items-center gap-2">
- {icon} {label}
- </span>
- </Badge>
- </HoverCardTrigger>
- <HoverCardContent className="w-80 flex items-start gap-3" side="right" align="center">
- <div className="rounded-full bg-surface-300 p-2 flex-shrink-0">
- {React.cloneElement(icon as React.ReactElement, {
- className: 'w-5 h-5',
- strokeWidth: 1.5,
- })}
- </div>
- <div className="flex-1">
- <h4 className="font-semibold truncate">{title}</h4>
- <p className="text-xs text-foreground-light">{description}</p>
- {links && links.length > 0 && (
- <div className="space-y-1 mt-2">
- {links.map((link, index) => (
- <a
- key={index}
- href={link.url}
- target="_blank"
- rel="noopener noreferrer"
- className="text-xs text-brand hover:text-brand-600 flex items-center"
- >
- <ExternalLink className="w-3 h-3 mr-1 flex-shrink-0" />
- <span className="truncate">{link.label}</span>
- </a>
- ))}
- </div>
- )}
- </div>
- </HoverCardContent>
- </HoverCard>
- )
-}
diff --git a/apps/www/components/Blog/BlogListItem.tsx b/apps/www/components/Blog/BlogListItem.tsx
index ce04574eddb..165e9519bc2 100644
--- a/apps/www/components/Blog/BlogListItem.tsx
+++ b/apps/www/components/Blog/BlogListItem.tsx
@@ -76,7 +76,7 @@ const BlogListItem = ({ post }: Props) => {
{post.categories.map(
(category, i) =>
i === 0 && (
- <Badge key={category} className="group-hover:border-foreground-muted capitalize">
+ <Badge key={category} className="group-hover:border-foreground-muted">
{sanitizeCategory(category)}
</Badge>
)
diff --git a/apps/www/components/Events/EventListItem.tsx b/apps/www/components/Events/EventListItem.tsx
index 91863d6a176..84765051721 100644
--- a/apps/www/components/Events/EventListItem.tsx
+++ b/apps/www/components/Events/EventListItem.tsx
@@ -47,7 +47,7 @@ const EventListItem = ({ event }: Props) => {
{event.categories.map(
(category, i) =>
i === 0 && (
- <Badge key={category} className="group-hover:border-foreground-muted capitalize">
+ <Badge key={category} className="group-hover:border-foreground-muted">
{category}
</Badge>
)