mirror of
https://github.com/supabase/supabase.git
synced 2026-09-07 02:20:52 +08:00
This PR removes all `paths` in `tsconfig.json` for all apps and packages. They were added previosly because some of the components had a `_Shadcn` suffix because of an ongoing migration. How that the migration is done, the paths can be removed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Standardized shared UI component, utility, and icon imports across design-system examples and application screens. * Simplified shared component access and project configuration. * Added shared access to anchor-link helpers and animation styles. * **Compatibility** * Updated component exports and imports without changing existing behavior. * No changes to user-facing workflows, screens, or functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
74 lines
1.3 KiB
TypeScript
74 lines
1.3 KiB
TypeScript
import { useMemo } from 'react'
|
|
import { Button } from 'ui'
|
|
import {
|
|
CommandMenu,
|
|
CommandMenuInput,
|
|
CommandMenuList,
|
|
CommandMenuTrigger as CommandMenuTriggerPrimitive,
|
|
CommandProvider,
|
|
PageType,
|
|
useRegisterCommands,
|
|
useRegisterPage,
|
|
useSetPage,
|
|
} from 'ui-patterns/CommandMenu'
|
|
|
|
function Commands() {
|
|
const setPage = useSetPage()
|
|
|
|
const commands = useMemo(
|
|
() => [
|
|
{
|
|
id: 'subcommand',
|
|
name: 'Subcommand',
|
|
action: () => alert('Triggered from subpage'),
|
|
},
|
|
],
|
|
[]
|
|
)
|
|
|
|
useRegisterPage(
|
|
'Subpage',
|
|
{
|
|
type: PageType.Commands,
|
|
sections: [
|
|
{
|
|
id: 'subpage',
|
|
name: 'Subpage',
|
|
commands,
|
|
},
|
|
],
|
|
},
|
|
{ deps: [commands] }
|
|
)
|
|
|
|
useRegisterCommands('Commands', [
|
|
{
|
|
id: 'subpage',
|
|
name: 'Go to subpage',
|
|
action: () => setPage('Subpage'),
|
|
},
|
|
])
|
|
|
|
return null
|
|
}
|
|
|
|
function CommandMenuTrigger() {
|
|
return (
|
|
<CommandMenuTriggerPrimitive>
|
|
<Button>Open command menu</Button>
|
|
</CommandMenuTriggerPrimitive>
|
|
)
|
|
}
|
|
|
|
export default function CommandMenuDemo() {
|
|
return (
|
|
<CommandProvider openKey="">
|
|
<Commands />
|
|
<CommandMenu trigger={<CommandMenuTrigger />}>
|
|
<CommandMenuInput />
|
|
<CommandMenuList />
|
|
</CommandMenu>
|
|
</CommandProvider>
|
|
)
|
|
}
|