-
Notifications
You must be signed in to change notification settings - Fork 25
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
c8d92fd
commit 59e3ed1
Showing
7 changed files
with
131 additions
and
11 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
79 changes: 79 additions & 0 deletions
79
packages/libs/kode-ui/src/patterns/SideBarLayout/aside.css.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,79 @@ | ||
import { recipe } from '@vanilla-extract/recipes'; | ||
import { responsiveStyle, token } from './../../styles'; | ||
|
||
export const asideWrapperClass = recipe({ | ||
base: [ | ||
{ | ||
gridArea: 'sidebarlayout-aside', | ||
gridRow: '1/5', | ||
// gridArea: 'sidebarlayout-aside', | ||
// background: 'purple', | ||
// display: 'flex', | ||
// position: 'absolute', | ||
// width: '300px', | ||
// top: 0, | ||
// bottom: 0, | ||
// right: 0, | ||
// zIndex: token('zIndex.overlay'), | ||
// willChange: 'transform, opacity', | ||
// transition: 'transform .4s ease, opacity 1s ease', | ||
// transform: 'translateX(0%)', | ||
}, | ||
responsiveStyle({ | ||
xs: { | ||
flex: 1, | ||
maxWidth: '300px', | ||
width: '100dvw', | ||
display: 'flex', | ||
willChange: 'transform', | ||
transition: 'transform .4s ease', | ||
transform: 'translateX(100%)', | ||
position: 'absolute', | ||
|
||
top: 0, | ||
bottom: 0, | ||
right: 0, | ||
zIndex: token('zIndex.overlay'), | ||
backgroundColor: token('color.background.layer.default'), | ||
padding: token('spacing.lg'), | ||
}, | ||
xl: { | ||
position: 'initial', | ||
transform: 'translateX(0%)', | ||
}, | ||
}), | ||
], | ||
}); | ||
|
||
export const menuBackdropClass = recipe({ | ||
base: [ | ||
responsiveStyle({ | ||
xs: { | ||
display: 'flex', | ||
position: 'absolute', | ||
inset: 0, | ||
background: token('color.neutral.n90@alpha20'), | ||
zIndex: token('zIndex.overlay'), | ||
backdropFilter: 'blur(8px)', | ||
opacity: 0, | ||
willChange: 'transform, opacity', | ||
transition: 'transform .4s ease, opacity 1s ease', | ||
transform: 'translateX(100%)', | ||
}, | ||
lg: { | ||
display: 'none!important', | ||
}, | ||
}), | ||
], | ||
variants: { | ||
expanded: { | ||
true: [ | ||
{ | ||
opacity: 1, | ||
transform: 'translateX(0%)', | ||
}, | ||
], | ||
false: [], | ||
}, | ||
}, | ||
}); |
25 changes: 25 additions & 0 deletions
25
packages/libs/kode-ui/src/patterns/SideBarLayout/components/SideBarAside.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,25 @@ | ||
import type { FC } from 'react'; | ||
import React from 'react'; | ||
import { asideWrapperClass, menuBackdropClass } from '../aside.css'; | ||
import type { PressEvent } from './../../../components'; | ||
import { Stack } from './../../../components'; | ||
import { useSideBar } from './SideBarProvider'; | ||
|
||
export const SideBarAside: FC = () => { | ||
const { handleToggleExpand } = useSideBar(); | ||
|
||
const handleExpand = (e: PressEvent) => { | ||
if (handleToggleExpand) { | ||
handleToggleExpand(e); | ||
} | ||
}; | ||
return ( | ||
<> | ||
<Stack | ||
className={menuBackdropClass({ expanded: false })} | ||
onClick={handleExpand} | ||
/> | ||
<aside className={asideWrapperClass()}>aside info</aside> | ||
</> | ||
); | ||
}; |
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