Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/custom/StyledAccordion/StyledAccordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { styled } from '@mui/material/styles';
import MuiAccordion, { AccordionProps } from '@mui/material/Accordion';
import MuiAccordionSummary, { AccordionSummaryProps } from '@mui/material/AccordionSummary';

export const StyledAccordion = styled(MuiAccordion)<AccordionProps>(({ theme }) => ({
border: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
'&:not(:last-child)': {
borderBottom: 0,
},
'&:before': {
display: 'none',
},
'&.Mui-expanded': {
margin: 'auto',
},
}));

export const StyledAccordionSummary = styled(MuiAccordionSummary)<AccordionSummaryProps>(({ theme }) => ({
backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255, 255, 255, .05)' : 'rgba(0, 0, 0, .03)',
borderBottom: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
marginBottom: -1,
minHeight: 56,
'& .MuiAccordionSummary-content': {
'&.Mui-expanded': {
margin: '12px 0',
},
},
}));
1 change: 1 addition & 0 deletions src/custom/StyledAccordion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './StyledAccordion';
1 change: 1 addition & 0 deletions src/custom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './CustomTooltip';
export * from './HelperTextPopover';
export * from './Markdown';
export * from './Modal';
export * from './StyledAccordion';