Skip to content

Commit

Permalink
Tidy Up and move SelectableGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Mar 10, 2019
1 parent 6166150 commit 23bea2d
Show file tree
Hide file tree
Showing 21 changed files with 14 additions and 355 deletions.
57 changes: 0 additions & 57 deletions docs/src/pages/lab/selectable-group/Checkboxes.hooks.js

This file was deleted.

76 changes: 0 additions & 76 deletions docs/src/pages/lab/selectable-group/Checkboxes.js

This file was deleted.

61 changes: 0 additions & 61 deletions docs/src/pages/lab/selectable-group/RadioButtons.hooks.js

This file was deleted.

75 changes: 0 additions & 75 deletions docs/src/pages/lab/selectable-group/RadioButtons.js

This file was deleted.

17 changes: 0 additions & 17 deletions docs/src/pages/lab/selectable-group/selectable-group.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/ToggleButton/ToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import withStyles from '@material-ui/core/styles/withStyles';
import { fade } from '@material-ui/core/styles/colorManipulator';
import ButtonBase from '@material-ui/core/ButtonBase';
import withForwardedRef from '@material-ui/core/utils/withForwardedRef';
import useSelectedState from '../SelectableGroup/useSelectedState';
import useSelectedState from '@material-ui/core/internal/SelectableGroup/useSelectedState';

export const styles = theme => ({
/* Styles applied to the root element. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '@material-ui/core/styles/withStyles';
import withForwardedRef from '@material-ui/core/utils/withForwardedRef';
import SelectableGroup from '../SelectableGroup';
import SelectableGroup from '@material-ui/core/internal/SelectableGroup';

export const styles = theme => ({
/* Styles applied to the root element. */
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';
import { capitalize } from '../utils/helpers';
import withStyles from '../styles/withStyles';
import useSelectedState from '@material-ui/lab/SelectableGroup/useSelectedState';
import useSelectedState from '../internal/SelectableGroup/useSelectedState';

export const styles = theme => ({
/* Styles applied to the root element. */
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/RadioGroup/RadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import FormGroup from '../FormGroup';
import SelectableGroup from '@material-ui/lab/SelectableGroup';
import SelectableGroup from '../internal/SelectableGroup';

function RadioGroup(props) {
const { children, defaultValue, name, onChange, value: valueProp, ...other } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import * as utils from './utils';
import SelectableGroupContext from './SelectableGroupContext';
import objectIs from '../utils/objectIs';
import objectIs from '../../../../material-ui-lab/src/utils/objectIs';

/**
* @ignore - internal component.
*/
function SelectableGroup(props) {
const [selected, setSelected] = React.useState(null);
const { additional, children, exclusive, value: valueProp } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react';
import SelectableGroupContext from './SelectableGroupContext';

/**
* @ignore - internal component.
*/
function useSelectedState() {
return React.useContext(SelectableGroupContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import hoistNonReactStatics from 'hoist-non-react-statics';
import { getDisplayName } from '@material-ui/utils';
import useSelectedState from './useSelectedState';

/**
* @ignore - internal component.
*/
export default function withSelectableGroupContext(Component) {
const WithSelectableGroupContext = props => {
const selectState = useSelectedState();
Expand Down
3 changes: 0 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ const pages = [
pathname: '/lab/about',
title: 'About The Lab',
},
{
pathname: '/lab/selectable-group',
},
{
pathname: '/lab/slider',
},
Expand Down
11 changes: 0 additions & 11 deletions pages/lab/api/selectable-group.js

This file was deleted.

0 comments on commit 23bea2d

Please sign in to comment.