Skip to content

Commit 4acb03f

Browse files
authored
Deprecate typography props and legacy Emotion components (#3440)
1 parent 0c6635b commit 4acb03f

22 files changed

Lines changed: 96 additions & 109 deletions

.changeset/bitter-candles-pick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sumup-oss/circuit-ui": minor
3+
---
4+
5+
Deprecated the InlineElements component. Use [CSS Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) or [CSS Grid](https://css-tricks.com/css-grid-layout-guide/) instead.

.changeset/gold-pants-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sumup-oss/circuit-ui": minor
3+
---
4+
5+
Deprecated the style mixins. Use the `utilClasses` instead. We strongly recommend migrating from Emotion.js to CSS Modules.

.changeset/thirty-moles-heal.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sumup-oss/circuit-ui": minor
3+
---
4+
5+
Deprecated the Body and Numeral components' italic decoration value. Since the brand refresh, italic text is no longer supported and the value will be removed in the next major release.

.changeset/wild-trams-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sumup-oss/circuit-ui": minor
3+
---
4+
5+
Deprecated the Display component's `weight` prop. Since the brand refresh, only `bold` is supported. The `weight` prop will be removed in the next major version.

packages/circuit-ui/components/Body/Body.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The Body component comes in three weights. Use the default `regular` weight in m
3030

3131
### Decorations
3232

33-
The Body component comes in two styles. Use the `as` prop to render the component as the `em` or `del` HTML elements if appropriate.
33+
The Body component supports a strikethrough style. Use the `as` prop to render the component as the `del` HTML element if appropriate.
3434

3535
<Story of={Stories.Decorations} />
3636

packages/circuit-ui/components/Body/Body.module.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636

3737
/* Decorations & styles */
3838

39-
.italic {
40-
font-style: italic;
41-
}
42-
4339
.strikethrough {
4440
text-decoration: line-through;
4541
}

packages/circuit-ui/components/Body/Body.stories.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,11 @@ export const Weights = (args: BodyProps) =>
4949
</Body>
5050
));
5151

52-
const decorations = ['italic', 'strikethrough'] as const;
53-
54-
export const Decorations = (args: BodyProps) =>
55-
decorations.map((decoration) => (
56-
<Body key={decoration} {...args} decoration={decoration}>
57-
{content}
58-
</Body>
59-
));
52+
export const Decorations = (args: BodyProps) => (
53+
<Body {...args} decoration="strikethrough">
54+
{content}
55+
</Body>
56+
);
6057

6158
const colors = [
6259
'normal',

packages/circuit-ui/components/Body/Body.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ export interface BodyProps extends HTMLAttributes<HTMLParagraphElement> {
5252
* Use the `as` prop to render the component as the `em` or `del` HTML
5353
* elements if appropriate.
5454
*/
55-
decoration?: 'italic' | 'strikethrough';
55+
decoration?:
56+
| 'strikethrough'
57+
/**
58+
* @deprecated Since the brand refresh, italic text is no longer supported.
59+
* The `italic` decoration value will be removed in the next major version.
60+
*/
61+
| 'italic';
5662
/**
5763
* Choose a foreground color token name. Default: `normal`.
5864
*/
@@ -163,7 +169,7 @@ export const Body = forwardRef<HTMLParagraphElement, BodyProps>(
163169
classes[size],
164170
classes[weight],
165171
classes[color],
166-
decoration && classes[decoration],
172+
decoration === 'strikethrough' && classes.strikethrough,
167173
variant && classes[variant],
168174
className,
169175
)}

packages/circuit-ui/components/Display/Display.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ The Display component comes in three sizes. In most cases, use the [Headline com
2020

2121
<Story of={Stories.Sizes} />
2222

23-
### Weights
24-
25-
The Display component comes in three weight. Use the default `bold` weight in most cases.
26-
27-
<Story of={Stories.Weights} />
28-
2923
---
3024

3125
## Accessibility

packages/circuit-ui/components/Display/Display.module.css

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
.base {
22
margin: 0;
33
font-family: var(--cui-font-stack-display);
4+
font-weight: var(--cui-font-weight-bold);
45
color: var(--cui-fg-normal);
56
letter-spacing: var(--cui-letter-spacing-tight, var(--cui-letter-spacing));
67
}
78

8-
/* Weights */
9-
10-
.regular {
11-
font-weight: var(--cui-font-weight-regular);
12-
}
13-
14-
.semibold {
15-
font-weight: var(--cui-font-weight-semibold);
16-
}
17-
18-
.bold {
19-
font-weight: var(--cui-font-weight-bold);
20-
}
21-
229
/* Sizes */
2310

2411
.l {

0 commit comments

Comments
 (0)