Skip to content

Commit

Permalink
fix: default badge size
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-kallavus committed Nov 4, 2020
1 parent 739022d commit 2e8d12b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 5 additions & 3 deletions packages/components/src/badge/README.mdx
Expand Up @@ -14,19 +14,21 @@ Use design system [Badge](/core/badge) instead.

## Migration guide

### Set proper size
### 1. Set proper size

Default size was increased.

Set `size="small"` if size wasn't set.

```
<Badge>Active</Badge> -> <Badge size="small">Active</Badge>
```

### Change size props
### 2. Change size props

`xsmall` -> `small`

`small` -> `default`
`small` -> `void`

```
<Badge size="xsmall">Example</Badge> -> <Badge size="small">Example</Badge>
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/badge/Badge.ts
Expand Up @@ -5,7 +5,7 @@ import { ColorProps } from '@heathmont/moon-themes';
export type BadgeProps = {
color?: ColorProps;
backgroundColor?: ColorProps;
size?: 'small' | 'default';
size?: 'small';
};

const Badge = styled.span<BadgeProps>(
Expand All @@ -29,7 +29,6 @@ const Badge = styled.span<BadgeProps>(
);

Badge.defaultProps = {
size: 'default',
color: 'goten.100',
backgroundColor: 'piccolo.100',
};
Expand Down
9 changes: 2 additions & 7 deletions packages/core/src/badge/README.mdx
Expand Up @@ -46,21 +46,16 @@ backgroundColor="piccolo.100"

## Customize size

You could use `size` prop.

By default size is `default`.

Possible sizes are `small` and `default`.
You could use `size="small"` prop.

```
size= "small" | "default"
size= "small" | undefined
```

```jsx react-live
<Inline>
<Badge size="small">Small</Badge>
<Badge size="default">Default</Badge>
<Badge>Default</Badge>
</Inline>
```

0 comments on commit 2e8d12b

Please sign in to comment.