Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 7893354

Browse files
authored
fix(mixed): correct types to match propTypes (#550)
* update deps and add nullable type * fix last warnings * add todo * add entry * use ReactProps in Dropdown * fix proptypes imports
1 parent de44332 commit 7893354

File tree

102 files changed

+199
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+199
-167
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions

docs/src/components/ComponentDoc/ComponentControls/ComponentControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsCopyLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsMaximize.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Icon, Menu } from 'semantic-ui-react'
55
import { NavLink } from 'react-router-dom'

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsRtl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsShowCode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsShowTransparent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentControls/ComponentControlsShowVariables.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Menu } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentDoc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import DocumentTitle from 'react-document-title'
55
import { withRouter } from 'react-router'

docs/src/components/ComponentDoc/ComponentDocLinks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { List } from 'semantic-ui-react'
44
import { constants } from 'src/lib'

docs/src/components/ComponentDoc/ComponentDocSee.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Link } from 'react-router-dom'
55
import { Header, List } from 'semantic-ui-react'

docs/src/components/ComponentDoc/ComponentExample/ComponentExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { RouteComponentProps, withRouter } from 'react-router'
55
import * as copyToClipboard from 'copy-to-clipboard'

docs/src/components/ComponentDoc/ComponentExamples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
import { exampleContext } from 'docs/src/utils'

docs/src/components/ComponentDoc/ComponentProp/ComponentPropDefaultValue.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
export default class ComponentPropDefaultValue extends React.PureComponent<any, any> {

docs/src/components/ComponentDoc/ComponentProp/ComponentPropDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
export default class ComponentPropDescription extends React.PureComponent<any, any> {

docs/src/components/ComponentDoc/ComponentProp/ComponentPropEnum.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
import { updateForKeys } from 'docs/src/hoc'

docs/src/components/ComponentDoc/ComponentProp/ComponentPropEnumToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import { updateForKeys } from 'docs/src/hoc'

docs/src/components/ComponentDoc/ComponentProp/ComponentPropEnumValue.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import { neverUpdate } from 'docs/src/hoc'

docs/src/components/ComponentDoc/ComponentProp/ComponentPropFunctionSignature.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
import { neverUpdate } from 'docs/src/hoc'

docs/src/components/ComponentDoc/ComponentProp/ComponentPropName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Icon, Popup } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentProps/ComponentProps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Checkbox } from 'semantic-ui-react'
55

docs/src/components/ComponentDoc/ComponentProps/ComponentPropsComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Menu } from 'semantic-ui-react'
55

docs/src/components/ComponentDoc/ComponentProps/ComponentPropsDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import { Divider } from 'semantic-ui-react'
44

docs/src/components/ComponentDoc/ComponentSidebar/ComponentSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Accordion, Menu, Sticky } from 'semantic-ui-react'
55

docs/src/components/ComponentDoc/ComponentSidebar/ComponentSidebarSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Accordion, Icon, Menu } from 'semantic-ui-react'
55

docs/src/components/ComponentDoc/ComponentTable/ComponentTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Table } from 'semantic-ui-react'
55

docs/src/components/ComponentDoc/ComponentTable/ComponentTableRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import * as _ from 'lodash'
44
import { Table } from 'semantic-ui-react'

docs/src/components/ComponentDoc/ContributionPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import { Message, Icon } from 'semantic-ui-react'

docs/src/components/ComponentDoc/ExampleSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import { Grid, Header } from 'semantic-ui-react'

docs/src/components/DocsBehaviorRoot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { Grid, Header } from 'semantic-ui-react'
55
import DocumentTitle from 'react-document-title'

docs/src/components/DocsLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import AnchorJS from 'anchor-js'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import { withRouter } from 'react-router'
55
import { Route } from 'react-router-dom'

docs/src/components/DocsRoot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
import ComponentDoc from '../components/ComponentDoc'

docs/src/components/Editor/Editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44
import AceEditor, { AceEditorProps } from 'react-ace'
55
import * as ace from 'brace'

docs/src/components/ExternalExampleLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash/fp'
2-
import PropTypes from 'prop-types'
2+
import * as PropTypes from 'prop-types'
33
import * as React from 'react'
44

55
import { exampleContext, exampleKebabNameToFilename, parseExamplePath } from 'docs/src/utils'

docs/src/components/Knobs/KnobsBoolean.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import KnobsField from './KnobsField'

docs/src/components/Knobs/KnobsScalar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import KnobsField from './KnobsField'

docs/src/components/Sidebar/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import keyboardKey from 'keyboard-key'
22
import * as _ from 'lodash/fp'
3-
import PropTypes from 'prop-types'
3+
import * as PropTypes from 'prop-types'
44
import * as React from 'react'
55
import { findDOMNode } from 'react-dom'
66
import { NavLink } from 'react-router-dom'

docs/src/examples/components/ItemLayout/Types/ItemLayoutExample.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import Knobs from 'docs/src/components/Knobs/Knobs'

docs/src/examples/components/ItemLayout/Types/ItemLayoutExampleSelection.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import Knobs from 'docs/src/components/Knobs/Knobs'
44

docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import Knobs from 'docs/src/components/Knobs/Knobs'
44

docs/src/examples/components/Layout/Variations/LayoutExampleGap.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33

44
import Knobs from 'docs/src/components/Knobs/Knobs'

docs/src/examples/components/List/Types/ListExample.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import Knobs from 'docs/src/components/Knobs/Knobs'
44

docs/src/examples/components/List/Variations/ListExampleTruncate.knobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22
import * as React from 'react'
33
import Knobs from 'docs/src/components/Knobs/Knobs'
44

docs/src/prototypes/popups/GridImagePicker/GridImagePicker.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ShorthandValue } from '../../../../../types/utils'
66
import GridImagePickerItem, { GridPickerItemProps } from './GridImagePickerItem'
77

88
export interface GridPickerProps {
9-
as?: keyof React.ReactHTML
109
items: GridPickerItemProps[]
1110
gridColumns?: string | number
1211
inputIcon?: ShorthandValue
@@ -27,7 +26,6 @@ const inputStyles = {
2726

2827
class GridImagePicker extends React.Component<GridPickerProps> {
2928
static defaultProps = {
30-
as: 'ul',
3129
gridColumns: 5,
3230
inputIcon: 'search',
3331
inputPlaceholder: 'Search...',
@@ -41,7 +39,7 @@ class GridImagePicker extends React.Component<GridPickerProps> {
4139
}
4240

4341
render() {
44-
const { as: ElementType, gridColumns, inputIcon, inputPlaceholder } = this.props
42+
const { gridColumns, inputIcon, inputPlaceholder } = this.props
4543

4644
return (
4745
<>
@@ -53,7 +51,7 @@ class GridImagePicker extends React.Component<GridPickerProps> {
5351
inputRef={this.setInputNode}
5452
/>
5553
<Grid
56-
as={ElementType}
54+
as="ul"
5755
accessibility={gridBehavior}
5856
columns={gridColumns}
5957
style={gridStyles}

docs/src/prototypes/popups/GridImagePicker/GridImagePickerItem.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Image, Button } from '@stardust-ui/react'
33
import * as React from 'react'
44

55
export interface GridPickerItemProps {
6-
as?: keyof React.ReactHTML
76
title?: string
87
imageSrc: string
98
onClick?: (e: React.SyntheticEvent, props: GridPickerItemProps) => void
@@ -17,19 +16,15 @@ const imageButtonStyles = {
1716
}
1817

1918
class GridImagePickerItem extends React.Component<GridPickerItemProps> {
20-
static defaultProps = {
21-
as: 'li',
22-
}
23-
2419
render() {
25-
const { title, imageSrc, as: ElementType, onClick } = this.props
20+
const { title, imageSrc, onClick } = this.props
2621

2722
return (
28-
<ElementType>
23+
<li>
2924
<Button styles={imageButtonStyles} onClick={onClick} title={title} role="listitem">
3025
{imageSrc && <Image src={imageSrc} fluid />}
3126
</Button>
32-
</ElementType>
27+
</li>
3328
)
3429
}
3530
}

docs/src/utils/componentInfoShape.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PropTypes from 'prop-types'
1+
import * as PropTypes from 'prop-types'
22

33
const componentInfoShape = PropTypes.shape({
44
displayName: PropTypes.string.isRequired,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
"@types/jest-axe": "^2.2.2",
8686
"@types/lodash": "^4.14.118",
8787
"@types/node": "^10.3.2",
88-
"@types/react": "^16.3.17",
88+
"@types/react": "^16.7.17",
8989
"@types/react-custom-scrollbars": "^4.0.5",
90-
"@types/react-dom": "^16.0.6",
90+
"@types/react-dom": "^16.0.11",
9191
"@types/react-is": "^16.5.0",
9292
"@types/react-router": "^4.0.27",
9393
"awesome-typescript-loader": "^5.2.1",
@@ -153,7 +153,7 @@
153153
"ts-node": "^6.1.0",
154154
"tslint": "^5.11.0",
155155
"tslint-config-airbnb": "^5.11.1",
156-
"typescript": "~3.1.0",
156+
"typescript": "~3.2.2",
157157
"webpack": "^4.25.1",
158158
"webpack-dev-middleware": "^3.4.0",
159159
"webpack-hot-middleware": "^2.18.2"

src/components/Accordion/Accordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Accessibility } from '../../lib/accessibility/types'
1717

1818
import {
1919
ComponentEventHandler,
20-
Extendable,
20+
ReactProps,
2121
ShorthandValue,
2222
ShorthandRenderFunction,
2323
} from '../../../types/utils'
@@ -72,7 +72,7 @@ export interface AccordionProps extends UIComponentProps, ChildrenComponentProps
7272
/**
7373
* An accordion allows users to toggle the display of sections of content.
7474
*/
75-
class Accordion extends AutoControlledComponent<Extendable<AccordionProps>, any> {
75+
class Accordion extends AutoControlledComponent<ReactProps<AccordionProps>, any> {
7676
static displayName = 'Accordion'
7777

7878
static className = 'ui-accordion'

0 commit comments

Comments
 (0)