Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectType Requireable
AirbnbPropTypes.between({ gte: 4 });
// $ExpectType Requireable
AirbnbPropTypes.between({ lt: 1, gt: 0 });
// $ExpectType Requireable
AirbnbPropTypes.booleanSome('foo', 'bar', 'baz');
// $ExpectType Requireable
AirbnbPropTypes.childrenHavePropXorChildren('foo');
// $ExpectType Requireable
AirbnbPropTypes.childrenOf(PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType('div');
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.number });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 });
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.between({ lt: 1, gt: 0 });
// $ExpectType Requireable
AirbnbPropTypes.booleanSome('foo', 'bar', 'baz');
// $ExpectType Requireable
AirbnbPropTypes.childrenHavePropXorChildren('foo');
// $ExpectType Requireable
AirbnbPropTypes.childrenOf(PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType('div');
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.number });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 });
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.booleanSome('foo', 'bar', 'baz');
// $ExpectType Requireable
AirbnbPropTypes.childrenHavePropXorChildren('foo');
// $ExpectType Requireable
AirbnbPropTypes.childrenOf(PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType('div');
// $ExpectType Requireable
AirbnbPropTypes.childrenOfType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.number });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 });
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
import style, { classes } from '../../styler';
import { classNamesPropType, numberCollectionPropType } from '../../propTypes';
import contextTypes from './contextTypes';
import type { AccordionContext, AccordionProps, AccordionState } from './types';
export class ToolkitAccordion extends React.Component {
context: AccordionContext;
props: AccordionProps;
static childContextTypes = {
accordion: contextTypes.isRequired,
};
static propTypes = {
children: childrenOfType(Item).isRequired,
classNames: classNamesPropType.isRequired,
collapsible: PropTypes.bool,
defaultIndex: numberCollectionPropType,
multiple: PropTypes.bool,
};
static defaultProps = {
collapsible: false,
defaultIndex: 0,
multiple: false,
};
state: AccordionState = {
indices: new Set(),
};
export type Props = Omit &
FormFieldProps & {
/** Dropdown options. Supports `option` and `optgroup`. */
children: NonNullable;
/** Empty and disabled option to display the top of the list. */
placeholder?: string;
};
export type State = {
id: string;
};
/** A controlled select field. */
export default class Select extends React.Component {
static propTypes = {
children: childrenOfType('option', 'optgroup').isRequired,
};
static defaultProps = {
placeholder: '',
};
state = {
id: uuid(),
};
render() {
const { children, fieldProps, inputProps } = partitionFieldProps(this.props);
const { id } = this.state;
return (
const steps = React.Children.count(children);
return (
<div>
{React.Children.map(children, (child, index) =>
React.cloneElement(child as React.ReactElement, {
first: index === 0,
last: index === steps - 1,
}),
)}
</div>
);
}
SteppedProgressBar.propTypes = {
children: childrenOfType(Step).isRequired,
};
export { Step };
export default SteppedProgressBar;
)}
>
{children}
);
}
export { Col };
const horizontalAlignProp = mutuallyExclusiveTrueProps('centerAlign', 'startAlign', 'endAlign');
const verticalAlignProp = mutuallyExclusiveTrueProps('bottomAlign', 'middleAlign', 'topAlign');
Grid.propTypes = {
bottomAlign: verticalAlignProp,
centerAlign: horizontalAlignProp,
children: childrenOfType(Col).isRequired,
endAlign: horizontalAlignProp,
middleAlign: verticalAlignProp,
startAlign: horizontalAlignProp,
topAlign: verticalAlignProp,
};
export default Grid;
/>
))}
<button disabled="{!isNextBtnClickable}">
>
</button>
);
};
Carousel.propTypes = {
children: childrenOfType(CarouselPage).isRequired,
selectedIndex: PropTypes.number.isRequired,
onSelectIndex: PropTypes.func.isRequired,
};
export default Carousel;
error: PropTypes.string,
/**
* A detailed explanation of the input expected by a form field. Can be text,
* other components, or HTML elements.
*
* If a function is provided, it must return an `InputFeedback`. The function will be
* invoked with the following arguments.
*
* @param {String} feedback The input's current feedback state.
* @param {String} value The input's current value.
*/
helper: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
/**
* A `Tooltip`
*/
tooltip: childrenOfType(Tooltip),
/**
* A callback function to be invoked when the input value changes.
*
* @param {SyntheticEvent} event The React `SyntheticEvent`
*/
onChange: PropTypes.func,
/**
* A callback function to be invoked when the input receives focus.
*
* @param {SyntheticEvent} event The React `SyntheticEvent`
*/
onFocus: PropTypes.func,
/**
* A callback function to be invoked when the input loses focus.
*
* @param {SyntheticEvent} event The React `SyntheticEvent`