Skip to content

Commit

Permalink
[core] Better distinction between the private and public components
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 17, 2018
1 parent e85802d commit b0196c2
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .size-limit
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"name": "The main bundle of the docs",
"webpack": false,
"path": ".next/main.js",
"limit": "185 KB"
"limit": "186 KB"
},
{
"name": "The home page of the docs",
Expand Down
3 changes: 0 additions & 3 deletions packages/material-ui/src/ButtonBase/TouchRipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ export const styles = theme => ({
},
});

/**
* @ignore - internal component.
*/
class TouchRipple extends React.Component {
state = {
nextKey: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Hidden/HiddenCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ HiddenCss.propTypes = {
xsUp: PropTypes.bool,
};

export default withStyles(styles, { name: 'MuiHiddenCss' })(HiddenCss);
export default withStyles(styles)(HiddenCss);
2 changes: 1 addition & 1 deletion packages/material-ui/src/Input/Textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ Textarea.defaultProps = {
rows: 1,
};

export default withStyles(styles, { name: 'MuiTextarea' })(Textarea);
export default withStyles(styles)(Textarea);
2 changes: 1 addition & 1 deletion packages/material-ui/src/Stepper/StepConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ StepConnector.defaultProps = {
orientation: 'horizontal',
};

export default withStyles(styles, { name: 'MuiStepConnector' })(StepConnector);
export default withStyles(styles)(StepConnector);
2 changes: 1 addition & 1 deletion packages/material-ui/src/Stepper/StepPositionIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ StepPositionIcon.propTypes = {
position: PropTypes.node,
};

export default withStyles(styles, { name: 'MuiStepPositionIcon' })(StepPositionIcon);
export default withStyles(styles)(StepPositionIcon);
4 changes: 1 addition & 3 deletions packages/material-ui/src/Table/TablePaginationActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,4 @@ TablePaginationActions.propTypes = {
theme: PropTypes.object.isRequired,
};

export default withStyles(styles, { name: 'MuiTablePaginationActions', withTheme: true })(
TablePaginationActions,
);
export default withStyles(styles, { withTheme: true })(TablePaginationActions);
2 changes: 1 addition & 1 deletion packages/material-ui/src/Tabs/TabIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ TabIndicator.propTypes = {
color: PropTypes.oneOf(['primary', 'secondary']),
};

export default withStyles(styles, { name: 'MuiTabIndicator' })(TabIndicator);
export default withStyles(styles)(TabIndicator);
3 changes: 0 additions & 3 deletions packages/material-ui/src/internal/SwitchBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export const styles = {
},
};

/**
* @ignore - internal component.
*/
class SwitchBase extends React.Component {
constructor(props, context) {
super(props, context);
Expand Down
10 changes: 1 addition & 9 deletions packages/material-ui/src/styles/overrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import { SnackbarClassKey } from '../Snackbar/Snackbar';
import { SnackbarContentClassKey } from '../Snackbar/SnackbarContent';
import { StepClasskey } from '../Stepper/Step';
import { StepButtonClasskey } from '../Stepper/StepButton';
import { StepConnectorClasskey } from '../Stepper/StepConnector';
import { StepContentClasskey } from '../Stepper/StepContent';
import { StepIconClasskey } from '../Stepper/StepIcon';
import { StepLabelClasskey } from '../Stepper/StepLabel';
Expand All @@ -80,7 +79,6 @@ import { TablePaginationClassKey } from '../Table/TablePagination';
import { TableRowClassKey } from '../Table/TableRow';
import { TableSortLabelClassKey } from '../Table/TableSortLabel';
import { TabsClassKey } from '../Tabs/Tabs';
import { TextareaClassKey } from '../Input/Textarea';
import { ToolbarClassKey } from '../Toolbar/Toolbar';
import { TooltipClassKey } from '../Tooltip/Tooltip';
import { TouchRippleClassKey } from '../ButtonBase/TouchRipple';
Expand All @@ -99,7 +97,7 @@ type ComponentNameToClassKey = {
MuiBottomNavigationAction: BottomNavigationActionClassKey;
MuiButton: ButtonClassKey;
MuiButtonBase: ButtonBaseClassKey;
// MuiCard: CardClassKey;
MuiCard: CardClassKey;
MuiCardActions: CardActionsClassKey;
MuiCardContent: CardContentClassKey;
MuiCardHeader: CardHeaderClassKey;
Expand Down Expand Up @@ -144,20 +142,16 @@ type ComponentNameToClassKey = {
MuiListSubheader: ListSubheaderClassKey;
MuiMenu: MenuClassKey;
MuiMenuItem: MenuItemClassKey;
// MuiMenuList: MenuListClassKey;
MuiMobileStepper: MobileStepperClassKey;
MuiModal: ModalClassKey;
MuiPaper: PaperClassKey;
MuiPopover: PopoverClassKey;
MuiRadio: RadioClassKey;
// MuiRadioGroup: RadioGroupClassKey;
MuiSelect: SelectClassKey;
// MuiSelectInput: SelectInputClassKey;
MuiSnackbar: SnackbarClassKey;
MuiSnackbarContent: SnackbarContentClassKey;
MuiStep: StepClasskey;
MuiStepButton: StepButtonClasskey;
MuiStepConnector: StepConnectorClasskey;
MuiStepContent: StepContentClasskey;
MuiStepIcon: StepIconClasskey;
MuiStepLabel: StepLabelClasskey;
Expand All @@ -172,8 +166,6 @@ type ComponentNameToClassKey = {
MuiTableRow: TableRowClassKey;
MuiTableSortLabel: TableSortLabelClassKey;
MuiTabs: TabsClassKey;
MuiTextarea: TextareaClassKey;
// MuiTextField: TextFieldClassKey;
MuiToolbar: ToolbarClassKey;
MuiTooltip: TooltipClassKey;
MuiTouchRipple: TouchRippleClassKey;
Expand Down
10 changes: 10 additions & 0 deletions pages/api/switch-base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import withRoot from 'docs/src/modules/components/withRoot';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from './switch-base.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default withRoot(Page);
53 changes: 53 additions & 0 deletions pages/api/switch-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
filename: /packages/material-ui/src/internal/SwitchBase.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# SwitchBase



## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">checked</span> | <span class="prop-type">union:&nbsp;bool&nbsp;&#124;<br>&nbsp;string<br> | | If `true`, the component is checked. |
| <span class="prop-name required">checkedIcon *</span> | <span class="prop-type">node | | The icon to display when the component is checked. |
| <span class="prop-name">classes</span> | <span class="prop-type">object | | Useful to extend the style applied to components. |
| <span class="prop-name">disabled</span> | <span class="prop-type">bool | | If `true`, the switch will be disabled. |
| <span class="prop-name">disableRipple</span> | <span class="prop-type">bool | | If `true`, the ripple effect will be disabled. |
| <span class="prop-name required">icon *</span> | <span class="prop-type">node | | The icon to display when the component is unchecked. |
| <span class="prop-name">id</span> | <span class="prop-type">string | | The id of the `input` element. |
| <span class="prop-name">indeterminate</span> | <span class="prop-type">bool | | If `true`, the component appears indeterminate. |
| <span class="prop-name">indeterminateIcon</span> | <span class="prop-type">node | | The icon to display when the component is indeterminate. |
| <span class="prop-name">inputProps</span> | <span class="prop-type">object | | Properties applied to the `input` element. |
| <span class="prop-name">inputRef</span> | <span class="prop-type">func | | Use that property to pass a ref callback to the native input component. |
| <span class="prop-name">name</span> | <span class="prop-type">string | | |
| <span class="prop-name">onChange</span> | <span class="prop-type">func | | Callback fired when the state is changed.<br><br>**Signature:**<br>`function(event: object, checked: boolean) => void`<br>*event:* The event source of the callback. You can pull out the new value by accessing `event.target.checked`.<br>*checked:* The `checked` value of the switch |
| <span class="prop-name">type</span> | <span class="prop-type">string | <span class="prop-default">'checkbox'</span> | The input component property `type`. |
| <span class="prop-name">value</span> | <span class="prop-type">string | | The value of the component. |

Any other properties supplied will be [spread to the root element](/guides/api#spread).

## CSS API

You can override all the class names injected by Material-UI thanks to the `classes` property.
This property accepts the following keys:
- `root`
- `checked`
- `disabled`
- `input`

Have a look at [overriding with classes](/customization/overrides#overriding-with-classes) section
and the [implementation of the component](https://github.com/mui-org/material-ui/tree/v1-beta/packages/material-ui/src/internal/SwitchBase.js)
for more detail.

If using the `overrides` key of the theme as documented
[here](/customization/themes#customizing-all-instances-of-a-component-type),
you need to use the following style sheet name: `MuiSwitchBase`.

## Inheritance

The properties of the [IconButton](/api/icon-button) component are also available.

10 changes: 10 additions & 0 deletions pages/api/touch-ripple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import withRoot from 'docs/src/modules/components/withRoot';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from './touch-ripple.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default withRoot(Page);
39 changes: 39 additions & 0 deletions pages/api/touch-ripple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
filename: /packages/material-ui/src/ButtonBase/TouchRipple.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# TouchRipple



## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">center</span> | <span class="prop-type">bool | <span class="prop-default">false</span> | If `true`, the ripple starts at the center of the component rather than at the point of interaction. |
| <span class="prop-name">classes</span> | <span class="prop-type">object | | Useful to extend the style applied to components. |

Any other properties supplied will be [spread to the root element](/guides/api#spread).

## CSS API

You can override all the class names injected by Material-UI thanks to the `classes` property.
This property accepts the following keys:
- `root`
- `ripple`
- `rippleVisible`
- `ripplePulsate`
- `child`
- `childLeaving`
- `childPulsate`

Have a look at [overriding with classes](/customization/overrides#overriding-with-classes) section
and the [implementation of the component](https://github.com/mui-org/material-ui/tree/v1-beta/packages/material-ui/src/ButtonBase/TouchRipple.js)
for more detail.

If using the `overrides` key of the theme as documented
[here](/customization/themes#customizing-all-instances-of-a-component-type),
you need to use the following style sheet name: `MuiTouchRipple`.

0 comments on commit b0196c2

Please sign in to comment.