How to use the @workday/canvas-kit-react-core.spacing.xxs 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 / _labs / header / react / lib / parts / Search.tsx View on Github external
const SearchReset = styled(IconButton)>(
  {
    width: spacing.l,
    height: spacing.l,
    marginLeft: -spacingNumbers.xl,
    padding: 0,
  },
  ({value}) => ({
    display: value ? 'block' : 'none',
  })
);

const SearchSubmit = styled(IconButton)({
  width: spacing.l,
  height: spacing.l,
  left: spacing.xxs,
  marginRight: -spacingNumbers.l,
  marginLeft: 0,
  padding: 0,
});

const iconButtonVariant = (inverse: boolean) =>
  inverse ? IconButton.Variant.Inverse : IconButton.Variant.Plain;

export class Search extends React.Component {
  static defaultProps = {
    themeColor: HeaderTheme.White,
    headerHeight: HeaderHeight.Small,
    placeholder: 'Search',
    resetSearchLabel: 'Reset Search Input',
    searchLabel: 'Search',
  };
github Workday / canvas-kit / modules / text-input / react / lib / InputIconContainer.tsx View on Github external
import {GrowthBehavior} from '@workday/canvas-kit-react-common';
import {spacing} from '@workday/canvas-kit-react-core';
import {SystemIcon} from '@workday/canvas-kit-react-icon';

export interface InputIconContainerProps extends GrowthBehavior {
  icon?: React.ReactElement;
}

const Container = styled('div')(({grow}) => ({
  display: grow ? 'block' : 'inline-block',
  position: 'relative',
}));

const IconContainer = styled('div')({
  position: 'absolute',
  top: spacing.xxs,
  right: spacing.xxs,
});

const InputIconContainer: React.FunctionComponent = ({
  grow,
  children,
  icon,
}) => (
  
    {children}
    {icon && {icon}}
  
);

export default InputIconContainer;
github Workday / canvas-kit / modules / action-bar / react / lib / ActionBar.tsx View on Github external
export interface ActionBarProps extends React.HTMLAttributes {
  /**
   * If the actionBar is fixed to the bottom of the screen
   */
  fixed?: boolean;
}

const ActionBarContainer = styled('div')(
  {
    borderTop: `solid 1px ${colors.soap400}`,
    background: commonColors.background,
    padding: spacing.s,
    boxShadow: '0 -2px 4px rgba(0, 0, 0, 0.08)',
    '@media (max-width: 575px)': {
      padding: spacing.xxs,
    },
  },
  ({fixed}: ActionBarProps) =>
    fixed && {
      position: 'fixed',
      left: 0,
      bottom: 0,
      right: 0,
    }
);

const ChildrenContainer = styled('div')({
  display: 'inline-block',
  padding: `0 ${spacing.m}`,
  '*:not(:first-child)': {
    marginLeft: spacing.s,
github Workday / canvas-kit / modules / text-input / react / lib / InputIconContainer.tsx View on Github external
import {spacing} from '@workday/canvas-kit-react-core';
import {SystemIcon} from '@workday/canvas-kit-react-icon';

export interface InputIconContainerProps extends GrowthBehavior {
  icon?: React.ReactElement;
}

const Container = styled('div')(({grow}) => ({
  display: grow ? 'block' : 'inline-block',
  position: 'relative',
}));

const IconContainer = styled('div')({
  position: 'absolute',
  top: spacing.xxs,
  right: spacing.xxs,
});

const InputIconContainer: React.FunctionComponent = ({
  grow,
  children,
  icon,
}) => (
  
    {children}
    {icon && {icon}}
  
);

export default InputIconContainer;
github Workday / canvas-kit / modules / banner / react / lib / Banner.tsx View on Github external
error?: ErrorType;
  /**
   * Text on the right, call to action
   */
  actionText?: string;
}

const BannerWrapper = styled('button')(
  {
    ...type.body2,
    backgroundColor: colors.cantaloupe400,
    boxSizing: 'border-box',
    color: colors.blackPepper400,
    fontSize: 14,
    fontWeight: 500,
    padding: `${spacing.xxs} ${spacing.s}`,
    textAlign: 'left',
    border: 0,
    display: 'flex',
    alignItems: 'center',
    transition: 'background-color 120ms',
    '&:focus': {
      outline: 'none',
      ...focusRing(2, 2),
    },
    '&:hover': {
      cursor: 'pointer',
    },
  },
  ({error, variant}) => ({
    backgroundColor: error === ErrorType.Error ? colors.cinnamon500 : colors.cantaloupe400,
    color: error === ErrorType.Error ? colors.frenchVanilla100 : colors.blackPepper400,
github Workday / canvas-kit / modules / page-header / react / lib / PageHeader.tsx View on Github external
);

const Title = styled('h2')({
  ...type.h1,
  color: colors.frenchVanilla100,
  padding: `${spacing.xs} 0`,
  margin: 0,
  whiteSpace: 'nowrap',
});

const IconList = styled('div')({
  display: 'flex',
  marginLeft: spacing.l,

  '> *:not(:last-child)': {
    marginRight: spacing.xxs,
  },
});

export default class PageHeader extends React.Component {
  static defaultProps = {
    title: '',
    capWidth: false,
    breakpoint: 768,
  };

  private renderChildren(children: React.ReactNode): React.ReactNode {
    return React.Children.map(children, child => {
      if (!React.isValidElement(child)) {
        return child;
      }
github Workday / canvas-kit / modules / popup / react / lib / Popup.tsx View on Github external
const popupAnimation = (transformOrigin: TransformOrigin) => {
  const translate = getTranslateFromOrigin(transformOrigin, spacing.xxs);

  return keyframes`
    0% {
      opacity: 0;
      transform: translate(${translate.x}px, ${translate.y}px);
    }
    100% {
      opacity: 1;
      transform: translate(0);
    }
  `;
};
github Workday / canvas-kit / modules / _labs / menu / react / lib / Menu.tsx View on Github external
id?: string;
  labeledBy?: string;
}

export interface MenuState {
  selectedItemIndex: number;
}

const minWidth = 100;

const List = styled('ul')({
  background: commonColors.background,
  minWidth: `${minWidth}px`,
  borderRadius: borderRadius.m,
  padding: 0,
  margin: `${spacing.xxs} 0`,
  '&:focus': {
    outline: 'none',
  },
  ...hideMouseFocus,
});

export default class Menu extends React.Component {
  static defaultProps = {
    isOpen: true,
  };

  private id = uuid();

  private menuRef: React.RefObject;
  private firstCharacters: string[];
github Workday / canvas-kit / modules / _labs / header / react / lib / parts / Search.tsx View on Github external
background: inputColors.background,
      color: inputColors.color,
      '&::placeholder': {
        color: inputColors.placeholderColor,
      },
      ...focusStyles,
      ...collapseStyles,
    };
  }
);

const iconStyle: React.CSSProperties = {
  position: 'absolute',
  top: '50%',
  transform: 'translateY(-50%)',
  left: spacing.xxs,
};

const SearchReset = styled(IconButton)>(
  {
    width: spacing.l,
    height: spacing.l,
    marginLeft: -spacingNumbers.xl,
    padding: 0,
  },
  ({value}) => ({
    display: value ? 'block' : 'none',
  })
);

const SearchSubmit = styled(IconButton)({
  width: spacing.l,