The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Page components (#40289)
Saxon Fletcherff599edf1462
diff --git a/apps/design-system/__registry__/index.tsx b/apps/design-system/__registry__/index.tsxindex 32ff2204d4f..2bb69907c83 100644--- a/apps/design-system/__registry__/index.tsx+++ b/apps/design-system/__registry__/index.tsx@@ -38,6 +38,39 @@ export const Index: Record<string, any> = {subcategory: "undefined",chunks: []},+ "PageContainer": {+ name: "PageContainer",+ type: "components:fragment",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/../../packages/ui-patterns/src/PageContainer")),+ source: "",+ files: ["registry/default//PageContainer/index.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "PageHeader": {+ name: "PageHeader",+ type: "components:fragment",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/../../packages/ui-patterns/src/PageHeader")),+ source: "",+ files: ["registry/default//PageHeader/index.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "PageSection": {+ name: "PageSection",+ type: "components:fragment",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/../../packages/ui-patterns/src/PageSection")),+ source: "",+ files: ["registry/default//PageSection/index.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },"accordion-demo": {name: "accordion-demo",type: "components:example",@@ -1886,6 +1919,105 @@ export const Index: Record<string, any> = {subcategory: "undefined",chunks: []},+ "page-container-demo": {+ name: "page-container-demo",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-container-demo")),+ source: "",+ files: ["registry/default/example/page-container-demo.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-layout-detail": {+ name: "page-layout-detail",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-layout-detail")),+ source: "",+ files: ["registry/default/example/page-layout-detail.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-layout-list": {+ name: "page-layout-list",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-layout-list")),+ source: "",+ files: ["registry/default/example/page-layout-list.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-layout-list-simple": {+ name: "page-layout-list-simple",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-layout-list-simple")),+ source: "",+ files: ["registry/default/example/page-layout-list-simple.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-layout-settings": {+ name: "page-layout-settings",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-layout-settings")),+ source: "",+ files: ["registry/default/example/page-layout-settings.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-header-demo": {+ name: "page-header-demo",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-header-demo")),+ source: "",+ files: ["registry/default/example/page-header-demo.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-section-demo": {+ name: "page-section-demo",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-section-demo")),+ source: "",+ files: ["registry/default/example/page-section-demo.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-section-horizontal": {+ name: "page-section-horizontal",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-section-horizontal")),+ source: "",+ files: ["registry/default/example/page-section-horizontal.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },+ "page-section-with-aside": {+ name: "page-section-with-aside",+ type: "components:example",+ registryDependencies: undefined,+ component: React.lazy(() => import("@/registry/default/example/page-section-with-aside")),+ source: "",+ files: ["registry/default/example/page-section-with-aside.tsx"],+ category: "undefined",+ subcategory: "undefined",+ chunks: []+ },"inner-side-menu-demo": {name: "inner-side-menu-demo",type: "components:example",diff --git a/apps/design-system/app/layout.tsx b/apps/design-system/app/layout.tsxindex 9c005db6ae4..72c8d4f5c04 100644--- a/apps/design-system/app/layout.tsx+++ b/apps/design-system/app/layout.tsx@@ -1,4 +1,5 @@import '@/styles/globals.css'+import '../../studio/styles/typography.scss'import type { Metadata } from 'next'import { ThemeProvider } from './Providers'import { SonnerToaster } from './SonnerToast'diff --git a/apps/design-system/components/component-preview.tsx b/apps/design-system/components/component-preview.tsxindex c1304ec5986..5a855c5f684 100644--- a/apps/design-system/components/component-preview.tsx+++ b/apps/design-system/components/component-preview.tsx@@ -120,11 +120,11 @@ export function ComponentPreview({)}, [Preview, align])- const wideClasses = wide ? '2xl:-ml-12 2xl:-mr-12' : ''+ const wideClasses = wide ? '2xl:-ml-20 2xl:-mr-20' : ''if (peekCode) {return (- <div className={cn('mt-4 mb-12', wideClasses)}>+ <div className={cn('@container mt-4 mb-12', wideClasses)}><divclassName={cn('relative rounded-tl-md rounded-tr-md border-t border-l border-r bg-studio'diff --git a/apps/design-system/config/docs.ts b/apps/design-system/config/docs.tsindex 7e9e2b628b1..93f3665c871 100644--- a/apps/design-system/config/docs.ts+++ b/apps/design-system/config/docs.ts@@ -45,6 +45,11 @@ export const docsConfig: DocsConfig = {href: '/docs/ui-patterns/navigation',items: [],},+ {+ title: 'Layout',+ href: '/docs/ui-patterns/layout',+ items: [],+ },{title: 'Empty States',href: '/docs/ui-patterns/empty-states',@@ -75,6 +80,21 @@ export const docsConfig: DocsConfig = {href: '/docs/fragments/modal',items: [],},+ {+ title: 'Page Container',+ href: '/docs/fragments/page-container',+ items: [],+ },+ {+ title: 'Page Header',+ href: '/docs/fragments/page-header',+ items: [],+ },+ {+ title: 'Page Section',+ href: '/docs/fragments/page-section',+ items: [],+ },{title: 'Text Confirm Dialog',href: '/docs/fragments/text-confirm-dialog',diff --git a/apps/design-system/content/docs/fragments/page-container.mdx b/apps/design-system/content/docs/fragments/page-container.mdxnew file mode 100644index 00000000000..f71dc79be82--- /dev/null+++ b/apps/design-system/content/docs/fragments/page-container.mdx@@ -0,0 +1,31 @@+---+title: Page Container+description: A container component that provides consistent max-width and padding based on size variants.+fragment: true+---++<ComponentPreview+ name="page-container-demo"+ description="Container with default size (1200px max-width)"+ peekCode+ wide+/>++## Usage++```tsx+import { PageContainer } from 'ui-patterns/PageContainer'+```++```tsx+<PageContainer size="default">{/* Page content */}</PageContainer>+```++## Size Variants++The `PageContainer` supports four size variants:++- `small` - max-width: 768px+- `default` - max-width: 1200px+- `large` - max-width: 1600px+- `full` - no max-width constraintdiff --git a/apps/design-system/content/docs/fragments/page-header.mdx b/apps/design-system/content/docs/fragments/page-header.mdxnew file mode 100644index 00000000000..741efbbc0e1--- /dev/null+++ b/apps/design-system/content/docs/fragments/page-header.mdx@@ -0,0 +1,24 @@+---+title: Page Header+description: A compound component for building page headers with consistent structure.+fragment: true+---++<ComponentPreview+ name="page-header-demo"+ description="Basic page header with title, description, and actions"+ peekCode+ wide+/>++## Sub-components++- `PageHeader` - Root container with size variants (`default`, `small`, `large`, `full`)+- `PageHeaderBreadcrumb` - Breadcrumb navigation wrapper (should be first child)+- `PageHeaderMeta` - Meta wrapper for icon, summary, and aside (groups icon and summary together, places aside on the right)+- `PageHeaderIcon` - Icon container positioned left of title (should be inside PageHeaderMeta, has `shrink-0`)+- `PageHeaderSummary` - Container for title and description (should be inside PageHeaderMeta, has `flex-1`)+- `PageHeaderTitle` - Primary page heading (h1)+- `PageHeaderDescription` - Supporting text below title+- `PageHeaderAside` - Container for action buttons (should be inside PageHeaderMeta, has `shrink-0`)+- `PageHeaderFooter` - Container for tab navigation (NavMenu, should be last child)diff --git a/apps/design-system/content/docs/fragments/page-section.mdx b/apps/design-system/content/docs/fragments/page-section.mdxnew file mode 100644index 00000000000..bc70b83723a--- /dev/null+++ b/apps/design-system/content/docs/fragments/page-section.mdx@@ -0,0 +1,47 @@+---+title: Page Section+description: A compound component for organizing page content into distinct sections.+fragment: true+---++<ComponentPreview+ name="page-section-demo"+ description="Basic page section with title, description, and content"+ peekCode+ wide+/>++## Sub-components++- `PageSection` - Root container with orientation variants (`horizontal` or `vertical`)+- `PageSectionMeta` - Meta wrapper for summary and aside (groups summary and aside together)+- `PageSectionSummary` - Container for section title and description (should be inside PageSectionMeta, has `flex-1`)+- `PageSectionTitle` - Section heading (h2)+- `PageSectionDescription` - Supporting text below section title+- `PageSectionAside` - Container for section-level actions (should be inside PageSectionMeta, has `shrink-0`)+- `PageSectionContent` - Container for the main section content++## Orientation Variants++- `vertical` - Content stacks vertically (default)+- `horizontal` - Summary and content arranged horizontally on larger screens++## Examples++### Horizontal Orientation++<ComponentPreview+ name="page-section-horizontal"+ description="PageSection with horizontal layout - summary on left, content on right"+ peekCode+ wide+/>++### With Aside Actions++<ComponentPreview+ name="page-section-with-aside"+ description="PageSection with multiple action buttons in the Aside component"+ peekCode+ wide+/>diff --git a/apps/design-system/content/docs/ui-patterns/layout.mdx b/apps/design-system/content/docs/ui-patterns/layout.mdxnew file mode 100644index 00000000000..e69716e597e--- /dev/null+++ b/apps/design-system/content/docs/ui-patterns/layout.mdx@@ -0,0 +1,80 @@+---+title: Layout+description: Guidelines to create consistent layouts across Studio pages using a set of page components.+---++The Page pattern consists of three main components that work together to create consistent page layouts: [PageContainer](../fragments/page-container), [PageHeader](../fragments/page-header), and [PageSection](../fragments/page-section). These components provide a structured approach to building pages with consistent spacing, max-widths, and content organization.++## Layout Types++### Settings++Settings pages are used for configuration and preference management. They follow a single-column layout with default widths to keep content focused and readable. Examples include project settings or auth sessions.++- Use `PageHeader` with `size="default"`+- Use `PageContainer` with `size="default"`+- Use `PageSection` for organizing settings into logical groups++<ComponentPreview+ name="page-layout-settings"+ description="Settings page layout with default widths"+ peekCode+ wide+/>++### List++List pages display collections of objects like tables, triggers, or functions. These pages use larger widths to accommodate wide content like data tables. Examples include database triggers, database functions or org team members.++- Use `PageHeader` with `size="large"`+- Use `PageContainer` with `size="large"`+- Use `PageSection` to wrap list content++**Table and List Actions:**++- **With filters or search:** If the table has filters or search, place table actions aligned with the filters on the right side. Do not use `PageSectionAside` or `PageHeaderAside` for table actions when filters are present.+- **Without filters:** For simple lists without filters or search, add primary list actions to `PageHeaderAside` or `PageSectionAside` as appropriate.++<ComponentPreview+ name="page-layout-list"+ description="List page layout with search and filters - actions aligned with search"+ peekCode+ wide+/>++<ComponentPreview+ name="page-layout-list-simple"+ description="Simple list page layout without filters - actions in PageHeaderAside"+ peekCode+ wide+/>++### Data and Full Page Experiences++Full-page experiences like the table editor, cron jobs, and edge functions require maximum screen real-estate and so make use of "full" size containers.++- Use `PageHeader` with `size="full"`+- Use `PageContainer` with `size="full"`+- Content spans the full width of the viewport++### Detail Pages++Detail pages display dense or lengthy content split into multiple sections. The horizontal orientation allows for better information hierarchy and context. Examples include organisation billing or project infrastructure.++- Use `PageHeader` with `size="large"`+- Use `PageContainer` with `size="large"`+- Use `PageSection` with `orientation="horizontal"` to show summary alongside content+- Multiple sections can stack vertically with horizontal layouts within each++<ComponentPreview+ name="page-layout-detail"+ description="Detail page layout with horizontal sections for dense content"+ peekCode+ wide+/>++## Components++- **[PageContainer](/docs/fragments/page-container)** - Container component providing consistent max-width and padding based on size variants+- **[PageHeader](/docs/fragments/page-header)** - Compound component for building page headers with breadcrumbs, icons, titles, descriptions, actions, and navigation+- **[PageSection](/docs/fragments/page-section)** - Compound component for organizing page content into distinct sections with title, description, and action areasdiff --git a/apps/design-system/package.json b/apps/design-system/package.jsonindex 11ac94ead0a..32c711e38c2 100644--- a/apps/design-system/package.json+++ b/apps/design-system/package.json@@ -52,6 +52,7 @@},"devDependencies": {"@shikijs/compat": "^1.1.7",+ "@tailwindcss/container-queries": "^0.1.1","@types/lodash.template": "4.5.0","@types/react": "catalog:","@types/react-dom": "catalog:",diff --git a/apps/design-system/registry/default/example/page-container-demo.tsx b/apps/design-system/registry/default/example/page-container-demo.tsxnew file mode 100644index 00000000000..248b28fb23d--- /dev/null+++ b/apps/design-system/registry/default/example/page-container-demo.tsx@@ -0,0 +1,20 @@+import { PageContainer } from 'ui-patterns/PageContainer'++export default function PageContainerDemo() {+ return (+ <div className="w-full space-y-4">+ <PageContainer size="small" className="bg-muted border rounded-lg p-4">+ <p>This is a page container with small size (768px max-width)</p>+ </PageContainer>+ <PageContainer size="default" className="bg-muted border rounded-lg p-4">+ <p>This is a page container with default size (1200px max-width)</p>+ </PageContainer>+ <PageContainer size="large" className="bg-muted border rounded-lg p-4">+ <p>This is a page container with large size (1600px max-width)</p>+ </PageContainer>+ <PageContainer size="full" className="bg-muted border rounded-lg p-4">+ <p>This is a page container with full size (no max-width)</p>+ </PageContainer>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-header-demo.tsx b/apps/design-system/registry/default/example/page-header-demo.tsxnew file mode 100644index 00000000000..b3d2ae9263a--- /dev/null+++ b/apps/design-system/registry/default/example/page-header-demo.tsx@@ -0,0 +1,86 @@+import { Database } from 'lucide-react'+import Link from 'next/link'+import React from 'react'+import {+ BreadcrumbItem_Shadcn_ as BreadcrumbItem,+ BreadcrumbLink_Shadcn_ as BreadcrumbLink,+ BreadcrumbList_Shadcn_ as BreadcrumbList,+ BreadcrumbSeparator_Shadcn_ as BreadcrumbSeparator,+ Button,+ NavMenu,+ NavMenuItem,+} from 'ui'+import {+ PageHeader,+ PageHeaderAside,+ PageHeaderBreadcrumb,+ PageHeaderDescription,+ PageHeaderFooter,+ PageHeaderIcon,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+} from 'ui-patterns/PageHeader'++export default function PageHeaderDemo() {+ const breadcrumbItems = [+ { label: 'Project', href: '/project/demo' },+ { label: 'Edge Functions', href: '/project/demo/functions' },+ ]++ const navigationItems = [+ { label: 'Overview', href: '/project/demo/functions/demo-function' },+ { label: 'Invocations', href: '/project/demo/functions/demo-function/invocations' },+ { label: 'Logs', href: '/project/demo/functions/demo-function/logs' },+ { label: 'Details', href: '/project/demo/functions/demo-function/details' },+ ]++ return (+ <div className="w-full">+ <PageHeader>+ <PageHeaderBreadcrumb>+ <BreadcrumbList>+ {breadcrumbItems.map((item, index) => (+ <React.Fragment key={item.label}>+ <BreadcrumbItem>+ <BreadcrumbLink asChild>+ <Link href={item.href}>{item.label}</Link>+ </BreadcrumbLink>+ </BreadcrumbItem>+ {index < breadcrumbItems.length - 1 && <BreadcrumbSeparator />}+ </React.Fragment>+ ))}+ </BreadcrumbList>+ </PageHeaderBreadcrumb>+ <PageHeaderMeta>+ <PageHeaderIcon>+ <Database className="w-5 h-5" />+ </PageHeaderIcon>+ <PageHeaderSummary>+ <PageHeaderTitle>Demo Function</PageHeaderTitle>+ <PageHeaderDescription>+ Serverless functions that run at the edge with low latency and automatic scaling.+ </PageHeaderDescription>+ </PageHeaderSummary>+ <PageHeaderAside>+ <Button type="default" size="small">+ Secondary+ </Button>+ <Button type="primary" size="small">+ Deploy Function+ </Button>+ </PageHeaderAside>+ </PageHeaderMeta>+ <PageHeaderFooter>+ <NavMenu>+ {navigationItems.map((item) => (+ <NavMenuItem key={item.label} active={false}>+ <Link href={item.href}>{item.label}</Link>+ </NavMenuItem>+ ))}+ </NavMenu>+ </PageHeaderFooter>+ </PageHeader>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-layout-detail.tsx b/apps/design-system/registry/default/example/page-layout-detail.tsxnew file mode 100644index 00000000000..52bee322f19--- /dev/null+++ b/apps/design-system/registry/default/example/page-layout-detail.tsx@@ -0,0 +1,136 @@+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageHeader,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+ PageHeaderDescription,+} from 'ui-patterns/PageHeader'+import {+ PageSection,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+ PageSectionDescription,+ PageSectionContent,+} from 'ui-patterns/PageSection'+import { Button, Card, CardContent } from 'ui'++export default function PageLayoutDetail() {+ return (+ <div className="w-full">+ <PageHeader size="large">+ <PageHeaderMeta size="large">+ <PageHeaderSummary>+ <PageHeaderTitle>Billing</PageHeaderTitle>+ <PageHeaderDescription>+ Manage your organization's billing and subscription settings.+ </PageHeaderDescription>+ </PageHeaderSummary>+ </PageHeaderMeta>+ </PageHeader>++ <PageContainer size="large">+ <PageSection orientation="horizontal">+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Subscription</PageSectionTitle>+ <PageSectionDescription>+ View and manage your current subscription plan and billing cycle.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <div className="space-y-4">+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Current Plan</p>+ <p className="text-sm font-medium">Pro Plan</p>+ </div>+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Billing Cycle</p>+ <p className="text-sm">Monthly</p>+ </div>+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Next Billing Date</p>+ <p className="text-sm">March 15, 2024</p>+ </div>+ <div className="pt-2">+ <Button type="default" size="small">+ Change Plan+ </Button>+ </div>+ </div>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>++ <PageSection orientation="horizontal">+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Cost Control</PageSectionTitle>+ <PageSectionDescription>+ Set spending limits and alerts to manage your organization's costs.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <div className="space-y-4">+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Monthly Spending Limit</p>+ <p className="text-sm">$500.00</p>+ </div>+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Current Month Spend</p>+ <p className="text-sm">$234.50</p>+ </div>+ <div className="pt-2">+ <Button type="default" size="small">+ Configure Limits+ </Button>+ </div>+ </div>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>++ <PageSection orientation="horizontal">+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Payment Methods</PageSectionTitle>+ <PageSectionDescription>+ Manage payment methods and billing information for your organization.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <div className="space-y-4">+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Primary Payment Method</p>+ <p className="text-sm">•••• •••• •••• 4242</p>+ </div>+ <div>+ <p className="text-xs text-foreground-lighter mb-1">Expires</p>+ <p className="text-sm">12/2025</p>+ </div>+ <div className="pt-2">+ <Button type="default" size="small">+ Update Payment Method+ </Button>+ </div>+ </div>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>+ </PageContainer>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-layout-list-simple.tsx b/apps/design-system/registry/default/example/page-layout-list-simple.tsxnew file mode 100644index 00000000000..f8cc9dde2d9--- /dev/null+++ b/apps/design-system/registry/default/example/page-layout-list-simple.tsx@@ -0,0 +1,96 @@+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageHeader,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+ PageHeaderDescription,+ PageHeaderAside,+} from 'ui-patterns/PageHeader'+import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'+import {+ Button,+ Card,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from 'ui'++export default function PageLayoutListSimple() {+ const items = [+ { id: 1, name: 'Project Alpha', status: 'Active', members: 12 },+ { id: 2, name: 'Project Beta', status: 'Active', members: 8 },+ { id: 3, name: 'Project Gamma', status: 'Inactive', members: 5 },+ ]++ return (+ <div className="w-full">+ <PageHeader size="large">+ <PageHeaderMeta size="large">+ <PageHeaderSummary>+ <PageHeaderTitle>Projects</PageHeaderTitle>+ <PageHeaderDescription>+ Manage and view all your projects in one place.+ </PageHeaderDescription>+ </PageHeaderSummary>+ <PageHeaderAside>+ <Button type="primary" size="small">+ Create Project+ </Button>+ </PageHeaderAside>+ </PageHeaderMeta>+ </PageHeader>++ <PageContainer size="large">+ <PageSection>+ <PageSectionContent>+ <Card>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Status</TableHead>+ <TableHead>Members</TableHead>+ <TableHead className="text-right">Actions</TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {items.map((item) => (+ <TableRow key={item.id}>+ <TableCell className="font-medium">{item.name}</TableCell>+ <TableCell>{item.status}</TableCell>+ <TableCell>{item.members}</TableCell>+ <TableCell className="text-right">+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button type="text" size="small">+ Actions+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem>Edit</DropdownMenuItem>+ <DropdownMenuItem>Duplicate</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem className="text-destructive">Delete</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </Card>+ </PageSectionContent>+ </PageSection>+ </PageContainer>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-layout-list.tsx b/apps/design-system/registry/default/example/page-layout-list.tsxnew file mode 100644index 00000000000..fafaee0a841--- /dev/null+++ b/apps/design-system/registry/default/example/page-layout-list.tsx@@ -0,0 +1,127 @@+import { Search } from 'lucide-react'+import React from 'react'+import {+ Button,+ Card,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+ Input,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from 'ui'+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageHeader,+ PageHeaderDescription,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+} from 'ui-patterns/PageHeader'+import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'++export default function PageLayoutList(): React.JSX.Element {+ const functions = [+ {+ id: 1,+ name: 'get_user_profile',+ arguments: 'user_id uuid',+ return_type: 'jsonb',+ security: 'Definer',+ },+ {+ id: 2,+ name: 'update_user_settings',+ arguments: 'user_id uuid, settings jsonb',+ return_type: 'void',+ security: 'Invoker',+ },+ {+ id: 3,+ name: 'calculate_total',+ arguments: 'amount numeric, tax_rate numeric',+ return_type: 'numeric',+ security: 'Definer',+ },+ ]++ return (+ <div className="w-full">+ <PageHeader size="large">+ <PageHeaderMeta size="large">+ <PageHeaderSummary>+ <PageHeaderTitle>Database Functions</PageHeaderTitle>+ <PageHeaderDescription>Manage your database functions</PageHeaderDescription>+ </PageHeaderSummary>+ </PageHeaderMeta>+ </PageHeader>++ <PageContainer size="large">+ <PageSection>+ <PageSectionContent>+ <div className="w-full space-y-4">+ <div className="flex flex-col lg:flex-row lg:items-center justify-between gap-2 flex-wrap">+ <div className="flex flex-col lg:flex-row lg:items-center gap-2">+ <Input+ placeholder="Search for a function"+ size="tiny"+ icon={<Search size={14} />}+ className="w-full lg:w-52"+ />+ </div>+ <Button type="primary">Create a new function</Button>+ </div>++ <Card>+ <Table className="table-fixed overflow-x-auto">+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead className="table-cell">Arguments</TableHead>+ <TableHead className="table-cell">Return type</TableHead>+ <TableHead className="table-cell w-[100px]">Security</TableHead>+ <TableHead className="w-1/6"></TableHead>+ </TableRow>+ </TableHeader>+ <TableBody>+ {functions.map((fn) => (+ <TableRow key={fn.id}>+ <TableCell className="font-medium">{fn.name}</TableCell>+ <TableCell>{fn.arguments}</TableCell>+ <TableCell>{fn.return_type}</TableCell>+ <TableCell>{fn.security}</TableCell>+ <TableCell>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button type="text" size="small">+ Actions+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem>Edit</DropdownMenuItem>+ <DropdownMenuItem>Duplicate</DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem className="text-destructive">+ Delete+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </Card>+ </div>+ </PageSectionContent>+ </PageSection>+ </PageContainer>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-layout-settings.tsx b/apps/design-system/registry/default/example/page-layout-settings.tsxnew file mode 100644index 00000000000..c9ddbd44b62--- /dev/null+++ b/apps/design-system/registry/default/example/page-layout-settings.tsx@@ -0,0 +1,253 @@+import { zodResolver } from '@hookform/resolvers/zod'+import { useForm } from 'react-hook-form'+import {+ Button,+ Card,+ CardContent,+ CardFooter,+ FormControl_Shadcn_,+ FormField_Shadcn_,+ Form_Shadcn_,+ Input_Shadcn_,+ PrePostTab,+ Switch,+} from 'ui'+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageHeader,+ PageHeaderDescription,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+} from 'ui-patterns/PageHeader'+import {+ PageSection,+ PageSectionContent,+ PageSectionDescription,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+} from 'ui-patterns/PageSection'+import * as z from 'zod'++const RefreshTokenSchema = z.object({+ REFRESH_TOKEN_ROTATION_ENABLED: z.boolean(),+ SECURITY_REFRESH_TOKEN_REUSE_INTERVAL: z.coerce.number().min(0),+})++const UserSessionsSchema = z.object({+ SESSIONS_TIMEBOX: z.coerce.number().min(0),+ SESSIONS_INACTIVITY_TIMEOUT: z.coerce.number().min(0),+ SESSIONS_SINGLE_PER_USER: z.boolean(),+})++function HoursOrNeverText({ value }: { value: number }) {+ if (value === 0) {+ return 'never'+ } else if (value === 1) {+ return 'hour'+ } else {+ return 'hours'+ }+}++export default function PageLayoutSettings() {+ const refreshTokenForm = useForm<z.infer<typeof RefreshTokenSchema>>({+ resolver: zodResolver(RefreshTokenSchema),+ defaultValues: {+ REFRESH_TOKEN_ROTATION_ENABLED: false,+ SECURITY_REFRESH_TOKEN_REUSE_INTERVAL: 10,+ },+ })++ const userSessionsForm = useForm<z.infer<typeof UserSessionsSchema>>({+ resolver: zodResolver(UserSessionsSchema),+ defaultValues: {+ SESSIONS_TIMEBOX: 0,+ SESSIONS_INACTIVITY_TIMEOUT: 0,+ SESSIONS_SINGLE_PER_USER: false,+ },+ })++ return (+ <div className="w-full">+ <PageHeader size="default">+ <PageHeaderMeta size="default">+ <PageHeaderSummary>+ <PageHeaderTitle>User Sessions</PageHeaderTitle>+ <PageHeaderDescription>+ Configure settings for user sessions and refresh tokens+ </PageHeaderDescription>+ </PageHeaderSummary>+ </PageHeaderMeta>+ </PageHeader>++ <PageContainer size="default">+ <PageSection>+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Refresh Tokens</PageSectionTitle>+ <PageSectionDescription>+ Configure refresh token rotation and security settings.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Form_Shadcn_ {...refreshTokenForm}>+ <form className="space-y-4">+ <Card>+ <CardContent className="pt-6">+ <FormField_Shadcn_+ control={refreshTokenForm.control}+ name="REFRESH_TOKEN_ROTATION_ENABLED"+ render={({ field }) => (+ <FormItemLayout+ layout="flex-row-reverse"+ label="Detect and revoke potentially compromised refresh tokens"+ description="Prevent replay attacks from potentially compromised refresh tokens."+ >+ <FormControl_Shadcn_>+ <Switch checked={field.value} onCheckedChange={field.onChange} />+ </FormControl_Shadcn_>+ </FormItemLayout>+ )}+ />+ </CardContent>+ <CardContent>+ <FormField_Shadcn_+ control={refreshTokenForm.control}+ name="SECURITY_REFRESH_TOKEN_REUSE_INTERVAL"+ render={({ field }) => (+ <FormItemLayout+ layout="flex-row-reverse"+ label="Refresh token reuse interval"+ description="Time interval where the same refresh token can be used multiple times to request for an access token. Recommendation: 10 seconds."+ >+ <FormControl_Shadcn_>+ <PrePostTab postTab="seconds">+ <Input_Shadcn_ type="number" min={0} {...field} />+ </PrePostTab>+ </FormControl_Shadcn_>+ </FormItemLayout>+ )}+ />+ </CardContent>+ <CardFooter className="justify-end space-x-2">+ {refreshTokenForm.formState.isDirty && (+ <Button type="default" onClick={() => refreshTokenForm.reset()}>+ Cancel+ </Button>+ )}+ <Button+ type="primary"+ htmlType="submit"+ disabled={!refreshTokenForm.formState.isDirty}+ >+ Save changes+ </Button>+ </CardFooter>+ </Card>+ </form>+ </Form_Shadcn_>+ </PageSectionContent>+ </PageSection>++ <PageSection>+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>User Sessions</PageSectionTitle>+ <PageSectionDescription>+ Configure session timeout and single session enforcement settings.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Form_Shadcn_ {...userSessionsForm}>+ <form className="space-y-4">+ <Card>+ <CardContent>+ <FormField_Shadcn_+ control={userSessionsForm.control}+ name="SESSIONS_SINGLE_PER_USER"+ render={({ field }) => (+ <FormItemLayout+ layout="flex-row-reverse"+ label="Enforce single session per user"+ description="If enabled, all but a user's most recently active session will be terminated."+ >+ <FormControl_Shadcn_>+ <Switch checked={field.value} onCheckedChange={field.onChange} />+ </FormControl_Shadcn_>+ </FormItemLayout>+ )}+ />+ </CardContent>++ <CardContent>+ <FormField_Shadcn_+ control={userSessionsForm.control}+ name="SESSIONS_TIMEBOX"+ render={({ field }) => (+ <FormItemLayout+ layout="flex-row-reverse"+ label="Time-box user sessions"+ description="The amount of time before a user is forced to sign in again. Use 0 for never."+ >+ <div className="flex items-center">+ <FormControl_Shadcn_>+ <PrePostTab postTab={<HoursOrNeverText value={field.value || 0} />}>+ <Input_Shadcn_ type="number" min={0} {...field} />+ </PrePostTab>+ </FormControl_Shadcn_>+ </div>+ </FormItemLayout>+ )}+ />+ </CardContent>++ <CardContent>+ <FormField_Shadcn_+ control={userSessionsForm.control}+ name="SESSIONS_INACTIVITY_TIMEOUT"+ render={({ field }) => (+ <FormItemLayout+ layout="flex-row-reverse"+ label="Inactivity timeout"+ description="The amount of time a user needs to be inactive to be forced to sign in again. Use 0 for never."+ >+ <div className="flex items-center">+ <FormControl_Shadcn_>+ <PrePostTab postTab={<HoursOrNeverText value={field.value || 0} />}>+ <Input_Shadcn_ type="number" {...field} />+ </PrePostTab>+ </FormControl_Shadcn_>+ </div>+ </FormItemLayout>+ )}+ />+ </CardContent>++ <CardFooter className="justify-end space-x-2">+ {userSessionsForm.formState.isDirty && (+ <Button type="default" onClick={() => userSessionsForm.reset()}>+ Cancel+ </Button>+ )}+ <Button+ type="primary"+ htmlType="submit"+ disabled={!userSessionsForm.formState.isDirty}+ >+ Save changes+ </Button>+ </CardFooter>+ </Card>+ </form>+ </Form_Shadcn_>+ </PageSectionContent>+ </PageSection>+ </PageContainer>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-section-demo.tsx b/apps/design-system/registry/default/example/page-section-demo.tsxnew file mode 100644index 00000000000..7b93892deff--- /dev/null+++ b/apps/design-system/registry/default/example/page-section-demo.tsx@@ -0,0 +1,41 @@+import {+ PageSection,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+ PageSectionDescription,+ PageSectionAside,+ PageSectionContent,+} from 'ui-patterns/PageSection'+import { Button, Card, CardContent } from 'ui'++export default function PageSectionDemo() {+ return (+ <div className="w-full">+ <PageSection>+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Section Title</PageSectionTitle>+ <PageSectionDescription>+ This is a section with a title and description, plus optional actions.+ </PageSectionDescription>+ </PageSectionSummary>+ <PageSectionAside>+ <Button type="default" size="small">+ Action+ </Button>+ </PageSectionAside>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <p className="text-sm text-foreground-light">+ Section content goes here. This could be forms, tables, or any other content.+ </p>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-section-horizontal.tsx b/apps/design-system/registry/default/example/page-section-horizontal.tsxnew file mode 100644index 00000000000..43a2e850956--- /dev/null+++ b/apps/design-system/registry/default/example/page-section-horizontal.tsx@@ -0,0 +1,38 @@+import {+ PageSection,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+ PageSectionDescription,+ PageSectionContent,+} from 'ui-patterns/PageSection'+import { Card, CardContent } from 'ui'++export default function PageSectionHorizontal() {+ return (+ <div className="w-full">+ <PageSection orientation="horizontal">+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Section Title</PageSectionTitle>+ <PageSectionDescription>+ In horizontal orientation, the summary (title and description) appears on the left,+ with content arranged on the right on larger screens. This is useful for detailed+ sections where you want to maintain context while viewing content.+ </PageSectionDescription>+ </PageSectionSummary>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <p className="text-sm text-foreground-light">+ The content area appears alongside the summary in a horizontal layout. On smaller+ screens, it will stack vertically.+ </p>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>+ </div>+ )+}diff --git a/apps/design-system/registry/default/example/page-section-with-aside.tsx b/apps/design-system/registry/default/example/page-section-with-aside.tsxnew file mode 100644index 00000000000..0ce3c8fb7c0--- /dev/null+++ b/apps/design-system/registry/default/example/page-section-with-aside.tsx@@ -0,0 +1,45 @@+import {+ PageSection,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+ PageSectionDescription,+ PageSectionAside,+ PageSectionContent,+} from 'ui-patterns/PageSection'+import { Button, Card, CardContent } from 'ui'++export default function PageSectionWithAside() {+ return (+ <div className="w-full">+ <PageSection>+ <PageSectionMeta>+ <PageSectionSummary>+ <PageSectionTitle>Section Title</PageSectionTitle>+ <PageSectionDescription>+ This demonstrates PageSection with actions in the Aside component.+ </PageSectionDescription>+ </PageSectionSummary>+ <PageSectionAside>+ <Button type="default" size="small">+ Secondary+ </Button>+ <Button type="primary" size="small">+ Primary Action+ </Button>+ </PageSectionAside>+ </PageSectionMeta>+ <PageSectionContent>+ <Card>+ <CardContent className="p-6">+ <p className="text-sm text-foreground-light">+ The Aside component positions actions horizontally aligned with the section summary,+ providing a clear separation between description and actions.+ </p>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>+ </div>+ )+}diff --git a/apps/design-system/registry/examples.ts b/apps/design-system/registry/examples.tsindex 76353eb5ba0..1403f630391 100644--- a/apps/design-system/registry/examples.ts+++ b/apps/design-system/registry/examples.ts@@ -1078,6 +1078,51 @@ export const examples: Registry = [type: 'components:example',files: ['example/info-tooltip-demo.tsx'],},+ {+ name: 'page-container-demo',+ type: 'components:example',+ files: ['example/page-container-demo.tsx'],+ },+ {+ name: 'page-layout-detail',+ type: 'components:example',+ files: ['example/page-layout-detail.tsx'],+ },+ {+ name: 'page-layout-list',+ type: 'components:example',+ files: ['example/page-layout-list.tsx'],+ },+ {+ name: 'page-layout-list-simple',+ type: 'components:example',+ files: ['example/page-layout-list-simple.tsx'],+ },+ {+ name: 'page-layout-settings',+ type: 'components:example',+ files: ['example/page-layout-settings.tsx'],+ },+ {+ name: 'page-header-demo',+ type: 'components:example',+ files: ['example/page-header-demo.tsx'],+ },+ {+ name: 'page-section-demo',+ type: 'components:example',+ files: ['example/page-section-demo.tsx'],+ },+ {+ name: 'page-section-horizontal',+ type: 'components:example',+ files: ['example/page-section-horizontal.tsx'],+ },+ {+ name: 'page-section-with-aside',+ type: 'components:example',+ files: ['example/page-section-with-aside.tsx'],+ },{name: 'inner-side-menu-demo',type: 'components:example',diff --git a/apps/design-system/registry/fragments.ts b/apps/design-system/registry/fragments.tsindex 91c01149067..7534016172c 100644--- a/apps/design-system/registry/fragments.ts+++ b/apps/design-system/registry/fragments.ts@@ -19,4 +19,22 @@ export const fragments: Registry = [files: ['/Dialogs/ConfirmDialog.tsx'],optionalPath: '/Dialogs',},+ {+ name: 'PageContainer',+ type: 'components:fragment',+ files: ['/PageContainer/index.tsx'],+ optionalPath: '/PageContainer',+ },+ {+ name: 'PageHeader',+ type: 'components:fragment',+ files: ['/PageHeader/index.tsx'],+ optionalPath: '/PageHeader',+ },+ {+ name: 'PageSection',+ type: 'components:fragment',+ files: ['/PageSection/index.tsx'],+ optionalPath: '/PageSection',+ },]diff --git a/apps/design-system/scripts/build-registry.mts b/apps/design-system/scripts/build-registry.mtsindex e2a9c5799da..f645b05842b 100644--- a/apps/design-system/scripts/build-registry.mts+++ b/apps/design-system/scripts/build-registry.mts@@ -207,17 +207,29 @@ export const Index: Record<string, any> = {// console.log('item', item)let packagePath = ''+ let componentImportPath = ''if (type === 'ui') {packagePath = `../../packages/ui/src/components/shadcn/ui`+ componentImportPath = `@/${packagePath}/${item.name}`}if (type === 'fragment') {packagePath = `../../packages/ui-patterns/src${item.optionalPath}`+ // Check if the file is index.tsx - if so, don't append the item name+ const isIndexFile = item.files.some((file) => {+ const basename = path.basename(file)+ return basename === 'index.tsx' || basename === 'index.ts'+ })+ componentImportPath = isIndexFile+ ? `@/${packagePath}`+ : `@/${packagePath}/${item.name}`}if (type === 'example') {packagePath = `registry/${style.name}/${type}`+ componentImportPath = `@/${packagePath}/${item.name}`}if (type === 'block') {packagePath = `registry/${style.name}/${type}`+ componentImportPath = `@/${packagePath}/${item.name}`}index += `@@ -225,7 +237,7 @@ export const Index: Record<string, any> = {name: "${item.name}",type: "${item.type}",registryDependencies: ${JSON.stringify(item.registryDependencies)},- component: React.lazy(() => import("@/${packagePath}/${item.name}")),+ component: React.lazy(() => import("${componentImportPath}")),source: "${sourceFilename}",files: [${resolveFiles.map((file) => `"${file}"`)}],category: "${item.category}",@@ -326,4 +338,4 @@ try {} catch (error) {console.error(error)process.exit(1)-}+}\ No newline at end of filediff --git a/apps/design-system/tailwind.config.js b/apps/design-system/tailwind.config.jsindex 10c142cc9cb..4d875930e75 100644--- a/apps/design-system/tailwind.config.js+++ b/apps/design-system/tailwind.config.js@@ -10,6 +10,7 @@ module.exports = config({'./../../packages/ui/src/**/*.{tsx,ts,js}','./../../packages/ui-patterns/src/**/*.{tsx,ts,js}',],+ plugins: [require('@tailwindcss/container-queries')],theme: {extend: {maxWidth: {diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsxindex f3d6ebe6438..e3ee1011ba7 100644--- a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx@@ -10,7 +10,6 @@ import { toast } from 'sonner'import z from 'zod'import { useParams } from 'common'-import { ScaffoldSection, ScaffoldSectionTitle } from 'components/layouts/Scaffold'import AlertError from 'components/ui/AlertError'import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query'import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'@@ -29,8 +28,6 @@ import {Card,CardContent,CardFooter,- CardHeader,- CardTitle,cn,CodeBlock,copyToClipboard,@@ -49,6 +46,13 @@ import {import { GenericSkeletonLoader } from 'ui-patterns'import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageSection,+ PageSectionContent,+ PageSectionSummary,+ PageSectionTitle,+} from 'ui-patterns/PageSection'import CommandRender from '../CommandRender'import { INVOCATION_TABS } from './EdgeFunctionDetails.constants'import { generateCLICommands } from './EdgeFunctionDetails.utils'@@ -159,290 +163,300 @@ export const EdgeFunctionDetails = () => {}, [selectedFunction])return (- <div className="mx-auto flex flex-col-reverse 2xl:flex-row gap-8 pb-8">- <div className="flex-1 min-w-0 overflow-hidden">- <ScaffoldSection isFullWidth className="!pt-0 2xl:first:!pt-12">- <ScaffoldSectionTitle className="mb-4">Function Configuration</ScaffoldSectionTitle>- <Form_Shadcn_ {...form}>- <form onSubmit={form.handleSubmit(onUpdateFunction)}>- <Card>- <CardContent>- <FormField_Shadcn_- control={form.control}- name="name"- render={({ field }) => (- <FormItemLayout- label="Name"- layout="flex-row-reverse"- description="Your slug and endpoint URL will remain the same"- >- <FormControl_Shadcn_>- <Input_Shadcn_- {...field}- className="w-64"- disabled={!canUpdateEdgeFunction}- />- </FormControl_Shadcn_>- </FormItemLayout>- )}- />- </CardContent>- <CardContent>- <FormField_Shadcn_- control={form.control}- name="verify_jwt"- render={({ field }) => (- <FormItemLayout- label="Verify JWT with legacy secret"- layout="flex-row-reverse"- description={- <>- Requires that a JWT signed{' '}- <em className="text-brand not-italic">only by the legacy JWT secret</em>{' '}- is present in the <code>Authorization</code> header. The easy to obtain{' '}- <code>anon</code> key can be used to satisfy this requirement.- Recommendation: OFF with JWT and additional authorization logic- implemented inside your function's code.- </>- }- >- <FormControl_Shadcn_>- <Switch- checked={field.value}- onCheckedChange={field.onChange}- disabled={!canUpdateEdgeFunction}- />- </FormControl_Shadcn_>- </FormItemLayout>- )}- />- </CardContent>- <CardFooter className="flex justify-end space-x-2">- {form.formState.isDirty && (- <Button type="default" onClick={() => form.reset()}>- Cancel- </Button>- )}- <Button- type="primary"- htmlType="submit"- loading={isUpdating}- disabled={!canUpdateEdgeFunction || !form.formState.isDirty}- >- Save changes- </Button>- </CardFooter>- </Card>- </form>- </Form_Shadcn_>- </ScaffoldSection>+ <PageContainer size="full">+ <PageSection orientation="horizontal">+ <PageSectionSummary className="gap-6">+ <PageSectionTitle>Details</PageSectionTitle>+ {isLoading && <GenericSkeletonLoader />}+ {isError && (+ <AlertError error={error} subject="Failed to retrieve edge function details" />+ )}+ {isSuccess && (+ <dl className="grid grid-cols-1 @xl:grid-cols-[auto_1fr] gap-y-2 [&>dd]:mb-3 @xl:[&>dd]:mb-0 @xl:gap-y-4 gap-x-10">+ <dt className="text-sm text-foreground-light">Slug</dt>+ <dd className="text-sm @lg:text-left">{selectedFunction?.slug}</dd>- <ScaffoldSection isFullWidth>- <ScaffoldSectionTitle className="mb-4">Invoke function</ScaffoldSectionTitle>- <Card>- <CardContent className="px-0">- <Tabs- className="w-full"- defaultValue="curl"- value={selectedTab}- onValueChange={setSelectedTab}- >- <TabsList className="flex flex-wrap gap-4 px-6">- {invocationTabs.map((tab) => (- <TabsTrigger key={tab.id} value={tab.id}>- {tab.label}- </TabsTrigger>- ))}- {selectedTab === 'curl' && (- <Button- type="default"- className="ml-auto -translate-y-2 translate-x-3"- onClick={() => setShowKey(!showKey)}- >- {showKey ? 'Hide' : 'Show'} anon key- </Button>- )}- </TabsList>- {invocationTabs.map((tab) => {- const code = tab.code({- showKey,- functionUrl,- functionName: selectedFunction?.name ?? '',- apiKey,- })-- return (- <TabsContent key={tab.id} value={tab.id} className="mt-4 px-6">- <div className="overflow-x-auto">- <CodeBlock- value={code}- className="p-0 text-xs !mt-0 border-none"- language={tab.language}- hideLineNumbers={tab.hideLineNumbers}- handleCopy={() => {- copyToClipboard(- tab.code({- showKey: true,- functionUrl,- functionName: selectedFunction?.name ?? '',- apiKey,- })- )- }}- />- </div>- </TabsContent>- )- })}- </Tabs>- </CardContent>- </Card>- </ScaffoldSection>+ <dt className="text-sm text-foreground-light">Endpoint URL</dt>+ <dd className="text-sm @lg:text-left">+ <Input+ className="font-mono input-mono"+ disabled+ copy+ size="small"+ value={functionUrl}+ />+ </dd>- <ScaffoldSection isFullWidth>- <ScaffoldSectionTitle className="mb-4">Develop locally</ScaffoldSectionTitle>- <div className="rounded border bg-surface-100 px-6 py-4 drop-shadow-sm">- <div className="space-y-6">- <CommandRender- commands={[- {- command: `supabase functions download ${selectedFunction?.slug}`,- description: 'Download the function to your local machine',- jsx: () => (- <>- <span className="text-brand-600">supabase</span> functions download{' '}- {selectedFunction?.slug}- </>- ),- comment: '1. Download the function',- },- ]}- />- <CommandRender commands={[managementCommands[0]]} />- <CommandRender commands={[managementCommands[1]]} />- </div>- </div>- </ScaffoldSection>- <ScaffoldSection isFullWidth>- <ScaffoldSectionTitle className="mb-4">Delete function</ScaffoldSectionTitle>- <Alert_Shadcn_ variant="destructive">- <CriticalIcon />- <AlertTitle_Shadcn_>- Once your function is deleted, it can no longer be restored- </AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- Make sure you have made a backup if you want to restore your edge function- </AlertDescription_Shadcn_>- <AlertDescription_Shadcn_ className="mt-3">- <Button- type="danger"- disabled={!canUpdateEdgeFunction}- loading={selectedFunction?.id === undefined}- onClick={() => setShowDeleteModal(true)}- >- Delete edge function- </Button>- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- </ScaffoldSection>+ <dt className="text-sm text-foreground-light">Region</dt>+ <dd className="text-sm @lg:text-left">All functions are deployed globally</dd>- <ConfirmationModal- visible={showDeleteModal}- loading={isDeleting}- variant="destructive"- confirmLabel="Delete"- confirmLabelLoading="Deleting"- title={`Confirm to delete ${selectedFunction?.name}`}- onCancel={() => setShowDeleteModal(false)}- onConfirm={onConfirmDelete}- alert={{- base: { variant: 'destructive' },- title: 'This action cannot be undone',- description:- 'Ensure that you have made a backup if you want to restore your edge function',- }}- />- </div>+ <dt className="text-sm text-foreground-light">Created at</dt>+ <dd className="text-sm @lg:text-left">+ {dayjs(selectedFunction?.created_at ?? 0).format('dddd, MMMM D, YYYY h:mm A')}+ </dd>- <div className="w-full 2xl:max-w-[600px] shrink-0">- <ScaffoldSection isFullWidth className="!pt-6 2xl:first:!pt-12">- <Card>- <CardHeader>- <CardTitle>Details</CardTitle>- </CardHeader>- <CardContent className="pt-6 space-y-6">- {isLoading && <GenericSkeletonLoader />}- {isError && (- <AlertError error={error} subject="Failed to retrieve edge function details" />- )}- {isSuccess && (- <dl className="grid grid-cols-1 xl:grid-cols-[auto_1fr] gap-y-4 xl:gap-y-6 gap-x-10">- <dt className="text-sm text-foreground-light">Slug</dt>- <dd className="text-sm lg:text-left">{selectedFunction?.slug}</dd>+ <dt className="text-sm text-foreground-light">Last updated at</dt>+ <dd className="text-sm @lg:text-left">+ {dayjs(selectedFunction?.updated_at ?? 0).format('dddd, MMMM D, YYYY h:mm A')}+ </dd>- <dt className="text-sm text-foreground-light">Endpoint URL</dt>- <dd className="text-sm lg:text-left">- <Input- className="font-mono input-mono"- disabled- copy- size="small"- value={functionUrl}- />- </dd>+ <dt className="text-sm text-foreground-light">Deployments</dt>+ <dd className="text-sm @lg:text-left">{selectedFunction?.version ?? 0}</dd>- <dt className="text-sm text-foreground-light">Region</dt>- <dd className="text-sm lg:text-left">All functions are deployed globally</dd>+ <dt className="text-sm text-foreground-light">Import Maps</dt>+ <dd className="text-sm @lg:text-left">+ <p>+ Import maps are{' '}+ <span className={cn(hasImportMap ? 'text-brand' : 'text-amber-900')}>+ {hasImportMap ? 'used' : 'not used'}+ </span>{' '}+ for this function+ </p>+ <p className="text-foreground-light mt-1">+ Import maps allow the use of bare specifiers in functions instead of explicit+ import URLs+ </p>+ <div className="mt-4">+ <Button+ asChild+ type="default"+ size="tiny"+ icon={<ExternalLink strokeWidth={1.5} />}+ >+ <Link+ href={`${DOCS_URL}/guides/functions/dependencies`}+ target="_blank"+ rel="noreferrer"+ >+ More about import maps+ </Link>+ </Button>+ </div>+ </dd>+ </dl>+ )}+ </PageSectionSummary>+ <PageSectionContent>+ <PageSection className="pt-0">+ <PageSectionSummary>+ <PageSectionTitle>Function Configuration</PageSectionTitle>+ </PageSectionSummary>+ <PageSectionContent>+ <Form_Shadcn_ {...form}>+ <form onSubmit={form.handleSubmit(onUpdateFunction)}>+ <Card>+ <CardContent>+ <FormField_Shadcn_+ control={form.control}+ name="name"+ render={({ field }) => (+ <FormItemLayout+ label="Name"+ layout="flex-row-reverse"+ description="Your slug and endpoint URL will remain the same"+ >+ <FormControl_Shadcn_>+ <Input_Shadcn_+ {...field}+ className="w-64"+ disabled={!canUpdateEdgeFunction}+ />+ </FormControl_Shadcn_>+ </FormItemLayout>+ )}+ />+ </CardContent>+ <CardContent>+ <FormField_Shadcn_+ control={form.control}+ name="verify_jwt"+ render={({ field }) => (+ <FormItemLayout+ label="Verify JWT with legacy secret"+ layout="flex-row-reverse"+ description={+ <>+ Requires that a JWT signed{' '}+ <em className="text-brand not-italic">+ only by the legacy JWT secret+ </em>{' '}+ is present in the <code>Authorization</code> header. The easy to+ obtain <code>anon</code> key can be used to satisfy this+ requirement. Recommendation: OFF with JWT and additional+ authorization logic implemented inside your function's code.+ </>+ }+ >+ <FormControl_Shadcn_>+ <Switch+ checked={field.value}+ onCheckedChange={field.onChange}+ disabled={!canUpdateEdgeFunction}+ />+ </FormControl_Shadcn_>+ </FormItemLayout>+ )}+ />+ </CardContent>+ <CardFooter className="flex justify-end space-x-2">+ {form.formState.isDirty && (+ <Button type="default" onClick={() => form.reset()}>+ Cancel+ </Button>+ )}+ <Button+ type="primary"+ htmlType="submit"+ loading={isUpdating}+ disabled={!canUpdateEdgeFunction || !form.formState.isDirty}+ >+ Save changes+ </Button>+ </CardFooter>+ </Card>+ </form>+ </Form_Shadcn_>+ </PageSectionContent>+ </PageSection>- <dt className="text-sm text-foreground-light">Created at</dt>- <dd className="text-sm lg:text-left">- {dayjs(selectedFunction?.created_at ?? 0).format('dddd, MMMM D, YYYY h:mm A')}- </dd>+ <PageSection>+ <PageSectionSummary>+ <PageSectionTitle>Invoke function</PageSectionTitle>+ </PageSectionSummary>+ <PageSectionContent>+ <Card>+ <CardContent className="px-0">+ <Tabs+ className="w-full"+ defaultValue="curl"+ value={selectedTab}+ onValueChange={setSelectedTab}+ >+ <TabsList className="flex flex-wrap gap-4 px-6">+ {invocationTabs.map((tab) => (+ <TabsTrigger key={tab.id} value={tab.id}>+ {tab.label}+ </TabsTrigger>+ ))}+ {selectedTab === 'curl' && (+ <Button+ type="default"+ className="ml-auto -translate-y-2 translate-x-3"+ onClick={() => setShowKey(!showKey)}+ >+ {showKey ? 'Hide' : 'Show'} anon key+ </Button>+ )}+ </TabsList>+ {invocationTabs.map((tab) => {+ const code = tab.code({+ showKey,+ functionUrl,+ functionName: selectedFunction?.name ?? '',+ apiKey,+ })- <dt className="text-sm text-foreground-light">Last updated at</dt>- <dd className="text-sm lg:text-left">- {dayjs(selectedFunction?.updated_at ?? 0).format('dddd, MMMM D, YYYY h:mm A')}- </dd>+ return (+ <TabsContent key={tab.id} value={tab.id} className="mt-4 px-6">+ <CodeBlock+ value={code}+ className="p-0 text-xs !mt-0 border-none [&>code]:!whitespace-pre-wrap [&>code]:break-words"+ language={tab.language}+ wrapLines={true}+ hideLineNumbers={tab.hideLineNumbers}+ handleCopy={() => {+ copyToClipboard(+ tab.code({+ showKey: true,+ functionUrl,+ functionName: selectedFunction?.name ?? '',+ apiKey,+ })+ )+ }}+ />+ </TabsContent>+ )+ })}+ </Tabs>+ </CardContent>+ </Card>+ </PageSectionContent>+ </PageSection>- <dt className="text-sm text-foreground-light">Deployments</dt>- <dd className="text-sm lg:text-left">{selectedFunction?.version ?? 0}</dd>+ <PageSection>+ <PageSectionSummary>+ <PageSectionTitle>Develop locally</PageSectionTitle>+ </PageSectionSummary>+ <PageSectionContent>+ <div className="rounded border bg-surface-100 px-6 py-4 drop-shadow-sm">+ <div className="space-y-6">+ <CommandRender+ commands={[+ {+ command: `supabase functions download ${selectedFunction?.slug}`,+ description: 'Download the function to your local machine',+ jsx: () => (+ <>+ <span className="text-brand-600">supabase</span> functions download{' '}+ {selectedFunction?.slug}+ </>+ ),+ comment: '1. Download the function',+ },+ ]}+ />+ <CommandRender commands={[managementCommands[0]]} />+ <CommandRender commands={[managementCommands[1]]} />+ </div>+ </div>+ </PageSectionContent>+ </PageSection>+ <PageSection>+ <PageSectionSummary>+ <PageSectionTitle>Delete function</PageSectionTitle>+ </PageSectionSummary>+ <PageSectionContent>+ <Alert_Shadcn_ variant="destructive">+ <CriticalIcon />+ <AlertTitle_Shadcn_>+ Once your function is deleted, it can no longer be restored+ </AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_>+ Make sure you have made a backup if you want to restore your edge function+ </AlertDescription_Shadcn_>+ <AlertDescription_Shadcn_ className="mt-3">+ <Button+ type="danger"+ disabled={!canUpdateEdgeFunction}+ loading={selectedFunction?.id === undefined}+ onClick={() => setShowDeleteModal(true)}+ >+ Delete edge function+ </Button>+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ </PageSectionContent>+ </PageSection>- <dt className="text-sm text-foreground-light">Import Maps</dt>- <dd className="text-sm lg:text-left">- <p>- Import maps are{' '}- <span className={cn(hasImportMap ? 'text-brand' : 'text-amber-900')}>- {hasImportMap ? 'used' : 'not used'}- </span>{' '}- for this function- </p>- <p className="text-foreground-light mt-1">- Import maps allow the use of bare specifiers in functions instead of explicit- import URLs- </p>- <div className="mt-4">- <Button- asChild- type="default"- size="tiny"- icon={<ExternalLink strokeWidth={1.5} />}- >- <Link- href={`${DOCS_URL}/guides/functions/dependencies`}- target="_blank"- rel="noreferrer"- >- More about import maps- </Link>- </Button>- </div>- </dd>- </dl>- )}- </CardContent>- </Card>- </ScaffoldSection>- </div>- </div>+ <ConfirmationModal+ visible={showDeleteModal}+ loading={isDeleting}+ variant="destructive"+ confirmLabel="Delete"+ confirmLabelLoading="Deleting"+ title={`Confirm to delete ${selectedFunction?.name}`}+ onCancel={() => setShowDeleteModal(false)}+ onConfirm={onConfirmDelete}+ alert={{+ base: { variant: 'destructive' },+ title: 'This action cannot be undone',+ description:+ 'Ensure that you have made a backup if you want to restore your edge function',+ }}+ />+ </PageSectionContent>+ </PageSection>+ </PageContainer>)}diff --git a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsxindex 22cc520b71c..a059a0a4917 100644--- a/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx+++ b/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx@@ -1,14 +1,13 @@import { PermissionAction } from '@supabase/shared-types/out/constants'import { Download, FileArchive, Send } from 'lucide-react'import { useRouter } from 'next/router'-import { useEffect, useState, type PropsWithChildren } from 'react'+import React, { useEffect, useState, type PropsWithChildren } from 'react'import { toast } from 'sonner'import { BlobReader, BlobWriter, ZipWriter } from '@zip.js/zip.js'import { useParams } from 'common'import { useIsAPIDocsSidePanelEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'import { EdgeFunctionTesterSheet } from 'components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet'-import { PageLayout } from 'components/layouts/PageLayout/PageLayout'import { APIDocsButton } from 'components/ui/APIDocsButton'import { DocsButton } from 'components/ui/DocsButton'import NoPermission from 'components/ui/NoPermission'@@ -19,14 +18,30 @@ import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'import { withAuth } from 'hooks/misc/withAuth'import { DOCS_URL } from 'lib/constants'+import Link from 'next/link'import {+ BreadcrumbItem_Shadcn_ as BreadcrumbItem,+ BreadcrumbLink_Shadcn_ as BreadcrumbLink,+ BreadcrumbList_Shadcn_ as BreadcrumbList,+ BreadcrumbSeparator_Shadcn_ as BreadcrumbSeparator,Button,+ NavMenu,+ NavMenuItem,Popover_Shadcn_,PopoverContent_Shadcn_,PopoverTrigger_Shadcn_,Separator,} from 'ui'import { Input } from 'ui-patterns/DataInputs/Input'+import {+ PageHeader,+ PageHeaderAside,+ PageHeaderBreadcrumb,+ PageHeaderFooter,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+} from 'ui-patterns/PageHeader'import { ProjectLayout } from '../ProjectLayout'import EdgeFunctionsLayout from './EdgeFunctionsLayout'@@ -82,6 +97,10 @@ const EdgeFunctionDetailsLayout = ({label: 'Edge Functions',href: `/project/${ref}/functions`,},+ {+ label: functionSlug,+ href: `/project/${ref}/functions/${functionSlug}`,+ },]const navigationItems = functionSlug@@ -155,78 +174,119 @@ const EdgeFunctionDetailsLayout = ({return (<EdgeFunctionsLayout>- <PageLayout- isCompact- size="full"- title={functionSlug ? name : 'Edge Functions'}- breadcrumbs={breadcrumbItems}- navigationItems={navigationItems}- primaryActions={- <div className="flex items-center space-x-2">- {isNewAPIDocsEnabled && (- <APIDocsButton- section={- functionSlug !== undefined ? ['edge-functions', functionSlug] : ['edge-functions']- }- source="edge-functions"- />- )}- <DocsButton href={`${DOCS_URL}/guides/functions`} />- <Popover_Shadcn_>- <PopoverTrigger_Shadcn_ asChild>- <Button type="default" icon={<Download />}>- Download- </Button>- </PopoverTrigger_Shadcn_>- <PopoverContent_Shadcn_ align="end" className="p-0">- <div className="p-3 flex flex-col gap-y-2">- <p className="text-xs text-foreground-light">Download via CLI</p>- <Input- copy- showCopyOnHover- readOnly- containerClassName=""- className="text-xs font-mono tracking-tighter"- value={`supabase functions download ${functionSlug}`}+ <div className="w-full min-h-full flex flex-col items-stretch">+ <PageHeader size="full">+ {breadcrumbItems.length > 0 && (+ <PageHeaderBreadcrumb size="full">+ <BreadcrumbList>+ {breadcrumbItems.map((item, index) => (+ <React.Fragment key={item.label || `breadcrumb-${index}`}>+ <BreadcrumbItem>+ {item.href ? (+ <BreadcrumbLink asChild>+ <Link href={item.href}>{item.label}</Link>+ </BreadcrumbLink>+ ) : (+ <span>{item.label}</span>+ )}+ </BreadcrumbItem>+ {index < breadcrumbItems.length - 1 && <BreadcrumbSeparator />}+ </React.Fragment>+ ))}+ </BreadcrumbList>+ </PageHeaderBreadcrumb>+ )}++ <PageHeaderMeta size="full">+ <PageHeaderSummary>+ <PageHeaderTitle>{functionSlug ? name : 'Edge Functions'}</PageHeaderTitle>+ </PageHeaderSummary>++ <PageHeaderAside>+ <div className="flex items-center space-x-2">+ {isNewAPIDocsEnabled && (+ <APIDocsButton+ section={+ functionSlug !== undefined+ ? ['edge-functions', functionSlug]+ : ['edge-functions']+ }+ source="edge-functions"/>- </div>- <Separator className="!bg-border-overlay" />- <div className="py-2 px-1">+ )}+ <DocsButton href={`${DOCS_URL}/guides/functions`} />+ <Popover_Shadcn_>+ <PopoverTrigger_Shadcn_ asChild>+ <Button type="default" icon={<Download />}>+ Download+ </Button>+ </PopoverTrigger_Shadcn_>+ <PopoverContent_Shadcn_ align="end" className="p-0">+ <div className="p-3 flex flex-col gap-y-2">+ <p className="text-xs text-foreground-light">Download via CLI</p>+ <Input+ copy+ showCopyOnHover+ readOnly+ containerClassName=""+ className="text-xs font-mono tracking-tighter"+ value={`supabase functions download ${functionSlug}`}+ />+ </div>+ <Separator className="!bg-border-overlay" />+ <div className="py-2 px-1">+ <Button+ type="text"+ className="w-min hover:bg-transparent"+ icon={<FileArchive />}+ onClick={downloadFunction}+ >+ Download as ZIP+ </Button>+ </div>+ </PopoverContent_Shadcn_>+ </Popover_Shadcn_>+ {!!functionSlug && (<Button- type="text"- className="w-min hover:bg-transparent"- icon={<FileArchive />}- onClick={downloadFunction}+ type="default"+ icon={<Send />}+ onClick={() => {+ setIsOpen(true)+ sendEvent({+ action: 'edge_function_test_side_panel_opened',+ groups: {+ project: ref ?? 'Unknown',+ organization: org?.slug ?? 'Unknown',+ },+ })+ }}>- Download as ZIP+ Test</Button>- </div>- </PopoverContent_Shadcn_>- </Popover_Shadcn_>- {!!functionSlug && (- <Button- type="default"- icon={<Send />}- onClick={() => {- setIsOpen(true)- sendEvent({- action: 'edge_function_test_side_panel_opened',- groups: {- project: ref ?? 'Unknown',- organization: org?.slug ?? 'Unknown',- },- })- }}- >- Test- </Button>- )}- </div>- }- >+ )}+ </div>+ </PageHeaderAside>+ </PageHeaderMeta>++ {navigationItems.length > 0 && (+ <PageHeaderFooter size="full">+ <NavMenu>+ {navigationItems.map((item) => {+ const isActive = router.asPath.split('?')[0] === item.href+ return (+ <NavMenuItem key={item.label} active={isActive}>+ <Link href={item.href}>{item.label}</Link>+ </NavMenuItem>+ )+ })}+ </NavMenu>+ </PageHeaderFooter>+ )}+ </PageHeader>+{children}<EdgeFunctionTesterSheet visible={isOpen} onClose={() => setIsOpen(false)} />- </PageLayout>+ </div></EdgeFunctionsLayout>)}diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsxindex 8033823a504..44850089399 100644--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx@@ -3,11 +3,7 @@ import DefaultLayout from 'components/layouts/DefaultLayout'import EdgeFunctionDetailsLayout from 'components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout'import type { NextPageWithLayout } from 'types'-const PageLayout: NextPageWithLayout = () => (- <div className="px-6">- <EdgeFunctionDetails />- </div>-)+const PageLayout: NextPageWithLayout = () => <EdgeFunctionDetails />PageLayout.getLayout = (page) => (<DefaultLayout>diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsxindex e09f4959457..dd26dee0ae5 100644--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx@@ -29,6 +29,8 @@ import {Button,WarningIcon,} from 'ui'+import { PageContainer } from 'ui-patterns/PageContainer'+import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'const CHART_INTERVALS: ChartIntervals[] = [{@@ -131,141 +133,260 @@ const PageLayout: NextPageWithLayout = () => {}return (- <div className="px-6 w-full py-6">- <div className="space-y-6">- <div className="flex flex-row items-center gap-2">- <div className="flex items-center">- {CHART_INTERVALS.map((item, i) => {- const classes = []+ <PageContainer size="full">+ <PageSection>+ <PageSectionContent>+ <div className="flex flex-row items-center gap-2 mb-4">+ <div className="flex items-center">+ {CHART_INTERVALS.map((item, i) => {+ const classes = []- if (i === 0) {- classes.push('rounded-tr-none rounded-br-none')- } else if (i === CHART_INTERVALS.length - 1) {- classes.push('rounded-tl-none rounded-bl-none')- } else {- classes.push('rounded-none')- }+ if (i === 0) {+ classes.push('rounded-tr-none rounded-br-none')+ } else if (i === CHART_INTERVALS.length - 1) {+ classes.push('rounded-tl-none rounded-bl-none')+ } else {+ classes.push('rounded-none')+ }- return (- <Button- key={`function-filter-${i}`}- type={interval === item.key ? 'secondary' : 'default'}- onClick={() => setInterval(item.key)}- className={classes.join(' ')}- >- {item.label}- </Button>- )- })}- </div>+ return (+ <Button+ key={`function-filter-${i}`}+ type={interval === item.key ? 'secondary' : 'default'}+ onClick={() => setInterval(item.key)}+ className={classes.join(' ')}+ >+ {item.label}+ </Button>+ )+ })}+ </div>- <span className="text-xs text-foreground-light">- Statistics for past {selectedInterval.label}- </span>- </div>- <div>- <div className="grid grid-cols-1 md:grid-cols-2 md:gap-4 lg:grid-cols-2 lg:gap-8">- <ReportWidget- title="Execution time"- tooltip="Average execution time of function invocations"- data={combinedStatsChartData}- isLoading={combinedStatsResults.isLoading}- renderer={(props) => {- return isErrorCombinedStats ? (- <Alert_Shadcn_ variant="warning">- <WarningIcon />- <AlertTitle_Shadcn_>Failed to reterieve execution time</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- {combinedStatsError.message}- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- ) : (- <div className="space-y-8">- <AreaChart- title="Average execution time"- className="w-full"- xAxisKey="timestamp"- customDateFormat={selectedInterval.format}- yAxisKey="avg_execution_time"- data={props.data}- format="ms"- highlightedValue={meanBy(props.data, 'avg_execution_time')}- />- {newChartsEnabled && (+ <span className="text-xs text-foreground-light">+ Statistics for past {selectedInterval.label}+ </span>+ </div>+ <div>+ <div className="grid grid-cols-1 md:grid-cols-2 md:gap-4 lg:grid-cols-2 lg:gap-8">+ <ReportWidget+ title="Execution time"+ tooltip="Average execution time of function invocations"+ data={combinedStatsChartData}+ isLoading={combinedStatsResults.isLoading}+ renderer={(props) => {+ return isErrorCombinedStats ? (+ <Alert_Shadcn_ variant="warning">+ <WarningIcon />+ <AlertTitle_Shadcn_>Failed to reterieve execution time</AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_>+ {combinedStatsError.message}+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ ) : (+ <div className="space-y-8"><AreaChart- title="Max execution time"+ title="Average execution time"className="w-full"xAxisKey="timestamp"customDateFormat={selectedInterval.format}- yAxisKey="max_execution_time"+ yAxisKey="avg_execution_time"data={props.data}format="ms"- highlightedValue={- maxBy(props.data, 'max_execution_time')?.max_execution_time- }+ highlightedValue={meanBy(props.data, 'avg_execution_time')}/>- )}- </div>- )- }}- />- <ReportWidget- title="Invocations"- tooltip="Requests made to a function are considered invocations, and each invocation may have worker logs."- data={combinedStatsChartData}- isLoading={combinedStatsResults.isLoading}- renderer={(props) => {- if (isErrorCombinedStats) {- return (+ {newChartsEnabled && (+ <AreaChart+ title="Max execution time"+ className="w-full"+ xAxisKey="timestamp"+ customDateFormat={selectedInterval.format}+ yAxisKey="max_execution_time"+ data={props.data}+ format="ms"+ highlightedValue={+ maxBy(props.data, 'max_execution_time')?.max_execution_time+ }+ />+ )}+ </div>+ )+ }}+ />+ <ReportWidget+ title="Invocations"+ tooltip="Requests made to a function are considered invocations, and each invocation may have worker logs."+ data={combinedStatsChartData}+ isLoading={combinedStatsResults.isLoading}+ renderer={(props) => {+ if (isErrorCombinedStats) {+ return (+ <Alert_Shadcn_ variant="warning">+ <WarningIcon />+ <AlertTitle_Shadcn_>Failed to reterieve invocations</AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_>+ {combinedStatsError.message}+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ )+ } else {+ const requestData = props.data+ .map((d: any) => [+ {+ status: '2xx',+ count: d.success_count,+ timestamp: d.timestamp,+ },+ {+ status: '3xx',+ count: d.redirect_count,+ timestamp: d.timestamp,+ },+ {+ status: '4xx',+ count: d.client_err_count,+ timestamp: d.timestamp,+ },+ {+ status: '5xx',+ count: d.server_err_count,+ timestamp: d.timestamp,+ },+ ])+ .flat()++ const logsData = props.data+ .map((d: any) => [+ {+ status: 'error',+ count: d.log_error_count,+ timestamp: d.timestamp,+ },+ {+ status: 'info',+ count: d.log_info_count,+ timestamp: d.timestamp,+ },+ {+ status: 'warn',+ count: d.log_warn_count,+ timestamp: d.timestamp,+ },+ ])+ .flat()++ return (+ <div className="space-y-8">+ <StackedBarChart+ title="Invocation Requests"+ className="w-full"+ xAxisKey="timestamp"+ yAxisKey="count"+ stackKey="status"+ data={requestData}+ highlightedValue={sumBy(requestData, 'count')}+ customDateFormat={selectedInterval.format}+ stackColors={['brand', 'slate', 'yellow', 'red']}+ onBarClick={() => {+ router.push(+ `/project/${projectRef}/functions/${functionSlug}/invocations?its=${startDate.toISOString()}`+ )+ }}+ />+ {newChartsEnabled && (+ <StackedBarChart+ title="Worker Logs"+ className="w-full"+ xAxisKey="timestamp"+ yAxisKey="count"+ stackKey="status"+ data={logsData}+ highlightedValue={sumBy(logsData, 'count')}+ customDateFormat={selectedInterval.format}+ stackColors={['red', 'brand', 'yellow']}+ onBarClick={() => {+ router.push(+ `/project/${projectRef}/functions/${functionSlug}/logs?its=${startDate.toISOString()}`+ )+ }}+ />+ )}+ </div>+ )+ }+ }}+ />+ <ReportWidget+ title="CPU time"+ tooltip="Average CPU time usage for the function"+ data={combinedStatsChartData}+ isLoading={combinedStatsResults.isLoading}+ renderer={(props) => {+ return isErrorCombinedStats ? (<Alert_Shadcn_ variant="warning"><WarningIcon />- <AlertTitle_Shadcn_>Failed to reterieve invocations</AlertTitle_Shadcn_>+ <AlertTitle_Shadcn_>Failed to retrieve CPU time</AlertTitle_Shadcn_><AlertDescription_Shadcn_>{combinedStatsError.message}</AlertDescription_Shadcn_></Alert_Shadcn_>+ ) : (+ <div className="space-y-8">+ <AreaChart+ title="Average CPU Time"+ className="w-full"+ xAxisKey="timestamp"+ customDateFormat={selectedInterval.format}+ yAxisKey="avg_cpu_time_used"+ data={props.data}+ format="ms"+ highlightedValue={meanBy(props.data, 'avg_cpu_time_used')}+ />+ {newChartsEnabled && (+ <AreaChart+ title="Max CPU Time"+ className="w-full"+ xAxisKey="timestamp"+ customDateFormat={selectedInterval.format}+ yAxisKey="max_cpu_time_used"+ data={props.data}+ format="ms"+ highlightedValue={+ maxBy(props.data, 'max_cpu_time_used')?.max_cpu_time_used+ }+ />+ )}+ </div>)- } else {- const requestData = props.data- .map((d: any) => [- {- status: '2xx',- count: d.success_count,- timestamp: d.timestamp,- },- {- status: '3xx',- count: d.redirect_count,- timestamp: d.timestamp,- },- {- status: '4xx',- count: d.client_err_count,- timestamp: d.timestamp,- },- {- status: '5xx',- count: d.server_err_count,- timestamp: d.timestamp,- },- ])- .flat()+ }}+ />+ <ReportWidget+ title="Memory"+ tooltip="Average memory usage for the function"+ data={combinedStatsChartData}+ isLoading={combinedStatsResults.isLoading}+ renderer={(props) => {+ if (isErrorCombinedStats) {+ return (+ <Alert_Shadcn_ variant="warning">+ <WarningIcon />+ <AlertTitle_Shadcn_>Failed to retrieve memory usage</AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_>+ {combinedStatsError.message}+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ )+ }- const logsData = props.data+ const memoryData = props.data.map((d: any) => [{- status: 'error',- count: d.log_error_count,- timestamp: d.timestamp,- },- {- status: 'info',- count: d.log_info_count,+ type: 'heap',+ count: d.avg_heap_memory_used,timestamp: d.timestamp,},{- status: 'warn',- count: d.log_warn_count,+ type: 'external',+ count: d.avg_external_memory_used,timestamp: d.timestamp,},])@@ -273,154 +394,39 @@ const PageLayout: NextPageWithLayout = () => {return (<div className="space-y-8">- <StackedBarChart- title="Invocation Requests"+ <AreaChart+ title="Average Memory Usage"className="w-full"xAxisKey="timestamp"- yAxisKey="count"- stackKey="status"- data={requestData}- highlightedValue={sumBy(requestData, 'count')}customDateFormat={selectedInterval.format}- stackColors={['brand', 'slate', 'yellow', 'red']}- onBarClick={() => {- router.push(- `/project/${projectRef}/functions/${functionSlug}/invocations?its=${startDate.toISOString()}`- )- }}+ yAxisKey="avg_memory_used"+ data={props.data}+ format="MB"+ highlightedValue={meanBy(props.data, 'avg_memory_used')}/>{newChartsEnabled && (<StackedBarChart- title="Worker Logs"+ title="Average Memory Usage by Type"className="w-full"xAxisKey="timestamp"yAxisKey="count"- stackKey="status"- data={logsData}- highlightedValue={sumBy(logsData, 'count')}+ stackKey="type"+ format="MB"+ data={memoryData}+ highlightedValue={sumBy(memoryData, 'count')}customDateFormat={selectedInterval.format}- stackColors={['red', 'brand', 'yellow']}- onBarClick={() => {- router.push(- `/project/${projectRef}/functions/${functionSlug}/logs?its=${startDate.toISOString()}`- )- }}+ stackColors={['blue', 'brand']}/>)}</div>)- }- }}- />- <ReportWidget- title="CPU time"- tooltip="Average CPU time usage for the function"- data={combinedStatsChartData}- isLoading={combinedStatsResults.isLoading}- renderer={(props) => {- return isErrorCombinedStats ? (- <Alert_Shadcn_ variant="warning">- <WarningIcon />- <AlertTitle_Shadcn_>Failed to retrieve CPU time</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- {combinedStatsError.message}- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- ) : (- <div className="space-y-8">- <AreaChart- title="Average CPU Time"- className="w-full"- xAxisKey="timestamp"- customDateFormat={selectedInterval.format}- yAxisKey="avg_cpu_time_used"- data={props.data}- format="ms"- highlightedValue={meanBy(props.data, 'avg_cpu_time_used')}- />- {newChartsEnabled && (- <AreaChart- title="Max CPU Time"- className="w-full"- xAxisKey="timestamp"- customDateFormat={selectedInterval.format}- yAxisKey="max_cpu_time_used"- data={props.data}- format="ms"- highlightedValue={maxBy(props.data, 'max_cpu_time_used')?.max_cpu_time_used}- />- )}- </div>- )- }}- />- <ReportWidget- title="Memory"- tooltip="Average memory usage for the function"- data={combinedStatsChartData}- isLoading={combinedStatsResults.isLoading}- renderer={(props) => {- if (isErrorCombinedStats) {- return (- <Alert_Shadcn_ variant="warning">- <WarningIcon />- <AlertTitle_Shadcn_>Failed to retrieve memory usage</AlertTitle_Shadcn_>- <AlertDescription_Shadcn_>- {combinedStatsError.message}- </AlertDescription_Shadcn_>- </Alert_Shadcn_>- )- }-- const memoryData = props.data- .map((d: any) => [- {- type: 'heap',- count: d.avg_heap_memory_used,- timestamp: d.timestamp,- },- {- type: 'external',- count: d.avg_external_memory_used,- timestamp: d.timestamp,- },- ])- .flat()-- return (- <div className="space-y-8">- <AreaChart- title="Average Memory Usage"- className="w-full"- xAxisKey="timestamp"- customDateFormat={selectedInterval.format}- yAxisKey="avg_memory_used"- data={props.data}- format="MB"- highlightedValue={meanBy(props.data, 'avg_memory_used')}- />- {newChartsEnabled && (- <StackedBarChart- title="Average Memory Usage by Type"- className="w-full"- xAxisKey="timestamp"- yAxisKey="count"- stackKey="type"- format="MB"- data={memoryData}- highlightedValue={sumBy(memoryData, 'count')}- customDateFormat={selectedInterval.format}- stackColors={['blue', 'brand']}- />- )}- </div>- )- }}- />+ }}+ />+ </div></div>- </div>- </div>- </div>+ </PageSectionContent>+ </PageSection>+ </PageContainer>)}diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsxindex 9d68e2471ed..0988ae64ace 100644--- a/apps/studio/pages/project/[ref]/functions/index.tsx+++ b/apps/studio/pages/project/[ref]/functions/index.tsx@@ -1,4 +1,5 @@import { ExternalLink } from 'lucide-react'+import React from 'react'import { useParams } from 'common'import { DeployEdgeFunctionButton } from 'components/interfaces/EdgeFunctions/DeployEdgeFunctionButton'@@ -9,8 +10,6 @@ import {} from 'components/interfaces/Functions/FunctionsEmptyState'import DefaultLayout from 'components/layouts/DefaultLayout'import EdgeFunctionsLayout from 'components/layouts/EdgeFunctionsLayout/EdgeFunctionsLayout'-import { PageLayout } from 'components/layouts/PageLayout/PageLayout'-import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'import AlertError from 'components/ui/AlertError'import { DocsButton } from 'components/ui/DocsButton'import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'@@ -18,6 +17,16 @@ import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'import { DOCS_URL, IS_PLATFORM } from 'lib/constants'import type { NextPageWithLayout } from 'types'import { Button, Card, Table, TableBody, TableHead, TableHeader, TableRow } from 'ui'+import { PageContainer } from 'ui-patterns/PageContainer'+import {+ PageHeader,+ PageHeaderAside,+ PageHeaderDescription,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+} from 'ui-patterns/PageHeader'+import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'const EdgeFunctionsPage: NextPageWithLayout = () => {const { ref } = useParams()@@ -31,29 +40,10 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {const hasFunctions = (functions ?? []).length > 0- const secondaryActions = [- <DocsButton key="docs" href={`${DOCS_URL}/guides/functions`} />,- <Button asChild key="edge-function-examples" type="default" icon={<ExternalLink />}>- <a- target="_blank"- rel="noreferrer"- href="https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions"- >- Examples- </a>- </Button>,- ]-return (- <PageLayout- size="large"- title="Edge Functions"- subtitle="Deploy edge functions to handle complex business logic"- primaryActions={IS_PLATFORM ? <DeployEdgeFunctionButton /> : undefined}- secondaryActions={secondaryActions}- >- <ScaffoldContainer size="large">- <ScaffoldSection isFullWidth>+ <PageContainer size="large">+ <PageSection>+ <PageSectionContent>{IS_PLATFORM ? (<>{isLoading && <GenericSkeletonLoader />}@@ -92,16 +82,54 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {) : (<FunctionsEmptyStateLocal />)}- </ScaffoldSection>- </ScaffoldContainer>- </PageLayout>+ </PageSectionContent>+ </PageSection>+ </PageContainer>)}-EdgeFunctionsPage.getLayout = (page) => {+EdgeFunctionsPage.getLayout = (page: React.ReactElement) => {+ const EdgeFunctionsPageLayout = () => {+ const secondaryActions = [+ <DocsButton key="docs" href={`${DOCS_URL}/guides/functions`} />,+ <Button asChild key="edge-function-examples" type="default" icon={<ExternalLink />}>+ <a+ target="_blank"+ rel="noreferrer"+ href="https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions"+ >+ Examples+ </a>+ </Button>,+ ]++ return (+ <div className="w-full min-h-full flex flex-col items-stretch">+ <PageHeader size="large">+ <PageHeaderMeta size="large">+ <PageHeaderSummary>+ <PageHeaderTitle>Edge Functions</PageHeaderTitle>+ <PageHeaderDescription>+ Deploy edge functions to handle complex business logic+ </PageHeaderDescription>+ </PageHeaderSummary>+ <PageHeaderAside>+ {secondaryActions.map((action) => action)}+ {IS_PLATFORM && <DeployEdgeFunctionButton />}+ </PageHeaderAside>+ </PageHeaderMeta>+ </PageHeader>++ {page}+ </div>+ )+ }+return (<DefaultLayout>- <EdgeFunctionsLayout>{page}</EdgeFunctionsLayout>+ <EdgeFunctionsLayout>+ <EdgeFunctionsPageLayout />+ </EdgeFunctionsLayout></DefaultLayout>)}diff --git a/packages/ui-patterns/index.tsx b/packages/ui-patterns/index.tsxindex f33a01ebe8d..6d6b600d4a3 100644--- a/packages/ui-patterns/index.tsx+++ b/packages/ui-patterns/index.tsx@@ -12,6 +12,9 @@ export * from './src/FilterBar'export * from './src/GlassPanel'export * from './src/InnerSideMenu'export * from './src/McpUrlBuilder'+export * from './src/PageContainer'+export * from './src/PageHeader'+export * from './src/PageSection'export * from './src/PopupFrame'export * from './src/ShimmeringLoader'export * from './src/TimestampInfo'diff --git a/packages/ui-patterns/package.json b/packages/ui-patterns/package.jsonindex 7d4cc23fdf2..39e7e8f6034 100644--- a/packages/ui-patterns/package.json+++ b/packages/ui-patterns/package.json@@ -34,17 +34,21 @@"import": "./src/AuthenticatedDropdownMenu/index.tsx","types": "./src/AuthenticatedDropdownMenu/index.tsx"},+ "./Banners/AnnouncementBanner": {+ "import": "./src/Banners/AnnouncementBanner.tsx",+ "types": "./src/Banners/AnnouncementBanner.tsx"+ },"./Banners/Countdown": {"import": "./src/Banners/Countdown.tsx","types": "./src/Banners/Countdown.tsx"},- "./Banners/LW14Announcement": {- "import": "./src/Banners/LW14Announcement.tsx",- "types": "./src/Banners/LW14Announcement.tsx"+ "./Banners/LW15Banner": {+ "import": "./src/Banners/LW15Banner.tsx",+ "types": "./src/Banners/LW15Banner.tsx"},- "./Banners/LW14Banner": {- "import": "./src/Banners/LW14Banner.tsx",- "types": "./src/Banners/LW14Banner.tsx"+ "./Banners": {+ "import": "./src/Banners/index.ts",+ "types": "./src/Banners/index.ts"},"./CommandMenu/api/Badges": {"import": "./src/CommandMenu/api/Badges.tsx",@@ -98,6 +102,14 @@"import": "./src/CommandMenu/api/hooks/useCommandFilterState.ts","types": "./src/CommandMenu/api/hooks/useCommandFilterState.ts"},+ "./CommandMenu/api/hooks/useCommandMenuTelemetry": {+ "import": "./src/CommandMenu/api/hooks/useCommandMenuTelemetry.ts",+ "types": "./src/CommandMenu/api/hooks/useCommandMenuTelemetry.ts"+ },+ "./CommandMenu/api/hooks/useCommandMenuTelemetryContext": {+ "import": "./src/CommandMenu/api/hooks/useCommandMenuTelemetryContext.tsx",+ "types": "./src/CommandMenu/api/hooks/useCommandMenuTelemetryContext.tsx"+ },"./CommandMenu/api/hooks/useCrossCompatRouter": {"import": "./src/CommandMenu/api/hooks/useCrossCompatRouter.tsx","types": "./src/CommandMenu/api/hooks/useCrossCompatRouter.tsx"@@ -214,6 +226,10 @@"import": "./src/CommandMenu/prepackaged/ai/queryAi.ts","types": "./src/CommandMenu/prepackaged/ai/queryAi.ts"},+ "./CommandMenu/prepackaged/ai/useAiChat.test": {+ "import": "./src/CommandMenu/prepackaged/ai/useAiChat.test.ts",+ "types": "./src/CommandMenu/prepackaged/ai/useAiChat.test.ts"+ },"./CommandMenu/prepackaged/ai/useAiChat": {"import": "./src/CommandMenu/prepackaged/ai/useAiChat.ts","types": "./src/CommandMenu/prepackaged/ai/useAiChat.ts"@@ -278,6 +294,14 @@"import": "./src/ExpandableVideo/index.tsx","types": "./src/ExpandableVideo/index.tsx"},+ "./FilterBar/DefaultCommandList": {+ "import": "./src/FilterBar/DefaultCommandList.tsx",+ "types": "./src/FilterBar/DefaultCommandList.tsx"+ },+ "./FilterBar/FilterBar.test": {+ "import": "./src/FilterBar/FilterBar.test.tsx",+ "types": "./src/FilterBar/FilterBar.test.tsx"+ },"./FilterBar/FilterBar": {"import": "./src/FilterBar/FilterBar.tsx","types": "./src/FilterBar/FilterBar.tsx"@@ -290,14 +314,50 @@"import": "./src/FilterBar/FilterGroup.tsx","types": "./src/FilterBar/FilterGroup.tsx"},+ "./FilterBar/hooks.test": {+ "import": "./src/FilterBar/hooks.test.ts",+ "types": "./src/FilterBar/hooks.test.ts"+ },+ "./FilterBar/hooks": {+ "import": "./src/FilterBar/hooks.ts",+ "types": "./src/FilterBar/hooks.ts"+ },"./FilterBar": {"import": "./src/FilterBar/index.ts","types": "./src/FilterBar/index.ts"},+ "./FilterBar/menuItems": {+ "import": "./src/FilterBar/menuItems.ts",+ "types": "./src/FilterBar/menuItems.ts"+ },"./FilterBar/types": {"import": "./src/FilterBar/types.ts","types": "./src/FilterBar/types.ts"},+ "./FilterBar/useAIFilter": {+ "import": "./src/FilterBar/useAIFilter.ts",+ "types": "./src/FilterBar/useAIFilter.ts"+ },+ "./FilterBar/useCommandHandling": {+ "import": "./src/FilterBar/useCommandHandling.ts",+ "types": "./src/FilterBar/useCommandHandling.ts"+ },+ "./FilterBar/useCommandMenu": {+ "import": "./src/FilterBar/useCommandMenu.ts",+ "types": "./src/FilterBar/useCommandMenu.ts"+ },+ "./FilterBar/useKeyboardNavigation": {+ "import": "./src/FilterBar/useKeyboardNavigation.ts",+ "types": "./src/FilterBar/useKeyboardNavigation.ts"+ },+ "./FilterBar/utils.test": {+ "import": "./src/FilterBar/utils.test.ts",+ "types": "./src/FilterBar/utils.test.ts"+ },+ "./FilterBar/utils": {+ "import": "./src/FilterBar/utils.ts",+ "types": "./src/FilterBar/utils.ts"+ },"./GlassPanel": {"import": "./src/GlassPanel/index.tsx","types": "./src/GlassPanel/index.tsx"@@ -314,10 +374,46 @@"import": "./src/LogsBarChart/index.tsx","types": "./src/LogsBarChart/index.tsx"},+ "./McpUrlBuilder/McpConfigPanel": {+ "import": "./src/McpUrlBuilder/McpConfigPanel.tsx",+ "types": "./src/McpUrlBuilder/McpConfigPanel.tsx"+ },+ "./McpUrlBuilder/components/ClientSelectDropdown": {+ "import": "./src/McpUrlBuilder/components/ClientSelectDropdown.tsx",+ "types": "./src/McpUrlBuilder/components/ClientSelectDropdown.tsx"+ },+ "./McpUrlBuilder/components/ConnectionIcon": {+ "import": "./src/McpUrlBuilder/components/ConnectionIcon.tsx",+ "types": "./src/McpUrlBuilder/components/ConnectionIcon.tsx"+ },+ "./McpUrlBuilder/components/McpConfigurationDisplay": {+ "import": "./src/McpUrlBuilder/components/McpConfigurationDisplay.tsx",+ "types": "./src/McpUrlBuilder/components/McpConfigurationDisplay.tsx"+ },+ "./McpUrlBuilder/components/McpConfigurationOptions": {+ "import": "./src/McpUrlBuilder/components/McpConfigurationOptions.tsx",+ "types": "./src/McpUrlBuilder/components/McpConfigurationOptions.tsx"+ },+ "./McpUrlBuilder/constants": {+ "import": "./src/McpUrlBuilder/constants.tsx",+ "types": "./src/McpUrlBuilder/constants.tsx"+ },"./McpUrlBuilder": {"import": "./src/McpUrlBuilder/index.ts","types": "./src/McpUrlBuilder/index.ts"},+ "./McpUrlBuilder/types": {+ "import": "./src/McpUrlBuilder/types.ts",+ "types": "./src/McpUrlBuilder/types.ts"+ },+ "./McpUrlBuilder/utils/getMcpButtonData": {+ "import": "./src/McpUrlBuilder/utils/getMcpButtonData.ts",+ "types": "./src/McpUrlBuilder/utils/getMcpButtonData.ts"+ },+ "./McpUrlBuilder/utils/getMcpUrl": {+ "import": "./src/McpUrlBuilder/utils/getMcpUrl.ts",+ "types": "./src/McpUrlBuilder/utils/getMcpUrl.ts"+ },"./MobileSheetNav/MobileSheetNav": {"import": "./src/MobileSheetNav/MobileSheetNav.tsx","types": "./src/MobileSheetNav/MobileSheetNav.tsx"@@ -338,6 +434,22 @@"import": "./src/MultiSelectDeprecated/index.tsx","types": "./src/MultiSelectDeprecated/index.tsx"},+ "./PageContainer": {+ "import": "./src/PageContainer/index.tsx",+ "types": "./src/PageContainer/index.tsx"+ },+ "./PageHeader": {+ "import": "./src/PageHeader/index.tsx",+ "types": "./src/PageHeader/index.tsx"+ },+ "./PageSection": {+ "import": "./src/PageSection/index.tsx",+ "types": "./src/PageSection/index.tsx"+ },+ "./PopupFrame": {+ "import": "./src/PopupFrame/index.tsx",+ "types": "./src/PopupFrame/index.tsx"+ },"./PrivacySettings": {"import": "./src/PrivacySettings/index.tsx","types": "./src/PrivacySettings/index.tsx"@@ -354,6 +466,14 @@"import": "./src/PromoToast/index.ts","types": "./src/PromoToast/index.ts"},+ "./Row/Row.utils": {+ "import": "./src/Row/Row.utils.ts",+ "types": "./src/Row/Row.utils.ts"+ },+ "./Row": {+ "import": "./src/Row/index.tsx",+ "types": "./src/Row/index.tsx"+ },"./ShimmeringLoader": {"import": "./src/ShimmeringLoader/index.tsx","types": "./src/ShimmeringLoader/index.tsx"diff --git a/packages/ui-patterns/src/PageContainer/index.tsx b/packages/ui-patterns/src/PageContainer/index.tsxnew file mode 100644index 00000000000..526e6506086--- /dev/null+++ b/packages/ui-patterns/src/PageContainer/index.tsx@@ -0,0 +1,51 @@+import { cva, type VariantProps } from 'class-variance-authority'+import { forwardRef, HTMLAttributes } from 'react'++import { cn } from 'ui'++// ============================================================================+// Variants+// ============================================================================++const pageContainerVariants = cva(['mx-auto w-full @container px-6 xl:px-10'], {+ variants: {+ size: {+ small: 'max-w-[768px]',+ default: 'max-w-[1200px]',+ large: 'max-w-[1600px]',+ full: 'max-w-none',+ },+ },+ defaultVariants: {+ size: 'default',+ },+})++// ============================================================================+// Component+// ============================================================================++export type PageContainerProps = HTMLAttributes<HTMLDivElement> &+ VariantProps<typeof pageContainerVariants>++/**+ * Container component for page content.+ * Provides consistent max-width and padding based on size prop.+ *+ * @example+ * ```tsx+ * <PageContainer size="large">+ * <PageHeader>+ * <PageHeaderTitle>My Page</PageHeaderTitle>+ * </PageHeader>+ * {children}+ * </PageContainer>+ * ```+ */+export const PageContainer = forwardRef<HTMLDivElement, PageContainerProps>(+ ({ className, size, ...props }, ref) => {+ return <div ref={ref} {...props} className={cn(pageContainerVariants({ size }), className)} />+ }+)++PageContainer.displayName = 'PageContainer'diff --git a/packages/ui-patterns/src/PageHeader/index.tsx b/packages/ui-patterns/src/PageHeader/index.tsxnew file mode 100644index 00000000000..a9d624c4eef--- /dev/null+++ b/packages/ui-patterns/src/PageHeader/index.tsx@@ -0,0 +1,282 @@+import { cva, type VariantProps } from 'class-variance-authority'+import React from 'react'++import { cn } from 'ui'+import { Breadcrumb } from 'ui/src/components/shadcn/ui/breadcrumb'+import { PageContainer } from '../PageContainer'++// ============================================================================+// Variants+// ============================================================================++const pageHeaderVariants = cva(['flex flex-col gap-4 w-full'], {+ variants: {+ size: {+ default: 'pt-12',+ small: 'pt-12',+ large: 'pt-12',+ full: 'pt-6',+ },+ },+ defaultVariants: {+ size: 'default',+ },+})++// ============================================================================+// Root+// ============================================================================++export type PageHeaderRootProps = React.ComponentProps<'div'> &+ VariantProps<typeof pageHeaderVariants>++/**+ * Root component for page header.+ * Renders children in order without searching for specific components.+ */+const PageHeaderRoot = ({+ className,+ size = 'default',+ children,+ ...props+}: PageHeaderRootProps) => {+ return (+ <div+ data-slot="page-header"+ data-size={size}+ className={cn(pageHeaderVariants({ size }), className)}+ {...props}+ >+ {children}+ </div>+ )+}++// ============================================================================+// Breadcrumb+// ============================================================================++export type PageHeaderBreadcrumbProps = React.ComponentProps<typeof Breadcrumb> & {+ size?: 'default' | 'small' | 'large' | 'full'+}++/**+ * Breadcrumb component for page header.+ * A wrapper around Breadcrumb with page header styling.+ * Should be placed as the first child of PageHeader.+ */+const PageHeaderBreadcrumb = ({+ className,+ size = 'default',+ children,+ ...props+}: PageHeaderBreadcrumbProps) => {+ return (+ <PageContainer size={size}>+ <Breadcrumb+ data-slot="page-header-breadcrumb"+ className={cn('flex items-center gap-4 [&_li]:text-xs', className)}+ {...props}+ >+ {children}+ </Breadcrumb>+ </PageContainer>+ )+}+PageHeaderBreadcrumb.displayName = 'PageHeaderBreadcrumb'++// ============================================================================+// Icon+// ============================================================================++export type PageHeaderIconProps = React.ComponentProps<'div'>++/**+ * Icon component for page header.+ * Positioned to the left of title and description.+ */+const PageHeaderIcon = ({ className, ...props }: PageHeaderIconProps) => {+ return (+ <div+ data-slot="page-header-icon"+ className={cn('text-foreground-light', className)}+ {...props}+ />+ )+}+PageHeaderIcon.displayName = 'PageHeaderIcon'++// ============================================================================+// Summary+// ============================================================================++export type PageHeaderSummaryProps = React.ComponentProps<'div'>++/**+ * Summary component to contain title and description.+ * Provides layout structure for text content.+ * Should be placed inside PageHeaderMeta.+ */+const PageHeaderSummary = ({ className, children, ...props }: PageHeaderSummaryProps) => {+ return (+ <div+ data-slot="page-header-summary"+ className={cn('flex flex-col gap-1', className)}+ {...props}+ >+ {children}+ </div>+ )+}+PageHeaderSummary.displayName = 'PageHeaderSummary'++// ============================================================================+// Title+// ============================================================================++export type PageHeaderTitleProps = React.ComponentProps<'h1'>++/**+ * Title component for page header.+ * Primary heading for the page.+ */+const PageHeaderTitle = ({ className, children, ...props }: PageHeaderTitleProps) => {+ return (+ <h1 data-slot="page-header-title" className={cn('heading-title', className)} {...props}>+ {children}+ </h1>+ )+}++// ============================================================================+// Description+// ============================================================================++export type PageHeaderDescriptionProps = React.ComponentProps<'div'>++/**+ * Description component for page header.+ * Supporting text rendered below the title.+ */+const PageHeaderDescription = ({ className, children, ...props }: PageHeaderDescriptionProps) => {+ return (+ <div+ data-slot="page-header-description"+ className={cn('heading-subSection text-foreground-light', className)}+ {...props}+ >+ {children}+ </div>+ )+}++// ============================================================================+// Meta+// ============================================================================++export type PageHeaderMetaProps = React.ComponentProps<'div'> & {+ size?: 'default' | 'small' | 'large' | 'full'+}++/**+ * Meta wrapper for page header.+ * Contains icon, summary, and aside components with proper layout.+ * Should be placed after PageHeaderBreadcrumb (if present) and before PageHeaderFooter.+ * Uses CSS to style children based on their data-slot attributes.+ */+const PageHeaderMeta = ({+ className,+ size = 'default',+ children,+ ...props+}: PageHeaderMetaProps) => {+ return (+ <PageContainer size={size}>+ <div+ data-slot="page-header-meta"+ className={cn(+ 'flex flex-col @xl:flex-row @xl:justify-between @xl:items-center gap-4',+ '[&>[data-slot="page-header-icon"]]:shrink-0',+ '[&>[data-slot="page-header-summary"]]:flex-1',+ className+ )}+ {...props}+ >+ {children}+ </div>+ </PageContainer>+ )+}+PageHeaderMeta.displayName = 'PageHeaderMeta'++// ============================================================================+// Actions+// ============================================================================++export type PageHeaderAsideProps = React.ComponentProps<'div'>++/**+ * Actions component for page header.+ * Container for buttons and other action elements.+ * Should be placed inside PageHeaderMeta.+ */+const PageHeaderAside = ({ className, ...props }: PageHeaderAsideProps) => {+ return (+ <div+ data-slot="page-header-actions"+ className={cn('flex items-center gap-2 shrink-0', className)}+ {...props}+ />+ )+}+PageHeaderAside.displayName = 'PageHeaderAside'++// ============================================================================+// Navigation+// ============================================================================++export type PageHeaderFooterProps = React.ComponentProps<'div'>++/**+ * Navigation component for page header.+ * Container for tab navigation (NavMenu).+ * Should be placed as the last child of PageHeader.+ */+const PageHeaderFooter = ({+ className,+ size = 'default',+ ...props+}: PageHeaderFooterProps & { size?: 'default' | 'small' | 'large' | 'full' }) => {+ return (+ <PageContainer size={size} className={cn(size === 'full' && 'border-b')}>+ <div+ data-slot="page-header-footer"+ className={cn('w-full [&>nav]:border-b-0', size !== 'full' && 'border-b', className)}+ {...props}+ />+ </PageContainer>+ )+}+PageHeaderFooter.displayName = 'PageHeaderFooter'++// ============================================================================+// Exports+// ============================================================================++export type PageHeaderProps = PageHeaderRootProps++/**+ * Page header root component.+ * Use PageHeader, PageHeaderBreadcrumb, PageHeaderMeta, PageHeaderIcon, etc.+ */+export {+ PageHeaderRoot as PageHeader,+ PageHeaderAside,+ PageHeaderBreadcrumb,+ PageHeaderDescription,+ PageHeaderFooter,+ PageHeaderIcon,+ PageHeaderMeta,+ PageHeaderSummary,+ PageHeaderTitle,+}diff --git a/packages/ui-patterns/src/PageSection/index.tsx b/packages/ui-patterns/src/PageSection/index.tsxnew file mode 100644index 00000000000..b13fc7c3829--- /dev/null+++ b/packages/ui-patterns/src/PageSection/index.tsx@@ -0,0 +1,207 @@+import { cva, type VariantProps } from 'class-variance-authority'+import React from 'react'++import { cn } from 'ui'++// ============================================================================+// Variants+// ============================================================================++const pageSectionRootVariants = cva(['pt-12 last:pb-12 gap-6'], {+ variants: {+ orientation: {+ horizontal: 'grid @3xl:grid-cols-[1fr_2fr] @3xl:gap-12',+ vertical: 'flex flex-col',+ },+ },+ defaultVariants: {+ orientation: 'vertical',+ },+})++// ============================================================================+// Root+// ============================================================================++export type PageSectionRootProps = React.ComponentProps<'div'> &+ VariantProps<typeof pageSectionRootVariants>++/**+ * Root component for page section.+ * Provides layout structure for section content with orientation variants.+ * Renders children in order without searching for specific components.+ */+const PageSectionRoot = ({+ className,+ orientation = 'vertical',+ children,+ ...props+}: PageSectionRootProps) => {+ return (+ <div+ data-slot="page-section"+ data-orientation={orientation}+ className={cn(pageSectionRootVariants({ orientation }), className)}+ {...props}+ >+ {children}+ </div>+ )+}++PageSectionRoot.displayName = 'PageSectionRoot'++// ============================================================================+// Summary+// ============================================================================++export type PageSectionSummaryProps = React.ComponentProps<'div'>++/**+ * Summary component to contain title and description.+ * Provides layout structure for text content.+ * Should be placed inside PageSectionMeta.+ */+const PageSectionSummary = ({ className, children, ...props }: PageSectionSummaryProps) => {+ return (+ <div+ data-slot="page-section-summary"+ className={cn('flex flex-col gap-1', className)}+ {...props}+ >+ {children}+ </div>+ )+}+PageSectionSummary.displayName = 'PageSectionSummary'++// ============================================================================+// Title+// ============================================================================++export type PageSectionTitleProps = React.ComponentProps<'h2'>++/**+ * Title component for page section.+ * Primary heading for the section.+ */+const PageSectionTitle = ({ className, children, ...props }: PageSectionTitleProps) => {+ return (+ <h2 data-slot="page-section-title" className={cn('heading-section', className)} {...props}>+ {children}+ </h2>+ )+}+PageSectionTitle.displayName = 'PageSectionTitle'++// ============================================================================+// Description+// ============================================================================++export type PageSectionDescriptionProps = React.ComponentProps<'div'>++/**+ * Description component for page section.+ * Supporting text rendered below the title.+ */+const PageSectionDescription = ({ className, children, ...props }: PageSectionDescriptionProps) => {+ return (+ <div+ data-slot="page-section-description"+ className={cn('text-sm text-foreground-light', className)}+ {...props}+ >+ {children}+ </div>+ )+}+PageSectionDescription.displayName = 'PageSectionDescription'++// ============================================================================+// Aside+// ============================================================================++export type PageSectionAsideProps = React.ComponentProps<'div'>++/**+ * Aside component for page section.+ * Container for buttons and other action elements.+ * Should be placed inside PageSectionMeta.+ */+const PageSectionAside = ({ className, ...props }: PageSectionAsideProps) => {+ return (+ <div+ data-slot="page-section-aside"+ className={cn('flex items-center gap-2', className)}+ {...props}+ />+ )+}+PageSectionAside.displayName = 'PageSectionAside'++// ============================================================================+// Meta+// ============================================================================++export type PageSectionMetaProps = React.ComponentProps<'div'>++/**+ * Meta wrapper for page section.+ * Contains summary and aside components with proper layout.+ * Should be placed as the first child of PageSectionRoot.+ * Uses CSS to style children based on their data-slot attributes.+ */+const PageSectionMeta = ({ className, children, ...props }: PageSectionMetaProps) => {+ return (+ <div className="@container">+ <div+ data-slot="page-section-meta"+ className={cn(+ 'flex flex-col @xl:flex-row @xl:justify-between @xl:items-center gap-4',+ '[&>[data-slot="page-section-summary"]]:flex-1',+ '[&>[data-slot="page-section-aside"]]:shrink-0',+ className+ )}+ {...props}+ >+ {children}+ </div>+ </div>+ )+}+PageSectionMeta.displayName = 'PageSectionMeta'++// ============================================================================+// Content+// ============================================================================++export type PageSectionContentProps = React.ComponentProps<'div'>++/**+ * Content component for page section.+ * Container for the main section content.+ */+const PageSectionContent = ({ className, ...props }: PageSectionContentProps) => {+ return <div data-slot="page-section-content" className={cn(className)} {...props} />+}+PageSectionContent.displayName = 'PageSectionContent'++// ============================================================================+// Exports+// ============================================================================++export type PageSectionProps = PageSectionRootProps++/**+ * Page section root component.+ * Use PageSection, PageSectionMeta, PageSectionSummary, etc.+ */+export {+ PageSectionRoot as PageSection,+ PageSectionAside,+ PageSectionContent,+ PageSectionDescription,+ PageSectionMeta,+ PageSectionSummary,+ PageSectionTitle,+}diff --git a/packages/ui/src/components/shadcn/ui/breadcrumb.tsx b/packages/ui/src/components/shadcn/ui/breadcrumb.tsxindex e76be186190..062b60d3670 100644--- a/packages/ui/src/components/shadcn/ui/breadcrumb.tsx+++ b/packages/ui/src/components/shadcn/ui/breadcrumb.tsx@@ -75,7 +75,7 @@ const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentP<lirole="presentation"aria-hidden="true"- className={cn('[&>svg]:size-3.5', className)}+ className={cn('[&>svg]:size-3.5 text-foreground-muted', className)}{...props}>{children ?? <ChevronRightIcon />}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 8dea0b5cb76..b0c929109ba 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -323,6 +323,9 @@ importers:'@shikijs/compat':specifier: ^1.1.7version: 1.6.0+ '@tailwindcss/container-queries':+ specifier: ^0.1.1'@types/lodash.template':specifier: 4.5.0version: 4.5.0