Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
53 changes: 53 additions & 0 deletions apps/design-system/app/fonts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Source_Code_Pro } from 'next/font/google'
import localFont from 'next/font/local'

export const customFont = localFont({
variable: '--font-custom',
display: 'swap',
fallback: ['Circular', 'custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
src: [
{
path: './CustomFont-Book.woff2',
weight: '400',
style: 'normal',
},
{
path: './CustomFont-BookItalic.woff2',
weight: '400',
style: 'italic',
},
{
path: './CustomFont-Medium.woff2',
weight: '500',
style: 'normal',
},
{
path: './CustomFont-Bold.woff2',
weight: '700',
style: 'normal',
},
{
path: './CustomFont-BoldItalic.woff2',
weight: '700',
style: 'italic',
},
{
path: './CustomFont-Black.woff2',
weight: '800',
style: 'normal',
},
{
path: './CustomFont-BlackItalic.woff2',
weight: '800',
style: 'italic',
},
],
})

export const sourceCodePro = Source_Code_Pro({
subsets: ['latin'],
fallback: ['Source Code Pro', 'Office Code Pro', 'Menlo', 'monospace'],
variable: '--font-source-code-pro',
display: 'swap',
weight: ['400', '500', '600', '700'],
})
17 changes: 12 additions & 5 deletions apps/design-system/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import '@/styles/globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { ThemeProvider } from './Providers'
import { SonnerToaster } from './SonnerToast'
import { customFont, sourceCodePro } from './fonts'

const inter = Inter({ subsets: ['latin'] })
const className = `${customFont.variable} ${sourceCodePro.variable}`

export const metadata: Metadata = {
title: 'Supabase Design System',
Expand All @@ -17,9 +17,16 @@ interface RootLayoutProps {

export default async function Layout({ children }: RootLayoutProps) {
return (
<html lang="en" suppressHydrationWarning>
<head />
<body className={inter.className}>
<html lang="en" suppressHydrationWarning className={className}>
<head>
{/* [Danny]: This has to be an inline style tag here and not a separate component due to next/font */}
<style
dangerouslySetInnerHTML={{
__html: `:root{--font-custom:${customFont.style.fontFamily};--font-source-code-pro:${sourceCodePro.style.fontFamily};}`,
}}
/>
</head>
<body>
<ThemeProvider
themes={['dark', 'light', 'classic-dark']}
defaultTheme="system"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FOREIGN_KEY_CASCADE_ACTION } from 'data/database/database-query-constan
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
import { Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import type { ColumnHeaderProps, ColumnType, DragItem, GridForeignKey } from '../../types'
import { ColumnMenu } from '../menu'
import { ColumnMenu } from '../menu/ColumnMenu'

export function ColumnHeader<R>({
column,
Expand Down
4 changes: 1 addition & 3 deletions apps/studio/components/grid/components/menu/ColumnMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface ColumnMenuProps {
isEncrypted?: boolean
}

const ColumnMenu = ({ column, isEncrypted }: ColumnMenuProps) => {
export const ColumnMenu = ({ column, isEncrypted }: ColumnMenuProps) => {
const tableEditorSnap = useTableEditorStateSnapshot()
const snap = useTableEditorTableStateSnapshot()
const { sorts, addOrUpdateSort, removeSort } = useTableSort()
Expand Down Expand Up @@ -163,5 +163,3 @@ const ColumnMenu = ({ column, isEncrypted }: ColumnMenuProps) => {
</>
)
}

export default ColumnMenu
1 change: 0 additions & 1 deletion apps/studio/components/grid/components/menu/index.ts

This file was deleted.

6 changes: 2 additions & 4 deletions apps/studio/components/interfaces/Account/AuditLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ArrowDown, ArrowUp, RefreshCw } from 'lucide-react'
import { useEffect, useMemo, useState } from 'react'

import { useDebounce } from '@uidotdev/usehooks'
import { LogDetailsPanel } from 'components/interfaces/AuditLogs'
import { LogDetailsPanel } from 'components/interfaces/AuditLogs/LogDetailsPanel'
import Table from 'components/to-be-cleaned/Table'
import AlertError from 'components/ui/AlertError'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
Expand All @@ -17,7 +17,7 @@ import { Button } from 'ui'
import { TimestampInfo } from 'ui-patterns'
import { LogsDatePicker } from '../Settings/Logs/Logs.DatePickers'

const AuditLogs = () => {
export const AuditLogs = () => {
const currentTime = dayjs().utc().set('millisecond', 0)

const [search, setSearch] = useState('')
Expand Down Expand Up @@ -294,5 +294,3 @@ const AuditLogs = () => {
</>
)
}

export default AuditLogs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Github } from 'lucide-react'
import Image from 'next/image'

import Panel from 'components/ui/Panel'
Expand All @@ -8,7 +7,7 @@ import { openInstallGitHubIntegrationWindow } from 'lib/github'
import { Badge, Button, cn } from 'ui'
import ShimmeringLoader from 'ui-patterns/ShimmeringLoader'

const AccountConnections = () => {
export const AccountConnections = () => {
const {
data: gitHubAuthorization,
isLoading,
Expand Down Expand Up @@ -78,5 +77,3 @@ const AccountConnections = () => {
</Panel>
)
}

export { AccountConnections }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } f
import { AddNewFactorModal } from './AddNewFactorModal'
import DeleteFactorModal from './DeleteFactorModal'

const TOTPFactors = () => {
export const TOTPFactors = () => {
const [isAddNewFactorOpen, setIsAddNewFactorOpen] = useState(false)
const [factorToBeDeleted, setFactorToBeDeleted] = useState<string | null>(null)
const { data, isLoading, isError, isSuccess, error } = useMfaListFactorsQuery()
Expand Down Expand Up @@ -88,5 +88,3 @@ const TOTPFactors = () => {
</>
)
}

export default TOTPFactors
2 changes: 0 additions & 2 deletions apps/studio/components/interfaces/Account/index.ts

This file was deleted.

4 changes: 1 addition & 3 deletions apps/studio/components/interfaces/App/AppBannerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import IncidentBanner from 'components/layouts/AppLayout/IncidentBanner'
import { NoticeBanner } from 'components/layouts/AppLayout/NoticeBanner'
import { OrganizationResourceBanner } from '../Organization/HeaderBanner'

const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
export const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
const ongoingIncident = useFlag('ongoingIncident')
const showNoticeBanner = useFlag('showNoticeBanner')
const clockSkewBanner = useFlag('clockSkewBanner')
Expand All @@ -23,5 +23,3 @@ const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
</div>
)
}

export default AppBannerWrapper
6 changes: 2 additions & 4 deletions apps/studio/components/interfaces/App/CommandMenu/Support.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { LifeBuoy, Activity } from 'lucide-react'
import { Activity, LifeBuoy } from 'lucide-react'
import { useMemo } from 'react'

import { IS_PLATFORM } from 'common'
import type { ICommand } from 'ui-patterns/CommandMenu'
import { useRegisterCommands } from 'ui-patterns/CommandMenu'
import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils'

const useSupportCommands = () => {
export const useSupportCommands = () => {
const commands = useMemo(
() =>
[
Expand Down Expand Up @@ -37,5 +37,3 @@ const useSupportCommands = () => {

useRegisterCommands(COMMAND_MENU_SECTIONS.SUPPORT, commands, { enabled: IS_PLATFORM })
}

export { useSupportCommands }
4 changes: 1 addition & 3 deletions apps/studio/components/interfaces/App/CommandMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { useCommandMenuInitiated } from 'ui-patterns/CommandMenu'

const LazyCommandMenu = dynamic(() => import('./CommandMenu'), { ssr: false })

const StudioCommandMenu = () => {
export const StudioCommandMenu = () => {
const isInitiated = useCommandMenuInitiated()
return isInitiated && <LazyCommandMenu />
}

export { StudioCommandMenu }
2 changes: 0 additions & 2 deletions apps/studio/components/interfaces/App/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface LogDetailsPanelProps {
onClose: () => void
}

const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps) => {
export const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps) => {
return (
<SidePanel
size="large"
Expand Down Expand Up @@ -82,5 +82,3 @@ const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps) => {
</SidePanel>
)
}

export default LogDetailsPanel
1 change: 0 additions & 1 deletion apps/studio/components/interfaces/AuditLogs/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface PolicyNameProps {
onUpdatePolicyName: (name: string) => void
}

const PolicyName = ({ name = '', limit = 100, onUpdatePolicyName }: PolicyNameProps) => {
export const PolicyName = ({ name = '', limit = 100, onUpdatePolicyName }: PolicyNameProps) => {
return (
<div className="flex flex-col md:flex-row gap-4 md:gap-12">
<div className="flex md:w-1/3 flex-col space-y-2">
Expand All @@ -30,5 +30,3 @@ const PolicyName = ({ name = '', limit = 100, onUpdatePolicyName }: PolicyNamePr
</div>
)
}

export default PolicyName
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface PolicyRolesProps {
}
type SystemRole = (typeof SYSTEM_ROLES)[number]

const PolicyRoles = ({ selectedRoles, onUpdateSelectedRoles }: PolicyRolesProps) => {
export const PolicyRoles = ({ selectedRoles, onUpdateSelectedRoles }: PolicyRolesProps) => {
const { data: project } = useSelectedProjectQuery()
const { data, error, isLoading, isError, isSuccess } = useDatabaseRolesQuery({
projectRef: project?.ref,
Expand Down Expand Up @@ -57,5 +57,3 @@ const PolicyRoles = ({ selectedRoles, onUpdateSelectedRoles }: PolicyRolesProps)
</div>
)
}

export default PolicyRoles
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { Modal } from 'ui'
import PolicyAllowedOperation from './PolicyAllowedOperation'
import PolicyDefinition from './PolicyDefinition'
import PolicyEditorFooter from './PolicyEditorFooter'
import PolicyName from './PolicyName'
import PolicyRoles from './PolicyRoles'

// Exposed for StoragePoliciesEditor.js
export { PolicyName, PolicyRoles }
import { PolicyName } from './PolicyName'
import { PolicyRoles } from './PolicyRoles'

interface PolicyEditorProps {
isNewPolicy: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@
*
* If Elements is on a higher level, we risk losing all form state in case a payment fails.
*/

import { zodResolver } from '@hookform/resolvers/zod'
import { AddressElement, PaymentElement, useElements, useStripe } from '@stripe/react-stripe-js'
import type { PaymentMethod } from '@stripe/stripe-js'
import {
StripeAddressElementChangeEvent,
StripeAddressElementOptions,
type SetupIntent,
} from '@stripe/stripe-js'
import { Check, ChevronsUpDown } from 'lucide-react'
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from 'react'
import { useForm } from 'react-hook-form'
import { toast } from 'sonner'
import { z } from 'zod'

import { Form } from '@ui/components/shadcn/ui/form'
import { TAX_IDS } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/TaxID.constants'
import type { CustomerAddress, CustomerTaxId } from 'data/organizations/types'
import { getURL } from 'lib/helpers'
import {
Button,
Checkbox_Shadcn_,
Expand All @@ -31,19 +40,7 @@ import {
PopoverContent_Shadcn_ as PopoverContent,
PopoverTrigger_Shadcn_ as PopoverTrigger,
} from 'ui'
import {
TAX_IDS,
type TaxId,
} from '../../../Organization/BillingSettings/BillingCustomerData/TaxID.constants'
import { z } from 'zod'
import { useForm } from 'react-hook-form'
import { Form } from '@ui/components/shadcn/ui/form'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { Check, ChevronsUpDown } from 'lucide-react'
import { zodResolver } from '@hookform/resolvers/zod'
import { getURL } from 'lib/helpers'
import type { CustomerAddress, CustomerTaxId } from 'data/organizations/types'
import type { PaymentMethod } from '@stripe/stripe-js'

export const BillingCustomerDataSchema = z.object({
tax_id_type: z.string(),
Expand Down Expand Up @@ -76,7 +73,7 @@ export type PaymentMethodElementRef = {
>
}

const NewPaymentMethodElement = forwardRef(
export const NewPaymentMethodElement = forwardRef(
(
{
email,
Expand Down Expand Up @@ -367,5 +364,3 @@ const NewPaymentMethodElement = forwardRef(
)

NewPaymentMethodElement.displayName = 'NewPaymentMethodElement'

export { NewPaymentMethodElement }
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface CPUWarningsProps {
severity?: 'warning' | 'critical' | null
}

const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) => {
export const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) => {
if (severity === 'warning') {
return (
<Alert_Shadcn_ variant="warning">
Expand Down Expand Up @@ -62,5 +62,3 @@ const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) =>

return null
}

export default CPUWarnings
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface DiskIOBandwidthWarningsProps {
highestIoBudgetConsumption: number
}

const DiskIOBandwidthWarnings = ({
export const DiskIOBandwidthWarnings = ({
isFreePlan,
hasLatest,
currentBillingCycleSelected,
Expand Down Expand Up @@ -116,5 +116,3 @@ const DiskIOBandwidthWarnings = ({

return null
}

export default DiskIOBandwidthWarnings
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface RAMWarningsProps {
severity?: 'warning' | 'critical' | null
}

const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) => {
export const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) => {
if (severity === 'warning') {
return (
<Alert_Shadcn_ variant="warning">
Expand Down Expand Up @@ -62,5 +62,3 @@ const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) =>

return null
}

export default RAMWarnings

This file was deleted.

Loading
Loading