@thecb/components 8.2.0-beta.3 → 8.2.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.2.0-beta.3",
3
+ "version": "8.2.0-beta.5",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -9,6 +9,7 @@ const StyledBadgeContainer = styled(Box)`
9
9
  display: inline-flex;
10
10
  padding: 2px 8px;
11
11
  align-items: center;
12
+ align-self: flex-start;
12
13
  gap: 4px;
13
14
  border-radius: 4px;
14
15
  background-color: ${({ themeValues }) => themeValues.background};
@@ -30,10 +31,11 @@ const StyledBadge = styled(Text)`
30
31
  }
31
32
  `;
32
33
 
33
- const Badge = ({ label, Icon, themeValues }) => (
34
+ const Badge = ({ label, Icon, themeValues, iconOnLeft = true }) => (
34
35
  <StyledBadgeContainer themeValues={themeValues}>
35
- {Icon && <Icon fill={themeValues.color} />}
36
+ {iconOnLeft && Icon && <Icon fill={themeValues.color} />}
36
37
  <StyledBadge themeValues={themeValues}>{label}</StyledBadge>
38
+ {!iconOnLeft && Icon && <Icon fill={themeValues.color} />}
37
39
  </StyledBadgeContainer>
38
40
  );
39
41
 
@@ -1,9 +1,10 @@
1
- import React from "react";
1
+ import React, { HTMLAttributes } from "react";
2
+ import Expand from "../../../util/expand";
2
3
 
3
4
  export interface BadgeProps {
4
5
  label: string;
5
6
  Icon?: JSX.Element;
7
+ iconOnLeft?: boolean;
6
8
  }
7
9
 
8
- export const Badge: React.FC<Expand<BadgeProps> &
9
- React.HTMLAttributes<HTMLElement>>;
10
+ export const Badge: React.FC<Expand<BadgeProps> & HTMLAttributes<HTMLElement>>;