How to use the @paprika/helpers/lib/customPropTypes.AlignTypes.ALL function in @paprika/helpers

To help you get started, we’ve selected a few @paprika/helpers 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 acl-services / paprika / packages / DatePicker / src / components / DatePickerPopover / DatePickerPopover.js View on Github external
import PropTypes from "prop-types";
import { AlignTypes } from "@paprika/helpers/lib/customPropTypes";

const propTypes = {
  /** Where the calendar is positioned relative to the trigger. */
  align: PropTypes.oneOf(AlignTypes.ALL),

  /** Distance, in px, between calendar edge and the input. */
  offset: PropTypes.number,

  /** Number setting the z-index for the calendar */
  zIndex: PropTypes.number,
};

const defaultProps = {
  align: AlignTypes.BOTTOM,
  offset: 8,
  zIndex: 1,
};

// shell component for enhancing development experience
function DatePickerPopover() {
github acl-services / paprika / packages / DropdownMenu / src / DropdownMenu.js View on Github external
import React from "react";
import PropTypes from "prop-types";
import uuid from "uuid/v4";
import { AlignTypes } from "@paprika/helpers/lib/customPropTypes";
import Popover from "@paprika/popover";
import extractChildren from "@paprika/helpers/lib/extractChildren";
import Divider from "./components/Divider";
import Trigger from "./components/Trigger";
import LinkItem from "./components/LinkItem";
import Item from "./components/Item";
import { contentStyles } from "./DropdownMenu.styles";

const propTypes = {
  /** Alignment of the dropdown menu */
  align: PropTypes.oneOf(AlignTypes.ALL),

  /** Children should consist of  */
  children: PropTypes.node.isRequired,

  edge: PropTypes.oneOf([AlignTypes.LEFT, AlignTypes.RIGHT, null]),
};

const defaultProps = {
  align: AlignTypes.BOTTOM,
  edge: AlignTypes.LEFT,
};

const popoverOffset = 4;

function DropdownMenu(props) {
  const { align, children, edge, ...moreProps } = props;