-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working on customizing CSS for MUI checkboxes * Modified DS Checkboxes to take in onClick, text, disabled, and checked values/statuses Co-authored-by: Hieu Ngo <hieu.ngo12989@gmail.com> * Modified DS Checkboxes to take in onClick, text, disabled, and checked values/statuses Co-authored-by: Hieu Ngo <hieu.ngo12989@gmail.com> * refactored Subgoal-Assignment to utilize styled MUI Checkbox. Though this updated design matches Design Systems designs, correct layout will be determined when Create Benchmark flow is complete and Assign to Benchmark can once again be accessed Co-authored-by: Hieu Ngo <hieu.ngo12989@gmail.com> * added disabled styling to MUI checkbox --------- Co-authored-by: tessathornberrypadg <theresa@padg.com> Co-authored-by: Hieu Ngo <hieu.ngo12989@gmail.com>
- Loading branch information
1 parent
a8bfae7
commit 9f0eb8b
Showing
4 changed files
with
75 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
/* PLACEHOLDER FOR DESIGN SYSTEMS COMPONENT CSS | ||
see notes in component file */ | ||
/* styling for the text in the checkbox label can go here */ | ||
.checkboxWrapper { | ||
cursor: pointer; | ||
} | ||
|
||
.behavior:hover { | ||
background-color: var(--primary-99); | ||
} | ||
|
||
.behavior:active { | ||
background-color: var(--primary-90); | ||
} |
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,9 +1,43 @@ | ||
/** DESIGN SYSTEM COMPONENT PLACEHOLDER | ||
* 1) Make a local branch for organizing your component (e.g. "design-systems-button") | ||
* 2) Replace this file and the corresponding css file(s) with your component file(s), cleaning up any duplicate files that are outside of the design components folder. | ||
* 3) Search and find all use cases for your component (likely linting will tell you where they are) and update the import paths | ||
* 4) Check code for errors and delete this comment | ||
* 5) Push code to branch and do a PR referencing the specific issue task you took for issue # 255. | ||
* NOTE: If you want a css.d.ts file to be generated or updated to help with any type issues, you can run `npm run type-css` | ||
* */ | ||
export {}; | ||
import { Checkbox } from "@mui/material"; | ||
import { styled } from "@mui/material"; | ||
import $checkbox from "./Checkbox.module.css"; | ||
import { MouseEventHandler } from "react"; | ||
|
||
interface CheckboxProps { | ||
onClickAction: MouseEventHandler<HTMLDivElement>; | ||
text?: string; | ||
checked: boolean; | ||
disabled?: boolean; | ||
} | ||
|
||
const DS_Checkbox = ({ | ||
onClickAction, | ||
text, | ||
checked, | ||
disabled, | ||
}: CheckboxProps) => { | ||
return ( | ||
<div onClick={onClickAction} className={$checkbox.checkboxWrapper}> | ||
<MUICheckbox | ||
edge="start" | ||
checked={checked} | ||
className={$checkbox.behavior} | ||
disabled={disabled || false} | ||
/> | ||
{text} | ||
</div> | ||
); | ||
}; | ||
|
||
const MUICheckbox = styled(Checkbox)(() => ({ | ||
color: "var(--primary-40)", | ||
"&.Mui-checked": { | ||
color: "var(--primary-40)", | ||
}, | ||
"&.Mui-disabled": { | ||
color: "var(--grey-70)", | ||
backgroundColor: "var(--grey-80)", | ||
}, | ||
})); | ||
|
||
export default DS_Checkbox; |
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