Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2548 from teamleadercrm/FEATURE_support-tiny-labe…
Browse files Browse the repository at this point in the history
…l-size

[FEATURE] Support "tiny" size for Label
  • Loading branch information
JorenSaeyTL authored Feb 2, 2023
2 parents 896ca12 + ca0e2d7 commit d269b43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

### Dependency updates

## [19.1.0] - 2023-02-01

### Added

- `Label`: Add support for "tiny" label size ([@JorenSaeyTL](https://github.com/JorenSaeyTL)) in([#2548](https://github.com/teamleadercrm/ui/pull/2548))

## [19.0.1] - 2023-01-27

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@teamleader/ui",
"description": "Teamleader UI library",
"version": "19.0.1",
"version": "19.1.0",
"author": "Teamleader <[email protected]>",
"bugs": {
"url": "https://github.com/teamleadercrm/ui/issues"
Expand Down
10 changes: 8 additions & 2 deletions src/components/label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface LabelProps extends Omit<BoxProps, 'children'> {
children: ReactNode;
inverse?: boolean;
required?: boolean;
size?: Exclude<typeof SIZES[number], 'tiny' | 'fullscreen' | 'smallest' | 'hero'>;
size?: Exclude<typeof SIZES[number], 'fullscreen' | 'smallest' | 'hero'>;
tooltip?: ReactNode;
tooltipProps?: Record<string, any>;
}
Expand All @@ -33,7 +33,13 @@ const Label: GenericComponent<LabelProps> = ({
marginTop: 1,
size,
};
const Element = size === 'large' ? TextDisplay : TextBodyCompact;

const Element = {
tiny: TextSmall,
small: TextBodyCompact,
medium: TextBodyCompact,
large: TextDisplay,
}[size];

return (
<Box data-teamleader-ui="label" display="block" element="label" marginBottom={3} {...others}>
Expand Down

0 comments on commit d269b43

Please sign in to comment.