import {css, keyframes, styled} from '@mui/material/styles'; import ChevronLeftIcon from 'herein-icon/chevron-left'; const spin = keyframes` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `; const Spinner = styled('div')` width: 1rem; height: 1rem; animation: ${spin} 1s linear infinite; border-radius: 9999px; border: 4px solid; border-color: #e5e7eb; border-top-color: #9333ea; `; const customizations = css` & .rc-cascader-dropdown { min-height: auto; position: absolute; background-color: white; } & .rc-cascader-dropdown-hidden { display: none; } & .rc-cascader-menus { display: flex; flex-wrap: nowrap; padding: 0.25rem 0; border: 1px solid #f3f4f6; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); border-radius: 0.375rem; } & .rc-cascader-menu { padding: 0 0.25rem; flex: none; margin: 0; list-style: none; border-left: 1px solid #f3f4f6; border-right: 0; height: 11rem; min-width: 100px; overflow: auto; &:first-of-type { border-left: 0; } } & .rc-cascader-menu-item { position: relative; display: flex; align-items: center; flex-wrap: nowrap; padding: 0.5rem 0.75rem; gap: 0.5rem; border-radius: 0.125rem; cursor: pointer; &:hover { background-color: #dbeafe; } } & .rc-cascader-menu-item-selected { background-color: #3b82f6; } & .rc-cascader-menu-item-active { background-color: #eff6ff; } & .rc-cascader-menu-item-disabled { opacity: 0.5; } & .rc-cascader-menu-item-content { flex: 1; color: #111827; font-weight: 400; font-size: 1rem; } & .rc-cascader-menu-item-expand-icon { display: flex; } & .rc-cascader-checkbox { display: inline-block; vertical-align: middle; position: relative; cursor: pointer; height: 1.25rem; width: 1.25rem; border: 1px solid #d1d5db; border-radius: 0.375rem; overflow: hidden; } & .rc-cascader-checkbox-checked { background-color: #2563eb; &::before { display: block; position: absolute; top: 2px; left: 6px; width: 6px; height: 12px; content: ''; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); box-sizing: border-box; } } & .rc-cascader-checkbox-indeterminate { background-color: #2563eb; &::after { content: ''; position: absolute; box-sizing: border-box; background-color: #fff; top: 50%; left: 50%; width: 10px; height: 2px; transform: translate(-50%, -50%); } } & .rc-cascader-rtl { direction: rtl; .rc-cascader-menu { padding: 0 0.25rem; flex: none; margin: 0; list-style: none; border-right: 1px solid #f3f4f6; border-left: 0; &:first-of-type { border-right: 0; } } } `; const ChevronLeft = styled(ChevronLeftIcon)` color: ${({theme}) => theme.palette.typography[800]}; `; export const CascadeStyle = { Spinner, customizations, ChevronLeft, };