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

[Rating] Migrate to emotion #25588

Merged
merged 11 commits into from
Apr 7, 2021
4 changes: 3 additions & 1 deletion docs/pages/api-docs/rating.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
},
"default": "'medium'"
},
"sx": { "type": { "name": "object" } },
"value": { "type": { "name": "number" } }
},
"name": "Rating",
"styles": {
"classes": [
"root",
"sizeSmall",
"sizeMedium",
"sizeLarge",
"readOnly",
"disabled",
Expand All @@ -57,6 +59,6 @@
"filename": "/packages/material-ui/src/Rating/Rating.js",
"inheritance": null,
"demos": "<ul><li><a href=\"/components/rating/\">Rating</a></li></ul>",
"styledComponent": false,
"styledComponent": true,
"cssComponent": false
}
6 changes: 6 additions & 0 deletions docs/translations/api-docs/rating/rating.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"precision": "The minimum increment value change allowed.",
"readOnly": "Removes all hover effects and pointer events.",
"size": "The size of the component.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/basics/#the-sx-prop\">`sx` page</a> for more details.",
"value": "The rating value."
},
"classDescriptions": {
Expand All @@ -25,6 +26,11 @@
"nodeName": "the root element",
"conditions": "<code>size=\"small\"</code>"
},
"sizeMedium": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "<code>size=\"medium\"</code>"
},
"sizeLarge": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
Expand Down
9 changes: 8 additions & 1 deletion packages/material-ui/src/Rating/Rating.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SxProps } from '@material-ui/system';
import * as React from 'react';
import { InternalStandardProps as StandardProps } from '..';
import { InternalStandardProps as StandardProps, Theme } from '..';

export interface IconContainerProps extends React.HTMLAttributes<HTMLSpanElement> {
value: number;
Expand All @@ -15,6 +16,8 @@ export interface RatingProps
root?: string;
/** Styles applied to the root element if `size="small"`. */
sizeSmall?: string;
/** Styles applied to the root element if `size="medium"`. */
sizeMedium?: string;
/** Styles applied to the root element if `size="large"`. */
sizeLarge?: string;
/** Styles applied to the root element if `readOnly={true}`. */
Expand Down Expand Up @@ -126,6 +129,10 @@ export interface RatingProps
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* The rating value.
*/
Expand Down
Loading