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

[core] Random small fixes #6522

Merged
merged 1 commit into from
Apr 6, 2017
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
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[ignore]

.*/node_modules/fbjs/*
.*/node_modules/fbjs/lib/partitionObjectByKey*
.*/node_modules/jss/lib/.*\.js\.flow
.*/node_modules/react-swipeable-views/src/.*
.*/scripts/*
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ export default function AppRouter() {
<Route
title="Color"
path="/style/color"
content={requireMarkdown('./style/color/color.md')}
content={requireMarkdown('./style/color.md')}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix and normalize edit path.

component={MarkdownDocs}
nav
/>
<Route
title="Icons"
path="/style/icons"
content={requireMarkdown('./style/icons/icons.md')}
content={requireMarkdown('./style/icons.md')}
component={MarkdownDocs}
nav
/>
<Route
title="Typography"
path="/style/typography"
content={requireMarkdown('./style/typography/typography.md')}
content={requireMarkdown('./style/typography.md')}
component={MarkdownDocs}
nav
/>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const primary = red[500]; // #F44336
const accent = purple['A200']; // #E040FB
```

{{demo='pages/style/color/Color.js'}}
{{demo='pages/style/Color.js'}}

## Color schemes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for example `<Icon>star</Icon>`.
By default, an Icon will inherit the current text color.
Optionally, you can set the icon color using one of the theme color properties: `accent`, `action`, `contrast`, `disabled`, `error`, & `primary`.

{{demo='pages/style/icons/Icons.js'}}
{{demo='pages/style/Icons.js'}}

### SVG Icons

Expand All @@ -36,7 +36,7 @@ and allows the icon to be styled and respond to mouse events.
The resulting icon can be used as is,
or included as a child for other Material-UI components that use icons.

{{demo='pages/style/icons/SvgPaths.js'}}
{{demo='pages/style/SvgPaths.js'}}

We also provide a separate package,
[material-ui-icons](https://www.npmjs.com/package/material-ui-icons),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ For more info checkout the [typeface](https://www.npmjs.com/package/typeface-rob

## Styles

{{demo='pages/style/typography/TextTypes.js'}}
{{demo='pages/style/TextTypes.js'}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"keycode": "^2.1.8",
"lodash": "^4.17.4",
"object-assign": "^4.1.1",
"react-event-listener": "^0.4.3",
"react-event-listener": "^0.4.4",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the next version of React.

"react-transition-group": "^1.1.1",
"recompose": "^0.22.0",
"warning": "^3.0.0"
Expand Down
123 changes: 61 additions & 62 deletions src/Checkbox/Checkbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow weak

import { PropTypes } from 'react';
import React, { PropTypes } from 'react';
import { createStyleSheet } from 'jss-theme-reactor';
import { createSwitch } from '../internal/SwitchBase';
import withSwitchLabel from '../internal/withSwitchLabel';
Expand Down Expand Up @@ -33,64 +33,63 @@ export { LabelCheckbox };
* [Checkboxes](https://material.io/guidelines/components/selection-controls.html#selection-controls-checkbox)
* allow the user to select multiple options from a set.
*/
export class CheckboxDocs {
render() {}
static propTypes = {
/**
* If `true`, the component is checked.
*/
checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
/**
* The CSS class name of the root element when checked.
*/
checkedClassName: PropTypes.string,
/**
* The icon to display when the component is checked.
*/
checkedIcon: PropTypes.node,
/**
* The CSS class name of the root element.
*/
className: PropTypes.string,
/**
* @ignore
*/
defaultChecked: PropTypes.bool,
/**
* If `true`, the switch will be disabled.
*/
disabled: PropTypes.bool,
/**
* The CSS class name of the root element when disabled.
*/
disabledClassName: PropTypes.string,
/**
* The icon to display when the component is unchecked.
* If a string is provided, it will be used as a font ligature.
*/
icon: PropTypes.node,
/*
* @ignore
*/
name: PropTypes.string,
/**
* Callback fired when the state is changed.
*
* @param {object} event `change` event
* @param {boolean} checked The `checked` value of the switch
*/
onChange: PropTypes.func,
/**
* If `false`, the ripple effect will be disabled.
*/
ripple: PropTypes.bool,
/**
* @ignore
*/
tabIndex: PropTypes.string,
/**
* The value of the component.
*/
value: PropTypes.string,
};
}
export const CheckboxDocs = () => <span />;

CheckboxDocs.propTypes = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For removing the docs in production.

/**
* If `true`, the component is checked.
*/
checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
/**
* The CSS class name of the root element when checked.
*/
checkedClassName: PropTypes.string,
/**
* The icon to display when the component is checked.
*/
checkedIcon: PropTypes.node,
/**
* The CSS class name of the root element.
*/
className: PropTypes.string,
/**
* @ignore
*/
defaultChecked: PropTypes.bool,
/**
* If `true`, the switch will be disabled.
*/
disabled: PropTypes.bool,
/**
* The CSS class name of the root element when disabled.
*/
disabledClassName: PropTypes.string,
/**
* The icon to display when the component is unchecked.
* If a string is provided, it will be used as a font ligature.
*/
icon: PropTypes.node,
/*
* @ignore
*/
name: PropTypes.string,
/**
* Callback fired when the state is changed.
*
* @param {object} event `change` event
* @param {boolean} checked The `checked` value of the switch
*/
onChange: PropTypes.func,
/**
* If `false`, the ripple effect will be disabled.
*/
ripple: PropTypes.bool,
/**
* @ignore
*/
tabIndex: PropTypes.string,
/**
* The value of the component.
*/
value: PropTypes.string,
};
119 changes: 59 additions & 60 deletions src/Radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,63 +40,62 @@ export { LabelRadio };
* [Radio buttons](https://www.google.com/design/spec/components/selection-controls.html#selection-controls-radio-button)
* are switches used for selection from multiple options.
*/
export class RadioDocs {
render() {}
static propTypes = {
/**
* If `true`, the component appears selected.
*/
checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
/**
* The CSS class name of the root element when selected.
*/
checkedClassName: PropTypes.string,
/**
* The icon to display when selected.
*/
checkedIcon: PropTypes.node,
/**
* The CSS class name of the root element.
*/
className: PropTypes.string,
/**
* @ignore
*/
defaultChecked: PropTypes.bool,
/**
* If `true`, the component disabled.
*/
disabled: PropTypes.bool,
/**
* The CSS class name of the root element when disabled.
*/
disabledClassName: PropTypes.string,
/**
* The icon to display when the component is unselected.
*/
icon: PropTypes.node,
/*
* @ignore
*/
name: PropTypes.string,
/**
* Callback fired when the state is changed.
*
* @param {object} event `change` event
* @param {boolean} checked The `checked` value of the switch
*/
onChange: PropTypes.func,
/**
* If `false`, the ripple effect will be disabled.
*/
ripple: PropTypes.bool,
/**
* @ignore
*/
tabIndex: PropTypes.string,
/**
* The value of the component.
*/
value: PropTypes.string,
};
}
export const RadioDocs = () => <span />;

RadioDocs.propTypes = {
/**
* If `true`, the component appears selected.
*/
checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
/**
* The CSS class name of the root element when selected.
*/
checkedClassName: PropTypes.string,
/**
* The icon to display when selected.
*/
checkedIcon: PropTypes.node,
/**
* The CSS class name of the root element.
*/
className: PropTypes.string,
/**
* @ignore
*/
defaultChecked: PropTypes.bool,
/**
* If `true`, the component disabled.
*/
disabled: PropTypes.bool,
/**
* The CSS class name of the root element when disabled.
*/
disabledClassName: PropTypes.string,
/**
* The icon to display when the component is unselected.
*/
icon: PropTypes.node,
/*
* @ignore
*/
name: PropTypes.string,
/**
* Callback fired when the state is changed.
*
* @param {object} event `change` event
* @param {boolean} checked The `checked` value of the switch
*/
onChange: PropTypes.func,
/**
* If `false`, the ripple effect will be disabled.
*/
ripple: PropTypes.bool,
/**
* @ignore
*/
tabIndex: PropTypes.string,
/**
* The value of the component.
*/
value: PropTypes.string,
};
1 change: 0 additions & 1 deletion src/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,4 @@ Switch.contextTypes = {
styleManager: customPropTypes.muiRequired,
};


export default Switch;
15 changes: 4 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4653,13 +4653,6 @@ react-addons-perf@^15.4.2:
fbjs "^0.8.4"
object-assign "^4.1.0"

react-addons-shallow-compare@^15.4.2:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react-addons-shallow-compare/-/react-addons-shallow-compare-15.4.2.tgz#027ffd9720e3a1e0b328dcd8fc62e214a0d174a5"
dependencies:
fbjs "^0.8.4"
object-assign "^4.1.0"

react-addons-test-utils@^15.4.2:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.4.2.tgz#93bcaa718fcae7360d42e8fb1c09756cc36302a2"
Expand Down Expand Up @@ -4687,12 +4680,12 @@ react-dom@^15.4.2:
loose-envify "^1.1.0"
object-assign "^4.1.0"

react-event-listener@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/react-event-listener/-/react-event-listener-0.4.3.tgz#a0aaa447555fbaa5c398a06b6ad47935bba961a8"
react-event-listener@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/react-event-listener/-/react-event-listener-0.4.4.tgz#af6552f06b5a4fa3f6df900bef0a7bba47cab39d"
dependencies:
babel-runtime "^6.20.0"
react-addons-shallow-compare "^15.4.2"
fbjs "^0.8.4"
warning "^3.0.0"

react-transition-group@^1.1.1:
Expand Down