mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
* Add lucide-react to docs (to make the autocomplete work). * Migrate the docs app icons. * Migrate the ui-patterns. * Remove the old icons from ui package. * Migrate the www app from react-feather icons. * Migrate all of studio icons. * Migrate the only component in design-system. * Fix an old import in ui package. Revert an import in docs app. * Fix some pages in www. * Remove unneeded files used in generation of icons. * Fix a prettier error. * Fix more issues in www. * Fix an issue in Log Date picker. * Replace all string sizes with number sizes because the icons grew in some cases. * Fix more imports in security page. * Fix an extra import. * Remove the size prop from all icons if they're in a button and they match the button size. * Minor fixes for docs and www. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
70 lines
2.3 KiB
TypeScript
70 lines
2.3 KiB
TypeScript
import { Index } from 'icons/__registry__/index'
|
|
import { Copy } from 'lucide-react'
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuGroup,
|
|
DropdownMenuItem,
|
|
DropdownMenuTrigger,
|
|
} from 'ui'
|
|
import { Grid, GridItem } from './grid'
|
|
|
|
function Icons() {
|
|
return (
|
|
<>
|
|
<Grid>
|
|
{Index.map((icon: any, i: number) => (
|
|
<DropdownMenu key={i} modal={false}>
|
|
<DropdownMenuTrigger asChild>
|
|
<GridItem>
|
|
<icon.component
|
|
strokeWidth={1.5}
|
|
size={21}
|
|
className="group-data-[state=open]:scale-125 transition-all"
|
|
/>
|
|
<span className="bg-surface-100 rounded-full border px-2 font-mono text-xs text-foreground-lighter group-data-[state=open]:text-foreground">
|
|
{icon.name}
|
|
</span>
|
|
</GridItem>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-48">
|
|
<DropdownMenuGroup>
|
|
<DropdownMenuItem
|
|
className="flex items-center gap-2"
|
|
onSelect={() => navigator.clipboard.writeText(icon.name)}
|
|
>
|
|
<Copy size={14} strokeWidth={1} />
|
|
Copy name
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem
|
|
className="flex items-center gap-2"
|
|
onSelect={() => navigator.clipboard.writeText(icon.jsx)}
|
|
>
|
|
<Copy size={14} strokeWidth={1} />
|
|
Copy JSX
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem
|
|
className="flex items-center gap-2"
|
|
onSelect={() => navigator.clipboard.writeText(icon.import)}
|
|
>
|
|
<Copy size={14} strokeWidth={1} />
|
|
Copy import path
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem
|
|
className="flex items-center gap-2"
|
|
onSelect={() => navigator.clipboard.writeText(icon.svg)}
|
|
>
|
|
<Copy size={14} strokeWidth={1} />
|
|
Copy SVG
|
|
</DropdownMenuItem>
|
|
</DropdownMenuGroup>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
))}
|
|
</Grid>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export { Icons }
|