generated from egoist/ts-lib-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
73 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import clsx, { type ClassValue } from 'clsx' | ||
import { twMerge } from 'tailwind-merge' | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { type PropsWithChildren } from 'react' | ||
import { cn } from './cn' | ||
|
||
export function Sidebar(props: PropsWithChildren) { | ||
return ( | ||
<div className="relative flex h-full overflow-hidden"> | ||
<div className="peer absolute inset-y-0 z-30 hidden border-r bg-muted duration-300 ease-in-out data-[state=open]:translate-x-0 lg:flex lg:w-[250px] xl:w-[300px] h-full flex-col dark:bg-zinc-950"> | ||
<div className="flex h-full flex-col"> | ||
<div className="flex flex-1 flex-col overflow-hidden"> | ||
<div className="flex-1 overflow-auto py-8 space-y-2"> | ||
{props.children} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export function SidebarItem(props: PropsWithChildren<{ selected?: boolean }>) { | ||
return ( | ||
<> | ||
<div className="space-y-2 px-2"> | ||
<div> | ||
<div className="relative h-8"> | ||
<div | ||
className={cn( | ||
'inline-flex items-center whitespace-nowrap rounded-md text-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground h-9 py-2 group w-full px-8 transition-colors hover:bg-zinc-200/40 dark:hover:bg-zinc-300/10 cursor-pointer', | ||
props.selected ? 'bg-zinc-200/40 dark:bg-zinc-300/10' : '', | ||
)} | ||
> | ||
{props.children} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} |