How to use the terra-application-utility.UtilityUtils.itemShape function in terra-application-utility

To help you get started, we’ve selected a few terra-application-utility 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-application-layout / src / utils / propTypes.js View on Github external
/**
 * Shape for ApplicationLayout's `utilityConfig` prop.
 */
const utilityConfigPropType = PropTypes.shape({
  title: PropTypes.string,
  accessory: PropTypes.element,
  onChange: PropTypes.func.isRequired,
  menuItems: PropTypes.arrayOf(UtilityUtils.itemShape).isRequired,
  initialSelectedKey: PropTypes.string.isRequired,
});

/**
 * Shape for utilityConfig's menuItem.
 */
const utilityMenuItemPropType = UtilityUtils.itemShape;

export default {
  utilityConfigPropType,
  utilityMenuItemPropType,
  layoutConfigPropType,
  nameConfigPropType,
  navigationAlignmentPropType,
  navigationItemsPropType,
};
github cerner / terra-framework / packages / terra-application-layout / src / utils / propTypes.js View on Github external
*/
const navigationItemsPropType = PropTypes.arrayOf(PropTypes.shape({
  path: PropTypes.string.isRequired,
  text: PropTypes.string.isRequired,
  hasSubMenu: PropTypes.bool,
  icon: PropTypes.node,
}));

/**
 * Shape for ApplicationLayout's `utilityConfig` prop.
 */
const utilityConfigPropType = PropTypes.shape({
  title: PropTypes.string,
  accessory: PropTypes.element,
  onChange: PropTypes.func.isRequired,
  menuItems: PropTypes.arrayOf(UtilityUtils.itemShape).isRequired,
  initialSelectedKey: PropTypes.string.isRequired,
});

/**
 * Shape for utilityConfig's menuItem.
 */
const utilityMenuItemPropType = UtilityUtils.itemShape;

export default {
  utilityConfigPropType,
  utilityMenuItemPropType,
  layoutConfigPropType,
  nameConfigPropType,
  navigationAlignmentPropType,
  navigationItemsPropType,
};

terra-application-utility

The Utility is used to disclose a utility menu. There are two versions - a header version and menu version. These should be used with the corresponding `terra-application-header-layout` and `terra-application-menu-layout` components.

Apache-2.0
Latest version published 6 months ago

Package Health Score

54 / 100
Full package analysis