How to use the @instructure/ui-prop-types.Children.oneOfEach function in @instructure/ui-prop-types

To help you get started, we’ve selected a few @instructure/ui-prop-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-drawer-layout / src / DrawerLayout / index.js View on Github external
/**
---
category: components
---
**/
@testable()
@bidirectional()
@themeable(theme, styles)
class DrawerLayout extends Component {
  static locatorAttribute = 'data-drawer-layout'
  static propTypes = {
    /**
     * Exactly one of each of the following child types: `DrawerLayout.Content`, `DrawerLayout.Tray`
     */
    children: ChildrenPropTypes.oneOfEach([DrawerContent, DrawerTray]),
    /**
     * Min width for the ``
     */
    minWidth: PropTypes.string,
    /**
     * Function called when the `` is resized and hits the `minWidth` breakpoint
     * Called with a boolean value, `true` if the tray is now overlaying the content or `false` if
     * it is side by side
     */
    onOverlayTrayChange: PropTypes.func
  }

  static defaultProps = {
    children: null,
    minWidth: '30rem',
    onOverlayTrayChange: (shouldOverlayTray) => {}
github instructure / instructure-ui / packages / ui-layout / src / DrawerLayout / index.js View on Github external
---
category: components/deprecated
id: DeprecatedDrawerLayout
---
**/
@deprecated('7.0.0', null, 'Use DrawerLayout from ui-drawer-layout instead.')
@testable()
@bidirectional()
@themeable(theme, styles)
class DrawerLayout extends Component {
  static locatorAttribute = 'data-drawer-layout'
  static propTypes = {
    /**
     * Exactly one of each of the following child types: `DrawerLayout.Content`, `DrawerLayout.Tray`
     */
    children: ChildrenPropTypes.oneOfEach([DrawerContent, DrawerTray]),
    /**
     * Min width for the ``
     */
    minWidth: PropTypes.string,
    /**
     * Function called when the `` is resized and hits the `minWidth` breakpoint
     * Called with a boolean value, `true` if the tray is now overlaying the content or `false` if
     * it is side by side
     */
    onOverlayTrayChange: PropTypes.func
  }

  static defaultProps = {
    children: null,
    minWidth: '30rem',
    onOverlayTrayChange: (shouldOverlayTray) => {}