1
- import React , { useState , PropsWithChildren , ReactElement } from 'react' ;
1
+ import React , { PropsWithChildren , ReactElement , useState } from 'react' ;
2
2
import styled from 'styled-components' ;
3
-
4
- import { SemanticColors } from '../../../essentials' ;
5
3
import { Text } from '../../Text/Text' ;
6
4
import { Box } from '../../Box/Box' ;
7
5
import { Headline } from '../../Headline/Headline' ;
@@ -10,49 +8,54 @@ import { ChevronUp } from './ChevronUp';
10
8
import { ChevronDown } from './ChevronDown' ;
11
9
import { Description } from './Description' ;
12
10
import { AccordionProps } from '../types' ;
11
+ import { getSemanticValue } from '../../../utils/cssVariables' ;
13
12
14
13
const ButtonLabel = styled ( Text ) . attrs ( { as : 'p' } ) `
15
- color: ${ SemanticColors . text . link } ;
14
+ color: ${ getSemanticValue ( ' text- link' ) } ;
16
15
` ;
17
16
18
17
const PanelHeader = styled ( Header ) `
19
18
&:hover {
20
- background-color: ${ SemanticColors . background . info } ;
19
+ background-color: ${ getSemanticValue ( ' background- info-default' ) } ;
21
20
}
22
21
23
22
&:hover ${ ButtonLabel } {
24
- color: ${ SemanticColors . text . linkHover } ;
23
+ color: ${ getSemanticValue ( ' text- linkHover' ) } ;
25
24
}
26
25
27
26
&:hover ${ ChevronDown } {
28
- color: ${ SemanticColors . text . linkHover } ;
27
+ color: ${ getSemanticValue ( ' text- linkHover' ) } ;
29
28
}
30
29
` ;
31
30
32
31
const CardHeader = styled ( Header ) . attrs ( { p : '3' } ) `
33
- background-color: ${ SemanticColors . background . secondary } ;
32
+ background-color: ${ getSemanticValue ( ' background- secondary-default' ) } ;
34
33
border-radius: 0.3125rem 0.3125rem 0 0;
35
34
36
35
&:hover {
37
- background-color: ${ SemanticColors . background . info } ;
36
+ background-color: ${ getSemanticValue ( ' background- info-default' ) } ;
38
37
}
39
38
40
39
&:hover ${ ButtonLabel } {
41
- color: ${ SemanticColors . text . linkHover } ;
40
+ color: ${ getSemanticValue ( ' text- linkHover' ) } ;
42
41
}
43
42
44
43
&:hover ${ ChevronUp } {
45
- color: ${ SemanticColors . text . linkHover } ;
44
+ color: ${ getSemanticValue ( ' text- linkHover' ) } ;
46
45
}
47
46
` ;
48
47
49
48
const PanelBody = styled ( Box ) . attrs ( { my : '3' } ) `
50
- border: solid 0.0625rem ${ SemanticColors . border . primary } ;
49
+ border: solid 0.0625rem ${ getSemanticValue ( ' border- primary-default' ) } ;
51
50
border-radius: 0.3125rem;
52
51
` ;
53
52
54
53
const PanelIcon = ( { isOpen } : { isOpen : boolean } ) =>
55
- isOpen ? < ChevronUp color = { SemanticColors . icon . action } /> : < ChevronDown color = { SemanticColors . icon . action } /> ;
54
+ isOpen ? (
55
+ < ChevronUp color = { getSemanticValue ( 'icon-action-default' ) } />
56
+ ) : (
57
+ < ChevronDown color = { getSemanticValue ( 'icon-action-default' ) } />
58
+ ) ;
56
59
57
60
export const DefaultPanel = ( {
58
61
heading,
0 commit comments