Skip to content

Commit ca2d300

Browse files
authored
Hero component updates (#27)
* changes to Hero * add changeset
1 parent 77abf53 commit ca2d300

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

.changeset/wild-meals-give.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@primer/react-brand': patch
3+
---
4+
5+
Updated Hero text appearance
6+
7+
- **updated** Hero description text size from `500` to `400`
8+
- **updated** button alignment to not stretch on mobile viewports
9+
- **removed** `size` prop. Now only one responsive size available.

docs/content/components/Hero.mdx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,6 @@ import {Hero} from '@primer/react-brand'
2929
/>
3030
```
3131

32-
### Size variants
33-
34-
`Hero` supports an optional `small` size variant.
35-
36-
```jsx live
37-
<Hero
38-
heading="This is my super sweet hero heading"
39-
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. Aliquam luctus sed turpis felis nam pulvinar risus elementum."
40-
primaryAction={{
41-
text: 'Primary action',
42-
href: '#',
43-
}}
44-
align="center"
45-
size="small"
46-
/>
47-
```
48-
4932
### Alignment
5033

5134
`Hero` text alignment can be adjusted by changing the `align` prop.

src/Hero/Hero.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
margin-top: 2rem;
2929
display: flex;
3030
flex-direction: column;
31-
align-items: stretch;
31+
align-items: center;
3232
width: 100%;
3333
}
3434

src/Hero/Hero.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,16 @@ export type HeroProps = {
1717
primaryAction: Action
1818
secondaryAction?: Action
1919
align?: 'start' | 'center'
20-
size?: 'small' | 'large'
2120
}
2221

23-
export function Hero({
24-
className,
25-
heading,
26-
description,
27-
primaryAction,
28-
secondaryAction,
29-
align = 'start',
30-
size = 'large'
31-
}: HeroProps) {
22+
export function Hero({className, heading, description, primaryAction, secondaryAction, align = 'start'}: HeroProps) {
3223
return (
33-
<div className={clsx(styles.Hero, styles[`Hero--align-${align}`], styles[`Hero--size-${size}`], className)}>
34-
<Heading className={styles['Hero-heading']} as={size === 'large' ? 'h1' : 'h2'}>
24+
<div className={clsx(styles.Hero, styles[`Hero--align-${align}`], className)}>
25+
<Heading className={styles['Hero-heading']} as="h1">
3526
{heading}
3627
</Heading>
3728
{description ? (
38-
<Text className={styles['Hero-description']} as="p" size="500" variant="muted">
29+
<Text className={styles['Hero-description']} as="p" size="400" variant="muted">
3930
{description}
4031
</Text>
4132
) : null}

0 commit comments

Comments
 (0)