Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export typing for next/Badge #110

Merged
merged 2 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 };