generated from garronej/ts-ci
-
Notifications
You must be signed in to change notification settings - Fork 15
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 #108 from InseeFrLab/bar-updates
Add BaseBar and be able to pass ref to ButtonBar
- Loading branch information
Showing
4 changed files
with
50 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ReactNode } from "react"; | ||
import { tss } from "./lib/tss"; | ||
import { symToStr } from "tsafe/symToStr"; | ||
|
||
export type BaseBarProps = { | ||
className?: string; | ||
children: ReactNode; | ||
}; | ||
|
||
export function BaseBar(props: BaseBarProps) { | ||
const { className, children } = props; | ||
|
||
const { classes, cx } = useStyles(); | ||
|
||
return <div className={cx(classes.root, className)}>{children}</div>; | ||
} | ||
|
||
BaseBar.displayName = symToStr({ BaseBar }); | ||
|
||
const useStyles = tss.withName({ BaseBar }).create(({ theme }) => ({ | ||
"root": { | ||
"backgroundColor": theme.colors.useCases.surfaces.surface1, | ||
"boxShadow": theme.shadows[1], | ||
"borderRadius": 8, | ||
"overflow": "hidden", | ||
}, | ||
})); |
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