Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/design-system/content/docs/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Chromium-based browsers and Firefox handle this automatically via the Tab key. S

Interactive page elements should also provide visual feedback upon selection via a `focus-visible` state. We use consistent focus styles such as `inset-focus` so users recognize this state instantly.

[Button](components/button) has all of the above built-in. Bespoke interactive elements however, such as the below interactive [Table Row](components/table#examples), require these props to be added manually:
[Button](components/button) has all of the above built-in. The same explicit `tabIndex` default is also baked into Checkbox, Switch, Select Trigger, Toggle, Accordion Trigger, Collapsible Trigger, Dropdown Menu Trigger, Popover Trigger, Dialog Trigger, Sheet Trigger, Alert Dialog Trigger, and the Sidebar Menu and action buttons. Bespoke interactive elements however, such as the below interactive [Table Row](components/table#examples), require these props to be added manually:

```tsx showLineNumbers {4-14}
<TableRow
Expand Down
8 changes: 7 additions & 1 deletion apps/docs/middleware.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { NextRequest } from 'next/server'
import { describe, expect, it } from 'vitest'
import { describe, expect, it, vi } from 'vitest'

import { middleware } from './middleware'

// The real manifest is generated at build time by a content script; mocking
// it here decouples this test from that build step.
vi.mock('~/public/markdown/manifest.json', () => ({
default: ['auth'],
}))

// BASE_PATH defaults to '/docs' when NEXT_PUBLIC_BASE_PATH is unset, so test
// paths include the /docs prefix to match the middleware's GUIDES_PATH check.
function makeRequest(
Expand Down
5 changes: 1 addition & 4 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
"preinstall": "npx only-allow pnpm",
"presync": "pnpm run codegen:graphql",
"pretest": "pnpm run codegen:examples",
"pretest:local": "pnpm run build:guides-markdown",
"pretest:local:unwatch": "pnpm run build:guides-markdown",
"pretest:smoke": "pnpm run build:guides-markdown",
"pretypecheck": "pnpm run codegen:graphql && pnpm run build:markdown && next typegen",
"pretypecheck": "pnpm run codegen:graphql && next typegen",
"start": "next start",
"sync": "tsx --conditions=react-server ./resources/rootSync.ts",
"test": "pnpm supabase start && pnpm run test:local && pnpm supabase stop",
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/types/manifest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// public/markdown/manifest.json is generated by internals/generate-guides-markdown.ts
// and gitignored, so it may not exist on disk when tsc runs.
declare module '~/public/markdown/manifest.json' {
const slugs: string[]
export default slugs
}
71 changes: 69 additions & 2 deletions apps/studio/.github/eslint-rule-baselines.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"jsx-a11y/tabindex-no-positive": 0,
"jsx-a11y/anchor-is-valid": 7,
"jsx-a11y/heading-has-content": 2,
"jsx-a11y/no-distracting-elements": 0
"jsx-a11y/no-distracting-elements": 0,
"supabase/require-explicit-tabindex": 82
},
"ruleFiles": {
"react-hooks/exhaustive-deps": {
Expand Down Expand Up @@ -1067,6 +1068,72 @@
"jsx-a11y/heading-has-content": {
"components/layouts/Scaffold.tsx": 2
},
"jsx-a11y/no-distracting-elements": {}
"jsx-a11y/no-distracting-elements": {},
"supabase/require-explicit-tabindex": {
"components/grid/components/grid/ColumnHeader.tsx": 1,
"components/grid/components/header/sort/SortRow.tsx": 1,
"components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx": 1,
"components/interfaces/BranchManagement/EdgeFunctionsDiffPanel.tsx": 1,
"components/interfaces/BranchManagement/WorkflowLogs.tsx": 1,
"components/interfaces/Connect/OrganizationSelector.tsx": 1,
"components/interfaces/ConnectSheet/ConnectConfigSection.tsx": 1,
"components/interfaces/ConnectSheet/ConnectionParameters.tsx": 1,
"components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx": 1,
"components/interfaces/Database/Policies/PolicyEditorPanel/PolicyEditorPanelHeader.tsx": 1,
"components/interfaces/Database/Privileges/PrivilegesTable.tsx": 1,
"components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx": 1,
"components/interfaces/Database/Replication/DestinationPanel/ReadReplicaForm/ReadReplicaPricingDialog.tsx": 1,
"components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.tsx": 1,
"components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx": 1,
"components/interfaces/Database/Replication/ReplicationPipelineStatus/TableReplicationRow.tsx": 1,
"components/interfaces/Database/Roles/RoleRow.tsx": 1,
"components/interfaces/Database/Roles/RolesList.tsx": 2,
"components/interfaces/Database/Triggers/TriggerSheet.tsx": 1,
"components/interfaces/ExplainVisualizer/ExplainVisualizer.NodeRow.tsx": 1,
"components/interfaces/Functions/CommandRender.tsx": 1,
"components/interfaces/Functions/EdgeFunctionsListItem.tsx": 1,
"components/interfaces/Integrations/Integration/MarkdownContent.tsx": 1,
"components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx": 3,
"components/interfaces/LogDrains/LogDrainsCard.tsx": 1,
"components/interfaces/Observability/ServiceHealthTable.tsx": 1,
"components/interfaces/Organization/OrganizationCard.tsx": 1,
"components/interfaces/Organization/PrivateApps/Apps/ViewAppSheet/ViewAppSheetInfo.tsx": 1,
"components/interfaces/ProjectAPIDocs/FirstLevelNav.tsx": 6,
"components/interfaces/ProjectAPIDocs/SecondLevelNav.Layout.tsx": 1,
"components/interfaces/ProjectHome/ConnectSection.tsx": 1,
"components/interfaces/ProjectHome/SortableSection.tsx": 1,
"components/interfaces/QueryInsights/QueryInsightsChart/QueryInsightsChart.tsx": 2,
"components/interfaces/QueryPerformance/QueryPerformanceMetrics.tsx": 2,
"components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx": 3,
"components/interfaces/Storage/BucketFilePickerDialog/BucketFilePickerHeader.tsx": 1,
"components/interfaces/Storage/StorageExplorer/FileExplorerRowEditing.tsx": 1,
"components/interfaces/Storage/StorageExplorer/MoveItemsModal.tsx": 1,
"components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketsSection.tsx": 1,
"components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx": 1,
"components/interfaces/Storage/StorageSettings/StorageSettings.ValidateSizeLimit.tsx": 1,
"components/interfaces/Support/AttachmentUpload.tsx": 3,
"components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx": 1,
"components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx": 3,
"components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx": 1,
"components/layouts/Navigation/LayoutHeader/FeedbackDropdown/FeedbackWidget.tsx": 1,
"components/layouts/ProjectLayout/LayoutHeader/MobileMenuContent/OrgMenuItem.tsx": 1,
"components/layouts/ProjectLayout/LayoutHeader/MobileMenuContent/TopLevelRouteItem.tsx": 1,
"components/layouts/TableEditorLayout/EntityListItem.tsx": 1,
"components/layouts/Tabs/CollapseButton.tsx": 1,
"components/layouts/Tabs/SortableTab.tsx": 1,
"components/layouts/Tabs/Tabs.tsx": 1,
"components/ui/AIAssistantPanel/ModelSelector.tsx": 1,
"components/ui/Charts/ChartHighlightActions.tsx": 1,
"components/ui/Charts/ComposedChart.utils.tsx": 1,
"components/ui/ComputeBadgeWrapper.tsx": 1,
"components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx": 2,
"components/ui/DataTable/DataTableFilters/DataTableFilterCheckboxAsync.tsx": 1,
"components/ui/DevToolbar/ProjectStatusTab.tsx": 1,
"components/ui/DevToolbar/ResourceWarningsTab.tsx": 2,
"components/ui/FeaturePreviewBadge.tsx": 1,
"components/ui/FilterPopover.tsx": 1,
"components/ui/PasswordStrengthBar.tsx": 1,
"components/ui/SingleStat.tsx": 1
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Key, Plus } from 'lucide-react'
import { Path, PathValue } from 'react-hook-form'
import {
Button,
Checkbox,
Expand All @@ -14,30 +13,16 @@ import {
PopoverTrigger,
} from 'ui'

import {
PermissionResource,
PermissionResourceSelectorProps,
PermissionRow,
PermissionsFormValues,
} from './Permissions.types'
import { togglePermissionResource } from './Permissions.utils'
import { PermissionResourceSelectorProps, PermissionRow } from './Permissions.types'
import { ACCESS_TOKEN_RESOURCES } from '@/components/interfaces/Account/AccessTokens/AccessToken.constants'

export const PermissionResourceSelector = <TFormValues extends PermissionsFormValues>({
export const PermissionResourceSelector = ({
open,
onOpenChange,
onResourceToggled,
permissionRows,
setValue,
align = 'center',
}: PermissionResourceSelectorProps<TFormValues>) => {
const handleToggleResource = (resource: PermissionResource) => {
const newRows = togglePermissionResource(permissionRows, resource)
setValue(
'permissionRows' as Path<TFormValues>,
newRows as PathValue<TFormValues, Path<TFormValues>>
)
}

}: PermissionResourceSelectorProps) => {
return (
<Popover open={open} onOpenChange={onOpenChange} modal={true}>
<PopoverTrigger asChild>
Expand All @@ -61,13 +46,13 @@ export const PermissionResourceSelector = <TFormValues extends PermissionsFormVa
<CommandItem
key={resource.resource}
value={`${resource.resource} ${resource.title}`}
onSelect={() => handleToggleResource(resource)}
onSelect={() => onResourceToggled(resource)}
className="text-foreground"
>
<div className="flex items-center gap-3 w-full">
<Checkbox
checked={isChecked}
onCheckedChange={() => handleToggleResource(resource)}
onCheckedChange={() => onResourceToggled(resource)}
onClick={(e) => e.stopPropagation()}
/>
<Key size={12} className="text-foreground-lighter" />
Expand Down
Loading
Loading