import * as React from 'react'; import styled from '@emotion/styled'; import { themeGet } from '@styled-system/theme-get'; import { IconChevronDown } from '@lightspeed/flame/Icon/ChevronDown'; import { IconChevronUp } from '@lightspeed/flame/Icon/ChevronUp'; import { IconChevronUpDown } from '@lightspeed/flame/Icon/ChevronUpDown'; import { SortingDirection } from '../types'; import { Th } from '../../../components/Table'; export const IconButton = styled('button')` border-width: 0; padding: 0; display: flex; cursor: pointer; outline: none; align-items: center; font-size: ${themeGet('fontSizes.text-s')}; font-weight: ${themeGet('fontWeights.bold')}; font-family: ${themeGet('fontFamily.sans-serif')}; padding: ${themeGet('space.1')}; height: auto; box-sizing: border-box; border-radius: ${themeGet('radii.radius-1')}; background-color: ${themeGet('colors.white')}; transition: background 200ms ease; color: ${themeGet('colors.textHeading')}; &:hover { background-color: ${themeGet('tableStyles.sortable.button.background', 'blue')}; } `; const IconContainer = styled('span')` margin-left: ${themeGet('space.1')}; display: inline-flex; `; interface SortIconProps { direction: SortingDirection; size: string; } const SortIcon: React.FC = ({ direction, ...restProps }) => { switch (direction) { case 'asc': return ; case 'desc': return ; case 'unsorted': default: return ; } }; interface SortButton extends React.HTMLProps { direction: SortingDirection; css?: any; } export const SortButton: React.FC = ({ children, direction, ...restProps }) => ( {children} ); interface SortableThProps extends React.ButtonHTMLAttributes { width?: string; direction?: SortingDirection; onClick?: () => void; css?: any; } export const SortableTh: React.FC = ({ width, direction, onClick, children, ...restProps }) => ( {children} );