Skip to content

Commit c3ac8d1

Browse files
authored
feat: Add 'medium' weight to Heading (#814)
* feat: Add 'medium' weight to Heading * Update changelog * Bump version
1 parent 3366d1e commit c3ac8d1

File tree

7 files changed

+21
-6
lines changed

7 files changed

+21
-6
lines changed

CHANGELOG.md

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

33
Reactist follows [semantic versioning](https://semver.org/) and doesn't introduce breaking changes (API-wise) in minor or patch releases. However, the appearance of a component might change in a minor or patch release so keep an eye on redesigns and make sure your app still looks and feels like you expect it.
44

5+
# v23.2.0
6+
7+
- [Feat] Add `medium` as a `weight` option for `Header`.
8+
59
# v23.1.0
610

711
- [Feat] Add `--reactist-font-family-monospace` with updated font family for monospace elements

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"email": "henning@doist.com",
77
"url": "http://doist.com"
88
},
9-
"version": "23.1.0",
9+
"version": "23.2.0",
1010
"license": "MIT",
1111
"homepage": "https://github.com/Doist/reactist#readme",
1212
"repository": {

src/heading/heading.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
font-family: var(--reactist-font-family);
55
}
66

7+
.weight-medium {
8+
font-weight: var(--reactist-font-weight-medium);
9+
}
10+
711
.weight-light {
812
font-weight: var(--reactist-font-weight-regular);
913
}

src/heading/heading.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function HeadingPlaygroundStory(props: React.ComponentProps<typeof Headin
128128
HeadingPlaygroundStory.argTypes = {
129129
level: select(['1', '2', '3', '4', '5', '6'], '1'),
130130
size: selectWithNone(['largest', 'larger', 'smaller'], 'none'),
131-
weight: select(['regular', 'light'], 'regular'),
131+
weight: select(['regular', 'medium', 'light'], 'regular'),
132132
lineClamp: selectWithNone([1, 2, 3, 4, 5], 'none'),
133133
tone: select(['normal', 'secondary', 'danger'], 'normal'),
134134
align: selectWithNone(['start', 'center', 'end', 'justify'], 'none'),

src/heading/heading.test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ describe('Heading', () => {
8383
expect(textElement).not.toHaveClass('weight-regular')
8484
expect(textElement).not.toHaveClass('weight-light')
8585

86+
rerender(
87+
<Heading level="1" data-testid="heading-element" weight="medium">
88+
Heading
89+
</Heading>,
90+
)
91+
expect(textElement).toHaveClass('weight-medium')
92+
8693
rerender(
8794
<Heading level="1" data-testid="heading-element" weight="light">
8895
Heading

src/heading/heading.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ type HeadingProps = SupportedHeadingElementProps & {
2121
*/
2222
level: HeadingLevel
2323
/**
24-
* The weight of the heading. Used to de-emphasize the heading visually when using 'light'.
24+
* The weight of the heading. Used to de-emphasize the heading visually when using 'medium' or 'light'.
2525
*
2626
* @default 'regular'
2727
*/
28-
weight?: 'regular' | 'light'
28+
weight?: 'regular' | 'medium' | 'light'
2929
/**
3030
* Shifts the default heading visual text size up or down, depending on the original size
3131
* imposed by the `level`. The heading continues to be semantically at the given level.

0 commit comments

Comments
 (0)