Skip to content

Commit

Permalink
chore(Ref): use component from Stardust UI (#3774)
Browse files Browse the repository at this point in the history
* chore(Ref): use component from Stardust

* chore(Ref): use component from Stardust

* fix UT
  • Loading branch information
layershifter authored Sep 6, 2019
1 parent a4b8757 commit 62d2fed
Show file tree
Hide file tree
Showing 40 changed files with 58 additions and 676 deletions.
72 changes: 0 additions & 72 deletions docs/src/examples/addons/Ref/Types/RefExampleRef.js

This file was deleted.

58 changes: 0 additions & 58 deletions docs/src/examples/addons/Ref/Types/RefForwardingExample.js

This file was deleted.

30 changes: 0 additions & 30 deletions docs/src/examples/addons/Ref/Types/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions docs/src/examples/addons/Ref/index.js

This file was deleted.

15 changes: 4 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Third party

export { Ref, RefProps } from '@stardust-ui/react-component-ref'

// Addons

export {
Expand Down Expand Up @@ -27,17 +31,6 @@ export {
StrictPortalInnerProps,
} from './dist/commonjs/addons/Portal/PortalInner'
export { default as Radio, RadioProps, StrictRadioProps } from './dist/commonjs/addons/Radio'
export { default as Ref, RefProps, StrictRefProps } from './dist/commonjs/addons/Ref'
export {
default as RefFindNode,
RefFindNodeProps,
StrictRefFindNodeProps,
} from './dist/commonjs/addons/Ref/RefFindNode'
export {
default as RefForward,
RefForwardProps,
StrictRefForwardProps,
} from './dist/commonjs/addons/Ref/RefForward'
export {
default as Responsive,
ResponsiveProps,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@
"dependencies": {
"@babel/runtime": "^7.1.2",
"@semantic-ui-react/event-stack": "^3.1.0",
"@stardust-ui/react-component-ref": "~0.38.0",
"classnames": "^2.2.6",
"keyboard-key": "^1.0.4",
"lodash": "^4.17.15",
"prop-types": "^15.7.2",
"react-is": "^16.8.6",
"react-popper": "^1.3.3",
"react-popper": "^1.3.4",
"shallowequal": "^1.1.0"
},
"devDependencies": {
Expand All @@ -102,7 +103,7 @@
"@babel/standalone": "^7.4.5",
"@mdx-js/loader": "^0.20.3",
"@stardust-ui/docs-components": "^0.34.1",
"@types/react": "^16.4.14",
"@types/react": "^16.8.25",
"anchor-js": "^4.2.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
Expand Down
6 changes: 3 additions & 3 deletions src/addons/MountNode/lib/getNodeRefFromProps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isRefObject, toRefObject } from '@stardust-ui/react-component-ref'
import _ from 'lodash'
import { isBrowser, isRefObject } from '../../../lib'

const toRef = _.memoize((node) => ({ current: node }))
import { isBrowser } from '../../../lib'

/**
* Given `this.props`, return a `node` value or undefined.
Expand All @@ -14,7 +14,7 @@ const getNodeRefFromProps = (props) => {

if (isBrowser()) {
if (isRefObject(node)) return node
return _.isNil(node) ? toRef(document.body) : toRef(node)
return _.isNil(node) ? toRefObject(document.body) : toRefObject(node)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/addons/Portal/Portal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import EventStack from '@semantic-ui-react/event-stack'
import { handleRef, Ref } from '@stardust-ui/react-component-ref'
import keyboardKey from 'keyboard-key'
import _ from 'lodash'
import PropTypes from 'prop-types'
Expand All @@ -8,10 +9,8 @@ import {
AutoControlledComponent as Component,
customPropTypes,
doesNodeContainClick,
handleRef,
makeDebugger,
} from '../../lib'
import Ref from '../Ref'
import PortalInner from './PortalInner'

const debug = makeDebugger('portal')
Expand Down
4 changes: 2 additions & 2 deletions src/addons/Portal/PortalInner.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { handleRef, Ref } from '@stardust-ui/react-component-ref'
import _ from 'lodash'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { createPortal } from 'react-dom'

import { customPropTypes, handleRef, isBrowser, makeDebugger } from '../../lib'
import Ref from '../Ref'
import { customPropTypes, isBrowser, makeDebugger } from '../../lib'

const debug = makeDebugger('portalInner')

Expand Down
27 changes: 0 additions & 27 deletions src/addons/Ref/Ref.d.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/addons/Ref/Ref.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/addons/Ref/RefFindNode.d.ts

This file was deleted.

Loading

0 comments on commit 62d2fed

Please sign in to comment.