How to use the @workday/canvas-kit-react-core.borderRadius.circle function in @workday/canvas-kit-react-core

To help you get started, we’ve selected a few @workday/canvas-kit-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 / button / react / lib / ButtonStyles.ts View on Github external
[ButtonSize.Medium]: {
        paddingLeft: '4px',
      },
    },
  },
};

export const deprecatedButtonStyles: ButtonGenericStyle = {
  classname: 'canvas-deprecated-button',
  styles: {
    boxSizing: 'border-box',
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    fontSize: '13px',
    borderRadius: borderRadius.circle,
    border: '1px solid transparent',
    boxShadow: 'none',
    position: 'relative',
    cursor: 'pointer',
    outline: 'none',
    transition: 'all 120ms linear',
    '&:hover:active': {transitionDuration: '40ms'}, // Makes the "down" state of the button happens faster than the hover state, so it animates in correctly.
    '&:disabled, &:disabled:active': {cursor: 'default', boxShadow: 'none'},
  },
  variants: {
    types: {
      [DeprecatedButtonVariant.Primary]: {
        ...getButtonStateStyle(DeprecatedButtonVariant.Primary),
      },
      [DeprecatedButtonVariant.Secondary]: {
        ...getButtonStateStyle(DeprecatedButtonVariant.Secondary),
github Workday / canvas-kit / modules / button / react / lib / ButtonStyles.ts View on Github external
},
      [ButtonSize.Small]: {
        height: canvas.spacing.l,
        padding: '0 8px',
      },
    },
  },
};

export const iconButtonStyles: ButtonGenericStyle = {
  classname: 'icon-button',
  styles: {
    // TODO: Support data-whatinput='input' css
    ...deprecatedButtonStyles.styles,
    borderWidth: '0',
    borderRadius: borderRadius.circle,
    ['& .wd-icon']: {
      display: 'inline-block',
      verticalAlign: 'middle',
    },
  },
  variants: {
    sizes: {
      [ButtonSize.Small]: {
        width: canvas.spacing.l,
        height: canvas.spacing.l,
        'span svg': {
          width: '20px',
          height: '20px',
        },
      },
      [ButtonSize.Medium]: {
github Workday / canvas-kit / modules / icon / react / lib / SystemIconCircle.tsx View on Github external
export interface SystemIconCircleProps {
  background: string;
  icon: CanvasSystemIcon;
  size: SystemIconCircleSize | number;
}

const Container = styled('div', {
  shouldForwardProp: prop => isPropValid(prop) && prop !== 'size',
})>(
  {
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    padding: 0,
    border: 0,
    borderRadius: borderRadius.circle,
    boxSizing: 'border-box',
    overflow: 'hidden',
    '& img': {
      width: '100%',
      height: '100%',
    },
  },
  ({background}) => ({
    background: background,
  }),
  ({size}) => ({
    width: size,
    height: size,
  })
);
github Workday / canvas-kit / modules / switch / react / lib / Switch.tsx View on Github external
const SwitchCircle = styled('div')>(({checked}) => ({
  width: circleSize,
  height: circleSize,
  borderRadius: borderRadius.circle,
  ...depth[1],
  backgroundColor: colors.frenchVanilla100,
  transform: checked ? `translateX(${translateLength})` : 'translateX(0)',
  transition: 'transform 150ms ease',
  pointerEvents: 'none',
}));
github Workday / canvas-kit / modules / radio / react / lib / Radio.tsx View on Github external
position: 'relative',
});

/**
 * Using a wrapper prevents the browser default behavior of trigging
 * :hover on the radio when you hover on it's corresponding label.
 * This stops the ripple from showing when you hover on the label.
 */
const RadioInputWrapper = styled('div')>(
  {
    height: radioHeight,
    width: radioWidth,
    marginTop: '3px',
    alignSelf: 'flex-start',
    '&::after': {
      borderRadius: borderRadius.circle,
      boxShadow: '0 0 0 0 ' + colors.soap200,
      content: '""',
      display: 'inline-block',
      height: radioHeight,
      transition: 'box-shadow 150ms ease-out',
      width: radioWidth,
      zIndex: 1,
    },
  },
  ({disabled}) => ({
    '&:hover::after': {
      boxShadow: disabled ? undefined : '0 0 0 ' + rippleRadius + 'px ' + colors.soap200,
    },
  })
);
github Workday / canvas-kit / modules / avatar / react / lib / Avatar.tsx View on Github external
/**
   * The url of the users avatar photo
   */
  url?: string;
}

export interface AvatarProps extends AvatarLocalProps, React.HTMLAttributes {}

export const avatarStyles: CSSObject = {
  background: colors.soap200,
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center',
  padding: 0,
  border: 0,
  borderRadius: borderRadius.circle,
  boxSizing: 'border-box',
  overflow: 'hidden',
  '& img': {
    width: '100%',
    height: '100%',
  },
};

const StyledContainer = styled('div', {
  shouldForwardProp: prop => isPropValid(prop) && prop !== 'size',
})>(
  {
    ...avatarStyles,
  },
  ({size}) => ({
    height: size,
github Workday / canvas-kit / modules / loading-animation / react / lib / LoadingDots.tsx View on Github external
/**
   * The animation-delay value, in ms, for the loading dots.
   */
  animationDelay: number;
};

/**
 * The actual loading dot div.
 */
const LoadingAnimationDot = styled('div')(
  {
    backgroundColor: canvas.colors.soap400,
    width: canvas.spacing.s,
    height: canvas.spacing.s,
    fontSize: '0px',
    borderRadius: borderRadius.circle,
    transform: 'scale(0)',
    display: 'inline-block',
    marginRight: canvas.spacing.xxs,
    animationName: keyframesLoading,
    animationDuration: '1400ms',
    animationIterationCount: 'infinite',
    animationTimingFunction: 'ease-in-out',
    animationFillMode: 'both',
    '&:last-child': {
      marginRight: 0,
    },
  },
  ({animationDelay}) => ({
    animationDelay: animationDelay + 'ms',
  })
);
github Workday / canvas-kit / modules / switch / react / lib / Switch.tsx View on Github external
const translateLength = spacing.s;

const SwitchContainer = styled('div')({
  position: 'relative',
  height: spacing.m,
  width: switchTapArea,
});

const SwitchInput = styled('input')(
  {
    position: 'absolute',
    height: spacing.m,
    width: switchTapArea,
    margin: 0,
    marginLeft: spacing.xxxs,
    borderRadius: borderRadius.circle,
    opacity: 0,
    '&:focus, &:active': {
      outline: 'none',
      '& ~ div:first-of-type': {
        ...focusRing(2, 2, false),
      },
    },
    ...mouseFocusBehavior({
      '&:focus, &:active': {
        '& ~ div:first-of-type': {
          ...focusRing(0, 0),
          animation: 'none',
        },
      },
    }),
  },
github Workday / canvas-kit / modules / checkbox / react / lib / Checkbox.tsx View on Github external
position: 'relative',
});

/**
 * Using a wrapper prevents the browser default behavior of trigging
 * :hover on the checkbox when you hover on it's corresponding label.
 * This stops the ripple from showing when you hover on the label.
 */
const CheckboxInputWrapper = styled('div')>(
  {
    height: checkboxHeight,
    width: checkboxWidth,
    marginTop: '3px',
    alignSelf: 'flex-start',
    '&::after': {
      borderRadius: borderRadius.circle,
      boxShadow: '0 0 0 0 ' + colors.soap200,
      content: '""',
      display: 'inline-block',
      height: checkboxHeight,
      transition: 'box-shadow 150ms ease-out',
      width: checkboxWidth,
      zIndex: 1,
    },
  },
  ({disabled}) => ({
    '&:hover::after': {
      boxShadow: disabled ? undefined : '0 0 0 ' + rippleRadius + 'px ' + colors.soap200,
    },
  })
);