Skip to content

Commit

Permalink
Export typing for next/Badge (#110)
Browse files Browse the repository at this point in the history
* export typing for next/Badge

* Update CHANGELOG.md
  • Loading branch information
xdrdak authored Jun 25, 2020
1 parent fb8d68a commit efc5418
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/flame/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Refer to the [CONTRIBUTING guide](https://github.com/lightspeed/flame/blob/maste
### Fixed

- Smoothed out border-radius for next/Badge ([#108](https://github.com/lightspeed/flame/pull/#108)
- Export next/Badge prop typing and variant types ([#110](https://github.com/lightspeed/flame/pull/#110)

## 2.0.0-rc.7 - 2020-06-22

Expand Down
11 changes: 6 additions & 5 deletions packages/flame/src/Badge/next/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import * as React from 'react';
import { css } from '@styled-system/css';

interface Props extends React.ComponentPropsWithRef<'span'> {
export type BadgeVariants = 'default' | 'danger' | 'primary' | 'success' | 'warning';
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
/**
* Adjust the overall look and feel of a badge.
* Possible variants are:
* 'default' | 'danger' | 'primary' | 'success' | 'warning'
*/
variant?: 'default' | 'danger' | 'primary' | 'success' | 'warning';
variant?: BadgeVariants;
}
/**
* A badge communicates the status of an item or event when placed beside it.
* It uses bold colors to quickly signal the intent of an item or event.
*/
const Badge: React.FC<Props> = ({ variant = 'default', ...restProps }) => (
export const Badge: React.FC<BadgeProps> = ({ variant = 'default', ...restProps }) => (
<span
className="fl-badge"
css={css({
Expand All @@ -29,5 +32,3 @@ const Badge: React.FC<Props> = ({ variant = 'default', ...restProps }) => (
{...restProps}
/>
);

export { Badge };

0 comments on commit efc5418

Please sign in to comment.