UNPKG

wix-style-react

Version:
34 lines (25 loc) 1.13 kB
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } import React from 'react'; import * as Composite from '../Composite'; import Label from '../Label'; import Input from '../Input'; import InputAreaWithLabelComposite from '../Composite/InputAreaWithLabelComposite/InputAreaWithLabelComposite'; import deprecationLog from '../utils/deprecationLog'; deprecationLog('Using "TextField" is deprecated. Please see "3.1 TextField" updated documentation for a composite usage of "FormField" and "Input".'); var TextField = function TextField(_ref) { var children = _ref.children, props = _objectWithoutProperties(_ref, ['children']); return React.createElement( InputAreaWithLabelComposite, props, children ); }; TextField.propTypes = { children: Composite.children(Composite.optional(Label), Composite.once(Input)) }; TextField.defaultProps = { appendToParent: false }; TextField.displayName = 'TextField'; export default TextField;