|
@@ -5,31 +5,74 @@ interface TitleProps {
|
|
|
isOrdered?: boolean;
|
|
|
}
|
|
|
|
|
|
-const isOrderableStyles = css`
|
|
|
- cursor: pointer;
|
|
|
+export const Title = styled.span<TitleProps>(
|
|
|
+ ({ isOrderable, isOrdered, theme: { table } }) => css`
|
|
|
+ font-family: Inter, sans-serif;
|
|
|
+ font-size: 12px;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 16px;
|
|
|
+ letter-spacing: 0em;
|
|
|
+ text-align: left;
|
|
|
+ justify-content: start;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ background: ${table.th.backgroundColor.normal};
|
|
|
+ cursor: default;
|
|
|
+ color: ${table.th.color.normal};
|
|
|
|
|
|
- &:hover {
|
|
|
- color: ${(props) => props.theme.table.th.color.hover};
|
|
|
- }
|
|
|
-`;
|
|
|
+ ${isOrderable &&
|
|
|
+ css`
|
|
|
+ cursor: pointer;
|
|
|
|
|
|
-export const Title = styled.span<TitleProps>`
|
|
|
- font-family: Inter, sans-serif;
|
|
|
- font-size: 12px;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 400;
|
|
|
- line-height: 16px;
|
|
|
- letter-spacing: 0em;
|
|
|
- text-align: left;
|
|
|
- background: ${(props) => props.theme.table.th.backgroundColor.normal};
|
|
|
- color: ${(props) =>
|
|
|
- props.isOrdered
|
|
|
- ? props.theme.table.th.color.active
|
|
|
- : props.theme.table.th.color.normal};
|
|
|
- cursor: default;
|
|
|
+ padding-right: 18px;
|
|
|
+ position: relative;
|
|
|
|
|
|
- ${(props) => props.isOrderable && isOrderableStyles}
|
|
|
-`;
|
|
|
+ &::before,
|
|
|
+ &::after {
|
|
|
+ border: 4px solid transparent;
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ height: 0;
|
|
|
+ right: 5px;
|
|
|
+ top: 50%;
|
|
|
+ position: absolute;
|
|
|
+ }
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ border-bottom-color: ${table.th.color.normal};
|
|
|
+ margin-top: -9px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ border-top-color: ${table.th.color.normal};
|
|
|
+ margin-top: 1px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: ${table.th.color.hover};
|
|
|
+ &::before {
|
|
|
+ border-bottom-color: ${table.th.color.hover};
|
|
|
+ }
|
|
|
+ &::after {
|
|
|
+ border-top-color: ${table.th.color.hover};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ `}
|
|
|
+
|
|
|
+ ${isOrderable &&
|
|
|
+ isOrdered &&
|
|
|
+ css`
|
|
|
+ color: ${table.th.color.active};
|
|
|
+ &::before {
|
|
|
+ border-bottom-color: ${table.th.color.active};
|
|
|
+ }
|
|
|
+ &::after {
|
|
|
+ border-top-color: ${table.th.color.active};
|
|
|
+ }
|
|
|
+ `}
|
|
|
+ `
|
|
|
+);
|
|
|
|
|
|
export const Preview = styled.span`
|
|
|
margin-left: 8px;
|