/*
Copyright (c) 2018-2019 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import { styled } from '../styles/index.js';

/**
 * Main component container element
 */
export const Root = styled('div', ({
  $theme
}) => {
  return {
    width: '100%'
  };
});
Root.displayName = "Root";
Root.displayName = 'StyledRoot';
export const List = styled('ul', ({
  $isDragged
}) => {
  return {
    paddingLeft: 0,
    cursor: $isDragged ? 'grabbing' : null,
    pointerEvents: $isDragged ? 'none' : 'auto'
  };
});
List.displayName = "List";
List.displayName = 'StyledList';
export const Item = styled('li', ({
  $isDragged,
  $isSelected,
  $theme
}) => {
  return {
    ':hover': !$isDragged && !$isSelected ? {
      borderTopWidth: '2px',
      borderBottomWidth: '2px',
      borderLeftWidth: '2px',
      borderRightWidth: '2px',
      borderTopStyle: 'solid',
      borderBottomStyle: 'solid',
      borderLeftStyle: 'solid',
      borderRightStyle: 'solid',
      borderTopColor: $theme.colors.primary,
      borderBottomColor: $theme.colors.primary,
      borderLeftColor: $theme.colors.primary,
      borderRightColor: $theme.colors.primary
    } : {},
    paddingTop: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale600,
    paddingLeft: $theme.sizing.scale600,
    paddingRight: $theme.sizing.scale600,
    color: $theme.colors.colorPrimary,
    display: 'flex',
    justifyContent: 'space-between',
    alignItems: 'center',
    listStyle: 'none',
    cursor: $isDragged ? 'grabbing' : 'grab',
    backgroundColor: $theme.colors.backgroundAlt,
    boxShadow: $isDragged ? '0 2px 6px rgba(0, 0, 0, 0.32)' : null,
    borderTopWidth: '2px',
    borderBottomWidth: '2px',
    borderLeftWidth: '2px',
    borderRightWidth: '2px',
    borderTopStyle: 'solid',
    borderBottomStyle: 'solid',
    borderLeftStyle: 'solid',
    borderRightStyle: 'solid',
    borderTopColor: $isDragged || $isSelected ? $theme.colors.primary : 'transparent',
    borderBottomColor: $isDragged || $isSelected ? $theme.colors.primary : 'transparent',
    borderLeftColor: $isDragged || $isSelected ? $theme.colors.primary : 'transparent',
    borderRightColor: $isDragged || $isSelected ? $theme.colors.primary : 'transparent'
  };
});
Item.displayName = "Item";
List.displayName = 'StyledItem';
export const DragHandle = styled('div', ({
  $theme
}) => ({
  [$theme.direction === 'rtl' ? 'marginLeft' : 'marginRight']: $theme.sizing.scale600,
  width: $theme.sizing.scale800,
  display: 'flex',
  alignItems: 'center'
}));
DragHandle.displayName = "DragHandle";
DragHandle.displayName = 'StyledDragHandle';
export const CloseHandle = styled('button', ({
  $theme
}) => ({
  border: 'none',
  paddingTop: 0,
  paddingBottom: 0,
  paddingLeft: 0,
  paddingRight: 0,
  overflow: 'visible',
  cursor: 'pointer',
  backgroundColor: 'transparent',
  [$theme.direction === 'rtl' ? 'marginRight' : 'marginLeft']: $theme.sizing.scale600,
  width: $theme.sizing.scale800,
  display: 'flex',
  alignItems: 'center'
}));
CloseHandle.displayName = "CloseHandle";
CloseHandle.displayName = 'StyledCloseHandle';
export const Label = styled('div', ({
  $theme
}) => ({
  flexGrow: 1,
  ...$theme.typography.font300
}));
Label.displayName = "Label";
Label.displayName = 'StyledLabel';