- Merge feedback works from status page 1 and status page 2 branches
This commit is contained in:
1 parent
fdca92e543
commit
406fa6ed9f
4 files changed
+16
-20
No files matched your search
@@ -21,6 +21,7 @@ import "./index.css";
|
||||
* @param {string} [props.value] - Optional value associated with the checkbox
|
||||
* @param {Function} [props.onChange] - Callback function triggered when checkbox state changes
|
||||
* @param {boolean} [props.isDisabled] - Determines if the checkbox is disabled
|
||||
* @param {boolean} [props.alignSelf] - Whether the checkbox label should be positioned on flex-start.
|
||||
*
|
||||
* @returns {React.ReactElement} Rendered Checkbox component
|
||||
*
|
||||
@@ -42,6 +43,7 @@ import "./index.css";
|
||||
* isChecked={isAdvanced}
|
||||
* isDisabled={!canModify}
|
||||
* onChange={handleAdvancedToggle}
|
||||
* alignSelf = {alignSelf}
|
||||
* />
|
||||
*/
|
||||
const Checkbox = ({
|
||||
@@ -53,11 +55,12 @@ const Checkbox = ({
|
||||
value,
|
||||
onChange,
|
||||
isDisabled,
|
||||
alignSelf
|
||||
}) => {
|
||||
/* TODO move sizes to theme */
|
||||
const sizes = { small: "14px", medium: "16px", large: "18px" };
|
||||
const theme = useTheme();
|
||||
const override = typeof label == "string" ? {} : { alignSelf: "flex-start" };
|
||||
const override = alignSelf? { alignSelf: "flex-start" } : {}
|
||||
return (
|
||||
<FormControlLabel
|
||||
className="checkbox-wrapper"
|
||||
@@ -76,7 +79,7 @@ const Checkbox = ({
|
||||
sx={{
|
||||
"&:hover": { backgroundColor: "transparent" },
|
||||
"& svg": { width: sizes[size], height: sizes[size] },
|
||||
...override
|
||||
...override
|
||||
}}
|
||||
/>
|
||||
}
|
||||
@@ -115,6 +118,7 @@ Checkbox.propTypes = {
|
||||
value: PropTypes.string,
|
||||
onChange: PropTypes.func,
|
||||
isDisabled: PropTypes.bool,
|
||||
alignSelf: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default Checkbox;
|
||||
Reference in new issue
Block a user