DocSpace-client/packages/components/selected-item/styled-selected-item.js
Aleksandr Lushkin 37efdc292a Merge branch 'develop' into feature/rtl-interface-direction
# Conflicts:
#	packages/client/src/components/panels/HotkeysPanel/index.js
#	packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js
#	packages/components/date-time-picker/index.js
#	packages/components/selected-item/styled-selected-item.js
2023-07-26 17:47:13 +02:00

62 lines
1.4 KiB
JavaScript

import React from "react";
import { Base } from "@docspace/components/themes";
import styled, { css } from "styled-components";
import NoUserSelect from "@docspace/components/utils/commonStyles";
const StyledSelectedItem = styled.div`
width: ${(props) => (props.isInline ? "fit-content" : "100%")};
height: 32px;
display: inline-flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
border-radius: 3px;
padding: 6px 8px;
${({ theme }) =>
theme.interfaceDirection === "rtl"
? `margin-left: 4px;`
: `margin-right: 4px;`}
margin-bottom: 4px;
background: ${(props) => props.theme.filterInput.selectedItems.background};
${(props) =>
!props.isDisabled &&
css`
:hover {
background: ${(props) =>
props.theme.filterInput.selectedItems.hoverBackground};
}
`}
`;
const StyledLabel = styled.div`
line-height: 20px;
${({ theme }) =>
theme.interfaceDirection === "rtl"
? `margin-left: 10px;`
: `margin-right: 10px;`}
max-width: 23ch;
color: ${(props) => props.isDisabled && props.theme.text.disableColor};
${() => NoUserSelect}
${(props) =>
props.truncate &&
css`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`}
`;
StyledSelectedItem.defaultProps = { theme: Base };
export { StyledSelectedItem, StyledLabel };