Skip to content

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

[packages/ui] chore: deprecate old components (#26817)

Jonathan Summers-Muird69b44bd4a63
diff --git a/packages/ui/src/components/Accordion/Accordion.tsx b/packages/ui/src/components/Accordion/Accordion.tsx
index 50e7f35cc54..612ba1090cb 100644
--- a/packages/ui/src/components/Accordion/Accordion.tsx
+++ b/packages/ui/src/components/Accordion/Accordion.tsx
@@ -38,6 +38,9 @@ export interface AccordionProps {
chevronAlign?: Align
}
+/**
+ * @deprecated Use ./Accordion_Shadcn_ instead
+ */
function Accordion({
children,
className,
@@ -98,6 +101,9 @@ interface ItemProps {
disabled?: boolean
}
+/**
+ * @deprecated Use ./AccordionItem_Shadcn_ instead
+ */
export function Item({ children, className, header, id, disabled }: ItemProps) {
const __styles = styleHandler('accordion')
const [open, setOpen] = useState(false)
diff --git a/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx b/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx
index 65d97cbb722..64273c14da3 100644
--- a/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx
+++ b/packages/ui/src/components/Breadcrumb/Breadcrumb.tsx
@@ -9,6 +9,9 @@ interface Props {
spacing?: 'small' | 'medium' | 'large'
}
+/**
+ * @deprecated Use ./Breadcrumb_shadcn_ instead
+ */
const Breadcrumb = ({ className, style, children, spacing = 'small' }: Props) => {
let classes = [BreadcrumbStyle['sbui-breadcrumb--container']]
let separatorClasses = [BreadcrumbStyle['sbui-breadcrumb--separator']]
@@ -42,6 +45,9 @@ interface ItemProps {
style?: React.CSSProperties
}
+/**
+ * @deprecated Use ./BreadcrumbItem_shadcn_ instead
+ */
export function Item({ children, active, onClick, style }: ItemProps) {
let classes = [BreadcrumbStyle['sbui-breadcrumb--item']]
if (active) classes.push(BreadcrumbStyle['sbui-breadcrumb--item__active'])
diff --git a/packages/ui/src/components/Checkbox/Checkbox.tsx b/packages/ui/src/components/Checkbox/Checkbox.tsx
index 20b82a003e5..0f37e7022c2 100644
--- a/packages/ui/src/components/Checkbox/Checkbox.tsx
+++ b/packages/ui/src/components/Checkbox/Checkbox.tsx
@@ -35,6 +35,9 @@ interface GroupProps {
size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge'
}
+/**
+ * @deprecated Use ./Checkbox_shadcn_ instead
+ */
function Group({
id,
layout = 'vertical',
@@ -95,6 +98,9 @@ function Group({
)
}
+/**
+ * @deprecated Use ./Checkbox_shadcn_ instead
+ */
export function Checkbox({
className,
id = '',
diff --git a/packages/ui/src/components/Collapsible/Collapsible.tsx b/packages/ui/src/components/Collapsible/Collapsible.tsx
index 89efba7ae97..88da35cb689 100644
--- a/packages/ui/src/components/Collapsible/Collapsible.tsx
+++ b/packages/ui/src/components/Collapsible/Collapsible.tsx
@@ -8,6 +8,9 @@ export interface CollapsibleProps extends RadixCollapsible.CollapsibleProps {
children: React.ReactNode
}
+/**
+ * @deprecated Use ./Collapsible_shadcn_ instead
+ */
export const Collapsible = ({
open = undefined,
children,
@@ -28,10 +31,16 @@ export const Collapsible = ({
)
}
+/**
+ * @deprecated Use ./CollapsibleTrigger_shadcn_ instead
+ */
export function Trigger({ children, asChild }: { children: React.ReactNode; asChild?: boolean }) {
return <RadixCollapsible.Trigger asChild={asChild}>{children}</RadixCollapsible.Trigger>
}
+/**
+ * @deprecated Use ./CollapsibleContent_shadcn_ instead
+ */
export function Content({
asChild,
children,
diff --git a/packages/ui/src/components/ContextMenu/ContextMenu.tsx b/packages/ui/src/components/ContextMenu/ContextMenu.tsx
index 20ae5f6f66b..b80dcf212fc 100644
--- a/packages/ui/src/components/ContextMenu/ContextMenu.tsx
+++ b/packages/ui/src/components/ContextMenu/ContextMenu.tsx
@@ -17,6 +17,9 @@ interface RootProps {
style?: React.CSSProperties
}
+/**
+ * @deprecated Use ./ContextMenu_shadcn_ instead
+ */
function ContextMenu({
onOpenChange,
@@ -56,6 +59,9 @@ interface ItemProps {
onClick?: (event: Event) => void
}
+/**
+ * @deprecated Use ./ContextMenuItem_shadcn_ instead
+ */
export function Item({ children, icon, disabled, onClick }: ItemProps) {
return (
<RadixContextMenu.Item
@@ -69,6 +75,9 @@ export function Item({ children, icon, disabled, onClick }: ItemProps) {
)
}
+/**
+ * @deprecated Use ./ContextMenu_shadcn_ instead
+ */
export function Misc({ children, icon }: ItemProps) {
return (
<div
@@ -88,6 +97,9 @@ interface CheckboxProps {
ItemIndicator?: React.ReactNode
}
+/**
+ * @deprecated Use ./ContextMenuCheckboxItem_shadcn_ instead
+ */
export function Checkbox({
children,
checked: propsChecked,
@@ -126,6 +138,9 @@ interface RadioProps {
ItemIndicator?: React.ReactNode
}
+/**
+ * @deprecated Use ./ContextMenuRadioItem_shadcn_ instead
+ */
export function Radio({ children, value, ItemIndicator }: RadioProps) {
return (
<RadixContextMenu.RadioItem
@@ -148,6 +163,9 @@ interface RadioGroupProps {
onChange?(x: string): void
}
+/**
+ * @deprecated Use ./ContextMenuRadioGroup_shadcn_ instead
+ */
export function RadioGroup({ children, value: propsValue, onChange }: RadioGroupProps) {
const [value, setValue] = useState(propsValue ? propsValue : '')
@@ -167,6 +185,9 @@ interface LabelProps {
children: React.ReactNode
}
+/**
+ * @deprecated Use ./ContextMenuLabel_shadcn_ instead
+ */
export function Label({ children }: LabelProps) {
return (
<RadixContextMenu.Label
diff --git a/packages/ui/src/components/Divider/Divider.tsx b/packages/ui/src/components/Divider/Divider.tsx
index 7030dff9e56..7dde6bf5328 100644
--- a/packages/ui/src/components/Divider/Divider.tsx
+++ b/packages/ui/src/components/Divider/Divider.tsx
@@ -11,6 +11,9 @@ interface Props {
type?: 'vertical' | 'horizontal'
}
+/**
+ * @deprecated Use ./Separator instead
+ */
export default function Divider({
children,
className,
diff --git a/packages/ui/src/components/Form/Form.tsx b/packages/ui/src/components/Form/Form.tsx
index 348f370ed05..781d3da032f 100644
--- a/packages/ui/src/components/Form/Form.tsx
+++ b/packages/ui/src/components/Form/Form.tsx
@@ -31,6 +31,9 @@ function errorReducer(state: any, action: any) {
}
}
+/**
+ * @deprecated Use ./Form_shadcn_ instead
+ */
export default function Form({ validate, ...props }: Props) {
const [fieldLevelErrors, dispatchErrors] = useReducer(errorReducer, null)
diff --git a/packages/ui/src/components/Image/Image.tsx b/packages/ui/src/components/Image/Image.tsx
index e079acae6e4..4fec7a8326e 100644
--- a/packages/ui/src/components/Image/Image.tsx
+++ b/packages/ui/src/components/Image/Image.tsx
@@ -11,14 +11,10 @@ interface Props {
responsive?: boolean
}
-export default function Image({
- source,
- style,
- className,
- type,
- alt,
- responsive,
-}: Props) {
+/**
+ * @deprecated Use Next/Image instead
+ */
+export default function Image({ source, style, className, type, alt, responsive }: Props) {
// let classes = [ImageStyles['sbui-image-normal']]
// classes.push(type === 'rounded' && ImageStyles['sbui-image-rounded'])
// classes.push(type === 'circle' && ImageStyles['sbui-image-circle'])
diff --git a/packages/ui/src/components/Input/Input.tsx b/packages/ui/src/components/Input/Input.tsx
index 48374dc9e5e..63f623051c8 100644
--- a/packages/ui/src/components/Input/Input.tsx
+++ b/packages/ui/src/components/Input/Input.tsx
@@ -36,6 +36,9 @@ export interface Props
validation?: (x: any) => void
}
+/**
+ * @deprecated Use ./Input_shadcn_ instead or ./ui-patterns/data-inputs/input
+ */
function Input({
autoComplete,
autoFocus,
@@ -196,6 +199,9 @@ function Input({
)
}
+/**
+ * @deprecated Use ./TextArea_Shadcn_ instead
+ */
export interface TextAreaProps
extends Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, 'size' | 'onCopy'> {
textAreaClassName?: string
diff --git a/packages/ui/src/components/InputNumber/InputNumber.tsx b/packages/ui/src/components/InputNumber/InputNumber.tsx
index a9beaa6cd8d..91501de58ae 100644
--- a/packages/ui/src/components/InputNumber/InputNumber.tsx
+++ b/packages/ui/src/components/InputNumber/InputNumber.tsx
@@ -26,6 +26,9 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
validation?: (x: any) => void
}
+/**
+ * @deprecated Use ./Input_shadcn_ with type="number" instead or ./ui-patterns/data-inputs/input with type="number"
+ */
function InputNumber({
defaultValue,
descriptionText,
diff --git a/packages/ui/src/components/InputOld/Input.js b/packages/ui/src/components/InputOld/Input.js
index 036f9fe179b..8ccf6b8bd46 100644
--- a/packages/ui/src/components/InputOld/Input.js
+++ b/packages/ui/src/components/InputOld/Input.js
@@ -4,9 +4,12 @@ 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"
+ */
const Input = ({
className = '',
- type='text',
+ type = 'text',
size = 'medium',
isError = false,
children,
diff --git a/packages/ui/src/components/Listbox/Listbox2.tsx b/packages/ui/src/components/Listbox/Listbox2.tsx
index 39957d0152f..98b9f3dac64 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<React.InputHTMLAttributes<HTMLButtonElement>
}
/**
- * @deprecated The component should not be used
+ * @deprecated Use ./Select_shadcn_ or follow ComboBox convention or use ./ui-patterns/multi-select
*/
function Listbox({
children,
@@ -280,6 +280,9 @@ type addOnBefore = {
active: boolean
}
+/**
+ * @deprecated Use ./Select_shadcn_ or follow ComboBox convention or use ./ui-patterns/multi-select
+ */
function SelectOption({
id,
value,
diff --git a/packages/ui/src/components/Modal/Modal.tsx b/packages/ui/src/components/Modal/Modal.tsx
index 0e45ba1abc5..d62d1fb32ef 100644
--- a/packages/ui/src/components/Modal/Modal.tsx
+++ b/packages/ui/src/components/Modal/Modal.tsx
@@ -60,6 +60,9 @@ interface Props {
header?: React.ReactNode
}
+/**
+ * @deprecated Use ./Dialog instead
+ */
const Modal = ({
children,
customFooter = undefined,
@@ -165,11 +168,17 @@ const Modal = ({
)
}
+/**
+ * @deprecated Use ./Dialog instead
+ */
function Content({ children, className }: { children: React.ReactNode; className?: string }) {
const __styles = styleHandler('modal')
return <div className={cn(__styles.content, className)}>{children}</div>
}
+/**
+ * @deprecated Use ./Dialog instead
+ */
export function Separator() {
const __styles = styleHandler('modal')
diff --git a/packages/ui/src/components/Popover/Popover.tsx b/packages/ui/src/components/Popover/Popover.tsx
index d27df078479..17f9d17dda6 100644
--- a/packages/ui/src/components/Popover/Popover.tsx
+++ b/packages/ui/src/components/Popover/Popover.tsx
@@ -28,6 +28,9 @@ interface RootProps {
size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge' | 'content'
}
+/**
+ * @deprecated Use ./Popover_shadcn_ instead
+ */
function Popover({
align = 'center',
ariaLabel,
@@ -93,6 +96,9 @@ function Popover({
)
}
+/**
+ * @deprecated Use ./Popover_shadcn_ instead
+ */
function Close() {
const __styles = styleHandler('popover')
@@ -103,6 +109,9 @@ function Close() {
)
}
+/**
+ * @deprecated Use ./PopoverSeparator_Shadcn_ instead
+ */
function Separator() {
const __styles = styleHandler('popover')
diff --git a/packages/ui/src/components/Radio/Radio.tsx b/packages/ui/src/components/Radio/Radio.tsx
index 470ee5786a1..7fa77a8a23b 100644
--- a/packages/ui/src/components/Radio/Radio.tsx
+++ b/packages/ui/src/components/Radio/Radio.tsx
@@ -33,6 +33,9 @@ interface GroupProps {
labelsLayout?: 'horizontal' | 'vertical'
}
+/**
+ * @deprecated Use ./RadioGroup_Shadcn_ instead
+ */
function RadioGroup({
id,
layout,
@@ -146,6 +149,9 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
children?: React.ReactNode
}
+/**
+ * @deprecated Use ./RadioGroupItem_Shadcn_ instead
+ */
function Radio({
id = generateUID(),
disabled,
diff --git a/packages/ui/src/components/RadioOld/Radio.js b/packages/ui/src/components/RadioOld/Radio.js
index df1a3adeb63..bab2deab778 100644
--- a/packages/ui/src/components/RadioOld/Radio.js
+++ b/packages/ui/src/components/RadioOld/Radio.js
@@ -2,14 +2,10 @@ import React from 'react'
import PropTypes from 'prop-types'
import './Radio.css'
-const Radio = ({
- className = '',
- label = '',
- containerClassName = '',
- children,
- ...props
-}) => {
-
+/**
+ * @deprecated Use ./RadioGroupItem_Shadcn_ and ./RadioGroup_Shadcn_ instead
+ */
+const Radio = ({ className = '', label = '', containerClassName = '', children, ...props }) => {
return (
<label className={`inline-flex items-center ${containerClassName}`}>
<input type="radio" className={`form-radio border-solid h-4 w-4 ${className}`} {...props} />
diff --git a/packages/ui/src/components/Select/Select.tsx b/packages/ui/src/components/Select/Select.tsx
index 87a587be9b5..d6d40e73e19 100644
--- a/packages/ui/src/components/Select/Select.tsx
+++ b/packages/ui/src/components/Select/Select.tsx
@@ -40,6 +40,9 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLSelectElement>
export const ColLayout = (props: any) => <div>{props.children}</div>
+/**
+ * @deprecated Use ./Select_shadcn_ instead
+ */
function Select({
autoComplete,
autofocus,
@@ -168,6 +171,9 @@ function Select({
)
}
+/**
+ * @deprecated Use ./SelectItem_Shadcn_ instead
+ */
export function Option({ value, children, selected }: OptionProps) {
return (
<option value={value} selected={selected}>
@@ -176,6 +182,9 @@ export function Option({ value, children, selected }: OptionProps) {
)
}
+/**
+ * @deprecated Use ./SelectGroup_Shadcn_ instead
+ */
export function OptGroup({ label, children }: OptGroupProps) {
return <optgroup label={label}>{children}</optgroup>
}
diff --git a/packages/ui/src/components/Space/Space.tsx b/packages/ui/src/components/Space/Space.tsx
index 45fc2fb5748..8694d9e7287 100644
--- a/packages/ui/src/components/Space/Space.tsx
+++ b/packages/ui/src/components/Space/Space.tsx
@@ -2,6 +2,9 @@ import React from 'react'
// @ts-ignore
// import SpaceStyles from './Space.module.css'
+/**
+ * @deprecated Use tailwind instead
+ */
function Space({ direction, size = 2, className, block, style, minus, children }: any) {
// const classes = []
// classes.push(direction === 'vertical' ? 'sbui-space-col' : 'sbui-space-row')
diff --git a/packages/ui/src/components/Tabs/Tabs.tsx b/packages/ui/src/components/Tabs/Tabs.tsx
index 621d2d9bbed..7d09ba8440f 100644
--- a/packages/ui/src/components/Tabs/Tabs.tsx
+++ b/packages/ui/src/components/Tabs/Tabs.tsx
@@ -37,6 +37,9 @@ interface TabsSubComponents {
Panel: React.FC<PropsWithChildren<PanelProps>>
}
+/**
+ * @deprecated Use ./Tabs_shadcn_ instead
+ */
const Tabs: React.FC<PropsWithChildren<TabsProps>> & TabsSubComponents = ({
defaultActiveId,
activeId,
@@ -141,6 +144,9 @@ interface PanelProps {
className?: string
}
+/**
+ * @deprecated Use ./TabsContent_Shadcn_ instead
+ */
export const Panel: React.FC<PropsWithChildren<PanelProps>> = ({ children, id, className }) => {
let __styles = styleHandler('tabs')
diff --git a/packages/ui/src/components/Textarea/Textarea.js b/packages/ui/src/components/Textarea/Textarea.js
index 3d1aa7e35b6..1dcf7343596 100644
--- a/packages/ui/src/components/Textarea/Textarea.js
+++ b/packages/ui/src/components/Textarea/Textarea.js
@@ -2,6 +2,9 @@ import React from 'react'
import PropTypes from 'prop-types'
import './Textarea.css'
+/**
+ * @deprecated Use ./TextArea_Shadcn_ instead
+ */
const Textarea = ({
className = '',
isError = false,
diff --git a/packages/ui/src/components/Toast/Toast.tsx b/packages/ui/src/components/Toast/Toast.tsx
index 2e8d90e5450..bb63bfa1150 100644
--- a/packages/ui/src/components/Toast/Toast.tsx
+++ b/packages/ui/src/components/Toast/Toast.tsx
@@ -57,6 +57,7 @@ function Description({ children, ...props }: ComponentProps<typeof Typography.Te
*
* `Toast.toast('Message', { description: 'Description', actions: [<SomeButton />] })`
*/
+
function Toast({
id,
visible,
diff --git a/packages/ui/src/components/Toggle/Toggle.tsx b/packages/ui/src/components/Toggle/Toggle.tsx
index 89869ed08f4..658e9e567d4 100644
--- a/packages/ui/src/components/Toggle/Toggle.tsx
+++ b/packages/ui/src/components/Toggle/Toggle.tsx
@@ -26,6 +26,9 @@ interface Props extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'size'> {
validation?: (x: any) => void
}
+/**
+ * @deprecated Use ./Switch instead
+ */
function Toggle({
disabled,
id = '',