-
Notifications
You must be signed in to change notification settings - Fork 4
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
6 changed files
with
192 additions
and
3 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
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,58 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import style from './tabbar.module.css'; | ||
import { Button, EType as ButtonProps } from '@components/button'; | ||
|
||
type TabProps = { selected?: boolean; controlsId: string } & ButtonProps; | ||
export function TabButton({ | ||
selected = false, | ||
controlsId, | ||
...props | ||
}: TabProps) { | ||
return ( | ||
<Button | ||
role="tab" | ||
aria-controls={controlsId} | ||
aria-selected={selected} | ||
{...props} | ||
/> | ||
); | ||
} | ||
|
||
type TabListProps = PropsWithChildren<{ label: string }>; | ||
export function TabList({ label, children }: TabListProps) { | ||
return ( | ||
<div role="tablist" aria-label={label} className={style.tablist}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
type TabPanelProps = PropsWithChildren<{ | ||
labelledBy: string; | ||
isVisible: boolean; | ||
id: string; | ||
}>; | ||
export function TabPanel({ | ||
labelledBy, | ||
id, | ||
isVisible, | ||
children, | ||
}: TabPanelProps) { | ||
return ( | ||
<div | ||
role="tabpanel" | ||
tabIndex={0} | ||
hidden={!isVisible} | ||
aria-labelledby={labelledBy} | ||
className={style.tabpanel} | ||
id={id} | ||
> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
type TabContainerProps = PropsWithChildren<{}>; | ||
export function TabContainer({ children }: TabContainerProps) { | ||
return <div className={style.container}>{children}</div>; | ||
} |
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,29 @@ | ||
.container { | ||
background: #fff; | ||
padding: 2rem; | ||
box-shadow: | ||
0px 73px 80px rgba(0, 0, 0, 0.05), | ||
0px 26.6462px 29.2013px rgba(0, 0, 0, 0.0344991), | ||
0px 12.9362px 14.1767px rgba(0, 0, 0, 0.0278145), | ||
0px 6.34158px 6.94968px rgba(0, 0, 0, 0.0221855), | ||
0px 2.50747px 2.74791px rgba(0, 0, 0, 0.0155009); | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.tablist { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 0.25rem; | ||
} | ||
.tablist__nav { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 0.25rem; | ||
} | ||
|
||
.tabpanel[hidden] { | ||
display: none; | ||
} |