Skip to content

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

chore: migrate `Input` usages to Shadcn component in various screens/components (#45604)

Gildas Garcia678aec38455f
diff --git a/apps/studio/components/grid/components/header/RefreshButton.tsx b/apps/studio/components/grid/components/header/RefreshButton.tsx
index cbfbe5c56b6..154360b15d0 100644
--- a/apps/studio/components/grid/components/header/RefreshButton.tsx
+++ b/apps/studio/components/grid/components/header/RefreshButton.tsx
@@ -36,7 +36,7 @@ export const RefreshButton = ({ tableId, isRefetching }: RefreshButtonProps) =>
loading={isRefetching}
icon={<RefreshCw />}
onClick={() => onClick()}
- className="w-7 h-7 p-0"
+ className="w-7 p-0"
/>
</Shortcut>
)
diff --git a/apps/studio/components/grid/components/header/filter/FilterRow.tsx b/apps/studio/components/grid/components/header/filter/FilterRow.tsx
index daf8ac174bb..e19a0dc2b77 100644
--- a/apps/studio/components/grid/components/header/filter/FilterRow.tsx
+++ b/apps/studio/components/grid/components/header/filter/FilterRow.tsx
@@ -1,6 +1,6 @@
import { ChevronDown, X } from 'lucide-react'
import { KeyboardEvent, memo } from 'react'
-import { Button, Input } from 'ui'
+import { Button, Input_Shadcn_ as Input } from 'ui'
import { FilterOperatorOptions } from './Filter.constants'
import { DropdownControl } from '@/components/grid/components/common/DropdownControl'
@@ -74,7 +74,7 @@ const FilterRow = ({ filter, filterIdx, onChange, onDelete, onKeyDown }: FilterR
</DropdownControl>
<Input
size="tiny"
- className="w-full"
+ className="bg-control w-full"
placeholder={placeholder}
value={filter.value}
onChange={(event) =>
diff --git a/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx b/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
index f9d6e06f927..2309ff0d0fd 100644
--- a/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
+++ b/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
@@ -4,7 +4,8 @@ import { LOCAL_STORAGE_KEYS } from 'common'
import { useEffect, useState } from 'react'
import { useForm, type SubmitHandler } from 'react-hook-form'
import { toast } from 'sonner'
-import { Form, FormControl, FormField, Input, Input_Shadcn_ } from 'ui'
+import { Form, FormControl, FormField, Input_Shadcn_ } from 'ui'
+import { Input } from 'ui-patterns/DataInputs/Input'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
@@ -225,14 +226,12 @@ const SecondStep = ({
<InformationBox
title="Unable to scan?"
description={
- <Input
- copy
- disabled
- id="ref"
- size="small"
+ <FormItemLayout
+ isReactForm={false}
label="You can also enter this secret key into your authenticator app"
- value={factor.totp.secret}
- />
+ >
+ <Input copy disabled id="ref" size="small" value={factor.totp.secret} />
+ </FormItemLayout>
}
/>
diff --git a/apps/studio/components/interfaces/Advisors/CreateRuleSheet.tsx b/apps/studio/components/interfaces/Advisors/CreateRuleSheet.tsx
index 6bb51d8e476..0eca4194689 100644
--- a/apps/studio/components/interfaces/Advisors/CreateRuleSheet.tsx
+++ b/apps/studio/components/interfaces/Advisors/CreateRuleSheet.tsx
@@ -1,7 +1,6 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { useParams } from 'common'
import { useRouter } from 'next/router'
-// import { useQueryState } from 'nuqs'
import { useEffect } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
import { toast } from 'sonner'
@@ -10,7 +9,6 @@ import {
Form,
FormControl,
FormField,
- Input,
Select_Shadcn_,
SelectContent_Shadcn_,
SelectItem_Shadcn_,
@@ -24,6 +22,7 @@ import {
SheetSection,
SheetTitle,
Switch,
+ TextArea_Shadcn_ as TextArea,
Tooltip,
TooltipContent,
TooltipTrigger,
@@ -221,9 +220,10 @@ export const CreateRuleSheet = ({ lint, open, onOpenChange }: CreateRuleSheetPro
labelOptional="Optional"
>
<FormControl>
- <Input.TextArea
+ <TextArea
{...field}
- className="[&>div>div>div>textarea]:text-sm"
+ rows={4}
+ className="text-sm"
placeholder="e.g Describe why this rule is being set"
/>
</FormControl>
diff --git a/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx b/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx
index e7378847616..803fc2dd8fb 100644
--- a/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx
+++ b/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx
@@ -1,5 +1,6 @@
import dayjs from 'dayjs'
-import { Input, SidePanel } from 'ui'
+import { Input_Shadcn_ as Input, SidePanel, TextArea_Shadcn_ as TextArea } from 'ui'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import {
FormSection,
@@ -34,28 +35,29 @@ export const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps)
>
<FormSection header={<FormSectionLabel>General</FormSectionLabel>}>
<FormSectionContent loading={false}>
- <Input
- readOnly
- size="small"
- label="Occurred at"
- value={
- selectedLog
- ? dayjs(selectedLog.timestamp / TIMESTAMP_MICROS_PER_MS).toISOString()
- : ''
- }
- descriptionText={timestampWithTz}
- />
- <Input readOnly size="small" label="Request ID" value={selectedLog?.request_id ?? ''} />
- {selectedLog?.organization_slug && (
+ <FormItemLayout label="Occurred at" description={timestampWithTz} isReactForm={false}>
<Input
readOnly
size="small"
- label="Organization"
- value={selectedLog.organization_slug}
+ value={
+ selectedLog
+ ? dayjs(selectedLog.timestamp / TIMESTAMP_MICROS_PER_MS).toISOString()
+ : ''
+ }
/>
+ </FormItemLayout>
+ <FormItemLayout label="Request ID" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.request_id ?? ''} />
+ </FormItemLayout>
+ {selectedLog?.organization_slug && (
+ <FormItemLayout label="Organization" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog.organization_slug} />
+ </FormItemLayout>
)}
{selectedLog?.project_ref && (
- <Input readOnly size="small" label="Project ref" value={selectedLog.project_ref} />
+ <FormItemLayout label="Project ref" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog.project_ref} />
+ </FormItemLayout>
)}
</FormSectionContent>
</FormSection>
@@ -64,31 +66,33 @@ export const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps)
<FormSection header={<FormSectionLabel>Actor</FormSectionLabel>}>
<FormSectionContent loading={false}>
- <Input
- readOnly
- size="small"
- label="Token type"
- value={selectedLog?.actor.token_type ?? ''}
- />
+ <FormItemLayout label="Token type" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.token_type ?? ''} />
+ </FormItemLayout>
{selectedLog?.actor.email && (
- <Input readOnly size="small" label="Email" value={selectedLog.actor.email} />
+ <FormItemLayout label="Email" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.email ?? ''} />
+ </FormItemLayout>
)}
{selectedLog?.actor.user_id && (
- <Input readOnly size="small" label="User ID" value={selectedLog.actor.user_id} />
+ <FormItemLayout label="User ID" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.user_id ?? ''} />
+ </FormItemLayout>
)}
{selectedLog?.actor.ip && (
- <Input readOnly size="small" label="IP address" value={selectedLog.actor.ip} />
+ <FormItemLayout label="IP address" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.ip ?? ''} />
+ </FormItemLayout>
)}
{selectedLog?.actor.oauth_app_name && (
- <Input
- readOnly
- size="small"
- label="OAuth app"
- value={selectedLog.actor.oauth_app_name}
- />
+ <FormItemLayout label="OAuth app" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.oauth_app_name ?? ''} />
+ </FormItemLayout>
)}
{selectedLog?.actor.app_name && (
- <Input readOnly size="small" label="App" value={selectedLog.actor.app_name} />
+ <FormItemLayout label="App" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.actor.app_name ?? ''} />
+ </FormItemLayout>
)}
</FormSectionContent>
</FormSection>
@@ -97,24 +101,27 @@ export const LogDetailsPanel = ({ selectedLog, onClose }: LogDetailsPanelProps)
<FormSection header={<FormSectionLabel>Action</FormSectionLabel>}>
<FormSectionContent loading={false}>
- <Input readOnly size="small" label="Name" value={selectedLog?.action.name ?? ''} />
- <Input readOnly size="small" label="Method" value={selectedLog?.action.method ?? ''} />
- <Input readOnly size="small" label="Route" value={selectedLog?.action.route ?? ''} />
- <Input
- readOnly
- size="small"
- label="Status"
- value={String(selectedLog?.action.status ?? '')}
- />
+ <FormItemLayout label="Name" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.action.name ?? ''} />
+ </FormItemLayout>
+ <FormItemLayout label="Method" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.action.method ?? ''} />
+ </FormItemLayout>
+ <FormItemLayout label="Route" isReactForm={false}>
+ <Input readOnly size="small" value={selectedLog?.action.route ?? ''} />
+ </FormItemLayout>
+ <FormItemLayout label="Status" isReactForm={false}>
+ <Input readOnly size="small" value={String(selectedLog?.action.status ?? '')} />
+ </FormItemLayout>
{selectedLog?.action.metadata && (
- <Input.TextArea
- readOnly
- size="small"
- label="Metadata"
- rows={5}
- className="input-mono input-xs"
- value={JSON.stringify(selectedLog.action.metadata, null, 2)}
- />
+ <FormItemLayout label="Metadata" isReactForm={false}>
+ <TextArea
+ readOnly
+ rows={5}
+ className="font-mono input-xs"
+ value={JSON.stringify(selectedLog.action.metadata, null, 2)}
+ />
+ </FormItemLayout>
)}
</FormSectionContent>
</FormSection>
diff --git a/apps/studio/components/interfaces/Docs/Description.tsx b/apps/studio/components/interfaces/Docs/Description.tsx
index 89feaa463a1..6f74fd74750 100644
--- a/apps/studio/components/interfaces/Docs/Description.tsx
+++ b/apps/studio/components/interfaces/Docs/Description.tsx
@@ -4,9 +4,8 @@ import { noop } from 'lodash'
import { Loader } from 'lucide-react'
import { useState } from 'react'
import { toast } from 'sonner'
-import { Button } from 'ui'
+import { Button, ExpandingTextArea } from 'ui'
-import AutoTextArea from '@/components/to-be-cleaned/forms/AutoTextArea'
import { executeSql } from '@/data/sql/execute-sql-query'
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
@@ -87,9 +86,9 @@ const Description = ({ content, metadata, onChange = noop }: DescrptionProps) =>
}
return (
- <div className="space-y-2">
- <AutoTextArea
- className="w-full"
+ <div className="space-y-2 px-0.5">
+ <ExpandingTextArea
+ className="w-full min-h-auto"
placeholder="Click to edit."
value={value}
onChange={(e: any) => setValue(e.target.value)}
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx
index aa755723aa7..afffb1b78cd 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx
@@ -10,7 +10,6 @@ import {
Form,
FormControl,
FormField,
- Input,
Input_Shadcn_,
Sheet,
SheetContent,
@@ -19,6 +18,7 @@ import {
SheetSection,
SheetTitle,
} from 'ui'
+import { Input } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import z from 'zod'
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
index 3e6b9dcb713..8a5d73f4852 100644
--- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
+++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx
@@ -7,7 +7,7 @@ import {
DialogSection,
DialogSectionSeparator,
DialogTitle,
- Input,
+ Input_Shadcn_ as Input,
Label_Shadcn_,
Textarea,
} from 'ui'
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
index fb84a6b72e0..2c52ed8cc0b 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
@@ -1,7 +1,8 @@
import { useFlag, useParams } from 'common'
import { useState } from 'react'
import { toast } from 'sonner'
-import { Alert, Button, cn, Input, Modal } from 'ui'
+import { Button, cn, Modal, TextArea_Shadcn_ as TextArea } from 'ui'
+import { Admonition } from 'ui-patterns/admonition'
import { ProjectUpdateDisabledTooltip } from '../ProjectUpdateDisabledTooltip'
import { CANCELLATION_REASONS } from '@/components/interfaces/Billing/Billing.constants'
@@ -136,8 +137,10 @@ export const ExitSurveyModal = ({ visible, projects, onClose }: ExitSurveyModalP
})}
</div>
<div className="text-area-text-sm flex flex-col gap-y-2">
- <label className="text-sm whitespace-pre-line wrap-break-word">{textareaLabel}</label>
- <Input.TextArea
+ <label htmlFor="message" className="text-sm whitespace-pre-line wrap-break-word">
+ {textareaLabel}
+ </label>
+ <TextArea
id="message"
name="message"
value={message}
@@ -147,14 +150,17 @@ export const ExitSurveyModal = ({ visible, projects, onClose }: ExitSurveyModalP
</div>
</div>
{hasProjectsWithComputeDowngrade && (
- <Alert
- withIcon
- variant="warning"
+ <Admonition
+ layout="horizontal"
+ type="warning"
title={`${projectsWithComputeDowngrade.length} of your projects will be restarted upon clicking confirm,`}
- >
- This is due to changes in compute instances from the downgrade. Affected projects
- include {projectsWithComputeDowngrade.map((project) => project.name).join(', ')}.
- </Alert>
+ description={
+ <>
+ This is due to changes in compute instances from the downgrade. Affected projects
+ include {projectsWithComputeDowngrade.map((project) => project.name).join(', ')}.
+ </>
+ }
+ />
)}
</div>
</Modal.Content>
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/UpgradeModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/UpgradeModal.tsx
index 57c3c61de2e..b1454f2862a 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/UpgradeModal.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/UpgradeModal.tsx
@@ -2,7 +2,7 @@ import { useParams } from 'common'
import { includes, without } from 'lodash'
import { useReducer, useState } from 'react'
import { toast } from 'sonner'
-import { Input, Modal } from 'ui'
+import { Modal, TextArea_Shadcn_ as TextArea } from 'ui'
import { generateUpgradeReasons } from '../helpers'
import { useSendUpgradeFeedbackMutation } from '@/data/feedback/upgrade-survey-send'
@@ -84,7 +84,7 @@ const UpgradeSurveyModal = ({
<label
key={option}
className={`
- flex cursor-pointer items-center space-x-2 rounded-md py-1
+ flex cursor-pointer items-center space-x-2 rounded-md py-1
pl-2 pr-3 text-center text-sm
shadow-xs transition-all duration-100
${
@@ -106,13 +106,16 @@ const UpgradeSurveyModal = ({
)
})}
</div>
- <div className="text-area-text-sm">
- <Input.TextArea
+ <div className="text-area-text-sm flex flex-col gap-y-2">
+ <label htmlFor="message" className="text-sm whitespace-pre-line wrap-break-word">
+ Anything else that we can improve on?
+ </label>
+ <TextArea
id="message"
name="message"
value={message}
onChange={(event: any) => setMessage(event.target.value)}
- label="Anything else that we can improve on?"
+ rows={3}
/>
</div>
</div>
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
index edd39a496d1..7bc591f7bf5 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
@@ -2,7 +2,9 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
import { Copy } from 'lucide-react'
import { useEffect, useState } from 'react'
-import { Button, copyToClipboard, Input } from 'ui'
+import { Button, copyToClipboard } from 'ui'
+import { Input } from 'ui-patterns/DataInputs/Input'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
@@ -40,88 +42,97 @@ export const Introduction = ({ showKeys, language, apikey, endpoint }: ContentPr
snippet={DOCS_CONTENT.init}
>
<div className="px-4 space-y-6">
- <div className="flex space-x-4 mt-8">
- <p className="text-sm w-40">Project URL</p>
- <Input disabled readOnly copy size="small" value={endpoint} className="w-full" />
+ <div className="flex flex-col space-x-4 mt-8">
+ <FormItemLayout isReactForm={false} layout="horizontal" label="Project URL">
+ <Input disabled readOnly copy size="small" value={endpoint} className="w-full" />
+ </FormItemLayout>
</div>
- <div className="flex space-x-4">
- <p className="text-sm w-40">Client API key</p>
- <Input
- disabled
- readOnly
- size="small"
- value={showKeys ? apikey : 'Reveal API keys via dropdown in the header'}
- className="w-full"
- descriptionText="This key is safe to use in a browser if you have enabled Row Level Security (RLS) for your tables and configured policies."
- actions={[
- <Button
- key="copy"
- type="default"
- icon={<Copy />}
- onClick={() => {
- setCopied('anon')
- copyToClipboard(anonApiKey ?? 'SUPABASE_CLIENT_ANON_KEY')
- sendEvent({
- action: 'api_docs_code_copy_button_clicked',
- properties: {
- title: 'Client API key',
- selectedLanguage: language,
- },
- groups: {
- project: ref ?? 'Unknown',
- organization: org?.slug ?? 'Unknown',
- },
- })
- }}
- >
- {copied === 'anon' ? 'Copied' : 'Copy'}
- </Button>,
- ]}
- />
+ <div className="flex flex-col space-x-4">
+ <FormItemLayout
+ isReactForm={false}
+ layout="horizontal"
+ label="Client API key"
+ description="This key is safe to use in a browser if you have enabled Row Level Security (RLS) for your tables and configured policies."
+ >
+ <Input
+ disabled
+ readOnly
+ size="small"
+ value={showKeys ? apikey : 'Reveal API keys via dropdown in the header'}
+ actions={[
+ <Button
+ key="copy"
+ type="default"
+ icon={<Copy />}
+ onClick={() => {
+ setCopied('anon')
+ copyToClipboard(anonApiKey ?? 'SUPABASE_CLIENT_ANON_KEY')
+ sendEvent({
+ action: 'api_docs_code_copy_button_clicked',
+ properties: {
+ title: 'Client API key',
+ selectedLanguage: language,
+ },
+ groups: {
+ project: ref ?? 'Unknown',
+ organization: org?.slug ?? 'Unknown',
+ },
+ })
+ }}
+ >
+ {copied === 'anon' ? 'Copied' : 'Copy'}
+ </Button>,
+ ]}
+ />
+ </FormItemLayout>
</div>
- <div className="flex space-x-4">
- <p className="text-sm w-40 mb-16">Service key</p>
- <Input
- disabled
- readOnly
- size="small"
- value={
- showKeys
- ? (serviceApiKey ?? 'SUPABASE_CLIENT_SERVICE_KEY')
- : 'Reveal API keys via dropdown in the header'
- }
- className="w-full"
- descriptionText={
+ <div className="flex flex-col space-x-4">
+ <FormItemLayout
+ isReactForm={false}
+ layout="horizontal"
+ label="Service key"
+ description={
<p>
This key has the ability to bypass Row Level Security.{' '}
<span className="text-amber-900">Never share it publicly.</span>
</p>
}
- actions={[
- <Button
- key="copy"
- type="default"
- icon={<Copy />}
- onClick={() => {
- setCopied('service')
- copyToClipboard(serviceApiKey)
- sendEvent({
- action: 'api_docs_code_copy_button_clicked',
- properties: {
- title: 'Service key',
- selectedLanguage: language,
- },
- groups: {
- project: ref ?? 'Unknown',
- organization: org?.slug ?? 'Unknown',
- },
- })
- }}
- >
- {copied === 'service' ? 'Copied' : 'Copy'}
- </Button>,
- ]}
- />
+ >
+ <Input
+ disabled
+ readOnly
+ size="small"
+ value={
+ showKeys
+ ? (serviceApiKey ?? 'SUPABASE_CLIENT_SERVICE_KEY')
+ : 'Reveal API keys via dropdown in the header'
+ }
+ actions={[
+ <Button
+ key="copy"
+ type="default"
+ icon={<Copy />}
+ onClick={() => {
+ setCopied('service')
+ copyToClipboard(serviceApiKey)
+ sendEvent({
+ action: 'api_docs_code_copy_button_clicked',
+ properties: {
+ title: 'Service key',
+ selectedLanguage: language,
+ },
+ groups: {
+ project: ref ?? 'Unknown',
+ organization: org?.slug ?? 'Unknown',
+ },
+ })
+ }}
+ >
+ {copied === 'service' ? 'Copied' : 'Copy'}
+ </Button>,
+ ]}
+ />
+ </FormItemLayout>
</div>
</div>
</ContentSnippet>
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
index db7f79c2196..3cd0dcd96d0 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx
@@ -9,7 +9,7 @@ import {
IconBroadcast,
IconDatabaseChanges,
IconPresence,
- Input,
+ Input_Shadcn_ as Input,
Popover_Shadcn_,
PopoverContent_Shadcn_,
PopoverTrigger_Shadcn_,
@@ -203,8 +203,7 @@ export const RealtimeFilterPopover = ({ config, onChangeConfig }: RealtimeFilter
<div className="flex flex-row gap-4 items-center">
<p className="w-[60px] flex justify-end text-sm">AND</p>
<Input
- size="tiny"
- className="grow"
+ className="w-64"
placeholder="body=eq.hey"
value={tempConfig.filter}
onChange={(v) => setTempConfig({ ...tempConfig, filter: v.target.value })}
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/SendMessageModal.tsx b/apps/studio/components/interfaces/Realtime/Inspector/SendMessageModal.tsx
index de3f89455a1..5b989bf58d7 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/SendMessageModal.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/SendMessageModal.tsx
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react'
-import { Input, Modal } from 'ui'
+import { Input_Shadcn_ as Input, Modal } from 'ui'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import CodeEditor from '@/components/ui/CodeEditor/CodeEditor'
import { tryParseJson } from '@/lib/helpers'
@@ -48,24 +49,28 @@ export const SendMessageModal = ({
}}
>
<Modal.Content className="flex flex-col gap-y-4">
- <Input
- label="Message name"
- size="small"
- className="grow"
- value={values.message}
- onChange={(v) => setValues({ ...values, message: v.target.value })}
- />
- <div className="flex flex-col gap-y-2">
- <p className="text-sm text-scale-1100">Message payload</p>
- <CodeEditor
- id="message-payload"
- language="json"
- className="mb-0! h-32 overflow-hidden rounded-sm border"
- onInputChange={(e: string | undefined) => setValues({ ...values, payload: e ?? '{}' })}
- options={{ wordWrap: 'off', contextmenu: false }}
- value={values.payload}
+ <FormItemLayout label="Message name" layout="vertical" isReactForm={false}>
+ <Input
+ size="small"
+ value={values.message}
+ onChange={(v) => setValues({ ...values, message: v.target.value })}
/>
- {error !== undefined && <p className="text-sm text-red-900">{error}</p>}
+ </FormItemLayout>
+
+ <div className="flex flex-col gap-y-2">
+ <FormItemLayout label="Message payload" layout="vertical" isReactForm={false}>
+ <CodeEditor
+ id="message-payload"
+ language="json"
+ className="mb-0! h-32 overflow-hidden rounded-sm border"
+ onInputChange={(e: string | undefined) =>
+ setValues({ ...values, payload: e ?? '{}' })
+ }
+ options={{ wordWrap: 'off', contextmenu: false }}
+ value={values.payload}
+ />
+ {error !== undefined && <p className="text-sm text-red-900">{error}</p>}
+ </FormItemLayout>
</div>
</Modal.Content>
</Modal>
diff --git a/apps/studio/components/interfaces/Reports/ReportFilterPopover.tsx b/apps/studio/components/interfaces/Reports/ReportFilterPopover.tsx
index 1b41f127e40..0a1fdc9de08 100644
--- a/apps/studio/components/interfaces/Reports/ReportFilterPopover.tsx
+++ b/apps/studio/components/interfaces/Reports/ReportFilterPopover.tsx
@@ -10,7 +10,7 @@ import {
CommandInput_Shadcn_,
CommandItem_Shadcn_,
CommandList_Shadcn_,
- Input,
+ Input_Shadcn_ as Input,
Popover_Shadcn_,
PopoverContent_Shadcn_,
PopoverSeparator_Shadcn_,
diff --git a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
index 07bb8d10bb5..9e63551331e 100644
--- a/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
+++ b/apps/studio/components/interfaces/RoleImpersonationSelector/UserImpersonationSelector.tsx
@@ -11,7 +11,11 @@ import {
CollapsibleContent_Shadcn_,
CollapsibleTrigger_Shadcn_,
DropdownMenuSeparator,
- Input,
+ Input_Shadcn_ as Input,
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupInput,
ScrollArea,
Switch,
Tabs_Shadcn_,
@@ -19,6 +23,7 @@ import {
TabsList_Shadcn_,
TabsTrigger_Shadcn_,
} from 'ui'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { InfoTooltip } from 'ui-patterns/info-tooltip'
import { getAvatarUrl, getDisplayName } from '../Auth/Users/Users.utils'
@@ -136,6 +141,7 @@ export const UserImpersonationSelector = () => {
parsedClaims = additionalClaims ? JSON.parse(additionalClaims) : {}
} catch (e) {
toast.error('Invalid JSON in additional claims')
+ setIsImpersonateLoading(false)
return
}
try {
@@ -226,11 +232,16 @@ export const UserImpersonationSelector = () => {
<TabsContent_Shadcn_ value="user">
<div className="flex flex-col gap-y-2">
- <Input
- size="tiny"
- className="table-editor-search border-none"
- icon={
- isSearching ? (
+ <InputGroup>
+ <InputGroupInput
+ size="tiny"
+ className="table-editor-search border-none"
+ placeholder="Search by id, email, phone, or name..."
+ onChange={(e) => setSearchText(e.target.value)}
+ value={searchText}
+ />
+ <InputGroupAddon>
+ {isSearching ? (
<Loader2
className="animate-spin text-foreground-lighter"
size={16}
@@ -238,24 +249,17 @@ export const UserImpersonationSelector = () => {
/>
) : (
<Search className="text-foreground-lighter" size={16} strokeWidth={1.5} />
- )
- }
- placeholder="Search by id, email, phone, or name..."
- onChange={(e) => setSearchText(e.target.value)}
- value={searchText}
- actions={
- searchText && (
- <Button
- size="tiny"
- type="text"
- className="px-1"
- onClick={() => setSearchText('')}
- >
- <X size={12} strokeWidth={2} />
- </Button>
- )
- }
- />
+ )}
+ </InputGroupAddon>
+ <InputGroupAddon align="inline-end">
+ {searchText && (
+ <InputGroupButton size="tiny" type="text" onClick={() => setSearchText('')}>
+ <span className="sr-only">Clear search</span>
+ <X size={12} />
+ </InputGroupButton>
+ )}
+ </InputGroupAddon>
+ </InputGroup>
{isLoading && (
<div className="flex flex-col gap-2 items-center justify-center h-24">
<Loader2 className="animate-spin" size={24} />
@@ -343,24 +347,32 @@ export const UserImpersonationSelector = () => {
<TabsContent_Shadcn_ value="external">
<div className="flex flex-col gap-y-4">
- <Input
- size="small"
+ <FormItemLayout
layout="horizontal"
label="External User ID"
- descriptionText="The user ID from your external auth provider"
- placeholder="e.g. user_abc123"
- value={externalUserId}
- onChange={(e) => setExternalUserId(e.target.value)}
- />
- <Input
- size="small"
+ description="The user ID from your external auth provider"
+ isReactForm={false}
+ >
+ <Input
+ size="small"
+ placeholder="e.g. user_abc123"
+ value={externalUserId}
+ onChange={(e) => setExternalUserId(e.target.value)}
+ />
+ </FormItemLayout>
+ <FormItemLayout
layout="horizontal"
label="Additional Claims (JSON)"
- descriptionText="Optional: Add custom claims like org_id or roles"
- placeholder='e.g. {"app_metadata": {"org_id": "org_456"}}'
- value={additionalClaims}
- onChange={(e) => setAdditionalClaims(e.target.value)}
- />
+ description="Optional: Add custom claims like org_id or roles"
+ isReactForm={false}
+ >
+ <Input
+ size="small"
+ placeholder='e.g. {"app_metadata": {"org_id": "org_456"}}'
+ value={additionalClaims}
+ onChange={(e) => setAdditionalClaims(e.target.value)}
+ />
+ </FormItemLayout>
<div className="flex items-center justify-end">
<Button
type="default"
diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/MoveItemsModal.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/MoveItemsModal.tsx
index 066f84b5ee2..6c953e9dfbf 100644
--- a/apps/studio/components/interfaces/Storage/StorageExplorer/MoveItemsModal.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageExplorer/MoveItemsModal.tsx
@@ -1,6 +1,7 @@
import { noop } from 'lodash'
import { useEffect, useState } from 'react'
-import { Button, Input, Modal } from 'ui'
+import { Button, Input_Shadcn_ as Input, Modal } from 'ui'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { StorageItemWithColumn } from '../Storage.types'
@@ -68,18 +69,20 @@ export const MoveItemsModal = ({
>
<Modal.Content>
<form>
- <div className="relative flex items-center">
+ <FormItemLayout
+ label={`Path to new directory in ${bucketName}`}
+ description="Leave blank to move items to the root of the bucket"
+ layout="vertical"
+ isReactForm={false}
+ >
<Input
autoFocus
- label={`Path to new directory in ${bucketName}`}
type="text"
- className="w-full"
placeholder="e.g folder1/subfolder2"
value={newPath}
- descriptionText="Leave blank to move items to the root of the bucket"
onChange={(event) => setNewPath(event.target.value)}
/>
- </div>
+ </FormItemLayout>
<button className="hidden" type="submit" onClick={onConfirmMove} />
</form>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx
index 8548e67cb79..a1776cba958 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx
@@ -209,13 +209,13 @@ export const ForeignRowSelector = ({
>
<div className="h-full flex flex-col">
<div className="flex items-center justify-between my-2 mx-3">
- <div className="flex items-center">
+ <div className="flex items-center gap-x-1">
<RefreshButton tableId={table?.id} isRefetching={isRefetching} />
<FilterPopoverPrimitive filters={filters} onApplyFilters={onApplyFilters} />
<SortPopoverPrimitive sorts={sorts} onApplySorts={onApplySorts} />
</div>
- <div className="flex items-center gap-x-3 divide-x">
+ <div className="flex items-center gap-x-3">
<Pagination
page={page}
setPage={setPage}
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetTextInput.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetTextInput.tsx
index 402030b6ad4..1b389b8a0f8 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetTextInput.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetTextInput.tsx
@@ -1,4 +1,4 @@
-import { Input } from 'ui'
+import { TextArea_Shadcn_ as TextArea } from 'ui'
interface SpreadSheetTextInputProps {
input: string
@@ -18,14 +18,7 @@ const SpreadSheetTextInput = ({ input, onInputChange }: SpreadSheetTextInputProp
Tip: Datetime columns should be formatted as YYYY-MM-DD HH:mm:ss
</p>
</div>
- <Input.TextArea
- size="tiny"
- className="font-mono"
- rows={15}
- style={{ resize: 'none' }}
- value={input}
- onChange={onInputChange}
- />
+ <TextArea className="font-mono" rows={15} value={input} onChange={onInputChange} />
</div>
)
diff --git a/apps/studio/components/to-be-cleaned/forms/AutoTextArea.tsx b/apps/studio/components/to-be-cleaned/forms/AutoTextArea.tsx
deleted file mode 100644
index 0494f3535f1..00000000000
--- a/apps/studio/components/to-be-cleaned/forms/AutoTextArea.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { TextAreaProps } from '@ui/components/Input/Input'
-import { Input } from 'ui'
-
-const AutoTextArea = (props: TextAreaProps) => {
- return (
- <div
- style={{
- minHeight: 'auto',
- }}
- >
- <Input.TextArea
- {...props}
- label={props.label}
- size="small"
- rows={1}
- style={{
- height: 'auto',
- overflow: 'hidden',
- resize: 'none',
- }}
- // onChange={onChangeHandler}
- />
- </div>
- )
-}
-
-export default AutoTextArea
diff --git a/packages/ui/src/components/ExpandingTextArea/index.tsx b/packages/ui/src/components/ExpandingTextArea/index.tsx
index 48b8755dd1f..c679e776574 100644
--- a/packages/ui/src/components/ExpandingTextArea/index.tsx
+++ b/packages/ui/src/components/ExpandingTextArea/index.tsx
@@ -3,7 +3,7 @@
import React, { forwardRef, useImperativeHandle, useLayoutEffect, useRef } from 'react'
import { cn } from '../../lib/utils'
-import { TextArea } from '../shadcn/ui/text-area'
+import { Textarea } from '../shadcn/ui/textarea'
export interface ExpandingTextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
/* The value of the textarea. Required to calculate the height of the textarea. */
@@ -34,7 +34,7 @@ const ExpandingTextArea = forwardRef<HTMLTextAreaElement, ExpandingTextAreaProps
}, [value])
return (
- <TextArea
+ <Textarea
ref={(element) => {
if (element) {
internalRef.current = element