Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove IconButton #1865

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/odyssey-react-mui/src/PasswordField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "react";

import { ShowIcon, HideIcon } from "./iconDictionary";
import { IconButton } from "@mui/material";
import { Button } from "./Button";
import { Field } from "./Field";

export type PasswordFieldProps = {
Expand Down Expand Up @@ -122,13 +122,13 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
autoFocus={hasInitialFocus}
endAdornment={
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
edge="end"
<Button
ariaLabel="toggle password visibility"
endIcon={inputType === "password" ? <ShowIcon /> : <HideIcon />}
onClick={togglePasswordVisibility}
>
{inputType === "password" ? <ShowIcon /> : <HideIcon />}
</IconButton>
size="small"
variant="floating"
/>
</InputAdornment>
}
id={id}
Expand Down
2 changes: 0 additions & 2 deletions packages/odyssey-react-mui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export {
FormGroup,
FormHelperText,
FormLabel,
IconButton,
/** @deprecated Will be removed in a future Odyssey version. Please switch to `TextField`. */
InputAdornment,
/** @deprecated Will be removed in a future Odyssey version. Please switch to `TextField`. */
Expand Down Expand Up @@ -60,7 +59,6 @@ export type {
FormGroupProps,
FormHelperTextProps,
FormLabelProps,
IconButtonProps,
/** @deprecated Will be removed in a future Odyssey version. Please switch to `TextFieldProps`. */
InputAdornmentProps,
/** @deprecated Will be removed in a future Odyssey version. Please switch to `TextFieldProps`. */
Expand Down
32 changes: 0 additions & 32 deletions packages/odyssey-react-mui/src/theme/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1314,38 +1314,6 @@ export const components = (
},
},
},
MuiIconButton: {
styleOverrides: {
edgeEnd: {
marginInlineEnd: odysseyTokens.Spacing1,
},
root: {
padding: odysseyTokens.Spacing1,
fontSize: odysseyTokens.TypographySizeBody,
backgroundColor: "transparent",
color: odysseyTokens.TypographyColorBody,
borderColor: "transparent",
borderRadius: odysseyTokens.BorderRadiusMain,

"&:hover, &:focus-visible": {
backgroundColor: "rgba(29, 29, 33, 0.1)",
borderColor: "transparent",
},
"&:focus-visible": {
outlineColor: odysseyTokens.FocusOutlineColorPrimary,
},
"&:active": {
backgroundColor: "rgba(29, 29, 33, 0.2)",
borderColor: "transparent",
},
"&:disabled": {
backgroundColor: "rgba(235, 235, 237, 0.6)",
color: odysseyTokens.TypographyColorSub,
borderColor: "transparent",
},
},
},
},
MuiInput: {
defaultProps: {
disableUnderline: true,
Expand Down