From 0f4ad7dad352eeee83097366cce1f3846480b820 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 5 Aug 2025 13:52:27 +0700 Subject: [PATCH 1/7] Factor in filters and sorts for export via CLI option (#37399) * Factor in filters and sorts for export via CLI option * Add align * Update * Smol fix --- .../grid/components/header/ExportDialog.tsx | 55 +++++++++++++----- .../grid/components/header/Header.tsx | 8 +-- .../TableEditorLayout/EntityListItem.tsx | 17 ++++-- .../TableEditorLayout/TableEditorMenu.tsx | 30 ++++++---- .../data/table-rows/table-rows-query.ts | 56 ++++++++++++------- .../pages/project/[ref]/editor/[id].tsx | 2 +- .../pages/project/[ref]/editor/index.tsx | 2 +- .../studio/pages/project/[ref]/editor/new.tsx | 2 +- 8 files changed, 115 insertions(+), 57 deletions(-) diff --git a/apps/studio/components/grid/components/header/ExportDialog.tsx b/apps/studio/components/grid/components/header/ExportDialog.tsx index 59ffe39bd9ac9..93aa9ef8eccf5 100644 --- a/apps/studio/components/grid/components/header/ExportDialog.tsx +++ b/apps/studio/components/grid/components/header/ExportDialog.tsx @@ -1,8 +1,13 @@ +import { useState } from 'react' + import { useParams } from 'common' +import { Filter, Sort, SupaTable } from 'components/grid/types' import { getConnectionStrings } from 'components/interfaces/Connect/DatabaseSettings.utils' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' +import { getAllTableRowsSql } from 'data/table-rows/table-rows-query' import { pluckObjectFields } from 'lib/helpers' -import { useState } from 'react' +import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation' +import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state' import { Button, cn, @@ -22,13 +27,25 @@ import { import { Admonition } from 'ui-patterns' interface ExportDialogProps { - table?: { name: string; schema: string } + table?: SupaTable + filters?: Filter[] + sorts?: Sort[] + ignoreRoleImpersonation?: boolean + open: boolean onOpenChange: (open: boolean) => void } -export const ExportDialog = ({ table, open, onOpenChange }: ExportDialogProps) => { +export const ExportDialog = ({ + table, + filters = [], + sorts = [], + ignoreRoleImpersonation = false, + open, + onOpenChange, +}: ExportDialogProps) => { const { ref: projectRef } = useParams() + const roleImpersonationState = useRoleImpersonationStateSnapshot() const [selectedTab, setSelectedTab] = useState('csv') @@ -48,10 +65,18 @@ export const ExportDialog = ({ table, open, onOpenChange }: ExportDialogProps) = }) const outputName = `${table?.name}_rows` + const queryChains = !table ? undefined : getAllTableRowsSql({ table, sorts, filters }) + const query = !!queryChains + ? ignoreRoleImpersonation + ? queryChains.toSql() + : wrapWithRoleImpersonation( + queryChains.toSql(), + roleImpersonationState as RoleImpersonationState + ) + : '' const csvExportCommand = ` -${connectionStrings.direct.psql} -c "COPY (SELECT * FROM "${table?.schema}"."${table?.name}") TO STDOUT WITH CSV HEADER DELIMITER ',';" > ${outputName}.csv -`.trim() +${connectionStrings.direct.psql} -c "COPY (${query}) TO STDOUT WITH CSV HEADER DELIMITER ',';" > ${outputName}.csv`.trim() const sqlExportCommand = ` pg_dump -h ${db_host} -p ${db_port} -d ${db_name} -U ${db_user} --table="${table?.schema}.${table?.name}" --data-only --column-inserts > ${outputName}.sql @@ -95,6 +120,12 @@ pg_dump -h ${db_host} -p ${db_port} -d ${db_name} -U ${db_user} --table="${table value={sqlExportCommand} className="[&_code]:text-[12px] [&_code]:text-foreground" /> + @@ -107,15 +138,11 @@ pg_dump -h ${db_host} -p ${db_port} -d ${db_name} -U ${db_user} --table="${table

{selectedTab === 'sql' && ( - -

- If you run into a server version mismatch error, you will need to update{' '} - pg_dump before running the command. -

-
+

+ Note: pg_dump needs to match your project's Postgres version. If you run + into a server version mismatch error, you will need to update pg_dump{' '} + before running the command. +

)} diff --git a/apps/studio/components/grid/components/header/Header.tsx b/apps/studio/components/grid/components/header/Header.tsx index baeeecc662fcf..bb401db90e8ac 100644 --- a/apps/studio/components/grid/components/header/Header.tsx +++ b/apps/studio/components/grid/components/header/Header.tsx @@ -504,11 +504,9 @@ const RowHeader = () => { Export - + Export as CSV Export as SQL - {/* [Joshen] Should make this available for all cases, but that'll involve updating - the Dialog's SQL output to be dynamic based on any filters applied */} {snap.allRowsSelected ? ( setShowExportModal(true)}>
@@ -535,7 +533,9 @@ const RowHeader = () => {
setShowExportModal(false)} /> diff --git a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx index e693516ccb869..c8ee912c07f37 100644 --- a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx +++ b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx @@ -1,5 +1,5 @@ import saveAs from 'file-saver' -import { Clipboard, Copy, Download, Edit, Lock, MoreHorizontal, Trash } from 'lucide-react' +import { Clipboard, Copy, Download, Edit, Lock, MoreVertical, Trash } from 'lucide-react' import Link from 'next/link' import Papa from 'papaparse' import { toast } from 'sonner' @@ -30,6 +30,7 @@ import { useTableEditorStateSnapshot } from 'state/table-editor' import { createTabId, useTabsStateSnapshot } from 'state/tabs' import { Badge, + Button, cn, copyToClipboard, DropdownMenu, @@ -242,7 +243,7 @@ const EntityListItem: ItemRenderer = ({ isOpened: isOpened && !isPreview, isPreview, }), - 'px-4' + 'pl-4 pr-1' )} onDoubleClick={(e) => { e.preventDefault() @@ -285,8 +286,16 @@ const EntityListItem: ItemRenderer = ({ {canEdit && ( - - + + +
+ + {isValidEdgeFunction && ( + + )} +
)} From 47249dc8b45b14cd84d7ae467d65ac659e33ab95 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 5 Aug 2025 14:14:28 +0700 Subject: [PATCH 3/7] Add a CTA to run the command of the cron job (#37621) --- .../CronJobs/CronJobTableCell.tsx | 32 ++++++++- .../database-cron-job-run-mutation.ts | 66 +++++++++++++++++++ 2 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 apps/studio/data/database-cron-jobs/database-cron-job-run-mutation.ts diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobTableCell.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobTableCell.tsx index 8ea872bb67a55..ea33c32f9285e 100644 --- a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobTableCell.tsx +++ b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobTableCell.tsx @@ -1,9 +1,10 @@ import dayjs from 'dayjs' -import { Clipboard, Edit, MoreVertical, Trash } from 'lucide-react' +import { Clipboard, Edit, MoreVertical, Play, Trash } from 'lucide-react' import { parseAsString, useQueryState } from 'nuqs' import { useState } from 'react' import { toast } from 'sonner' +import { useDatabaseCronJobRunCommandMutation } from 'data/database-cron-jobs/database-cron-job-run-mutation' import { CronJob } from 'data/database-cron-jobs/database-cron-jobs-infinite-query' import { useDatabaseCronJobToggleMutation } from 'data/database-cron-jobs/database-cron-jobs-toggle-mutation' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' @@ -74,15 +75,29 @@ export const CronJobTableCell = ({ ? getNextRun(schedule, latest_run) : value + const { mutate: runCronJob, isLoading: isRunning } = useDatabaseCronJobRunCommandMutation({ + onSuccess: () => { + toast.success(`Command from "${jobname}" ran successfully`) + }, + }) + const { mutate: toggleDatabaseCronJob, isLoading: isToggling } = useDatabaseCronJobToggleMutation( { - onSuccess: () => { - toast.success('Successfully asdasd') + onSuccess: (_, vars) => { + toast.success(`Successfully ${vars.active ? 'enabled' : 'disabled'} "${jobname}"`) setShowToggleModal(false) }, } ) + const onRunCronJob = () => { + runCronJob({ + projectRef: project?.ref!, + connectionString: project?.connectionString, + jobId: jobid, + }) + } + const onConfirmToggle = () => { toggleDatabaseCronJob({ projectRef: project?.ref!, @@ -100,12 +115,23 @@ export const CronJobTableCell = ({ - - - - )} - - ) + return } const AuthLayout = ({ children }: PropsWithChildren<{}>) => { diff --git a/apps/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx b/apps/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx index b579a00c0786f..3895c1115a44a 100644 --- a/apps/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx +++ b/apps/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx @@ -1,21 +1,22 @@ import { PropsWithChildren } from 'react' +import { cn } from 'ui' interface ProductMenuBarProps { title: string + className?: string } -const ProductMenuBar = ({ title, children }: PropsWithChildren) => { +const ProductMenuBar = ({ title, children, className }: PropsWithChildren) => { return (

{title}

-
{children}
+
{children}
) } diff --git a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx index 1e2a94dc71956..f183b8a9bb52e 100644 --- a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx +++ b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx @@ -10,8 +10,8 @@ import { AIAssistant } from 'components/ui/AIAssistantPanel/AIAssistant' import { EditorPanel } from 'components/ui/EditorPanel/EditorPanel' import { Loading } from 'components/ui/Loading' import { ResourceExhaustionWarningBanner } from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner' -import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' -import { useSelectedProject } from 'hooks/misc/useSelectedProject' +import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization' +import { useSelectedProject, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { withAuth } from 'hooks/misc/withAuth' import { PROJECT_STATUS } from 'lib/constants' import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' @@ -66,6 +66,7 @@ export interface ProjectLayoutProps { productMenu?: ReactNode selectedTable?: string resizableSidebar?: boolean + productMenuClassName?: string } const ProjectLayout = forwardRef>( @@ -79,13 +80,14 @@ const ProjectLayout = forwardRef { const router = useRouter() const [isClient, setIsClient] = useState(false) - const selectedOrganization = useSelectedOrganization() - const selectedProject = useSelectedProject() + const { data: selectedOrganization } = useSelectedOrganizationQuery() + const { data: selectedProject } = useSelectedProjectQuery() const { editorPanel, @@ -190,7 +192,9 @@ const ProjectLayout = forwardRef - {productMenu} + + {productMenu} + diff --git a/apps/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx b/apps/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx index f13ca0793be67..c9b6b7a342fed 100644 --- a/apps/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx +++ b/apps/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx @@ -1,7 +1,8 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' +import { PropsWithChildren } from 'react' + import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions' -import { PropsWithChildren } from 'react' import { ProjectLayoutWithAuth } from '../ProjectLayout/ProjectLayout' const TableEditorLayout = ({ children }: PropsWithChildren<{}>) => { @@ -16,7 +17,7 @@ const TableEditorLayout = ({ children }: PropsWithChildren<{}>) => { ) } - return <>{children} + return children } export default TableEditorLayout diff --git a/apps/studio/components/layouts/editors/EditorBaseLayout.tsx b/apps/studio/components/layouts/editors/EditorBaseLayout.tsx index 9f0da404d7fb4..27c4b4a41bede 100644 --- a/apps/studio/components/layouts/editors/EditorBaseLayout.tsx +++ b/apps/studio/components/layouts/editors/EditorBaseLayout.tsx @@ -11,12 +11,18 @@ import { useEditorType } from './EditorsLayout.hooks' export interface ExplorerLayoutProps extends ComponentProps { children: ReactNode - hideTabs?: boolean title?: string product?: string + productMenuClassName?: string } -export const EditorBaseLayout = ({ children, title, product, ...props }: ExplorerLayoutProps) => { +export const EditorBaseLayout = ({ + children, + title, + product, + productMenuClassName, + productMenu, +}: ExplorerLayoutProps) => { const { ref } = useParams() const pathname = usePathname() const editor = useEditorType() @@ -28,7 +34,13 @@ export const EditorBaseLayout = ({ children, title, product, ...props }: Explore pathname === `/project/${ref}/editor` || pathname === `/project/${ref}/sql` || hasNoOpenTabs return ( - +
{ className="w-fit mt-4" onClick={() => setIsConfirmOptInModalOpen(true)} > - Update AI settings + Permission settings )} diff --git a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx index 67cc2c49e39c6..d55a15a053b17 100644 --- a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx +++ b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx @@ -10,7 +10,7 @@ interface ProductMenuProps { const ProductMenu = ({ page, menu }: ProductMenuProps) => { return ( -
+
{menu.map((group, idx) => (
diff --git a/apps/studio/pages/project/[ref]/editor/[id].tsx b/apps/studio/pages/project/[ref]/editor/[id].tsx index 3a1f9c8697ae2..6f11123aa8fde 100644 --- a/apps/studio/pages/project/[ref]/editor/[id].tsx +++ b/apps/studio/pages/project/[ref]/editor/[id].tsx @@ -56,7 +56,11 @@ const TableEditorPage: NextPageWithLayout = () => { TableEditorPage.getLayout = (page) => ( - } product="Table Editor"> + } + product="Table Editor" + productMenuClassName="overflow-y-hidden" + > {page} diff --git a/apps/studio/pages/project/[ref]/editor/index.tsx b/apps/studio/pages/project/[ref]/editor/index.tsx index 71e4686868b24..6ba1073515fb6 100644 --- a/apps/studio/pages/project/[ref]/editor/index.tsx +++ b/apps/studio/pages/project/[ref]/editor/index.tsx @@ -47,7 +47,11 @@ const TableEditorPage: NextPageWithLayout = () => { TableEditorPage.getLayout = (page) => ( - } product="Table Editor"> + } + product="Table Editor" + productMenuClassName="overflow-y-hidden" + > {page} diff --git a/apps/studio/pages/project/[ref]/editor/new.tsx b/apps/studio/pages/project/[ref]/editor/new.tsx index 48546300b9268..ec76bdc6a4982 100644 --- a/apps/studio/pages/project/[ref]/editor/new.tsx +++ b/apps/studio/pages/project/[ref]/editor/new.tsx @@ -27,7 +27,11 @@ const EditorNewPage: NextPageWithLayout = () => { EditorNewPage.getLayout = (page) => ( - } product="Table Editor"> + } + product="Table Editor" + productMenuClassName="overflow-y-hidden" + > {page} diff --git a/apps/studio/styles/main.scss b/apps/studio/styles/main.scss index 1fab429887ce1..9a0898e8eac42 100644 --- a/apps/studio/styles/main.scss +++ b/apps/studio/styles/main.scss @@ -2,7 +2,6 @@ @tailwind components; @tailwind utilities; -@import './../../../packages/ui/build/css/source/global.css'; @import './../../../packages/ui/build/css/source/global.css'; @import './../../../packages/ui/build/css/themes/dark.css'; @import './../../../packages/ui/build/css/themes/light.css'; From a88a71f33943b5e609436f79ff12fff5da5819db Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Tue, 5 Aug 2025 17:46:55 +1000 Subject: [PATCH 5/7] truncate branch project card (#37679) --- .../components/interfaces/Home/ProjectList/ProjectCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx index bab4d0c394f30..0f2283b1b973a 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx @@ -65,7 +65,7 @@ const ProjectCard = ({
-

{githubRepository}

+

{githubRepository}

)}
From bab22d9e7e7bff1dc0a8c40acfd8845651730010 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Tue, 5 Aug 2025 11:13:57 +0200 Subject: [PATCH 6/7] docs: Add react Router to SSr auth guide (#37514) * Clarify where to add utils folder * Add React Router * Revert "Clarify where to add utils folder" This reverts commit 89f72c6bea0038bd9b6a8eeb32e08ddaa3aba4e3. --- .../auth/server-side/creating-a-client.mdx | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/apps/docs/content/guides/auth/server-side/creating-a-client.mdx b/apps/docs/content/guides/auth/server-side/creating-a-client.mdx index b5f0276ac2d51..7e8a38450e911 100644 --- a/apps/docs/content/guides/auth/server-side/creating-a-client.mdx +++ b/apps/docs/content/guides/auth/server-side/creating-a-client.mdx @@ -77,6 +77,14 @@ SUPABASE_URL=your_supabase_project_url SUPABASE_ANON_KEY=your_supabase_anon_key ``` + + + +```bash .env +SUPABASE_URL=your_supabase_project_url +SUPABASE_ANON_KEY=your_supabase_anon_key +``` + @@ -660,6 +668,105 @@ export default function Index() { + + + + + +```ts _index.tsx +import { LoaderFunctionArgs } from 'react-router' +import { createServerClient, parseCookieHeader, serializeCookieHeader } from '@supabase/ssr' + +export async function loader({ request }: LoaderFunctionArgs) { + const headers = new Headers() + + const supabase = createServerClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!, { + cookies: { + getAll() { + return parseCookieHeader(request.headers.get('Cookie') ?? '') + }, + setAll(cookiesToSet) { + cookiesToSet.forEach(({ name, value, options }) => + headers.append('Set-Cookie', serializeCookieHeader(name, value, options)) + ) + }, + }, + }) + + return new Response('...', { + headers, + }) +} +``` + + + + + +```ts _index.tsx +import { type ActionFunctionArgs } from '@react-router' +import { createServerClient, parseCookieHeader, serializeCookieHeader } from '@supabase/ssr' + +export async function action({ request }: ActionFunctionArgs) { + const headers = new Headers() + + const supabase = createServerClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!, { + cookies: { + getAll() { + return parseCookieHeader(request.headers.get('Cookie') ?? '') + }, + setAll(cookiesToSet) { + cookiesToSet.forEach(({ name, value, options }) => + headers.append('Set-Cookie', serializeCookieHeader(name, value, options)) + ) + }, + }, + }) + + return new Response('...', { + headers, + }) +} +``` + + + + + +```ts _index.tsx +import { type LoaderFunctionArgs } from "react-router"; +import { useLoaderData } from "react-router"; +import { createBrowserClient } from "@supabase/ssr"; + +export async function loader({}: LoaderFunctionArgs) { + return { + env: { + SUPABASE_URL: process.env.SUPABASE_URL!, + SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY!, + }, + }; +} + +export default function Index() { + const { env } = useLoaderData(); + + const supabase = createBrowserClient(env.SUPABASE_URL, env.SUPABASE_ANON_KEY); + + return ... +} +``` + + + + + + Date: Tue, 5 Aug 2025 02:31:32 -0700 Subject: [PATCH 7/7] Update `@deprecated` suggestions for `ui` package components (#36944) update deprecation hints This updates the deprecation notices for components in the `ui` package to follow this format: ``` /** @deprecated Use `import { } from "ui"` instead */ ``` The intent here is to be more explicit about what import a developer should be using instead to replace the deprecated component. Most of these notices were using a confusing relative path segment, which made it unclear as to which library the suggested replacement was coming from. --- packages/ui/src/components/Accordion/Accordion.tsx | 2 +- packages/ui/src/components/Alert/Alert.tsx | 2 +- packages/ui/src/components/Breadcrumb/Breadcrumb.tsx | 2 +- packages/ui/src/components/Checkbox/Checkbox.tsx | 2 +- packages/ui/src/components/Collapsible/Collapsible.tsx | 2 +- packages/ui/src/components/Form/Form.tsx | 2 +- packages/ui/src/components/Input/Input.tsx | 2 +- packages/ui/src/components/InputNumber/InputNumber.tsx | 2 +- packages/ui/src/components/InputOld/Input.js | 2 +- packages/ui/src/components/Listbox/Listbox2.tsx | 2 +- packages/ui/src/components/Modal/Modal.tsx | 2 +- packages/ui/src/components/Popover/Popover.tsx | 2 +- packages/ui/src/components/Radio/Radio.tsx | 2 +- packages/ui/src/components/RadioOld/Radio.js | 2 +- packages/ui/src/components/Select/Select.tsx | 2 +- packages/ui/src/components/Tabs/Tabs.tsx | 2 +- packages/ui/src/components/Toggle/Toggle.tsx | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/ui/src/components/Accordion/Accordion.tsx b/packages/ui/src/components/Accordion/Accordion.tsx index 26a1629099c74..4b793744c12ca 100644 --- a/packages/ui/src/components/Accordion/Accordion.tsx +++ b/packages/ui/src/components/Accordion/Accordion.tsx @@ -39,7 +39,7 @@ export interface AccordionProps { } /** - * @deprecated Use ./Accordion_Shadcn_ instead + * @deprecated Use `import { Accordion_Shadcn_ } from "ui"` instead */ function Accordion({ children, diff --git a/packages/ui/src/components/Alert/Alert.tsx b/packages/ui/src/components/Alert/Alert.tsx index 34f40e9d2f06a..1c49c76c46059 100644 --- a/packages/ui/src/components/Alert/Alert.tsx +++ b/packages/ui/src/components/Alert/Alert.tsx @@ -27,7 +27,7 @@ const icons: Record = { } /** - * @deprecated Use Alert_Shadcn_. For studio use Admonition + * @deprecated Use `import { Alert_Shadcn_ } from "ui"` instead. For studio use `Admonition` */ export function Alert({ variant = 'neutral', diff --git a/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx b/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx index 35a06b852213c..7de226f7170bd 100644 --- a/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx +++ b/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx @@ -10,7 +10,7 @@ interface Props { } /** - * @deprecated Use ./Breadcrumb_shadcn_ instead + * @deprecated Use `import { Breadcrumb_shadcn_ } from "ui"` instead */ const Breadcrumb = ({ className, style, children, spacing = 'small' }: Props) => { let classes = [BreadcrumbStyle['sbui-breadcrumb--container']] diff --git a/packages/ui/src/components/Checkbox/Checkbox.tsx b/packages/ui/src/components/Checkbox/Checkbox.tsx index 0f37e7022c294..f98fafb97ceb5 100644 --- a/packages/ui/src/components/Checkbox/Checkbox.tsx +++ b/packages/ui/src/components/Checkbox/Checkbox.tsx @@ -36,7 +36,7 @@ interface GroupProps { } /** - * @deprecated Use ./Checkbox_shadcn_ instead + * @deprecated Use `import { Checkbox_shadcn_ } from "ui"` instead */ function Group({ id, diff --git a/packages/ui/src/components/Collapsible/Collapsible.tsx b/packages/ui/src/components/Collapsible/Collapsible.tsx index 88da35cb68937..cbc4941a8215a 100644 --- a/packages/ui/src/components/Collapsible/Collapsible.tsx +++ b/packages/ui/src/components/Collapsible/Collapsible.tsx @@ -9,7 +9,7 @@ export interface CollapsibleProps extends RadixCollapsible.CollapsibleProps { } /** - * @deprecated Use ./Collapsible_shadcn_ instead + * @deprecated Use `import { Collapsible_shadcn_ } from "ui"` instead */ export const Collapsible = ({ open = undefined, diff --git a/packages/ui/src/components/Form/Form.tsx b/packages/ui/src/components/Form/Form.tsx index 781d3da032fe7..47bd2c8202cfe 100644 --- a/packages/ui/src/components/Form/Form.tsx +++ b/packages/ui/src/components/Form/Form.tsx @@ -32,7 +32,7 @@ function errorReducer(state: any, action: any) { } /** - * @deprecated Use ./Form_shadcn_ instead + * @deprecated Use `import { Form_shadcn_ } from "ui"` instead */ export default function Form({ validate, ...props }: Props) { const [fieldLevelErrors, dispatchErrors] = useReducer(errorReducer, null) diff --git a/packages/ui/src/components/Input/Input.tsx b/packages/ui/src/components/Input/Input.tsx index d827478f87ef0..35f21c2aa8aa3 100644 --- a/packages/ui/src/components/Input/Input.tsx +++ b/packages/ui/src/components/Input/Input.tsx @@ -38,7 +38,7 @@ export interface Props } /** - * @deprecated Use ./Input_shadcn_ instead or ./ui-patterns/data-inputs/input + * @deprecated Use `import { Input_shadcn_ } from "ui"` instead or ./ui-patterns/data-inputs/input */ function Input({ autoComplete, diff --git a/packages/ui/src/components/InputNumber/InputNumber.tsx b/packages/ui/src/components/InputNumber/InputNumber.tsx index 91501de58ae3f..e4aad0c0f756c 100644 --- a/packages/ui/src/components/InputNumber/InputNumber.tsx +++ b/packages/ui/src/components/InputNumber/InputNumber.tsx @@ -27,7 +27,7 @@ export interface Props extends Omit, } /** - * @deprecated Use ./Input_shadcn_ with type="number" instead or ./ui-patterns/data-inputs/input with type="number" + * @deprecated Use `import { Input_shadcn_ } from "ui"` with `type="number"` instead or ./ui-patterns/data-inputs/input with `type="number"` */ function InputNumber({ defaultValue, diff --git a/packages/ui/src/components/InputOld/Input.js b/packages/ui/src/components/InputOld/Input.js index 8ccf6b8bd46a3..00c287a4d6452 100644 --- a/packages/ui/src/components/InputOld/Input.js +++ b/packages/ui/src/components/InputOld/Input.js @@ -5,7 +5,7 @@ import './Input.css' export const SIZES = ['small', 'medium'] /** - * @deprecated Use ./Input_shadcn_ with type="number" instead or ./ui-patterns/data-inputs/input with type="number" + * @deprecated Use `import { Input_shadcn_ } from "ui"` with `type="number"` instead or ./ui-patterns/data-inputs/input with `type="number"` */ const Input = ({ className = '', diff --git a/packages/ui/src/components/Listbox/Listbox2.tsx b/packages/ui/src/components/Listbox/Listbox2.tsx index f6e90ad0dcb54..2b4aa34a3282e 100644 --- a/packages/ui/src/components/Listbox/Listbox2.tsx +++ b/packages/ui/src/components/Listbox/Listbox2.tsx @@ -38,7 +38,7 @@ export interface Props extends Omit } /** - * @deprecated Use ./Select_shadcn_ or follow ComboBox convention or use ./ui-patterns/multi-select + * @deprecated Use `import { Select_shadcn_ } from "ui"` or follow ComboBox convention or use ./ui-patterns/multi-select */ function Listbox({ children, diff --git a/packages/ui/src/components/Modal/Modal.tsx b/packages/ui/src/components/Modal/Modal.tsx index ebdf78b5e2207..df2b7adfd9d24 100644 --- a/packages/ui/src/components/Modal/Modal.tsx +++ b/packages/ui/src/components/Modal/Modal.tsx @@ -62,7 +62,7 @@ interface ModalType Separator: React.ComponentType } -/** @deprecated use instead */ +/** @deprecated Use `import { Dialog } from "ui"` instead */ const Modal = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & ModalProps diff --git a/packages/ui/src/components/Popover/Popover.tsx b/packages/ui/src/components/Popover/Popover.tsx index faea74be735d1..59a3cf4aa2d28 100644 --- a/packages/ui/src/components/Popover/Popover.tsx +++ b/packages/ui/src/components/Popover/Popover.tsx @@ -30,7 +30,7 @@ interface RootProps { } /** - * @deprecated Use ./Popover_shadcn_ instead + * @deprecated Use `import { Popover_shadcn_ } from "ui"` instead */ function Popover({ align = 'center', diff --git a/packages/ui/src/components/Radio/Radio.tsx b/packages/ui/src/components/Radio/Radio.tsx index 7fa77a8a23bb2..19ecc83375c89 100644 --- a/packages/ui/src/components/Radio/Radio.tsx +++ b/packages/ui/src/components/Radio/Radio.tsx @@ -34,7 +34,7 @@ interface GroupProps { } /** - * @deprecated Use ./RadioGroup_Shadcn_ instead + * @deprecated Use `import { RadioGroup_Shadcn_ } from "ui"` instead */ function RadioGroup({ id, diff --git a/packages/ui/src/components/RadioOld/Radio.js b/packages/ui/src/components/RadioOld/Radio.js index bab2deab77818..8601699b2f42a 100644 --- a/packages/ui/src/components/RadioOld/Radio.js +++ b/packages/ui/src/components/RadioOld/Radio.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import './Radio.css' /** - * @deprecated Use ./RadioGroupItem_Shadcn_ and ./RadioGroup_Shadcn_ instead + * @deprecated Use `import { RadioGroup_Shadcn_, RadioGroupItem_Shadcn_ } from "ui"` instead */ const Radio = ({ className = '', label = '', containerClassName = '', children, ...props }) => { return ( diff --git a/packages/ui/src/components/Select/Select.tsx b/packages/ui/src/components/Select/Select.tsx index d6d40e73e1977..5794abf5c010b 100644 --- a/packages/ui/src/components/Select/Select.tsx +++ b/packages/ui/src/components/Select/Select.tsx @@ -41,7 +41,7 @@ export interface Props extends Omit export const ColLayout = (props: any) =>
{props.children}
/** - * @deprecated Use ./Select_shadcn_ instead + * @deprecated Use `import { Select_shadcn_ } from "ui"` instead */ function Select({ autoComplete, diff --git a/packages/ui/src/components/Tabs/Tabs.tsx b/packages/ui/src/components/Tabs/Tabs.tsx index 7d09ba8440fab..eb96b4bfa7d32 100644 --- a/packages/ui/src/components/Tabs/Tabs.tsx +++ b/packages/ui/src/components/Tabs/Tabs.tsx @@ -38,7 +38,7 @@ interface TabsSubComponents { } /** - * @deprecated Use ./Tabs_shadcn_ instead + * @deprecated Use `import { Tabs_shadcn_ } from "ui"` instead */ const Tabs: React.FC> & TabsSubComponents = ({ defaultActiveId, diff --git a/packages/ui/src/components/Toggle/Toggle.tsx b/packages/ui/src/components/Toggle/Toggle.tsx index 658e9e567d432..3093b267436ff 100644 --- a/packages/ui/src/components/Toggle/Toggle.tsx +++ b/packages/ui/src/components/Toggle/Toggle.tsx @@ -27,7 +27,7 @@ interface Props extends Omit, 'size'> { } /** - * @deprecated Use ./Switch instead + * @deprecated Use `import { Switch } from "ui"` instead */ function Toggle({ disabled,