-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
1 parent
34ea7aa
commit 6e6dad8
Showing
61 changed files
with
1,192 additions
and
3,433 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
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 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,16 @@ | ||
import { memo } from 'react'; | ||
|
||
import { DivProps } from '@/types/index'; | ||
|
||
import { useStyles } from './style'; | ||
|
||
const SidebarBody = memo<DivProps>(({ className, children, ...props }) => { | ||
const { cx, styles } = useStyles(); | ||
return ( | ||
<div className={cx(styles.body, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
}); | ||
|
||
export default SidebarBody; |
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,16 @@ | ||
import { memo } from 'react'; | ||
|
||
import { DivProps } from '@/types/index'; | ||
|
||
import { useStyles } from './style'; | ||
|
||
const SidebarContainer = memo<DivProps>(({ className, children, ...props }) => { | ||
const { cx, styles } = useStyles(); | ||
return ( | ||
<div className={cx(styles.container, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
}); | ||
|
||
export default SidebarContainer; |
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,16 @@ | ||
import { memo } from 'react'; | ||
|
||
import { DivProps } from '@/types/index'; | ||
|
||
import { useStyles } from './style'; | ||
|
||
const SidebarFooter = memo<DivProps>(({ className, children, ...props }) => { | ||
const { cx, styles } = useStyles(); | ||
return ( | ||
<div className={cx(styles.footer, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
}); | ||
|
||
export default SidebarFooter; |
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,38 @@ | ||
import { ActionIcon, Icon } from '@lobehub/ui'; | ||
import { PanelLeft, Pin, PinOff } from 'lucide-react'; | ||
import { memo } from 'react'; | ||
|
||
import { DivProps } from '@/types/index'; | ||
|
||
import { useStyles } from './style'; | ||
|
||
export interface SidebarHeaderProps extends DivProps { | ||
pin: boolean; | ||
position?: 'left' | 'right'; | ||
setPin: (pin: boolean) => void; | ||
title: string; | ||
} | ||
|
||
const SidebarHeader = memo<SidebarHeaderProps>( | ||
({ pin, setPin, className, title, position = 'left', ...props }) => { | ||
const { cx, styles } = useStyles(); | ||
const panelIcon = <Icon icon={PanelLeft} />; | ||
const pinIcon = ( | ||
<ActionIcon | ||
active={pin} | ||
icon={pin ? Pin : PinOff} | ||
onClick={() => setPin(!pin)} | ||
size={{ blockSize: 24, fontSize: 14 }} | ||
/> | ||
); | ||
return ( | ||
<div className={cx(styles.header, className)} {...props}> | ||
{position === 'left' ? panelIcon : pinIcon} | ||
{title} | ||
{position === 'left' ? pinIcon : panelIcon} | ||
</div> | ||
); | ||
}, | ||
); | ||
|
||
export default SidebarHeader; |
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,47 @@ | ||
import { createStyles } from 'antd-style'; | ||
import { rgba } from 'polished'; | ||
|
||
export const useStyles = createStyles(({ css, token, stylish, cx }) => ({ | ||
body: css` | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
flex: 1; | ||
padding: 16px; | ||
`, | ||
container: cx( | ||
stylish.blur, | ||
css` | ||
position: relative; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
background: ${rgba(token.colorBgLayout, 0.8)}; | ||
`, | ||
), | ||
footer: css` | ||
display: flex; | ||
flex: 0; | ||
gap: 8px; | ||
align-items: center; | ||
justify-content: flex-start; | ||
padding: 8px 16px; | ||
border-top: 1px solid ${token.colorBorderSecondary}; | ||
`, | ||
header: css` | ||
display: flex; | ||
flex: 0; | ||
gap: 8px; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 8px 16px; | ||
font-weight: 500; | ||
border-bottom: 1px solid ${token.colorBorderSecondary}; | ||
`, | ||
})); |
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,2 +1,6 @@ | ||
export { default as Logo, type LogoProps } from './Logo'; | ||
export { default as Modal, type ModalProps } from './Modal'; | ||
export { default as SidebarBody } from './Sidebar/SidebarBody'; | ||
export { default as SidebarContainer } from './Sidebar/SidebarContainer'; | ||
export { default as SidebarFooter } from './Sidebar/SidebarFooter'; | ||
export { default as SidebarHeader, type SidebarHeaderProps } from './Sidebar/SidebarHeader'; |
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
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
Oops, something went wrong.