-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from liam-hq/feat/erd-header
feat: Add AppBar for ERDRenderer
- Loading branch information
Showing
47 changed files
with
792 additions
and
180 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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
@import url('@liam-hq/erd-core/styles/globals.css'); | ||
|
||
#root { | ||
display: flex; | ||
flex-direction: column; | ||
|
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
65 changes: 65 additions & 0 deletions
65
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/AppBar.module.css
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,65 @@ | ||
.wrapper { | ||
display: grid; | ||
grid-template-columns: auto 1fr auto; | ||
align-items: center; | ||
min-height: var(--default-header-height); | ||
padding: 0 var(--spacing-4); | ||
background-color: var(--global-muted-background); | ||
} | ||
|
||
.logo { | ||
width: 1.25rem; | ||
height: 1.25rem; | ||
} | ||
|
||
.title { | ||
color: var(--overlay-40); | ||
text-align: center; | ||
font-family: var(--main-font); | ||
font-size: var(--font-size-4); | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 1; | ||
} | ||
|
||
.rightSide { | ||
display: grid; | ||
grid-auto-flow: column; | ||
gap: var(--spacing-4); | ||
align-items: center; | ||
} | ||
|
||
.iconButtonGroup { | ||
display: grid; | ||
grid-auto-flow: column; | ||
gap: var(--spacing-2); | ||
align-items: center; | ||
} | ||
|
||
.iconWrapper { | ||
display: grid; | ||
place-content: center; | ||
place-items: center; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
border-radius: var(--border-radius-base); | ||
transition: background-color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} | ||
|
||
.iconWrapper:hover { | ||
background-color: var(--pane-background-active); | ||
|
||
.icon { | ||
color: var(--global-foreground); | ||
} | ||
} | ||
|
||
.icon { | ||
width: 1rem; | ||
height: 1rem; | ||
color: var(--overlay-70); | ||
stroke-width: 1.5px; | ||
transition: color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} |
48 changes: 48 additions & 0 deletions
48
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/AppBar.tsx
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,48 @@ | ||
import { | ||
Button, | ||
LiamLogoMark, | ||
TooltipContent, | ||
TooltipPortal, | ||
TooltipProvider, | ||
TooltipRoot, | ||
TooltipTrigger, | ||
} from '@liam-hq/ui' | ||
import type { FC } from 'react' | ||
import styles from './AppBar.module.css' | ||
import { ExportButton } from './ExportButton' | ||
import { GithubButton } from './GithubButton' | ||
import { HelpButton } from './HelpButton' | ||
import { ReleaseNoteButton } from './ReleaseNoteButton' | ||
|
||
export const AppBar: FC = () => { | ||
return ( | ||
<header className={styles.wrapper}> | ||
<TooltipProvider> | ||
<TooltipRoot> | ||
<TooltipTrigger asChild> | ||
<a href="https://liambx.com" target="_blank" rel="noreferrer"> | ||
<LiamLogoMark className={styles.logo} /> | ||
</a> | ||
</TooltipTrigger> | ||
<TooltipPortal> | ||
<TooltipContent sideOffset={4}>Go to Home page</TooltipContent> | ||
</TooltipPortal> | ||
</TooltipRoot> | ||
</TooltipProvider> | ||
|
||
<h1 className={styles.title}>ERD Generator</h1> | ||
|
||
<div className={styles.rightSide}> | ||
<div className={styles.iconButtonGroup}> | ||
<GithubButton /> | ||
<ReleaseNoteButton /> | ||
<HelpButton /> | ||
</div> | ||
<ExportButton /> | ||
<Button variant="solid-primary" size="md"> | ||
Share | ||
</Button> | ||
</div> | ||
</header> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
.../packages/erd-core/src/components/ERDRenderer/AppBar/ExportButton/ExportButton.module.css
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,3 @@ | ||
.menuContent { | ||
min-width: 9.75rem; | ||
} |
51 changes: 51 additions & 0 deletions
51
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/ExportButton/ExportButton.tsx
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,51 @@ | ||
import { | ||
Button, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuPortal, | ||
DropdownMenuRoot, | ||
DropdownMenuTrigger, | ||
} from '@liam-hq/ui' | ||
import { ChevronDown, Download } from 'lucide-react' | ||
import { type FC, useRef } from 'react' | ||
import styles from './ExportButton.module.css' | ||
|
||
export const ExportButton: FC = () => { | ||
const ref = useRef<HTMLButtonElement>(null) | ||
|
||
return ( | ||
<> | ||
<DropdownMenuRoot> | ||
<DropdownMenuTrigger asChild> | ||
<Button | ||
ref={ref} | ||
variant="outline-secondary" | ||
size="md" | ||
leftIcon={ | ||
<Download | ||
strokeWidth={1.5} | ||
stroke="var(--button-secondary-foreground)" | ||
/> | ||
} | ||
rightIcon={ | ||
<ChevronDown strokeWidth={1.5} stroke="var(--overlay-40)" /> | ||
} | ||
> | ||
Export | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuPortal> | ||
<DropdownMenuContent | ||
align="end" | ||
sideOffset={4} | ||
className={styles.menuContent} | ||
> | ||
<DropdownMenuItem>DDL</DropdownMenuItem> | ||
<DropdownMenuItem>schema.rb</DropdownMenuItem> | ||
<DropdownMenuItem>mermaid.js</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenuPortal> | ||
</DropdownMenuRoot> | ||
</> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/ExportButton/index.ts
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 @@ | ||
export * from './ExportButton' |
27 changes: 27 additions & 0 deletions
27
.../packages/erd-core/src/components/ERDRenderer/AppBar/GithubButton/GithubButton.module.css
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,27 @@ | ||
.iconWrapper { | ||
display: grid; | ||
place-content: center; | ||
place-items: center; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
border-radius: var(--border-radius-base); | ||
transition: background-color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} | ||
|
||
.iconWrapper:hover { | ||
background-color: var(--pane-background-active); | ||
|
||
.icon { | ||
color: var(--global-foreground); | ||
} | ||
} | ||
|
||
.icon { | ||
width: 1rem; | ||
height: 1rem; | ||
color: var(--overlay-70); | ||
stroke-width: 1.5px; | ||
transition: color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} |
32 changes: 32 additions & 0 deletions
32
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/GithubButton/GithubButton.tsx
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,32 @@ | ||
import { | ||
TooltipContent, | ||
TooltipPortal, | ||
TooltipProvider, | ||
TooltipRoot, | ||
TooltipTrigger, | ||
} from '@liam-hq/ui' | ||
import { GithubLogo } from '@liam-hq/ui' | ||
import type { FC } from 'react' | ||
import styles from './GithubButton.module.css' | ||
|
||
export const GithubButton: FC = () => { | ||
return ( | ||
<TooltipProvider> | ||
<TooltipRoot> | ||
<TooltipTrigger asChild> | ||
<a | ||
href="https://github.com/liam-hq/liam" | ||
target="_blank" | ||
rel="noreferrer" | ||
className={styles.iconWrapper} | ||
> | ||
<GithubLogo className={styles.icon} /> | ||
</a> | ||
</TooltipTrigger> | ||
<TooltipPortal> | ||
<TooltipContent sideOffset={4}>Go to Github</TooltipContent> | ||
</TooltipPortal> | ||
</TooltipRoot> | ||
</TooltipProvider> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/packages/erd-core/src/components/ERDRenderer/AppBar/GithubButton/index.ts
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 @@ | ||
export * from './GithubButton' |
31 changes: 31 additions & 0 deletions
31
...tend/packages/erd-core/src/components/ERDRenderer/AppBar/HelpButton/HelpButton.module.css
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,31 @@ | ||
.iconWrapper { | ||
display: grid; | ||
place-content: center; | ||
place-items: center; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
border-radius: var(--border-radius-base); | ||
transition: background-color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} | ||
|
||
.iconWrapper:hover { | ||
background-color: var(--pane-background-active); | ||
|
||
.icon { | ||
color: var(--global-foreground); | ||
} | ||
} | ||
|
||
.icon { | ||
width: 1rem; | ||
height: 1rem; | ||
color: var(--overlay-70); | ||
stroke-width: 1.5px; | ||
transition: color var(--default-hover-animation-duration) | ||
var(--default-timing-function); | ||
} | ||
|
||
.menuContent { | ||
min-width: 9.75rem; | ||
} |
Oops, something went wrong.