-
+
event.stopPropagation()}>
+ onSelectAllItemsInColumn(index)}
+ />
+
+ Select all {columnFiles.length} files
+
+
Name
Size
diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx
index d206131f040..8b7caba93fd 100644
--- a/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageExplorer/FileExplorerRow.tsx
@@ -18,7 +18,7 @@ import {
} from 'lucide-react'
import type { CSSProperties } from 'react'
import {
- Checkbox,
+ Checkbox_Shadcn_ as Checkbox,
cn,
DropdownMenu,
DropdownMenuContent,
@@ -333,15 +333,15 @@ export const FileExplorerRow = ({
)}
{
- event.stopPropagation()
- onCheckItem((event.nativeEvent as KeyboardEvent).shiftKey)
+ // use onClick instead of onCheckedChange to handle shift-key selection
+ onClick={(event) => {
+ onCheckItem(event.nativeEvent.shiftKey)
}}
+ aria-label="Check to select this item"
/>
diff --git a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
index 55b2a6e09cc..313cd71f426 100644
--- a/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
+++ b/apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
@@ -1,5 +1,5 @@
import { noop } from 'lodash'
-import { Button, Checkbox, cn, Modal } from 'ui'
+import { Button, Checkbox_Shadcn_ as Checkbox, cn, Modal } from 'ui'
import { STORAGE_CLIENT_LIBRARY_MAPPINGS } from '../Storage.constants'
import { deriveAllowedClientLibraryMethods } from '../Storage.utils'
@@ -52,26 +52,58 @@ const PolicyAllowedOperations = ({ allowedOperations = [], onToggleOperation = (
-
onToggleOperation('SELECT')}
- checked={allowedOperations.includes('SELECT')}
- />
- onToggleOperation('INSERT')}
- checked={allowedOperations.includes('INSERT')}
- />
- onToggleOperation('UPDATE')}
- checked={allowedOperations.includes('UPDATE')}
- />
- onToggleOperation('DELETE')}
- checked={allowedOperations.includes('DELETE')}
- />
+
+ onToggleOperation('SELECT')}
+ checked={allowedOperations.includes('SELECT')}
+ />
+
+ SELECT
+
+
+
+ onToggleOperation('INSERT')}
+ checked={allowedOperations.includes('INSERT')}
+ />
+
+ INSERT
+
+
+
+ onToggleOperation('UPDATE')}
+ checked={allowedOperations.includes('UPDATE')}
+ />
+
+ UPDATE
+
+
+
+ onToggleOperation('DELETE')}
+ checked={allowedOperations.includes('DELETE')}
+ />
+
+ DELETE
+
+
{hasUpdateOrDelete && (
diff --git a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx
index f160ac1833f..ce007312c22 100644
--- a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx
@@ -1,7 +1,13 @@
import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { toast } from 'sonner'
-import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Button, Checkbox } from 'ui'
+import {
+ Alert_Shadcn_,
+ AlertDescription_Shadcn_,
+ AlertTitle_Shadcn_,
+ Button,
+ Checkbox_Shadcn_ as Checkbox,
+} from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { useTableFilter } from '@/components/grid/hooks/useTableFilter'
@@ -216,12 +222,24 @@ const DeleteConfirmationDialogs = ({
Are you sure you want to delete the selected column? This action cannot be undone.
-
snap.toggleConfirmationIsWithCascade()}
- />
+
+
snap.toggleConfirmationIsWithCascade()}
+ />
+
+
+ Drop column with cascade?
+
+
+ Deletes the column and its dependent objects
+
+
+
{isDeleteWithCascade && (
Are you sure you want to delete the selected table? This action cannot be undone.
- snap.toggleConfirmationIsWithCascade(!isDeleteWithCascade)}
- />
+
+
snap.toggleConfirmationIsWithCascade(!isDeleteWithCascade)}
+ />
+
+
+ Drop table with cascade?
+
+
+ Deletes the table and its dependent objects
+
+
+
{isDeleteWithCascade && (
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx
index 334cbd8a2b8..5db6e03a62d 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx
@@ -5,7 +5,6 @@ import { useState } from 'react'
import {
Badge,
Button,
- Checkbox,
Checkbox_Shadcn_,
cn,
Command_Shadcn_,
@@ -284,10 +283,10 @@ export const Column = ({
-
{
+ onCheckedChange={() => {
const updatedValue = !column.isPrimaryKey
onUpdateColumn({
isPrimaryKey: updatedValue,
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
index 4559ad46ad9..29206299ab1 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
@@ -2,7 +2,7 @@ import type { PostgresTable } from '@supabase/postgres-meta'
import { isEmpty, noop } from 'lodash'
import { useContext, useEffect, useMemo, useState } from 'react'
import { toast } from 'sonner'
-import { Badge, Checkbox, Input, SidePanel } from 'ui'
+import { Badge, Checkbox_Shadcn_, Input, SidePanel } from 'ui'
import { Admonition } from 'ui-patterns'
import { ConfirmationModal } from 'ui-patterns/Dialogs/ConfirmationModal'
@@ -371,26 +371,31 @@ export const TableEditor = ({
-
+
+
{
+ // if isEnabled, show confirm modal to turn off
+ // if not enabled, allow turning on without modal confirmation
+ tableFields.isRLSEnabled
+ ? setRlsConfirmVisible(true)
+ : onUpdateField({ isRLSEnabled: !tableFields.isRLSEnabled })
+ }}
+ />
+
+
Enable Row Level Security (RLS)
Recommended
-
- }
- description="Restrict access to your table by enabling RLS and writing Postgres policies."
- checked={tableFields.isRLSEnabled}
- onChange={() => {
- // if isEnabled, show confirm modal to turn off
- // if not enabled, allow turning on without modal confirmation
- tableFields.isRLSEnabled
- ? setRlsConfirmVisible(true)
- : onUpdateField({ isRLSEnabled: !tableFields.isRLSEnabled })
- }}
- size="medium"
- />
+
+
+ Restrict access to your table by enabling RLS and writing Postgres policies.
+
+
+
{tableFields.isRLSEnabled ? (
{
- track('realtime_toggle_table_clicked', {
- newState: tableFields.isRealtimeEnabled ? 'disabled' : 'enabled',
- origin: 'tableSidePanel',
- })
- onUpdateField({
- isRealtimeEnabled: !tableFields.isRealtimeEnabled,
- })
- }}
- size="medium"
- />
+
+
{
+ track('realtime_toggle_table_clicked', {
+ newState: tableFields.isRealtimeEnabled ? 'disabled' : 'enabled',
+ origin: 'tableSidePanel',
+ })
+ onUpdateField({
+ isRealtimeEnabled: !tableFields.isRealtimeEnabled,
+ })
+ }}
+ />
+
+
+ Enable Realtime
+
+
+ Broadcast changes on this table to authorized subscribers.
+
+
+
)}
@@ -474,14 +489,24 @@ export const TableEditor = ({
)}
{isDuplicating && (
<>
- setIsDuplicateRows(!isDuplicateRows)}
- size="medium"
- />
+
+
setIsDuplicateRows(!isDuplicateRows)}
+ />
+
+
+ Duplicate table entries
+
+
+ This will copy all the data in the table into the new table
+
+
+
>
)}
diff --git a/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx b/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
index 0cf3ead66a6..a7e68985006 100644
--- a/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
+++ b/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
@@ -3,7 +3,7 @@ import { useParams } from 'common'
import { ChangeEvent, useEffect, useState } from 'react'
import { AWS_REGIONS } from 'shared-data'
import { toast } from 'sonner'
-import { Alert, Button, Checkbox, Input, Listbox } from 'ui'
+import { Alert, Button, Checkbox_Shadcn_, Input, Listbox } from 'ui'
import { isVercelUrl } from '@/components/interfaces/Integrations/Vercel/VercelIntegration.utils'
import { Markdown } from '@/components/interfaces/Markdown'
@@ -306,22 +306,48 @@ const CreateProject = () => {
-
setShouldRunMigrations(e.target.checked)}
- />
+
+
setShouldRunMigrations(!!checked)}
+ />
+
+
+ Create sample tables with seed data
+
+
+ To get you started quickly, we can create new tables for you with seed (sample) data.
+ You can delete these tables later.
+
+
+
-
setDataApiDefaultPrivileges(e.target.checked)}
- />
+
+
setDataApiDefaultPrivileges(!!checked)}
+ />
+
+
+ Automatically expose new tables and functions
+
+
+ Grants privileges to Data API roles by default, exposing new tables and functions. We
+ recommend disabling this to control access manually.
+
+
+
setShowSelfHostedOnly(!showSelfHostedOnly)}
+ onCheckedChange={() => setShowSelfHostedOnly(!showSelfHostedOnly)}
className="[&_input]:m-0"
/>
handleProductChange(product)}
+ onCheckedChange={() => handleProductChange(product)}
className="[&_input]:m-0"
/>
{
- it('should render checkbox correctly', () => {
- render( )
- expect(screen.queryByTestId('form-checkbox')).toBeInTheDocument()
- })
-
- it('should show label', () => {
- render( )
- expect(screen.queryByText('JavaScript')).toBeInTheDocument()
- })
-})
diff --git a/packages/ui/src/components/Checkbox/Checkbox.tsx b/packages/ui/src/components/Checkbox/Checkbox.tsx
deleted file mode 100644
index e87a0f39d00..00000000000
--- a/packages/ui/src/components/Checkbox/Checkbox.tsx
+++ /dev/null
@@ -1,201 +0,0 @@
-'use client'
-
-import React from 'react'
-
-import { FormLayout } from '../../lib/Layout/FormLayout/FormLayout'
-import styleHandler from '../../lib/theme/styleHandler'
-import CheckboxStyles from './Checkbox.module.css'
-import { CheckboxContext } from './CheckboxContext'
-
-export interface InputProps extends Omit, 'size'> {
- afterLabel?: string
- beforeLabel?: string
- description?: string
- label?: string
- size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge'
-}
-
-interface GroupProps {
- id?: string
- layout?: 'horizontal' | 'vertical'
- error?: any
- descriptionText?: any
- label?: any
- afterLabel?: string
- beforeLabel?: string
- labelOptional?: any
- name?: any
- value?: any
- className?: string
- children?: React.ReactNode
- options?: Array
- defaultValue?: string
- onChange?(x: React.ChangeEvent): void
- size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge'
-}
-
-/**
- * @deprecated Use `import { Checkbox_shadcn_ } from "ui"` instead
- */
-function Group({
- id,
- layout = 'vertical',
- error,
- descriptionText,
- label,
- afterLabel,
- beforeLabel,
- labelOptional,
- children,
- className,
- options,
- onChange,
- size = 'medium',
-}: GroupProps) {
- const parentCallback = (e: React.ChangeEvent) => {
- if (onChange) onChange(e)
- }
-
- const __styles = styleHandler('checkbox')
-
- return (
-
-
-
- {options
- ? options.map((option: InputProps) => {
- return (
-
- )
- })
- : children}
-
-
-
- )
-}
-
-/**
- * @deprecated Use ./Checkbox_shadcn_ instead
- */
-export function Checkbox({
- className,
- id = '',
- name = '',
- label,
- afterLabel,
- beforeLabel,
- description,
- value,
- onChange,
- size = 'medium',
- disabled = false,
- ...props
-}: InputProps) {
- const __styles = styleHandler('checkbox')
-
- return (
-
- {({ parentCallback, parentSize }) => {
- // if id does not exist, use label
- const markupId = id
- ? id
- : name
- ? name
- : label
- ? label
- .toLowerCase()
- .replace(/^[^A-Z0-9]+/gi, '')
- .replace(/ /g, '-')
- : undefined
-
- // @ts-ignore
- size = parentSize ? parentSize : size
-
- // if name does not exist on Radio then use Context Name from Radio.Group
- // if that fails, use the id
- const markupName = name ? name : markupId
-
- let containerClasses = [__styles.container]
-
- function onInputChange(e: React.ChangeEvent) {
- // '`onChange` callback for parent component
- if (parentCallback) parentCallback(e)
- // '`onChange` callback for this component
- if (onChange) onChange(e)
- }
-
- if (className) containerClasses.push(className)
-
- return (
-
-
-
-
-
- {beforeLabel && (
-
- {beforeLabel}
-
- )}
- {label}
- {afterLabel && (
-
- {afterLabel}
-
- )}
-
-
- {description && (
-
- {description}
-
- )}
-
-
- )
- }}
-
- )
-}
-
-Checkbox.Group = Group
-export default Checkbox
diff --git a/packages/ui/src/components/Checkbox/CheckboxContext.tsx b/packages/ui/src/components/Checkbox/CheckboxContext.tsx
deleted file mode 100644
index a2a783b01f9..00000000000
--- a/packages/ui/src/components/Checkbox/CheckboxContext.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-'use client'
-
-import { createContext } from 'react'
-
-// Make sure the shape of the default value passed to
-// createContext matches the shape that the consumers expect!
-export const CheckboxContext = createContext({
- parentCallback: (e: any) => {},
- parentSize: '',
-})
diff --git a/packages/ui/src/components/Checkbox/index.tsx b/packages/ui/src/components/Checkbox/index.tsx
deleted file mode 100644
index 78f632097e3..00000000000
--- a/packages/ui/src/components/Checkbox/index.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-import Checkbox from './Checkbox'
-
-export default Checkbox
-export { default as Checkbox } from './Checkbox'
diff --git a/packages/ui/src/lib/theme/defaultTheme.ts b/packages/ui/src/lib/theme/defaultTheme.ts
index e61e10cb6e5..dc215a55cd2 100644
--- a/packages/ui/src/lib/theme/defaultTheme.ts
+++ b/packages/ui/src/lib/theme/defaultTheme.ts
@@ -511,65 +511,6 @@ export default {
chevron: 'h-5 w-5 text-foreground-lighter',
},
- /*
- * Checkbox
- *
- *
- * This Checkbox requires a plugin in your config:
-
- ```
- // tailwind.config.js
- module.exports = {
- // ...
- plugins: [
- // ...
- require('@tailwindcss/forms'),
- ],
- }
- ```
- *
- *
- */
-
- checkbox: {
- base: `
- bg-transparent
- ${defaults.focus}
- focus:ring-border-muted
- text-brand
- border-strong
- shadow-sm
- rounded
- cursor-pointer
- `,
- container: `flex cursor-pointer leading-none`,
- size: {
- tiny: `h-3 w-3 mt-1 mr-3`,
- small: `h-3.5 w-3.5 mt-0.5 mr-3.5`,
- medium: `h-4 w-4 mt-0.5 mr-3.5`,
- large: `h-5 w-5 mt-0.5 mr-4`,
- xlarge: `h-5 w-5 mt-0.5 mr-4`,
- },
- disabled: 'opacity-50',
- label: {
- base: `text-foreground-light cursor-pointer`,
- ...defaults.size.text,
- },
- label_before: {
- base: 'text-border',
- ...defaults.size.text,
- },
- label_after: {
- base: 'text-border',
- ...defaults.size.text,
- },
- description: {
- base: `text-foreground-lighter`,
- ...defaults.size.text,
- },
- group: `space-y-3`,
- },
-
sidepanel: {
base: `
z-50