@atlaskit/skeleton 0.5.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/skeleton
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#142024](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142024)
8
+ [`a25bee9de4d3c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a25bee9de4d3c) -
9
+ Support to override color and shimmering color in keyframes
10
+
11
+ ## 0.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#129411](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129411)
16
+ [`300b0a472d9ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/300b0a472d9ce) -
17
+ Removes deprecated usage of ak/theme mixin functions and replaces them with their direct outputs
18
+ - Updated dependencies
19
+
3
20
  ## 0.5.0
4
21
 
5
22
  ### Minor Changes
@@ -21,6 +21,18 @@ var skeletonStyles = (0, _react.css)(_objectSpread({}, shimmer.css));
21
21
  var activeShimmerStyles = (0, _react.css)({
22
22
  animationName: "".concat(shimmerKeyframes)
23
23
  });
24
+ var getKeyframes = function getKeyframes(fromColor, toColor) {
25
+ return (0, _react.keyframes)({
26
+ from: {
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
28
+ backgroundColor: fromColor
29
+ },
30
+ to: {
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
32
+ backgroundColor: toColor
33
+ }
34
+ });
35
+ };
24
36
 
25
37
  /**
26
38
  * __Skeleton__
@@ -35,6 +47,8 @@ var Skeleton = function Skeleton(_ref) {
35
47
  height = _ref.height,
36
48
  _ref$borderRadius = _ref.borderRadius,
37
49
  borderRadius = _ref$borderRadius === void 0 ? '100px' : _ref$borderRadius,
50
+ color = _ref.color,
51
+ ShimmeringEndColor = _ref.ShimmeringEndColor,
38
52
  _ref$isShimmering = _ref.isShimmering,
39
53
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
40
54
  groupName = _ref.groupName,
@@ -47,7 +61,9 @@ var Skeleton = function Skeleton(_ref) {
47
61
  {
48
62
  width: width,
49
63
  height: height,
50
- borderRadius: borderRadius
64
+ borderRadius: borderRadius,
65
+ backgroundColor: color,
66
+ animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
51
67
  }]
52
68
  }, groupDataAttribute && (0, _defineProperty2.default)({}, groupDataAttribute, 'true')));
53
69
  };
@@ -16,6 +16,16 @@ const skeletonStyles = css({
16
16
  const activeShimmerStyles = css({
17
17
  animationName: `${shimmerKeyframes}`
18
18
  });
19
+ const getKeyframes = (fromColor, toColor) => keyframes({
20
+ from: {
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
22
+ backgroundColor: fromColor
23
+ },
24
+ to: {
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
26
+ backgroundColor: toColor
27
+ }
28
+ });
19
29
 
20
30
  /**
21
31
  * __Skeleton__
@@ -29,6 +39,8 @@ const Skeleton = ({
29
39
  width,
30
40
  height,
31
41
  borderRadius = '100px',
42
+ color,
43
+ ShimmeringEndColor,
32
44
  isShimmering = false,
33
45
  groupName,
34
46
  testId
@@ -41,7 +53,9 @@ const Skeleton = ({
41
53
  {
42
54
  width,
43
55
  height,
44
- borderRadius
56
+ borderRadius,
57
+ backgroundColor: color,
58
+ animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
45
59
  }]
46
60
  }, groupDataAttribute && {
47
61
  [groupDataAttribute]: 'true'
@@ -16,6 +16,18 @@ var skeletonStyles = css(_objectSpread({}, shimmer.css));
16
16
  var activeShimmerStyles = css({
17
17
  animationName: "".concat(shimmerKeyframes)
18
18
  });
19
+ var getKeyframes = function getKeyframes(fromColor, toColor) {
20
+ return keyframes({
21
+ from: {
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
23
+ backgroundColor: fromColor
24
+ },
25
+ to: {
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
27
+ backgroundColor: toColor
28
+ }
29
+ });
30
+ };
19
31
 
20
32
  /**
21
33
  * __Skeleton__
@@ -30,6 +42,8 @@ var Skeleton = function Skeleton(_ref) {
30
42
  height = _ref.height,
31
43
  _ref$borderRadius = _ref.borderRadius,
32
44
  borderRadius = _ref$borderRadius === void 0 ? '100px' : _ref$borderRadius,
45
+ color = _ref.color,
46
+ ShimmeringEndColor = _ref.ShimmeringEndColor,
33
47
  _ref$isShimmering = _ref.isShimmering,
34
48
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
35
49
  groupName = _ref.groupName,
@@ -42,7 +56,9 @@ var Skeleton = function Skeleton(_ref) {
42
56
  {
43
57
  width: width,
44
58
  height: height,
45
- borderRadius: borderRadius
59
+ borderRadius: borderRadius,
60
+ backgroundColor: color,
61
+ animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
46
62
  }]
47
63
  }, groupDataAttribute && _defineProperty({}, groupDataAttribute, 'true')));
48
64
  };
@@ -10,6 +10,14 @@ type SkeletonProps = {
10
10
  * Defaults to 100px to allow for any reasonable size skeleton having rounded corners.
11
11
  */
12
12
  borderRadius?: string | number;
13
+ /**
14
+ * Overrides the default color of skeleton, and overrides the default shimmering start color if ShimmeringEndColor also provided.
15
+ */
16
+ color?: string;
17
+ /**
18
+ * Overrides the default shimmering ending color of skeleton.
19
+ */
20
+ ShimmeringEndColor?: string;
13
21
  /**
14
22
  * Enables the shimmering animation.
15
23
  */
@@ -31,5 +39,5 @@ type SkeletonProps = {
31
39
  * - [Examples](https://atlassian.design/components/skeleton/examples)
32
40
  * - [Code](https://atlassian.design/components/skeleton/code)
33
41
  */
34
- declare const Skeleton: ({ width, height, borderRadius, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
42
+ declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
35
43
  export default Skeleton;
@@ -10,6 +10,14 @@ type SkeletonProps = {
10
10
  * Defaults to 100px to allow for any reasonable size skeleton having rounded corners.
11
11
  */
12
12
  borderRadius?: string | number;
13
+ /**
14
+ * Overrides the default color of skeleton, and overrides the default shimmering start color if ShimmeringEndColor also provided.
15
+ */
16
+ color?: string;
17
+ /**
18
+ * Overrides the default shimmering ending color of skeleton.
19
+ */
20
+ ShimmeringEndColor?: string;
13
21
  /**
14
22
  * Enables the shimmering animation.
15
23
  */
@@ -31,5 +39,5 @@ type SkeletonProps = {
31
39
  * - [Examples](https://atlassian.design/components/skeleton/examples)
32
40
  * - [Code](https://atlassian.design/components/skeleton/code)
33
41
  */
34
- declare const Skeleton: ({ width, height, borderRadius, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
42
+ declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
35
43
  export default Skeleton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/skeleton",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A skeleton acts as a placeholder for content, usually while the content loads.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -16,8 +16,6 @@
16
16
  "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
- "inPublicMirror": false,
20
- "releaseModel": "continuous",
21
19
  "website": {
22
20
  "name": "Skeleton",
23
21
  "category": "Components",
@@ -28,7 +26,7 @@
28
26
  "runReact18": true
29
27
  },
30
28
  "dependencies": {
31
- "@atlaskit/theme": "^12.12.0",
29
+ "@atlaskit/theme": "^13.0.0",
32
30
  "@babel/runtime": "^7.0.0",
33
31
  "@emotion/react": "^11.7.1"
34
32
  },