Skip to content

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

menu pref (#29297)

Terry Sutton32b9cbf3c1c5
diff --git a/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx b/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
index e90964a05fd..2e2c83bf341 100644
--- a/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
@@ -1,5 +1,6 @@
import Panel from 'components/ui/Panel'
-import { BASE_PATH } from 'lib/constants'
+import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
+import { BASE_PATH, LOCAL_STORAGE_KEYS } from 'lib/constants'
import { useTheme } from 'next-themes'
import { useEffect, useState } from 'react'
import SVG from 'react-inlinesvg'
@@ -7,14 +8,24 @@ import {
Label_Shadcn_,
RadioGroup_Shadcn_,
RadioGroupLargeItem_Shadcn_,
+ Separator,
singleThemes,
+ Switch,
Theme,
} from 'ui'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
const ThemeSettings = () => {
const [mounted, setMounted] = useState(false)
const { theme, setTheme } = useTheme()
+ const [allowNavPanelToExpand, setAllowNavPanelToExpand] = useLocalStorageQuery(
+ LOCAL_STORAGE_KEYS.EXPAND_NAVIGATION_PANEL,
+ true
+ )
+
+ const [expandNavigationPanel, setExpandNavigationPanel] = useState(allowNavPanelToExpand)
+
/**
* Avoid Hydration Mismatch
* https://github.com/pacocoursey/next-themes?tab=readme-ov-file#avoid-hydration-mismatch
@@ -37,10 +48,15 @@ const ThemeSettings = () => {
aria-label="Choose a theme"
defaultValue={theme}
value={theme}
- className="flex flex-wrap gap-3"
+ className="flex flex-wrap gap-5"
>
{singleThemes.map((theme: Theme) => (
- <RadioGroupLargeItem_Shadcn_ key={theme.value} value={theme.value} label={theme.name}>
+ <RadioGroupLargeItem_Shadcn_
+ className="grow p-3"
+ key={theme.value}
+ value={theme.value}
+ label={theme.name}
+ >
<SVG src={`${BASE_PATH}/img/themes/${theme.value}.svg?v=2`} />
</RadioGroupLargeItem_Shadcn_>
))}
@@ -49,22 +65,45 @@ const ThemeSettings = () => {
)
}
+ function handleExpandNavigationPanel() {
+ setExpandNavigationPanel(!expandNavigationPanel)
+ setAllowNavPanelToExpand(!allowNavPanelToExpand)
+ }
+
return (
<Panel title={<h5 key="panel-title">Appearance</h5>}>
- <Panel.Content className="grid grid-cols-12">
- <div className="col-span-4 flex flex-col gap-5">
- <Label_Shadcn_ htmlFor="theme" className="text-light">
- Theme mode
- </Label_Shadcn_>
- <p className="text-sm text-foreground-light max-w-[220px]">
- Choose how Supabase looks to you. Select a single theme, or sync with your system.
- </p>
- </div>
+ <Panel.Content className="grid gap-8">
+ <div className="grid grid-cols-12">
+ <div className="col-span-4 flex flex-col gap-5">
+ <Label_Shadcn_ htmlFor="theme" className="text-light">
+ Theme mode
+ </Label_Shadcn_>
+ <p className="text-sm text-foreground-light max-w-[220px]">
+ Choose how Supabase looks to you. Select a single theme, or sync with your system.
+ </p>
+ </div>
- <div className="col-span-8 flex flex-col gap-4">
- <p className="text-sm text-light">Supabase will use your selected theme</p>
- <SingleThemeSelection />
+ <div className="col-span-8 flex flex-col gap-4">
+ <p className="text-sm text-light">Supabase will use your selected theme</p>
+ <SingleThemeSelection />
+ </div>
</div>
+
+ <Separator />
+
+ <FormItemLayout
+ isReactForm={false}
+ label="Expand Navigation menu"
+ layout="flex-row-reverse"
+ description="Allow the Navigation panel to expand on hover"
+ className="pb-3"
+ >
+ <Switch
+ size="large"
+ checked={expandNavigationPanel}
+ onCheckedChange={() => handleExpandNavigationPanel()}
+ />
+ </FormItemLayout>
</Panel.Content>
</Panel>
)
diff --git a/apps/studio/components/interfaces/Account/Preferences/ThemeSettingsWithPreferredTheme.tsx b/apps/studio/components/interfaces/Account/Preferences/ThemeSettingsWithPreferredTheme.tsx
deleted file mode 100644
index 995dd12025a..00000000000
--- a/apps/studio/components/interfaces/Account/Preferences/ThemeSettingsWithPreferredTheme.tsx
+++ /dev/null
@@ -1,192 +0,0 @@
-import Panel from 'components/ui/Panel'
-import { BASE_PATH } from 'lib/constants'
-import { useTheme } from 'next-themes'
-import { useEffect, useState } from 'react'
-import SVG from 'react-inlinesvg'
-import {
- Label_Shadcn_,
- RadioGroupLargeItem_Shadcn_,
- RadioGroup_Shadcn_,
- SelectContent_Shadcn_,
- SelectItem_Shadcn_,
- SelectTrigger_Shadcn_,
- SelectValue_Shadcn_,
- Select_Shadcn_,
- Theme,
- prefixedThemes,
- singleThemes,
-} from 'ui'
-
-const ThemeSettings = () => {
- const [mounted, setMounted] = useState(false)
-
- // @ts-expect-error // remove this ts error if you use this file
- const { theme, setTheme, setSystemPrefixResolve, themePrefix } = useTheme()
- const [mode, setMode] = useState<'system' | 'single-theme'>(
- theme === 'system' ? 'system' : 'single-theme'
- )
- const [prefixedTheme, setPrefixedThemeState] = useState(themePrefix === '' ? 'dark' : themePrefix)
-
- /**
- * Avoid Hydration Mismatch
- * https://github.com/pacocoursey/next-themes?tab=readme-ov-file#avoid-hydration-mismatch
- */
- // useEffect only runs on the client, so now we can safely show the UI
- useEffect(() => {
- setMounted(true)
- }, [])
-
- if (!mounted) {
- return null
- }
-
- function SingleThemeSelection() {
- return (
- <form>
- <RadioGroup_Shadcn_
- onValueChange={setTheme}
- aria-label="Choose a theme"
- defaultValue={theme}
- value={theme}
- className="flex flex-wrap gap-3"
- >
- {singleThemes
- .filter((x) => x.value !== 'system')
- .map((theme: Theme) => (
- <RadioGroupLargeItem_Shadcn_ key={theme.value} value={theme.value} label={theme.name}>
- <SVG src={`${BASE_PATH}/img/themes/${theme.value}.svg`} />
- </RadioGroupLargeItem_Shadcn_>
- ))}
- </RadioGroup_Shadcn_>
- </form>
- )
- }
-
- function PrefixThemeSelection() {
- return (
- <form>
- <RadioGroup_Shadcn_
- onValueChange={(value) => {
- setSystemPrefixResolve(value)
- setPrefixedThemeState(value === '' ? 'dark' : value)
- }}
- aria-label="Choose a preferred dark mode"
- defaultValue={prefixedTheme}
- value={prefixedTheme}
- className="flex flex-wrap gap-3"
- >
- <RadioGroupLargeItem_Shadcn_ key={'dark'} value={'dark'} label={'Dark'}>
- <SVG src={`${BASE_PATH}/img/themes/dark.svg`} />
- </RadioGroupLargeItem_Shadcn_>
- {prefixedThemes.map((prefix: Theme) => (
- <RadioGroupLargeItem_Shadcn_
- key={prefix.value}
- value={prefix.value}
- label={prefix.name}
- >
- <SVG src={`${BASE_PATH}/img/themes/${prefix.value}-dark.svg`} />
- </RadioGroupLargeItem_Shadcn_>
- ))}
- </RadioGroup_Shadcn_>
- </form>
- )
- }
-
- {
- mode === 'system' && (
- <Select_Shadcn_
- onValueChange={(value: string) => {
- setSystemPrefixResolve(value)
- setPrefixedThemeState(value === '' ? 'dark' : value)
- }}
- name="theme-mode"
- value={prefixedTheme}
- >
- <SelectTrigger_Shadcn_ className="w-32">
- <SelectValue_Shadcn_ placeholder="Choose a prefix">{prefixedTheme}</SelectValue_Shadcn_>
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_>
- <SelectItem_Shadcn_ key={'dark'} value={'dark'}>
- dark
- </SelectItem_Shadcn_>
- {prefixedThemes.map((prefix: Theme) => (
- <SelectItem_Shadcn_ key={prefix.value} value={prefix.value}>
- {prefix.name}
- </SelectItem_Shadcn_>
- ))}
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- )
- }
-
- const themeModes = {
- 'single-theme': {
- value: 'single-theme',
- label: 'Single theme',
- },
- system: {
- value: 'system',
- label: 'Sync with system',
- },
- }
-
- return (
- <Panel title={<h5 key="panel-title">Appearance</h5>}>
- <Panel.Content className="grid grid-cols-12">
- <div className="col-span-4 flex flex-col gap-5">
- <Label_Shadcn_ htmlFor="theme-mode" className="text-light">
- Theme mode
- </Label_Shadcn_>
- <p className="text-sm text-foreground-light max-w-[220px]">
- Choose how Supabase looks to you. Select a single theme, or sync with your system.
- </p>
- </div>
-
- <div className="col-span-8 flex flex-col gap-4">
- <Select_Shadcn_
- onValueChange={(value: 'system' | 'single-theme') => {
- setMode(value)
- if (value === 'system') {
- setTheme('system')
- } else {
- setTheme('dark')
- // reset prefix
- setSystemPrefixResolve('')
- }
- }}
- value={mode}
- name="theme-mode"
- >
- <SelectTrigger_Shadcn_ className="w-40">
- <SelectValue_Shadcn_ placeholder="Choose a mode">
- {themeModes[mode].label}
- </SelectValue_Shadcn_>
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_>
- <SelectItem_Shadcn_ key={'single-theme'} value={'single-theme'}>
- Single theme
- </SelectItem_Shadcn_>
- <SelectItem_Shadcn_ key={'system'} value={'system'}>
- Sync with system
- </SelectItem_Shadcn_>
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- {mode === 'single-theme' && (
- <>
- <p className="text-sm text-light">Supabase will use your selected theme</p>
- <SingleThemeSelection />
- </>
- )}
- {mode === 'system' && (
- <>
- <p className="text-sm text-light">Choose your preferred dark mode</p>
- <PrefixThemeSelection />
- </>
- )}
- </div>
- </Panel.Content>
- </Panel>
- )
-}
-
-export default ThemeSettings
diff --git a/apps/studio/components/interfaces/Account/Preferences/index.ts b/apps/studio/components/interfaces/Account/Preferences/index.ts
index 73078697650..c1d48f60d42 100644
--- a/apps/studio/components/interfaces/Account/Preferences/index.ts
+++ b/apps/studio/components/interfaces/Account/Preferences/index.ts
@@ -2,4 +2,3 @@ export { default as AccountInformation } from './AccountInformation'
export { default as AnalyticsSettings } from './AnalyticsSettings'
export { default as ThemeSettingsOld } from './ThemeSettingsOld'
export { default as ThemeSettings } from './ThemeSettings'
-export { default as ThemeSettingsWithPreferredTheme } from './ThemeSettingsWithPreferredTheme'
diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
index e85cc8f667c..645e52260ef 100644
--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
@@ -11,7 +11,7 @@ import { useIsAPIDocsSidePanelEnabled } from 'components/interfaces/App/FeatureP
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useFlag } from 'hooks/ui/useFlag'
import { useSignOut } from 'lib/auth'
-import { IS_PLATFORM } from 'lib/constants'
+import { IS_PLATFORM, LOCAL_STORAGE_KEYS } from 'lib/constants'
import { detectOS } from 'lib/helpers'
import { useProfile } from 'lib/profile'
import { useAppStateSnapshot } from 'state/app-state'
@@ -42,6 +42,8 @@ import {
import { NavigationIconButton } from './NavigationIconButton'
import NavigationIconLink from './NavigationIconLink'
import { useProjectLintsQuery } from 'data/lint/lint-query'
+import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
+import { Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
export const ICON_SIZE = 20
export const ICON_STROKE_WIDTH = 1.5
@@ -62,6 +64,11 @@ const NavigationBar = () => {
const isNewAPIDocsEnabled = useIsAPIDocsSidePanelEnabled()
const [userDropdownOpen, setUserDropdownOpenState] = useState(false)
+ const [allowNavPanelToExpand] = useLocalStorageQuery(
+ LOCAL_STORAGE_KEYS.EXPAND_NAVIGATION_PANEL,
+ true
+ )
+
const {
projectAuthAll: authEnabled,
projectEdgeFunctionAll: edgeFunctionsEnabled,
@@ -101,6 +108,79 @@ const NavigationBar = () => {
)
}
+ const SearchButton = (
+ <NavigationIconButton
+ size="tiny"
+ onClick={() => {
+ setCommandMenuOpen(true)
+ snap.setNavigationPanelOpen(false)
+ }}
+ type="text"
+ icon={<Search size={ICON_SIZE} strokeWidth={ICON_STROKE_WIDTH} />}
+ rightText={
+ <div
+ className={cn(
+ 'flex items-center gap-1',
+ 'h-6 py-1.5 px-2 leading-none',
+ 'bg-surface-100 text-foreground-lighter',
+ 'border border-default rounded-md',
+ 'shadow-xs shadow-background-surface-100'
+ )}
+ >
+ {os === 'macos' || true ? ( // todo: issue with `os` and hydration fail
+ <Command size={11.5} strokeWidth={1.5} />
+ ) : (
+ <p className="text-xs">CTRL</p>
+ )}
+ <p className="text-xs">K</p>
+ </div>
+ }
+ >
+ Search
+ </NavigationIconButton>
+ )
+
+ const UserAccountButton = (
+ <Button
+ type="text"
+ size="tiny"
+ className={cn(
+ 'mt-3 h-10 [&>span]:relative [&>span]:flex [&>span]:w-full [&>span]:h-full p-0'
+ )}
+ block
+ >
+ <div className="relative w-full h-full flex items-center justify-center">
+ <figure className="absolute left-1.5 min-h-6 min-w-6 bg-foreground rounded-full flex items-center justify-center">
+ <User size={ICON_SIZE - 2} strokeWidth={ICON_STROKE_WIDTH} className="text-background" />
+ </figure>
+ <span
+ className={cn(
+ 'w-[8rem] flex flex-col items-start text-sm truncate',
+ 'absolute left-7 group-data-[state=expanded]:left-10',
+ 'group-data-[state=collapsed]:opacity-0 group-data-[state=expanded]:opacity-100',
+ 'transition-all'
+ )}
+ >
+ {profile && IS_PLATFORM && (
+ <>
+ <span title={profile.username} className="w-full text-left text-foreground truncate">
+ {profile.username}
+ </span>
+ {profile.primary_email !== profile.username && (
+ <span
+ title={profile.primary_email}
+ className="w-full text-left text-foreground-light text-xs truncate"
+ >
+ {profile.primary_email}
+ </span>
+ )}
+ </>
+ )}
+ </span>
+ </div>
+ </Button>
+ )
+
return (
<div className="w-14 h-full flex flex-col">
<nav
@@ -111,9 +191,9 @@ const NavigationBar = () => {
'transition-width duration-200',
'hide-scrollbar flex flex-col justify-between overflow-y-auto'
)}
- onMouseEnter={() => snap.setNavigationPanelOpen(true)}
+ onMouseEnter={() => allowNavPanelToExpand && snap.setNavigationPanelOpen(true)}
onMouseLeave={() => {
- if (!userDropdownOpen) snap.setNavigationPanelOpen(false)
+ if (!userDropdownOpen && allowNavPanelToExpand) snap.setNavigationPanelOpen(false)
}}
>
<ul className="flex flex-col gap-y-1 justify-start px-2 relative">
@@ -229,35 +309,17 @@ const NavigationBar = () => {
))}
{IS_PLATFORM && (
- <NavigationIconButton
- size="tiny"
- onClick={() => {
- setCommandMenuOpen(true)
- snap.setNavigationPanelOpen(false)
- }}
- type="text"
- icon={<Search size={ICON_SIZE} strokeWidth={ICON_STROKE_WIDTH} />}
- rightText={
- <div
- className={cn(
- 'flex items-center gap-1',
- 'h-6 py-1.5 px-2 leading-none',
- 'bg-surface-100 text-foreground-lighter',
- 'border border-default rounded-md',
- 'shadow-xs shadow-background-surface-100'
- )}
- >
- {os === 'macos' || true ? ( // todo: issue with `os` and hydration fail
- <Command size={11.5} strokeWidth={1.5} />
- ) : (
- <p className="text-xs">CTRL</p>
- )}
- <p className="text-xs">K</p>
- </div>
- }
- >
- Search
- </NavigationIconButton>
+ <>
+ {!allowNavPanelToExpand && (
+ <Tooltip_Shadcn_>
+ <TooltipTrigger_Shadcn_ asChild>{SearchButton}</TooltipTrigger_Shadcn_>
+ <TooltipContent_Shadcn_ side="right">
+ <span>Search</span>
+ </TooltipContent_Shadcn_>
+ </Tooltip_Shadcn_>
+ )}
+ {allowNavPanelToExpand && SearchButton}
+ </>
)}
<DropdownMenu
@@ -267,53 +329,19 @@ const NavigationBar = () => {
if (open === false) snap.setNavigationPanelOpen(false)
}}
>
- <DropdownMenuTrigger asChild>
- <Button
- type="text"
- size="tiny"
- className={cn(
- 'mt-3 h-10 [&>span]:relative [&>span]:flex [&>span]:w-full [&>span]:h-full p-0'
- )}
- block
- >
- <div className="relative w-full h-full flex items-center justify-center">
- <figure className="absolute left-1.5 min-h-6 min-w-6 bg-foreground rounded-full flex items-center justify-center">
- <User
- size={ICON_SIZE - 2}
- strokeWidth={ICON_STROKE_WIDTH}
- className="text-background"
- />
- </figure>
- <span
- className={cn(
- 'w-[8rem] flex flex-col items-start text-sm truncate',
- 'absolute left-7 group-data-[state=expanded]:left-10',
- 'group-data-[state=collapsed]:opacity-0 group-data-[state=expanded]:opacity-100',
- 'transition-all'
- )}
- >
- {profile && IS_PLATFORM && (
- <>
- <span
- title={profile.username}
- className="w-full text-left text-foreground truncate"
- >
- {profile.username}
- </span>
- {profile.primary_email !== profile.username && (
- <span
- title={profile.primary_email}
- className="w-full text-left text-foreground-light text-xs truncate"
- >
- {profile.primary_email}
- </span>
- )}
- </>
- )}
- </span>
- </div>
- </Button>
- </DropdownMenuTrigger>
+ {allowNavPanelToExpand ? (
+ <DropdownMenuTrigger asChild>{UserAccountButton}</DropdownMenuTrigger>
+ ) : (
+ <Tooltip_Shadcn_>
+ <TooltipTrigger_Shadcn_ asChild>
+ <DropdownMenuTrigger asChild>{UserAccountButton}</DropdownMenuTrigger>
+ </TooltipTrigger_Shadcn_>
+ <TooltipContent_Shadcn_ side="right">
+ <span>Account settings</span>
+ </TooltipContent_Shadcn_>
+ </Tooltip_Shadcn_>
+ )}
+
<DropdownMenuContent side="top" align="start">
{IS_PLATFORM && (
<>
diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx
index 4c09b668d46..ca8b6143169 100644
--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx
@@ -2,9 +2,12 @@ import { noop } from 'lodash'
import Link from 'next/link'
import { AnchorHTMLAttributes, forwardRef } from 'react'
import { cn } from 'ui'
+import { Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
import type { Route } from 'components/ui/ui.types'
import { useAppStateSnapshot } from 'state/app-state'
+import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
+import { LOCAL_STORAGE_KEYS } from 'lib/constants'
interface NavigationIconButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
route: Route
@@ -15,6 +18,10 @@ const NavigationIconLink = forwardRef<HTMLAnchorElement, NavigationIconButtonPro
({ route, isActive = false, onClick = noop, ...props }, ref) => {
const snap = useAppStateSnapshot()
+ const [allowNavPanelToExpand] = useLocalStorageQuery(
+ LOCAL_STORAGE_KEYS.EXPAND_NAVIGATION_PANEL,
+ true
+ )
const iconClasses = [
'absolute left-0 top-0 flex rounded items-center h-10 w-10 items-center justify-center text-foreground-lighter', // Layout
'group-hover/item:text-foreground-light',
@@ -34,14 +41,19 @@ const NavigationIconLink = forwardRef<HTMLAnchorElement, NavigationIconButtonPro
`${isActive && '!bg-selection shadow-sm'}`,
]
- return route.link !== undefined ? (
+ const linkContent = (
<Link
role="button"
aria-current={isActive}
ref={ref}
- href={route.link!}
+ href={route.link || '#'} // Provide a fallback href
{...props}
- onClick={onClick}
+ onClick={(e) => {
+ if (!route.link) {
+ e.preventDefault() // Prevent navigation if there's no link
+ }
+ onClick(e)
+ }}
className={cn(classes, props.className)}
>
<span id="icon-link" className={cn(...iconClasses)} {...props}>
@@ -62,9 +74,20 @@ const NavigationIconLink = forwardRef<HTMLAnchorElement, NavigationIconButtonPro
{route.label}
</span>
</Link>
- ) : (
- <span ref={ref} {...props}></span>
)
+
+ if (!allowNavPanelToExpand) {
+ return (
+ <Tooltip_Shadcn_>
+ <TooltipTrigger_Shadcn_ asChild>{linkContent}</TooltipTrigger_Shadcn_>
+ <TooltipContent_Shadcn_ side="right">
+ <span>{route.label}</span>
+ </TooltipContent_Shadcn_>
+ </Tooltip_Shadcn_>
+ )
+ }
+
+ return linkContent
}
)
diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts
index 99f2b23f766..d8e17d86dde 100644
--- a/apps/studio/lib/constants/index.ts
+++ b/apps/studio/lib/constants/index.ts
@@ -68,6 +68,8 @@ export const LOCAL_STORAGE_KEYS = {
// Track position of nodes for schema visualizer
SCHEMA_VISUALIZER_POSITIONS: (ref: string, schemaId: number) =>
`schema-visualizer-positions-${ref}-${schemaId}`,
+ // Used for allowing the main nav panel to expand on hover
+ EXPAND_NAVIGATION_PANEL: 'supabase-expand-navigation-panel',
GITHUB_AUTHORIZATION_STATE: 'supabase-github-authorization-state',
}
diff --git a/apps/studio/public/img/themes/system.svg b/apps/studio/public/img/themes/system.svg
index 386cd717702..f83e7b128e5 100644
--- a/apps/studio/public/img/themes/system.svg
+++ b/apps/studio/public/img/themes/system.svg
@@ -1,4 +1,4 @@
-<svg width="163" height="88" viewBox="0 0 163 88" fill="none" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 163 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_742_69895)">
<rect x="0.742188" width="161.5" height="88" rx="6" fill="#1C1C1C"/>
<mask id="path-3-inside-1_742_69895" fill="white">
diff --git a/packages/ui-patterns/form/Layout/FormLayout.tsx b/packages/ui-patterns/form/Layout/FormLayout.tsx
index 412dfd01fb2..8c57754db4c 100644
--- a/packages/ui-patterns/form/Layout/FormLayout.tsx
+++ b/packages/ui-patterns/form/Layout/FormLayout.tsx
@@ -16,7 +16,7 @@ type Props = {
error?: string | React.ReactNode
label?: string | React.ReactNode
labelOptional?: string | React.ReactNode
- layout?: 'horizontal' | 'vertical' | 'flex'
+ layout?: 'horizontal' | 'vertical' | 'flex' | 'flex-row-reverse'
size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge'
beforeLabel?: string | React.ReactNode
afterLabel?: string | React.ReactNode
@@ -45,6 +45,7 @@ const ContainerVariants = cva('relative grid gap-2', {
horizontal: 'grid grid-cols-12',
vertical: 'flex flex-col gap-3',
flex: 'flex flex-row gap-3',
+ 'flex-row-reverse': 'flex flex-row gap-3 flex-row-reverse justify-between',
},
flex: {
true: '',
@@ -57,6 +58,11 @@ const ContainerVariants = cva('relative grid gap-2', {
align: 'right',
className: 'justify-between',
},
+ {
+ layout: 'flex-row-reverse',
+ align: 'right',
+ className: 'justify-between',
+ },
],
defaultVariants: {},
})
@@ -75,6 +81,7 @@ const LabelContainerVariants = cva('transition-all duration-500 ease-in-out', {
horizontal: 'flex flex-col gap-2 col-span-4',
vertical: 'flex flex-row gap-2 justify-between',
flex: 'flex flex-col gap-0',
+ 'flex-row-reverse': 'flex flex-col gap-2',
},
labelLayout: {
horizontal: '',
@@ -122,6 +129,7 @@ const DataContainerVariants = cva('transition-all duration-500 ease-in-out', {
horizontal: '',
vertical: '',
flex: '',
+ 'flex-row-reverse': '',
},
},
compoundVariants: [
@@ -162,6 +170,7 @@ const DescriptionVariants = cva('text-foreground-lighter leading-normal', {
vertical: 'mt-2',
horizontal: 'mt-2',
flex: '',
+ 'flex-row-reverse': '',
},
},
defaultVariants: {},
@@ -232,6 +241,7 @@ const NonBoxInputContainer = cva('', {
layout: {
vertical: '',
horizontal: '',
+ 'flex-row-reverse': '',
},
},
compoundVariants: [
@@ -276,7 +286,7 @@ export const FormLayout = React.forwardRef<
},
ref
) => {
- const flex = layout === 'flex'
+ const flex = layout === 'flex' || layout === 'flex-row-reverse'
const hasLabel = Boolean(label || beforeLabel || afterLabel)
const renderError = isReactForm && !hideMessage && (
<motion.div