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

Theme: TypeScript support missing for palette.action properties #20069

Closed
2 tasks done
timonweber opened this issue Mar 11, 2020 · 0 comments · Fixed by #20075
Closed
2 tasks done

Theme: TypeScript support missing for palette.action properties #20069

timonweber opened this issue Mar 11, 2020 · 0 comments · Fixed by #20075
Labels
good first issue Great for first contributions. Enable to learn the contribution process. package: material-ui Specific to @mui/material typescript

Comments

@timonweber
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The following properties of palette.action are exported in src/styles/createPalette.js, but the related TypeScript declaration file (createPalette.d.ts) is missing some of them:

https://github.com/mui-org/material-ui/blob/e02abe51ce16ad1cd3d0af95c77e76d5625c82e8/packages/material-ui/src/styles/createPalette.js#L33-L51

https://github.com/mui-org/material-ui/blob/e02abe51ce16ad1cd3d0af95c77e76d5625c82e8/packages/material-ui/src/styles/createPalette.d.ts#L13-L20

selectedOpacity, disabledOpacity, focus, focusOpacity , activatedOpacity are missing.

Expected Behavior 🤔

The TypeScript definition for TypeAction should look like this:

export interface TypeAction {
  active: string;
  hover: string;
  hoverOpacity: number;
  selected: string;
  selectedOpacity: number;
  disabled: string;
  disabledOpacity: number;
  disabledBackground: string;
  focus: string;
  focusOpacity: number;
  activatedOpacity: number;
}

Context 🔦

As the TypeScript support is missing, the affected properties cannot be used in strict TypeScript environments. I can try to create an PR for that, but I’m new to Material-UI, so I’m not exactly sure if this is a mistake or by purpose.

Your Environment 🌎

Tech Version
Material-UI v4.9.5
@eps1lon eps1lon added good first issue Great for first contributions. Enable to learn the contribution process. package: material-ui Specific to @mui/material typescript labels Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Great for first contributions. Enable to learn the contribution process. package: material-ui Specific to @mui/material typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants