@thecb/components 11.1.1 → 11.1.2

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": "11.1.1",
3
+ "version": "11.1.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,12 +1,16 @@
1
1
  import React from "react";
2
2
  import { LoadingPill } from "./LoadingPill.styled";
3
+ import { colors } from "../../../constants";
3
4
 
4
5
  const LoadingLine = ({
5
6
  minWidth,
6
7
  maxWidth,
7
8
  exactWidth = null,
8
9
  height = "16px",
9
- margin = "0px"
10
+ margin = "0px",
11
+ backgroundColor = colors.SEASHELL_WHITE,
12
+ foregroundColor = colors.ALABASTER_WHITE,
13
+ ...props
10
14
  }) => {
11
15
  const calculatedWidth = Math.floor(
12
16
  Math.random() * (parseInt(maxWidth) - parseInt(minWidth) + 1) +
@@ -15,9 +19,13 @@ const LoadingLine = ({
15
19
 
16
20
  return (
17
21
  <LoadingPill
22
+ aria-label="loading"
18
23
  margin={margin}
19
24
  height={height}
20
25
  width={exactWidth || calculatedWidth}
26
+ backgroundColor={backgroundColor}
27
+ foregroundColor={foregroundColor}
28
+ {...props}
21
29
  />
22
30
  );
23
31
  };
@@ -13,18 +13,19 @@ const shineFrames = keyframes`{
13
13
  }
14
14
  }`;
15
15
 
16
- export const LoadingPill = styled.div`
16
+ export const LoadingPill = styled.span`
17
+ display: block;
17
18
  width: ${({ width }) => width}px;
18
- background-color: ${colors.SEASHELL_WHITE};
19
+ background-color: ${({ backgroundColor }) => backgroundColor};
19
20
  margin: ${({ margin }) => margin};
20
21
  height: ${({ height }) => height};
21
22
  border-radius: 16px;
22
23
  background-image: linear-gradient(
23
24
  135deg,
24
- ${colors.SEASHELL_WHITE} 0%,
25
- ${colors.ALABASTER_WHITE} 40%,
26
- ${colors.SEASHELL_WHITE} 60%,
27
- ${colors.SEASHELL_WHITE} 100%
25
+ ${({ backgroundColor }) => backgroundColor} 0%,
26
+ ${({ foregroundColor }) => foregroundColor} 40%,
27
+ ${({ backgroundColor }) => backgroundColor} 60%,
28
+ ${({ backgroundColor }) => backgroundColor} 100%
28
29
  );
29
30
  background-size: 400%;
30
31
  animation: ${shineFrames} 2s infinite ease-in-out;
Binary file