mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
## What kind of change does this PR introduce? Mechanical cleanup on top of the Button default-variant change (#50160). ## What is the current behavior? Many callsites still pass `variant="default"` even though that is now the component default. ## What is the new behavior? Removes redundant static `variant="default"` from legacy `Button` and `ButtonTooltip` callsites. Keeps explicit defaults where they document the API: - `button-default.tsx` and `button-sizes.tsx` demos - `DocsButton`, which pins neutral styling at the wrapper boundary ## To test Studio: - [Auth → Rate Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits): dirty the form so Cancel appears; Cancel stays neutral, Save stays green - [Project Settings → API Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys): `DocsButton` in the header actions stays neutral Design system: - [Design system → Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button): `button-default` / `button-sizes` still show explicit default styling; Primary (green) is restricted to the Primary section (and `asChild`) WWW: - [www → Brand assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets): Download logo kit / Download button kit stay neutral
67 lines
2.4 KiB
TypeScript
67 lines
2.4 KiB
TypeScript
import { Heart, Pointer } from 'lucide-react'
|
|
import React from 'react'
|
|
import { Button, Card } from 'ui'
|
|
import {
|
|
InnerSideBarEmptyPanel,
|
|
InnerSideBarShimmeringLoaders,
|
|
InnerSideMenuCollapsible,
|
|
InnerSideMenuCollapsibleContent,
|
|
InnerSideMenuCollapsibleTrigger,
|
|
InnerSideMenuItem,
|
|
InnerSideMenuSeparator,
|
|
} from 'ui-patterns/InnerSideMenu'
|
|
|
|
export default function InnerSideMenuEmpty() {
|
|
const [isLoading, setIsLoading] = React.useState(true)
|
|
const [hasItems, setHasItems] = React.useState(false)
|
|
|
|
React.useEffect(() => {
|
|
// Simulate loading
|
|
const timer = setTimeout(() => {
|
|
setIsLoading(false)
|
|
}, 2000)
|
|
return () => clearTimeout(timer)
|
|
}, [])
|
|
|
|
return (
|
|
<Card className="w-64 py-4 flex flex-col gap-4 bg-dash-sidebar">
|
|
<InnerSideMenuCollapsible defaultOpen>
|
|
<InnerSideMenuCollapsibleTrigger title="Functions" />
|
|
<InnerSideMenuCollapsibleContent className="pt-2">
|
|
<InnerSideBarEmptyPanel
|
|
className="mx-2"
|
|
title="No functions found"
|
|
description="Create your first serverless function to get started."
|
|
illustration={<div className="text-4xl">🚀</div>}
|
|
actions={<Button onClick={() => setHasItems(true)}>Create Function</Button>}
|
|
/>
|
|
</InnerSideMenuCollapsibleContent>
|
|
</InnerSideMenuCollapsible>
|
|
<InnerSideMenuSeparator />
|
|
<InnerSideMenuCollapsible defaultOpen>
|
|
<InnerSideMenuCollapsibleTrigger title="Functions" />
|
|
<InnerSideMenuCollapsibleContent className="pt-2">
|
|
<InnerSideBarEmptyPanel
|
|
className="mx-2"
|
|
title="No functions found"
|
|
description="Create your first serverless function to get started."
|
|
illustration={
|
|
<figure className="relative mb-3">
|
|
<div className="h-6 w-6 bg-surface-100 border rounded-md flex items-center justify-center">
|
|
<Heart className="text-light" size={13} />
|
|
</div>
|
|
<Pointer
|
|
className="absolute right-[-6px] -bottom-2 text-lighter"
|
|
strokeWidth={1.5}
|
|
size={16}
|
|
/>
|
|
</figure>
|
|
}
|
|
actions={<Button onClick={() => setHasItems(true)}>Create Function</Button>}
|
|
/>
|
|
</InnerSideMenuCollapsibleContent>
|
|
</InnerSideMenuCollapsible>
|
|
</Card>
|
|
)
|
|
}
|