How to use the @paprika/helpers/lib/types.size.MEDIUM 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 / DataTable / src / components / RowHeight / RowHeight.js View on Github external
import React from "react";
import PropTypes from "prop-types";
import RawButton from "@paprika/raw-button";
import { size } from "@paprika/helpers/lib/types";

import { useDispatch, useDataTableState } from "../..";
import { plugins } from "../../constants";

const propTypes = {
  defaultHeight: PropTypes.oneOf([size.XSMALL, size.SMALL, size.MEDIUM, size.LARGE]),
};

const defaultProps = {
  defaultHeight: size.XSMALL,
};

function getIndexByValue(value, values) {
  return values.indexOf(values.find(item => item === value));
}

function getNextIndex(index, values) {
  if (index + 1 >= values.length) {
    return 0;
  }

  return index + 1;