How to use the terra-popup.Opts function in terra-popup

To help you get started, we’ve selected a few terra-popup 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 cerner / terra-framework / packages / terra-popup / src / terra-dev-site / doc / example / PopupDimensions.jsx View on Github external
import React, { useState } from 'react';
import Button from 'terra-button';
import Popup from 'terra-popup';
import Placeholder from 'terra-doc-template/lib/Placeholder';

const HEIGHT_KEYS = Object.keys(Popup.Opts.heights);
const WIDTH_KEYS = Object.keys(Popup.Opts.widths);

function PopupDimensions() {
  const [open, setOpen] = useState(false);
  const [popupContentHeight, setPopupContentHeight] = useState('Default');
  const [popupContentWidth, setPopupContentWidth] = useState('Default');
  /* eslint-disable */
  const PopupContent = ({ contentStyle, isHeightBounded, isWidthBounded }) => {
    let title = 'Popup Content';
    if (isHeightBounded) {
      title += ' HeightBounded';
    }
    if (isWidthBounded) {
      title += ' WidthBounded';
    }
    return ;
github cerner / terra-framework / packages / terra-menu / src / Menu.jsx View on Github external
const slides = this.state.stack.map((item, index) => (
      
        {item.props.children || item.props.subMenuItems}
      
    ));
github cerner / terra-framework / packages / terra-popup / src / terra-dev-site / doc / example / PopupDimensions.jsx View on Github external
import React, { useState } from 'react';
import Button from 'terra-button';
import Popup from 'terra-popup';
import Placeholder from 'terra-doc-template/lib/Placeholder';

const HEIGHT_KEYS = Object.keys(Popup.Opts.heights);
const WIDTH_KEYS = Object.keys(Popup.Opts.widths);

function PopupDimensions() {
  const [open, setOpen] = useState(false);
  const [popupContentHeight, setPopupContentHeight] = useState('Default');
  const [popupContentWidth, setPopupContentWidth] = useState('Default');
  /* eslint-disable */
  const PopupContent = ({ contentStyle, isHeightBounded, isWidthBounded }) => {
    let title = 'Popup Content';
    if (isHeightBounded) {
      title += ' HeightBounded';
    }
    if (isWidthBounded) {
      title += ' WidthBounded';
    }
    return ;
  };
github cerner / terra-core / packages / terra-menu / src / Menu.jsx View on Github external
const slides = this.state.stack.map((item, index) => (
      
        {item.props.children || item.props.subMenuItems}
      
    ));
github cerner / terra-core / packages / terra-menu / src / Menu.jsx View on Github external
isHeaderDisabled
        isContentFocusDisabled
      >
        {slides}
      
    );
  }
}

Menu.propTypes = propTypes;
Menu.defaultProps = defaultProps;
Menu.Item = MenuItem;
Menu.ItemGroup = MenuItemGroup;
Menu.Divider = MenuDivider;
Menu.Opts = {
  widths: Popup.Opts.widths,
};

export default Menu;
github cerner / terra-framework / packages / terra-menu / src / Menu.jsx View on Github external
isHeaderDisabled
        isContentFocusDisabled
      >
        {slides}
      
    );
  }
}

Menu.propTypes = propTypes;
Menu.defaultProps = defaultProps;
Menu.Item = MenuItem;
Menu.ItemGroup = MenuItemGroup;
Menu.Divider = MenuDivider;
Menu.Opts = {
  widths: Popup.Opts.widths,
};

export default Menu;
github cerner / terra-core / packages / terra-site / src / examples / popup / PopupDimensions.jsx View on Github external
import React from 'react';
import Popup from 'terra-popup';
import Button from 'terra-button';
import ExamplePopupContent from './ExamplePopupContent';

const HEIGHT_KEYS = Object.keys(Popup.Opts.heights);
const WIDTH_KEYS = Object.keys(Popup.Opts.widths);

class PopupDimensions extends React.Component {
  static generateOptions(values) {
    return values.map((currentValue, index) => {
      const keyValue = index;
      return <option value="{currentValue}">{currentValue}</option>;
    });
  }

  constructor(props) {
    super(props);
    this.handleButtonClick = this.handleButtonClick.bind(this);
    this.handleRequestClose = this.handleRequestClose.bind(this);
    this.handleOnChange = this.handleOnChange.bind(this);
    this.handleSelectChange = this.handleSelectChange.bind(this);
    this.getId = this.getId.bind(this);
github cerner / terra-core / packages / terra-site / src / examples / popup / PopupDimensions.jsx View on Github external
import React from 'react';
import Popup from 'terra-popup';
import Button from 'terra-button';
import ExamplePopupContent from './ExamplePopupContent';

const HEIGHT_KEYS = Object.keys(Popup.Opts.heights);
const WIDTH_KEYS = Object.keys(Popup.Opts.widths);

class PopupDimensions extends React.Component {
  static generateOptions(values) {
    return values.map((currentValue, index) =&gt; {
      const keyValue = index;
      return <option value="{currentValue}">{currentValue}</option>;
    });
  }

  constructor(props) {
    super(props);
    this.handleButtonClick = this.handleButtonClick.bind(this);
    this.handleRequestClose = this.handleRequestClose.bind(this);
    this.handleOnChange = this.handleOnChange.bind(this);
    this.handleSelectChange = this.handleSelectChange.bind(this);
github cerner / terra-core / packages / terra-menu / src / Menu.jsx View on Github external
* CSS classnames that are append to the menu content inner.
   */
  classNameContent: PropTypes.string,
  /**
   * CSS classnames that are append to the overlay.
   */
  classNameOverlay: PropTypes.string,
  /**
   * Should the menu be presented as open.
   */
  isOpen: PropTypes.bool,
  /**
   * A string representation of the width in px, limited to:
   * 160, 240, 320, 640, 960, 1280, 1760 or auto
   */
  contentWidth: PropTypes.oneOf(Object.keys(Popup.Opts.widths)),
  /**
   * Indicates if the menu should have an center aligned arrow displayed on dropdown.
   * Otherwise, the menu will display without an arrow and right aligned.
   */
  isArrowDisplayed: PropTypes.bool,
};

const defaultProps = {
  isArrowDisplayed: false,
  isOpen: false,
  contentWidth: '240',
};

class Menu extends React.Component {
  constructor(props) {
    super(props);
github cerner / terra-framework / packages / terra-menu / src / Menu.jsx View on Github external
* CSS classnames that are append to the menu content inner.
   */
  classNameContent: PropTypes.string,
  /**
   * CSS classnames that are append to the overlay.
   */
  classNameOverlay: PropTypes.string,
  /**
   * Should the menu be presented as open.
   */
  isOpen: PropTypes.bool,
  /**
   * A string representation of the width in px, limited to:
   * 160, 240, 320, 640, 960, 1280, 1760 or auto
   */
  contentWidth: PropTypes.oneOf(Object.keys(Popup.Opts.widths)),
  /**
   * Indicates if the menu should have an center aligned arrow displayed on dropdown.
   * Otherwise, the menu will display without an arrow and right aligned.
   */
  isArrowDisplayed: PropTypes.bool,
};

const defaultProps = {
  isArrowDisplayed: false,
  isOpen: false,
  contentWidth: '240',
};

class Menu extends React.Component {
  constructor(props) {
    super(props);

terra-popup

The Terra Popup is higher order component that launches terra-hookshot positioned content with the ability to display a dynamic arrow.

Apache-2.0
Latest version published 6 months ago

Package Health Score

54 / 100
Full package analysis

Popular terra-popup functions