-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Label): Convert Label to TypeScript
Fixes #1893
- Loading branch information
1 parent
c5bbc00
commit c13ba78
Showing
8 changed files
with
22 additions
and
41 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
packages/patternfly-4/react-core/src/components/Label/Label.d.ts
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
packages/patternfly-4/react-core/src/components/Label/Label.js
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...t-core/src/components/Label/Label.test.js → ...-core/src/components/Label/Label.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/patternfly-4/react-core/src/components/Label/Label.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import styles from '@patternfly/patternfly/components/Label/label.css'; | ||
import { css } from '@patternfly/react-styles'; | ||
|
||
export interface LabelProps extends React.HTMLProps<HTMLSpanElement> { | ||
children: React.ReactNode; | ||
className?: string; | ||
isCompact?: boolean; | ||
} | ||
|
||
export const Label: React.FunctionComponent<LabelProps> = ({ | ||
children, | ||
className = '', | ||
isCompact = false, | ||
...props | ||
}) => ( | ||
<span {...props} className={css(styles.label, className, isCompact && styles.modifiers.compact)}> | ||
{children} | ||
</span> | ||
); |
File renamed without changes.
1 change: 0 additions & 1 deletion
1
packages/patternfly-4/react-core/src/components/Label/index.d.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Label } from './Label'; |