reset comoponents

This commit is contained in:
Alex Holliday committed 2025-02-01 18:36:43 -08:00
1 parent 701e81cb78
commit 5a85711cac
3 files changed
+8 -12

No files matched your search

@@ -21,7 +21,6 @@ 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
*
@@ -55,12 +54,10 @@ const Checkbox = ({
value,
onChange,
isDisabled,
alignSelf
}) => {
/* TODO move sizes to theme */
const sizes = { small: "14px", medium: "16px", large: "18px" };
const theme = useTheme();
const override = alignSelf? { alignSelf: "flex-start" } : {}
return (
<FormControlLabel
className="checkbox-wrapper"
@@ -79,7 +76,6 @@ const Checkbox = ({
sx={{
"&:hover": { backgroundColor: "transparent" },
"& svg": { width: sizes[size], height: sizes[size] },
...override
}}
/>
}
@@ -57,7 +57,7 @@ const Search = ({
disabled,
startAdornment,
endAdornment,
onBlur
onBlur,
}) => {
const theme = useTheme();
return (
@@ -70,15 +70,15 @@ const Search = ({
onInputChange={(_, newValue) => {
handleInputChange(newValue);
}}
onChange={(e, newValue) => {
handleChange && handleChange(e, newValue);
onChange={(_, newValue) => {
handleChange(newValue);
}}
fullWidth
freeSolo
disabled={disabled}
disableClearable
options={options}
getOptionLabel={(option) => option[filteredBy]??""}
getOptionLabel={(option) => option[filteredBy]}
renderInput={(params) => (
<Stack>
<Typography
@@ -213,7 +213,7 @@ Search.propTypes = {
options: PropTypes.array.isRequired,
filteredBy: PropTypes.string.isRequired,
secondaryLabel: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
value: PropTypes.array,
inputValue: PropTypes.string.isRequired,
handleInputChange: PropTypes.func.isRequired,
handleChange: PropTypes.func,
@@ -223,7 +223,7 @@ Search.propTypes = {
disabled: PropTypes.bool,
startAdornment: PropTypes.object,
endAdornment: PropTypes.object,
onBlur: PropTypes.func
onBlur: PropTypes.func,
};
export default Search;
@@ -6,7 +6,7 @@ import Visibility from "@mui/icons-material/Visibility";
import ReorderRoundedIcon from "@mui/icons-material/ReorderRounded";
import DeleteIcon from "../../../../assets/icons/trash-bin.svg?react";
export const HttpAdornment = ({ https, prefix }) => {
export const HttpAdornment = ({ https }) => {
const theme = useTheme();
return (
<Stack
@@ -25,7 +25,7 @@ export const HttpAdornment = ({ https, prefix }) => {
color={theme.palette.primary.contrastTextSecondary}
sx={{ lineHeight: 1, opacity: 0.8 }}
>
{prefix !== undefined ? prefix : https ? "https://" : "http://"}
{https ? "https" : "http"}
</Typography>
</Stack>
);