Skip to content

Commit 5cae15f

Browse files
committed
feat: migrate StyledAccordion to Sistent custom components
Signed-off-by: Canbow <hailstorm362@gmail.com>
1 parent e3b4cf4 commit 5cae15f

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { styled } from '@mui/material/styles';
2+
import MuiAccordion, { AccordionProps } from '@mui/material/Accordion';
3+
import MuiAccordionSummary, { AccordionSummaryProps } from '@mui/material/AccordionSummary';
4+
5+
export const StyledAccordion = styled(MuiAccordion)<AccordionProps>(({ theme }) => ({
6+
border: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
7+
'&:not(:last-child)': {
8+
borderBottom: 0,
9+
},
10+
'&:before': {
11+
display: 'none',
12+
},
13+
'&.Mui-expanded': {
14+
margin: 'auto',
15+
},
16+
}));
17+
18+
export const StyledAccordionSummary = styled(MuiAccordionSummary)<AccordionSummaryProps>(({ theme }) => ({
19+
backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255, 255, 255, .05)' : 'rgba(0, 0, 0, .03)',
20+
borderBottom: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
21+
marginBottom: -1,
22+
minHeight: 56,
23+
'& .MuiAccordionSummary-content': {
24+
'&.Mui-expanded': {
25+
margin: '12px 0',
26+
},
27+
},
28+
}));
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './StyledAccordion';

src/custom/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export * from './CustomTooltip';
33
export * from './HelperTextPopover';
44
export * from './Markdown';
55
export * from './Modal';
6+
export * from './StyledAccordion';

0 commit comments

Comments
 (0)