Skip to content

Commit b2bc411

Browse files
authored
chore: replace deprecated retrieveComponentStyles with componentStyles utility (#1989)
1 parent c3a7041 commit b2bc411

File tree

290 files changed

+596
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+596
-596
lines changed

packages/.template/src/styled/Styled{{capitalize component}}.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { ThemeProps, DefaultTheme, css } from 'styled-components';
9-
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9+
import { componentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = '{{pluralize (lowercase component)}}.{{lowercase component}}';
1212

@@ -63,13 +63,13 @@ export const Styled{{capitalize component}} = styled.div.attrs<IStyled{{capitali
6363
white-space: nowrap;
6464
box-sizing: border-box;
6565
66-
${props => sizeStyles(props)};
66+
${sizeStyles};
6767
6868
&:focus {
6969
outline: none;
7070
}
7171
72-
${props => colorStyles(props)};
72+
${colorStyles};
7373
7474
& > * {
7575
display: block;
@@ -78,7 +78,7 @@ export const Styled{{capitalize component}} = styled.div.attrs<IStyled{{capitali
7878
text-overflow: ellipsis;
7979
}
8080
81-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
81+
${componentStyles};
8282
`;
8383

8484
Styled{{capitalize component}}.defaultProps = {

packages/accordions/src/styled/accordion/StyledAccordion.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.accordion';
1212

1313
export const StyledAccordion = styled.div.attrs({
1414
'data-garden-id': COMPONENT_ID,
1515
'data-garden-version': PACKAGE_VERSION
1616
})`
17-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
17+
${componentStyles};
1818
`;

packages/accordions/src/styled/accordion/StyledButton.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css, ThemeProps, DefaultTheme } from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
1010

1111
export const COMPONENT_ID = 'accordions.button';
1212

@@ -72,5 +72,5 @@ export const StyledButton = styled.button.attrs<IStyledButton>({
7272
cursor: ${props => (props.$isCollapsible || !props.$isExpanded) && 'pointer'};
7373
}
7474
75-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
75+
${componentStyles};
7676
`;

packages/accordions/src/styled/accordion/StyledHeader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles, focusStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles, focusStyles } from '@zendeskgarden/react-theming';
1010
import { StyledButton } from './StyledButton';
1111

1212
const COMPONENT_ID = 'accordions.header';
@@ -36,5 +36,5 @@ export const StyledHeader = styled.div.attrs<IStyledHeader>({
3636
selector: `&:has(${StyledButton}:focus-visible)`
3737
})}
3838
39-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
39+
${componentStyles};
4040
`;

packages/accordions/src/styled/accordion/StyledInnerPanel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010
import { StyledPanel } from './StyledPanel';
1111

1212
const COMPONENT_ID = 'accordions.step_inner_panel';
@@ -32,5 +32,5 @@ export const StyledInnerPanel = styled.div.attrs({
3232
visibility: visible;
3333
}
3434
35-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
35+
${componentStyles};
3636
`;

packages/accordions/src/styled/accordion/StyledPanel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import styled, { css, ThemeProps, DefaultTheme } from 'styled-components';
99
import {
1010
getLineHeight,
11-
retrieveComponentStyles,
11+
componentStyles,
1212
DEFAULT_THEME,
1313
getColor
1414
} from '@zendeskgarden/react-theming';
@@ -70,7 +70,7 @@ export const StyledPanel = styled.section.attrs<IStyledPanel>({
7070
${sizeStyles}
7171
${colorStyles}
7272
73-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
73+
${componentStyles};
7474
`;
7575

7676
StyledPanel.defaultProps = {

packages/accordions/src/styled/accordion/StyledRotateIcon.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css, ThemeProps, DefaultTheme, DataAttributes } from 'styled-components';
9-
import { retrieveComponentStyles, StyledBaseIcon, getColor } from '@zendeskgarden/react-theming';
9+
import { componentStyles, StyledBaseIcon, getColor } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.rotate_icon';
1212

@@ -58,5 +58,5 @@ export const StyledRotateIcon = styled(StyledBaseIcon).attrs<DataAttributes>({
5858
5959
${colorStyles}
6060
61-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
61+
${componentStyles};
6262
`;

packages/accordions/src/styled/accordion/StyledSection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010
import { StyledPanel } from './StyledPanel';
1111

1212
const COMPONENT_ID = 'accordions.section';
@@ -19,5 +19,5 @@ export const StyledSection = styled.div.attrs({
1919
border: none;
2020
}
2121
22-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
22+
${componentStyles};
2323
`;

packages/accordions/src/styled/stepper/StyledContent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css, ThemeProps, DefaultTheme } from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.step_content';
1212

@@ -42,5 +42,5 @@ export const StyledContent = styled.div.attrs<IStyledContent>({
4242
4343
${sizeStyles}
4444
45-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
45+
${componentStyles};
4646
`;

packages/accordions/src/styled/stepper/StyledIcon.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css, ThemeProps, DefaultTheme } from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.step_icon';
1212

@@ -75,5 +75,5 @@ export const StyledIcon = styled.div.attrs<IStyledIcon>({
7575
${sizeStyles}
7676
${colorStyles}
7777
78-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
78+
${componentStyles};
7979
`;

packages/accordions/src/styled/stepper/StyledInnerContent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { ThemeProps, DefaultTheme } from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.step_inner_content';
1212

@@ -23,5 +23,5 @@ export const StyledInnerContent = styled.div.attrs({
2323
color: ${({ theme }) => getColor({ theme, variable: 'foreground.default' })};
2424
font-size: ${props => props.theme.fontSizes.md};
2525
26-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
26+
${componentStyles};
2727
`;

packages/accordions/src/styled/stepper/StyledLabel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.step_label';
1212

@@ -34,5 +34,5 @@ export const StyledLabel = styled.div.attrs<IStyledLabelProps>({
3434
font-size: ${props => props.theme.fontSizes.md};
3535
font-weight: ${props => props.$isActive && 600};
3636
37-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
37+
${componentStyles};
3838
`;

packages/accordions/src/styled/stepper/StyledStep.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
1010
import { StyledContent } from './StyledContent';
1111
import { StyledLine } from './StyledLine';
1212

@@ -37,5 +37,5 @@ export const StyledStep = styled.li.attrs<IStyledStep>({
3737
border-color: ${({ theme }) => getColor({ theme, variable: 'border.default' })};
3838
}
3939
40-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
40+
${componentStyles};
4141
`;

packages/accordions/src/styled/stepper/StyledStepper.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'accordions.stepper';
1212

@@ -26,5 +26,5 @@ export const StyledStepper = styled.ol.attrs<IStyledStepper>({
2626
padding: 0; /* [1] */
2727
list-style: none; /* [1] */
2828
29-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
29+
${componentStyles};
3030
`;

packages/accordions/src/styled/timeline/StyledContent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'timeline.content';
1212

@@ -16,5 +16,5 @@ export const StyledTimelineContent = styled.div.attrs({
1616
})`
1717
flex: 1;
1818
padding: ${props => `${props.theme.space.base * 5}px ${props.theme.space.base * 4}px`};
19-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
19+
${componentStyles};
2020
`;

packages/accordions/src/styled/timeline/StyledItem.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css } from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
1010
import { StyledSeparator } from './StyledSeparator';
1111
import { StyledTimelineContent } from './StyledContent';
1212
import { StyledOppositeContent } from './StyledOppositeContent';
@@ -57,5 +57,5 @@ export const StyledTimelineItem = styled.li.attrs({
5757
}
5858
`}
5959
60-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
60+
${componentStyles};
6161
`;

packages/accordions/src/styled/timeline/StyledItemIcon.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import styled, { DataAttributes, DefaultTheme, ThemeProps, css } from 'styled-components';
99
import { math } from 'polished';
10-
import { retrieveComponentStyles, StyledBaseIcon, getColor } from '@zendeskgarden/react-theming';
10+
import { componentStyles, StyledBaseIcon, getColor } from '@zendeskgarden/react-theming';
1111

1212
const COMPONENT_ID = 'timeline.icon';
1313

@@ -49,5 +49,5 @@ export const StyledItemIcon = styled(StyledBaseIcon).attrs<DataAttributes>({
4949
5050
${colorStyles}
5151
52-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
52+
${componentStyles};
5353
`;

packages/accordions/src/styled/timeline/StyledOppositeContent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'timeline.opposite.content';
1212

@@ -17,5 +17,5 @@ export const StyledOppositeContent = styled.div.attrs({
1717
flex: 1;
1818
padding: ${props => `${props.theme.space.base * 5}px ${props.theme.space.base * 4}px`};
1919
text-align: ${props => (props.theme.rtl ? 'left' : 'right')};
20-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
20+
${componentStyles};
2121
`;

packages/accordions/src/styled/timeline/StyledSeparator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9+
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'timeline.content.separator';
1212

@@ -27,5 +27,5 @@ export const StyledSeparator = styled.div.attrs({
2727
content: '';
2828
}
2929
30-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
30+
${componentStyles};
3131
`;

packages/accordions/src/styled/timeline/StyledTimeline.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'timeline';
1212

@@ -20,5 +20,5 @@ export const StyledTimeline = styled.ol.attrs({
2020
margin: 0; /* [1] */
2121
padding: 0; /* [1] */
2222
list-style: none; /* [1] */
23-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
23+
${componentStyles};
2424
`;

packages/avatars/src/styled/StyledAvatar.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { css, ThemeProps, keyframes, DefaultTheme } from 'styled-components';
9-
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9+
import { componentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
1010
import { math } from 'polished';
1111

1212
import { IAvatarProps, SIZE } from '../types';
@@ -229,7 +229,7 @@ export const StyledAvatar = styled.figure.attrs({
229229
${badgeStyles};
230230
}
231231
232-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
232+
${componentStyles};
233233
`;
234234

235235
StyledAvatar.defaultProps = {

packages/avatars/src/styled/StyledStandaloneStatus.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { ThemeProps, DefaultTheme } from 'styled-components';
9-
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { componentStyles } from '@zendeskgarden/react-theming';
1010

1111
import { TRANSITION_DURATION } from './utility';
1212

@@ -22,5 +22,5 @@ export const StyledStandaloneStatus = styled.figure.attrs({
2222
margin: 0;
2323
box-sizing: content-box;
2424
25-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
25+
${componentStyles};
2626
`;

packages/avatars/src/styled/StyledStandaloneStatusCaption.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import styled, { ThemeProps, DefaultTheme, css } from 'styled-components';
9-
import { getLineHeight, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9+
import { getLineHeight, componentStyles } from '@zendeskgarden/react-theming';
1010

1111
const COMPONENT_ID = 'avatars.status-indicator.caption';
1212

@@ -28,5 +28,5 @@ export const StyledStandaloneStatusCaption = styled.figcaption.attrs({
2828
})<ThemeProps<DefaultTheme>>`
2929
${sizeStyles}
3030
31-
${props => retrieveComponentStyles(COMPONENT_ID, props)};
31+
${componentStyles};
3232
`;

0 commit comments

Comments
 (0)