Skip to content

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

fix(ui-patterns): responsive with_icon spacing (#40841)

Francesco Sansalvadoredfecff7629c8
diff --git a/apps/design-system/registry/default/example/page-layout-list.tsx b/apps/design-system/registry/default/example/page-layout-list.tsx
index e848704080b..7b5dc84a157 100644
--- a/apps/design-system/registry/default/example/page-layout-list.tsx
+++ b/apps/design-system/registry/default/example/page-layout-list.tsx
@@ -71,7 +71,7 @@ export default function PageLayoutList(): React.JSX.Element {
<Input
placeholder="Search for a function"
size="tiny"
- icon={<Search size={14} />}
+ icon={<Search />}
className="w-full lg:w-52"
/>
</div>
diff --git a/apps/studio/components/interfaces/Auth/OAuthApps/OAuthAppsList.tsx b/apps/studio/components/interfaces/Auth/OAuthApps/OAuthAppsList.tsx
index ef134e54851..7ee3f465b1f 100644
--- a/apps/studio/components/interfaces/Auth/OAuthApps/OAuthAppsList.tsx
+++ b/apps/studio/components/interfaces/Auth/OAuthApps/OAuthAppsList.tsx
@@ -165,7 +165,7 @@ export const OAuthAppsList = () => {
<Input
placeholder="Search oAuth apps"
size="tiny"
- icon={<Search size="14" />}
+ icon={<Search />}
value={filterString}
className="w-full lg:w-52"
onChange={(e) => setFilterString(e.target.value)}
diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/PolicyTemplates.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/PolicyTemplates.tsx
index bdb31dd0d3d..f72c2f8f656 100644
--- a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/PolicyTemplates.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/PolicyTemplates.tsx
@@ -59,7 +59,7 @@ export const PolicyTemplates = ({
<Input
size="small"
id="template-search"
- icon={<Search size={16} className="text-foreground-muted" />}
+ icon={<Search className="text-foreground-muted" />}
placeholder="Search templates"
value={search}
onChange={(event) => setSearch(event.target.value)}
diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypes.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypes.tsx
index 98a4bda35ee..edaa198a6ef 100644
--- a/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypes.tsx
+++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypes.tsx
@@ -90,7 +90,7 @@ export const EnumeratedTypes = () => {
className="w-full lg:w-52"
onChange={(e) => setSearch(e.target.value)}
placeholder="Search for a type"
- icon={<Search size={14} />}
+ icon={<Search />}
/>
</div>
diff --git a/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx b/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
index bab02486bed..ba0a266a22c 100644
--- a/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/Extensions.tsx
@@ -69,7 +69,7 @@ export const Extensions = () => {
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
className="w-52"
- icon={<Search size={14} />}
+ icon={<Search />}
/>
</div>
diff --git a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
index f63d1428eed..003fb9bbaf4 100644
--- a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
+++ b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
@@ -257,7 +257,7 @@ const FunctionsList = () => {
<Input
placeholder="Search for a function"
size="tiny"
- icon={<Search size={14} />}
+ icon={<Search />}
value={filterString}
className="w-full lg:w-52"
onChange={(e) => setFilterString(e.target.value)}
diff --git a/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx b/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
index 5c19e17b08e..90b11efdc31 100644
--- a/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
+++ b/apps/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
@@ -58,7 +58,7 @@ export const HooksList = ({
<Input
placeholder="Search for a webhook"
size="tiny"
- icon={<Search size="14" />}
+ icon={<Search />}
value={filterString}
className="w-52"
onChange={(e) => setFilterString(e.target.value)}
diff --git a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx
index 9adff97567c..51df142e932 100644
--- a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx
+++ b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx
@@ -148,7 +148,7 @@ const Indexes = () => {
className="w-full lg:w-52"
onChange={(e) => setSearch(e.target.value)}
placeholder="Search for an index"
- icon={<Search size={14} />}
+ icon={<Search />}
/>
{!isSchemaLocked && (
diff --git a/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx b/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx
index 407f2e74397..3224619fc94 100644
--- a/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx
+++ b/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx
@@ -89,9 +89,8 @@ const Migrations = () => {
value={search}
className="w-full lg:w-52"
onChange={(e: any) => setSearch(e.target.value)}
- icon={<Search size="14" />}
+ icon={<Search />}
/>
-
<Card>
<Table>
<TableHeader>
diff --git a/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx b/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
index 59d71ef77bf..589bb0dff45 100644
--- a/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
+++ b/apps/studio/components/interfaces/Database/Publications/PublicationsList.tsx
@@ -100,8 +100,8 @@ export const PublicationsList = () => {
<div className="flex items-center">
<Input
size="tiny"
- icon={<Search size={12} />}
- className="w-48 pl-8"
+ icon={<Search />}
+ className="w-48"
placeholder="Search for a publication"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
diff --git a/apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx b/apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx
index b1cdf2a8e9a..c4c087eac57 100644
--- a/apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx
+++ b/apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx
@@ -69,8 +69,8 @@ export const PublicationsTables = () => {
placeholder="Search for a table"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
- className="w-48 pl-8"
+ icon={<Search />}
+ className="w-48"
/>
</div>
</div>
diff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
index 9aa73a00f24..5ccee96a937 100644
--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
@@ -14,7 +14,7 @@ import { useReplicationPipelinesQuery } from 'data/replication/pipelines-query'
import { useReplicationSourcesQuery } from 'data/replication/sources-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { DOCS_URL } from 'lib/constants'
-import { Button, cn, Input_Shadcn_ } from 'ui'
+import { Button, cn, Input } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
import { DestinationPanel } from './DestinationPanel/DestinationPanel'
import { DestinationRow } from './DestinationRow'
@@ -100,18 +100,14 @@ export const Destinations = () => {
<div className="mb-4">
<div className="flex items-center justify-between">
<div className="flex items-center">
- <div className="relative">
- <Search
- className="absolute left-3 top-1/2 transform -translate-y-1/2 text-foreground-lighter"
- size={14}
- />
- <Input_Shadcn_
- className="pl-9 h-7"
- placeholder={'Filter destinations'}
- value={filterString}
- onChange={(e) => setFilterString(e.target.value)}
- />
- </div>
+ <Input
+ placeholder="Filter destinations"
+ size="tiny"
+ icon={<Search />}
+ value={filterString}
+ className="w-full lg:w-52"
+ onChange={(e) => setFilterString(e.target.value)}
+ />
</div>
<div className="flex items-center gap-x-2">
{!!sourceId && (
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
index 5500217aee1..28017f217ed 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
@@ -215,8 +215,8 @@ export const ReplicationPipelineStatus = () => {
</Button>
)}
<Input
- icon={<Search size={12} />}
- className="pl-7 h-[26px] text-xs"
+ icon={<Search />}
+ className="text-xs"
placeholder="Search for tables"
value={searchString}
disabled={isPipelineError}
@@ -228,7 +228,7 @@ export const ReplicationPipelineStatus = () => {
key="close"
className="mx-2 cursor-pointer text-foreground"
size={14}
- strokeWidth={2}
+ strokeWidth={1.5}
onClick={() => setSearchString('')}
/>,
]
diff --git a/apps/studio/components/interfaces/Database/Roles/RolesList.tsx b/apps/studio/components/interfaces/Database/Roles/RolesList.tsx
index b33a2d1ce47..114a9f6b876 100644
--- a/apps/studio/components/interfaces/Database/Roles/RolesList.tsx
+++ b/apps/studio/components/interfaces/Database/Roles/RolesList.tsx
@@ -84,7 +84,7 @@ export const RolesList = () => {
size="tiny"
className="w-52"
placeholder="Search for a role"
- icon={<Search size={12} />}
+ icon={<Search />}
value={filterString}
onChange={(event: any) => setFilterString(event.target.value)}
actions={
diff --git a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
index 5bd11cf444f..2b6be19b184 100644
--- a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
+++ b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
@@ -82,7 +82,7 @@ export const ColumnList = ({
placeholder="Filter columns"
value={filterString}
onChange={(e: any) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
/>
</div>
{!isSchemaLocked && isTableEntity && (
diff --git a/apps/studio/components/interfaces/Database/Tables/TableList.tsx b/apps/studio/components/interfaces/Database/Tables/TableList.tsx
index 4faae844bb4..a49aceaa145 100644
--- a/apps/studio/components/interfaces/Database/Tables/TableList.tsx
+++ b/apps/studio/components/interfaces/Database/Tables/TableList.tsx
@@ -280,7 +280,7 @@ export const TableList = ({
placeholder="Search for a table"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
/>
{!isSchemaLocked && (
diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx
index f38b19e69ab..2476626499e 100644
--- a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx
+++ b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx
@@ -190,7 +190,7 @@ execute function function_name();`)
<Input
placeholder="Search for a trigger"
size="tiny"
- icon={<Search size="14" />}
+ icon={<Search />}
value={filterString}
className="w-full lg:w-52"
onChange={(e) => setFilterString(e.target.value)}
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
index a2ece5a8550..1fed4f148f5 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
@@ -117,7 +117,7 @@ export const EdgeFunctionSecrets = () => {
placeholder="Search for a secret"
value={searchString}
onChange={(e: any) => setSearchString(e.target.value)}
- icon={<Search size={14} />}
+ icon={<Search />}
/>
</div>
diff --git a/apps/studio/components/interfaces/HomePageActions.tsx b/apps/studio/components/interfaces/HomePageActions.tsx
index cd648cc200f..4c1bb728428 100644
--- a/apps/studio/components/interfaces/HomePageActions.tsx
+++ b/apps/studio/components/interfaces/HomePageActions.tsx
@@ -57,9 +57,9 @@ export const HomePageActions = ({
<div className="flex items-center gap-2">
<Input
placeholder="Search for a project"
- icon={<Search size={12} />}
+ icon={<Search />}
size="tiny"
- className="w-32 md:w-64 pl-8 [&>div>div>div>input]:!pl-7 [&>div>div>div>div]:!pl-2"
+ className="w-32 md:w-64"
value={search}
onChange={(event) => setSearch(event.target.value)}
actions={[
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsTab.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsTab.tsx
index 501bbcc32ba..2fc7fb2c9bc 100644
--- a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsTab.tsx
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsTab.tsx
@@ -175,7 +175,7 @@ export const CronjobsTab = () => {
size="tiny"
className="w-52"
placeholder="Search for a job"
- icon={<Search size={14} />}
+ icon={<Search />}
value={search ?? ''}
onChange={(e) => setSearch(e.target.value)}
onKeyDown={(e) => {
diff --git a/apps/studio/components/interfaces/Integrations/Queues/QueuesTab.tsx b/apps/studio/components/interfaces/Integrations/Queues/QueuesTab.tsx
index 611752fd39f..d7172ee4e29 100644
--- a/apps/studio/components/interfaces/Integrations/Queues/QueuesTab.tsx
+++ b/apps/studio/components/interfaces/Integrations/Queues/QueuesTab.tsx
@@ -63,7 +63,7 @@ export const QueuesTab = () => {
size="tiny"
className="w-52"
placeholder="Search for a queue"
- icon={<Search size={14} />}
+ icon={<Search />}
value={search ?? ''}
onChange={(e) => setSearch(e.target.value)}
onKeyDown={(e) => {
diff --git a/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx b/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
index b11d7e9260d..05a440e41a9 100644
--- a/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
+++ b/apps/studio/components/interfaces/Integrations/Vault/Secrets/SecretsManagement.tsx
@@ -110,7 +110,7 @@ export const SecretsManagement = () => {
size="tiny"
className="w-52"
placeholder="Search by name or key ID"
- icon={<Search size={14} />}
+ icon={<Search />}
value={searchValue ?? ''}
onChange={(e) => setSearchValue(e.target.value)}
actions={[
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
index dd0fa5499de..b7abf61489f 100644
--- a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
+++ b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
@@ -40,7 +40,7 @@ export const TeamSettings = () => {
<Input
size="tiny"
autoComplete="off"
- icon={<Search size={12} />}
+ icon={<Search />}
value={searchString}
onChange={(e: any) => setSearchString(e.target.value)}
name="email"
diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceFilterBar.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceFilterBar.tsx
index 69377159ae9..81ec966b358 100644
--- a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceFilterBar.tsx
+++ b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceFilterBar.tsx
@@ -79,7 +79,7 @@ export const QueryPerformanceFilterBar = ({
<Input
size="tiny"
autoComplete="off"
- icon={<Search size={12} />}
+ icon={<Search />}
value={inputValue}
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e.target.value)}
name="keyword"
diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
index e561e74c2b8..08228cc76cf 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
@@ -105,7 +105,7 @@ export const AnalyticsBuckets = () => {
placeholder="Search for a bucket"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
/>
<CreateAnalyticsBucketModal buttonType="primary" buttonClassName="w-fit" />
</div>
diff --git a/apps/studio/components/interfaces/Storage/FilesBuckets/index.tsx b/apps/studio/components/interfaces/Storage/FilesBuckets/index.tsx
index cc1690819aa..57f85cb3836 100644
--- a/apps/studio/components/interfaces/Storage/FilesBuckets/index.tsx
+++ b/apps/studio/components/interfaces/Storage/FilesBuckets/index.tsx
@@ -100,7 +100,7 @@ export const FilesBuckets = () => {
placeholder="Search for a bucket"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
/>
<DropdownMenu>
<DropdownMenuTrigger asChild>
diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerHeader.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerHeader.tsx
index 8948e8dd512..d663a791c2a 100644
--- a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerHeader.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerHeader.tsx
@@ -454,14 +454,14 @@ export const FileExplorerHeader = ({
size="tiny"
autoFocus
className="w-52"
- icon={<Search size={14} strokeWidth={2} />}
+ icon={<Search />}
actions={[
- <X
- key="close"
- className="mx-2 cursor-pointer text-foreground"
- size={14}
- strokeWidth={2}
+ <Button
+ size="tiny"
+ type="text"
+ icon={<X />}
onClick={onCancelSearch}
+ className="p-0 h-5 w-5"
/>,
]}
placeholder="Search for a file or folder"
@@ -471,7 +471,7 @@ export const FileExplorerHeader = ({
/>
) : (
<Button
- icon={<Search size={16} strokeWidth={2} />}
+ icon={<Search />}
size="tiny"
type="text"
className="px-1"
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsx
index 9143a92a345..0dacaf84bed 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsx
@@ -243,13 +243,13 @@ export const StoragePolicies = () => {
size="tiny"
placeholder="Filter buckets"
className="block"
- containerClassName="w-full lg:w-52 [&>div>svg]:-mt-0.5"
+ containerClassName="w-full lg:w-52"
value={searchString || ''}
onChange={(e) => {
const str = e.target.value
setSearchString(str)
}}
- icon={<Search size={14} />}
+ icon={<Search />}
actions={
searchString ? (
<Button
diff --git a/apps/studio/components/interfaces/Storage/VectorBuckets/VectorBucketDetails/index.tsx b/apps/studio/components/interfaces/Storage/VectorBuckets/VectorBucketDetails/index.tsx
index 6b98e92025b..fe43688fb53 100644
--- a/apps/studio/components/interfaces/Storage/VectorBuckets/VectorBucketDetails/index.tsx
+++ b/apps/studio/components/interfaces/Storage/VectorBuckets/VectorBucketDetails/index.tsx
@@ -137,7 +137,7 @@ export const VectorBucketDetails = () => {
placeholder="Search for a table"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
className="w-48"
/>
<CreateVectorTableSheet bucketName={bucket?.vectorBucketName} />
diff --git a/apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx b/apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx
index 5266d187532..4eef95cd636 100644
--- a/apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx
+++ b/apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx
@@ -86,7 +86,7 @@ export const VectorsBuckets = () => {
placeholder="Search for a bucket"
value={filterString}
onChange={(e) => setFilterString(e.target.value)}
- icon={<Search size={12} />}
+ icon={<Search />}
/>
<CreateVectorBucketButton onClick={() => setVisible(true)} />
diff --git a/apps/studio/components/interfaces/Support/Success.tsx b/apps/studio/components/interfaces/Support/Success.tsx
index 0ef8d6a3f86..488e4f0655f 100644
--- a/apps/studio/components/interfaces/Support/Success.tsx
+++ b/apps/studio/components/interfaces/Support/Success.tsx
@@ -68,7 +68,7 @@ export const Success = ({
<Input
value={searchValue}
onChange={(e) => setSearchValue(e.target.value)}
- icon={<Search size={16} strokeWidth={1.5} />}
+ icon={<Search />}
actions={[
<Button
asChild
diff --git a/apps/studio/pages/organizations.tsx b/apps/studio/pages/organizations.tsx
index 50ecaa90afc..1a1421b1e69 100644
--- a/apps/studio/pages/organizations.tsx
+++ b/apps/studio/pages/organizations.tsx
@@ -75,8 +75,8 @@ const OrganizationsPage: NextPageWithLayout = () => {
<Input
size="tiny"
placeholder="Search for an organization"
- icon={<Search size={16} />}
- className="w-full flex-1 md:w-64 [&>div>div>div>input]:!pl-7 [&>div>div>div>div]:!pl-2"
+ icon={<Search />}
+ className="w-full flex-1 md:w-64"
value={search}
onChange={(event) => setSearch(event.target.value)}
/>
diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx
index e017abc8a68..d39387fd8c8 100644
--- a/apps/studio/pages/project/[ref]/auth/policies.tsx
+++ b/apps/studio/pages/project/[ref]/auth/policies.tsx
@@ -230,14 +230,13 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
<Input
size="tiny"
placeholder="Filter tables and policies"
- className="block w-full lg:w-52"
- containerClassName="[&>div>svg]:-mt-0.5"
+ className="w-full lg:w-52"
value={searchString || ''}
onChange={(e) => {
const str = e.target.value
setSearchString(str)
}}
- icon={<Search size={14} />}
+ icon={<Search />}
actions={
searchString ? (
<Button
diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsx
index 3601eb75a6e..37137374238 100644
--- a/apps/studio/pages/project/[ref]/functions/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/index.tsx
@@ -106,9 +106,9 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
<div className="relative">
<Input
placeholder="Search function names"
- icon={<Search size={12} />}
+ icon={<Search />}
size="tiny"
- className="w-32 md:w-64 pl-8 [&>div>div>div>input]:!pl-7 [&>div>div>div>div]:!pl-2"
+ className="w-32 md:w-64"
value={search}
onChange={(event) => setSearch(event.target.value)}
actions={[
diff --git a/packages/ui-patterns/src/DataInputs/Input.tsx b/packages/ui-patterns/src/DataInputs/Input.tsx
index 36094a03a24..fabf03e1066 100644
--- a/packages/ui-patterns/src/DataInputs/Input.tsx
+++ b/packages/ui-patterns/src/DataInputs/Input.tsx
@@ -12,7 +12,7 @@ import InputIconContainer from '../form/Layout/InputIconContainer'
export const HIDDEN_PLACEHOLDER = '**** **** **** ****'
-export interface Props extends Omit<ComponentProps<typeof Input_Shadcn_>, 'size' | 'onCopy'> {
+export interface Props extends Omit<ComponentProps<typeof Input_Shadcn_>, 'onCopy'> {
copy?: boolean
showCopyOnHover?: boolean
onCopy?: () => void
@@ -37,6 +37,7 @@ const Input = forwardRef<
onCopy,
iconContainerClassName,
containerClassName,
+ size = 'small',
...props
}: Props,
ref
@@ -62,19 +63,21 @@ const Input = forwardRef<
}
let inputClasses: string[] = []
- if (icon) inputClasses.push(__styles.with_icon)
+ if (size) inputClasses.push(__styles.size[size])
+ if (icon) inputClasses.push(__styles.with_icon[size ?? 'small'])
return (
<div className={cn('relative group', containerClassName)}>
<Input_Shadcn_
ref={ref}
{...props}
+ size={size}
onCopy={onCopy}
value={reveal && hidden ? HIDDEN_PLACEHOLDER : props.value}
disabled={reveal && hidden ? true : props.disabled}
className={cn(...inputClasses, props.className)}
/>
- {icon && <InputIconContainer icon={icon} className={iconContainerClassName} />}
+ {icon && <InputIconContainer size={size} icon={icon} className={iconContainerClassName} />}
{copy || actions ? (
<div className={__styles.actions_container}>
{copy && !(reveal && hidden) ? (
diff --git a/packages/ui-patterns/src/InnerSideMenu/index.tsx b/packages/ui-patterns/src/InnerSideMenu/index.tsx
index 961f3b43fa6..14bc602ed6d 100644
--- a/packages/ui-patterns/src/InnerSideMenu/index.tsx
+++ b/packages/ui-patterns/src/InnerSideMenu/index.tsx
@@ -204,7 +204,7 @@ const InnerSideBarFilterSearchInput = forwardRef<
/>
) : (
<Search
- className="absolute left-2 top-2 text-foreground-muted"
+ className="absolute left-2 top-0 bottom-0 my-auto text-foreground-muted"
size={14}
strokeWidth={1.5}
/>
diff --git a/packages/ui-patterns/src/form/Layout/InputIconContainer.tsx b/packages/ui-patterns/src/form/Layout/InputIconContainer.tsx
index f30e883e396..b30791dcb6b 100644
--- a/packages/ui-patterns/src/form/Layout/InputIconContainer.tsx
+++ b/packages/ui-patterns/src/form/Layout/InputIconContainer.tsx
@@ -1,14 +1,15 @@
import { cn } from 'ui'
+import styleHandler from 'ui/src/lib/theme/styleHandler'
-export default function InputIconContainer({ icon, className }: any) {
- return (
- <div
- className={cn(
- 'absolute inset-y-0 left-0 pl-2 flex items-center pointer-events-none text-foreground-light',
- className
- )}
- >
- {icon}
- </div>
- )
+export default function InputIconContainer({
+ icon,
+ className,
+ size,
+}: {
+ icon: React.ReactNode
+ className?: string
+ size: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge' | null
+}) {
+ const __styles = styleHandler('inputIconContainer')
+ return <div className={cn(__styles.base, __styles.size[size ?? 'small'], className)}>{icon}</div>
}
diff --git a/packages/ui/src/components/Input/Input.tsx b/packages/ui/src/components/Input/Input.tsx
index d895037d2e0..bbbf8302ca7 100644
--- a/packages/ui/src/components/Input/Input.tsx
+++ b/packages/ui/src/components/Input/Input.tsx
@@ -134,7 +134,7 @@ function Input({
if (error) inputClasses.push(__styles.variants.error)
if (!error) inputClasses.push(__styles.variants.standard)
if (size) inputClasses.push(__styles.size[size])
- if (icon) inputClasses.push(__styles.with_icon)
+ if (icon) inputClasses.push(__styles.with_icon[size])
if (disabled) inputClasses.push(__styles.disabled)
if (inputClassName) inputClasses.push(inputClassName)
@@ -238,7 +238,7 @@ function TextArea({
style,
rows = 4,
limit,
- size,
+ size = 'medium',
borderless = false,
validation,
copy = false,
@@ -298,7 +298,7 @@ function TextArea({
if (error) classes.push(__styles.variants.error)
if (!error) classes.push(__styles.variants.standard)
- if (icon) classes.push(__styles.with_icon)
+ if (icon) classes.push(__styles.with_icon[size])
if (size) classes.push(__styles.size[size])
if (disabled) classes.push(__styles.disabled)
if (textAreaClassName) classes.push(textAreaClassName)
diff --git a/packages/ui/src/components/InputNumber/InputNumber.tsx b/packages/ui/src/components/InputNumber/InputNumber.tsx
index e4aad0c0f75..8723e2226e5 100644
--- a/packages/ui/src/components/InputNumber/InputNumber.tsx
+++ b/packages/ui/src/components/InputNumber/InputNumber.tsx
@@ -103,7 +103,7 @@ function InputNumber({
if (error) inputClasses.push(__styles.variants.error)
if (!error) inputClasses.push(__styles.variants.standard)
- if (icon) inputClasses.push(__styles.with_icon)
+ if (icon) inputClasses.push(__styles.with_icon[size])
if (size) inputClasses.push(__styles.size[size])
if (props.disabled) inputClasses.push(__styles.disabled)
// if (borderless)
diff --git a/packages/ui/src/components/Listbox/Listbox2.tsx b/packages/ui/src/components/Listbox/Listbox2.tsx
index 2b4aa34a328..948c41ea036 100644
--- a/packages/ui/src/components/Listbox/Listbox2.tsx
+++ b/packages/ui/src/components/Listbox/Listbox2.tsx
@@ -191,7 +191,7 @@ function Listbox({
if (error) selectClasses.push(__styles.variants.error)
if (!error) selectClasses.push(__styles.variants.standard)
// if (icon) selectClasses.push(SelectStyles['sbui-listbox--with-icon'])
- if (icon) addonBeforeClasses.push(__styles.with_icon)
+ if (icon) addonBeforeClasses.push(__styles.with_icon[size])
// if (size) selectClasses.push(SelectStyles[`sbui-listbox--${size}`])
if (size) selectClasses.push(__styles.size[size])
// if (borderless) selectClasses.push(SelectStyles['sbui-listbox--borderless'])
diff --git a/packages/ui/src/components/Select/Select.tsx b/packages/ui/src/components/Select/Select.tsx
index 5794abf5c01..e7ea3ad3905 100644
--- a/packages/ui/src/components/Select/Select.tsx
+++ b/packages/ui/src/components/Select/Select.tsx
@@ -106,7 +106,7 @@ function Select({
let classes = [__styles.base]
if (error) classes.push(__styles.variants.error)
if (!error) classes.push(__styles.variants.standard)
- if (icon) classes.push(__styles.with_icon)
+ if (icon) classes.push(__styles.with_icon[size])
if (size) classes.push(__styles.size[size])
if (disabled) classes.push(__styles.disabled)
diff --git a/packages/ui/src/lib/theme/defaultTheme.ts b/packages/ui/src/lib/theme/defaultTheme.ts
index de0bc841c39..d0a11f514c2 100644
--- a/packages/ui/src/lib/theme/defaultTheme.ts
+++ b/packages/ui/src/lib/theme/defaultTheme.ts
@@ -72,6 +72,14 @@ const default__padding_and_text = {
xlarge: `${defaults.size.text.xlarge} ${defaults.size.padding.xlarge}`,
}
+const with_icon_spacing_sizes = {
+ tiny: 'pl-7',
+ small: 'pl-8',
+ medium: 'pl-8',
+ large: 'pl-10',
+ xlarge: 'pl-11',
+}
+
/*
* Animations
*
@@ -446,7 +454,7 @@ export default {
`,
},
container: 'relative',
- with_icon: 'pl-7',
+ with_icon: with_icon_spacing_sizes,
size: {
...default__padding_and_text,
},
@@ -492,7 +500,7 @@ export default {
`,
},
container: 'relative',
- with_icon: 'pl-7',
+ with_icon: with_icon_spacing_sizes,
size: {
...default__padding_and_text,
},
@@ -539,7 +547,7 @@ export default {
},
disabled: 'opacity-50',
container: 'relative',
- with_icon: 'pl-7',
+ with_icon: with_icon_spacing_sizes,
size: {
...default__padding_and_text,
},
@@ -1392,10 +1400,10 @@ export default {
tiny: '[&_svg]:h-[14px] [&_svg]:w-[14px]',
small: '[&_svg]:h-[18px] [&_svg]:w-[18px]',
medium: '[&_svg]:h-[20px] [&_svg]:w-[20px]',
- large: '[&_svg]:h-[20px] [&_svg]:w-[20px]',
- xlarge: '[&_svg]:h-[24px] [&_svg]:w-[24px]',
- xxlarge: '[&_svg]:h-[30px] [&_svg]:w-[30px]',
- xxxlarge: '[&_svg]:h-[42px] [&_svg]:w-[42px]',
+ large: '[&_svg]:h-[20px] [&_svg]:w-[20px] pl-3',
+ xlarge: '[&_svg]:h-[24px] [&_svg]:w-[24px] pl-3',
+ xxlarge: '[&_svg]:h-[30px] [&_svg]:w-[30px] pl-3',
+ xxxlarge: '[&_svg]:h-[42px] [&_svg]:w-[42px] pl-3',
},
},