Skip to content

Commit

Permalink
fix(pill): ts type definitions not properly exported
Browse files Browse the repository at this point in the history
add index.d.ts file
add documentation to type definitions
sort type definitions

Fixes #3708
  • Loading branch information
grabkowski committed May 11, 2021
1 parent 6c6f599 commit 379efd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/pill/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./pill";
15 changes: 11 additions & 4 deletions src/components/pill/pill.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import * as React from "react";
import { MarginSpacingProps } from "../../utils/helpers/options-helper";
import { MarginProps } from "styled-system";

export interface PillProps extends MarginSpacingProps {
colorVariant?: "neutral" | "negative" | "positive" | "warning";
export interface PillProps extends MarginProps {
/** Override color variant, provide any color from palette or any valid css color value. */
borderColor?: string;
/** Change the color of a status pill. */
colorVariant?: "neutral" | "negative" | "positive" | "warning";
/** The content to display inside of the pill. */
children: string;
/** Fills the pill background with colour. When fill is false only the border is coloured. */
fill?: boolean;
pillRole?: "tag" | "status";
/** Callback function for when the pill is clicked. */
onClick?: React.MouseEventHandler<HTMLSpanElement>;
/** Callback function for when the remove icon is clicked. */
onDelete?: React.MouseEventHandler<HTMLButtonElement>;
/** Sets the type of pill in use. */
pillRole?: "tag" | "status";
size?: "S" | "M" | "L" | "XL";
}

Expand Down

0 comments on commit 379efd3

Please sign in to comment.