prop-types#any JavaScript Examples

The following examples show how to use prop-types#any. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MenuItem.js    From react-menu with MIT License 6 votes vote down vote up
MenuItem.propTypes = {
  ...stylePropTypes(),
  value: any,
  href: string,
  type: oneOf(['checkbox', 'radio']),
  checked: bool,
  disabled: bool,
  children: oneOfType([node, func]),
  onClick: func
};
Example #2
Source File: Heading.js    From wix-style-react with MIT License 6 votes vote down vote up
Heading.propTypes = {
  dataHook: string,
  /** any nodes to be rendered (usually text nodes) */
  children: any,

  /** is the text has dark or light skin */
  light: bool,

  /** typography of the heading */
  appearance: oneOf(Object.keys(APPEARANCES)),

  ...ellipsisHOC.propTypes,
};
Example #3
Source File: BulkSelection.js    From wix-style-react with MIT License 6 votes vote down vote up
BulkSelection.propTypes = {
  /** Array of item selection boolean states. Should correspond in length to the data prop */
  selectedIds: oneOfType([arrayOf(string), arrayOf(number)]),
  /** An array of all selectable item ids (string ids) */
  allIds: oneOfType([arrayOf(string), arrayOf(number)]).isRequired,
  /** Called when item selection changes.
   * Receives 2 arguments, the updated selectedIds array, and a `change` object.
   * The `change` object has a `type` property with the following possible values: 'ALL', 'NONE', 'SINGLE_TOGGLE'.
   * In case of 'SINGLE_TOGGLE' the `change` object will also include an `id` prop with the item's id,
   * and a `value` prop with the new boolean selection state of the item.
   * The `change` object also contains an `origin` property which indicates what initiated the selection change.
   * The `origin` property can be set when selection is updated using a `SelectionContext` method.
   * In case `totalSelectableCount` is set and the list is not fully loaded, and the user did bulk selection ("Select All"), the first parameter (selectedIds) will be null.
   * You can use the selection context's getNotSelectedIds() method to get the items that the user unselected after selecting all items. */
  onSelectionChanged: func,
  /** Are checkboxes disabled */
  disabled: bool,
  /** Indicates whether the table is in infinite bulk selection mode (`infiniteScroll` and `totalSelectableCount` props are set) and there are more items to load (`hasMore` prop is `true`) */
  hasMoreInBulkSelection: bool,
  /** The table's `totalSelectableCount` prop  */
  totalCount: number,
  /** Any - can consume the BulkSelectionProvider context */
  children: any,
};
Example #4
Source File: MenuItem.js    From react-menu with MIT License 6 votes vote down vote up
process.env.NODE_ENV !== "production" ? MenuItem.propTypes = /*#__PURE__*/_extends({}, /*#__PURE__*/stylePropTypes(), {
  value: any,
  href: string,
  type: /*#__PURE__*/oneOf(['checkbox', 'radio']),
  checked: bool,
  disabled: bool,
  children: /*#__PURE__*/oneOfType([node, func]),
  onClick: func
}) : void 0;
Example #5
Source File: utils.js    From wix-style-react with MIT License 6 votes vote down vote up
ExampleWrapper.propTypes = {
  children: any,
  label: string,
};
Example #6
Source File: Text.js    From wix-style-react with MIT License 6 votes vote down vote up
Text.propTypes = {
  dataHook: string,
  /** tag name that will be rendered */
  tagName: string,

  /** class to be applied to the root element */
  className: string,

  /** font size of the text */
  size: oneOf(Object.keys(SIZES)),

  /** any nodes to be rendered (usually text nodes) */
  children: any,

  /** is the text type is secondary. Affects the font color */
  secondary: bool,

  /** skin color of the text */
  skin: oneOf(Object.keys(SKINS)),

  /** make the text color lighter */
  light: bool,

  /** font weight of the text */
  weight: oneOf(Object.keys(WEIGHTS)),

  ...ellipsisHOC.propTypes,
};
Example #7
Source File: Toolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
Label.propTypes = {
  children: any,
};
Example #8
Source File: MenuRadioGroup.js    From react-menu with MIT License 5 votes vote down vote up
MenuRadioGroup.propTypes = {
  ...stylePropTypes(),
  name: string,
  value: any,
  onRadioChange: func
};
Example #9
Source File: MenuRadioGroup.js    From react-menu with MIT License 5 votes vote down vote up
process.env.NODE_ENV !== "production" ? MenuRadioGroup.propTypes = /*#__PURE__*/_extends({}, /*#__PURE__*/stylePropTypes(), {
  name: string,
  value: any,
  onRadioChange: func
}) : void 0;
Example #10
Source File: Example.js    From react-nice-dates with MIT License 5 votes vote down vote up
Example.propTypes = {
  code: string,
  children: any
}
Example #11
Source File: Dialog.jsx    From Turnip-Calculator with MIT License 5 votes vote down vote up
CustomDialog.propTypes = {
  open: bool.isRequired,
  onClose: func,
  title: any,
  description: any,
  children: any,
  actions: any,
};
Example #12
Source File: FieldWithSelectionComposite.js    From wix-style-react with MIT License 5 votes vote down vote up
FieldWithSelectionComposite.propTypes = {
  children: any,
};
Example #13
Source File: Toolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
Item.propTypes = {
  children: any,
  layout: oneOf(['button']),
};
Example #14
Source File: Toolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
ItemGroup.propTypes = {
  children: any, // TODO: validate children are either <Item> od <Divider>
  position: oneOf(['start', 'end']),
};
Example #15
Source File: Toolbar.js    From wix-style-react with MIT License 5 votes vote down vote up
Toolbar.propTypes = {
  children: any, // TODO: validate children are of type <ItemGroup>
};
Example #16
Source File: TableToolbarContainer.js    From wix-style-react with MIT License 5 votes vote down vote up
TableToolbarContainer.propTypes = {
  children: any,
};
Example #17
Source File: ButtonLayout.js    From wix-style-react with MIT License 5 votes vote down vote up
ButtonLayout.propTypes = {
  className: string,
  active: bool,
  children: any,
  disabled: bool,

  /** The size of the button */
  height: oneOf(['x-small', 'small', 'medium', 'large', 'x-large']),
  hover: bool,

  /** When true the button will match its parent width */
  matchParent: bool,

  /** The theme of the button */
  theme: oneOf([
    'transparent',
    'fullred',
    'fullgreen',
    'fullpurple',
    'emptyred',
    'emptygreen',
    'emptybluesecondary',
    'emptyblue',
    'emptypurple',
    'fullblue',
    'login',
    'emptylogin',
    'transparentblue',
    'whiteblue',
    'whiteblueprimary',
    'whitebluesecondary',
    'close-standard',
    'close-dark',
    'close-transparent',
    'icon-greybackground',
    'icon-standard',
    'icon-standardsecondary',
    'icon-white',
    'icon-whitesecondary',
    'no-border',
    'dark-no-border',
    'outlined',
  ]),

  type: oneOf(['button', 'submit', 'reset']),
};
Example #18
Source File: InputAreaWithLabelComposite.js    From wix-style-react with MIT License 5 votes vote down vote up
InputAreaWithLabelComposite.propTypes = {
  children: any,
  required: bool,
  appendToParent: bool,
  info: node,
  tooltip: node,
};