/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
import * as styled from 'styled-components';
import {theme} from 'components/shared/theme';
import {InputElement} from 'components/ui/input';

const {spacing, colors, formFieldMaxHeight, formFieldWidth, formFieldMaxWidth, primaryBorderRadius} = theme;

export const InputWithTagsWrapper = styled.default.div<{width: number | string}>`
  position: relative;
  width: ${({width}) => (width && isNaN(+width) ? width : (width || formFieldWidth) + 'px')};
  max-width: ${formFieldMaxWidth}px;
  display: flex;
  flex-direction: column;
  ${InputElement} {
    padding-right: 58px;
  }
`;

export const TagContainer = styled.default.div`
  display: flex;
  width: 100%;
  max-width: ${formFieldWidth}px;
  max-height: ${formFieldMaxHeight - 50}px;
  overflow-y: auto;
  flex-wrap: wrap;
  margin: ${spacing.xxSmall} 0;
`;

export const TagButton = styled.default.button`
  position: absolute;
  background-color: ${colors.gray500};
  top: 3px;
  right: 3px;
  width: 50px;
  height: 30px;
  border: none;
  border-radius: ${primaryBorderRadius};
  :hover {
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
  }
`;

export const TagWrapper = styled.default.div`
  position: relative;
  width: 100%;
`;
