How to use the @workday/canvas-kit-labs-react-core.body2 function in @workday/canvas-kit-labs-react-core

To help you get started, we’ve selected a few @workday/canvas-kit-labs-react-core 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 Workday / canvas-kit / modules / _labs / menu / react / lib / MenuItem.tsx View on Github external
export interface MenuItemProps extends React.LiHTMLAttributes {
  onClick?: (event: React.SyntheticEvent) => void;
  children?: React.ReactNode;
  id?: string;
  icon?: CanvasSystemIcon;
  secondaryIcon?: CanvasSystemIcon;
  hasDivider?: boolean;
  isDisabled?: boolean;
  isFocused?: boolean;
  role: string;
  shouldClose?: boolean;
}

const Item = styled('li')>(
  {
    ...type.body2,
    padding: `${spacing.xxs} ${spacing.s}`,
    height: spacing.xl,
    boxSizing: 'border-box',
    cursor: 'pointer',
    color: colors.blackPepper300,
    display: 'flex',
    flexDirection: 'row',
    alignItems: 'center',
    transition: 'background-color 80ms, color 80ms',
    '&:focus': {
      outline: 'none',
    },
  },
  ({isFocused, isDisabled}) => {
    if (!isFocused && !isDisabled) {
      return {

@workday/canvas-kit-labs-react-core

A group of core primitives (i.e. colors, text, etc.)

Apache-2.0
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis