Files
twenty_crm/front/src/modules/command-menu/components/CommandMenuStyles.tsx
brendanlaschke 20267f081a Fix command menu keyboard input & refactor group (#1706)
* - fix command menu keyboard shortcuts
- refactor command groups

* - refactor the MenuItemCommand to use cmdk

* - fixed matching commands multiple displays

* - fixed array count problems react with boolean
2023-09-22 11:44:42 +02:00

59 lines
1.7 KiB
TypeScript

import styled from '@emotion/styled';
import { Command } from 'cmdk';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
export const StyledDialog = styled(Command.Dialog)`
background: ${({ theme }) => theme.background.primary};
border-radius: ${({ theme }) => theme.border.radius.md};
box-shadow: ${({ theme }) => theme.boxShadow.strong};
font-family: ${({ theme }) => theme.font.family};
left: 50%;
max-width: 640px;
overflow: hidden;
padding: 0;
padding: ${({ theme }) => theme.spacing(1)};
position: fixed;
top: 30%;
transform: ${() =>
useIsMobile() ? 'translateX(-49.5%)' : 'translateX(-50%)'};
width: ${() => (useIsMobile() ? 'calc(100% - 40px)' : '100%')};
z-index: 1000;
`;
export const StyledInput = styled(Command.Input)`
background: ${({ theme }) => theme.background.primary};
border: none;
border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
border-radius: 0;
color: ${({ theme }) => theme.font.color.primary};
font-size: ${({ theme }) => theme.font.size.lg};
margin: 0;
outline: none;
padding: ${({ theme }) => theme.spacing(5)};
width: 100%;
&::placeholder {
color: ${({ theme }) => theme.font.color.light};
}
`;
export const StyledList = styled(Command.List)`
background: ${({ theme }) => theme.background.secondary};
height: min(300px, var(--cmdk-list-height));
max-height: 400px;
overflow: auto;
overscroll-behavior: contain;
transition: 100ms ease;
transition-property: height;
`;
export const StyledEmpty = styled(Command.Empty)`
align-items: center;
color: ${({ theme }) => theme.font.color.light};
display: flex;
font-size: ${({ theme }) => theme.font.size.md};
height: 64px;
justify-content: center;
white-space: pre-wrap;
`;