@synerise/ds-skeleton 0.2.36 → 0.3.0

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-skeleton@0.2.36...@synerise/ds-skeleton@0.3.0) (2023-05-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **skeleton:** add height prop to allow custom height ([f68b8d0](https://github.com/Synerise/synerise-design/commit/f68b8d04b5b2e73442721928212a0bef85e98ece))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.2.36](https://github.com/Synerise/synerise-design/compare/@synerise/ds-skeleton@0.2.35...@synerise/ds-skeleton@0.2.36) (2023-05-24)
7
18
 
8
19
 
package/README.md CHANGED
@@ -30,5 +30,6 @@ import Skeleton from '@synerise/ds-skeleton'
30
30
  | ---------------- | ---------------------------- | ------------------------- | ----------- |
31
31
  | size | Changing size of Skeleton | 'S' / 'M' / 'L' | M |
32
32
  | width | Changing width of Skeleton | 'M' / 'L' | M |
33
+ | height | Set height of Skeleton | number | |
33
34
  | numberOfSkeletons| Add more Skeletons | number | 2 |
34
35
  | shape | Change shape of Skeletons | `circle`|`square` | `circle` |
package/dist/Skeleton.js CHANGED
@@ -7,7 +7,8 @@ var Skeleton = function Skeleton(_ref) {
7
7
  size = _ref$size === void 0 ? 'M' : _ref$size,
8
8
  _ref$numberOfSkeleton = _ref.numberOfSkeletons,
9
9
  numberOfSkeletons = _ref$numberOfSkeleton === void 0 ? 2 : _ref$numberOfSkeleton,
10
- width = _ref.width;
10
+ width = _ref.width,
11
+ height = _ref.height;
11
12
  var tiles = React.useMemo(function () {
12
13
  return Array.from({
13
14
  length: numberOfSkeletons
@@ -22,7 +23,8 @@ var Skeleton = function Skeleton(_ref) {
22
23
  key: tile.id,
23
24
  className: "ds-skeleton",
24
25
  size: size,
25
- width: width
26
+ width: width,
27
+ height: height
26
28
  }, /*#__PURE__*/React.createElement(S.SkeletonBar, {
27
29
  width: width,
28
30
  size: size
@@ -9,4 +9,5 @@ export declare const SkeletonBar: import("styled-components").StyledComponent<"d
9
9
  export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
10
10
  size?: "S" | "M" | "L" | undefined;
11
11
  width?: "M" | "L" | undefined;
12
+ height?: number | undefined;
12
13
  }, never>;
@@ -4,20 +4,17 @@ export var BackgroundGradient = css(["linear-gradient(90deg,rgba(252,252,255,1)
4
4
  var OFFSET_LEFT = 140;
5
5
  var START_OFFSET_LEFT = -120;
6
6
  export var loadingAnimation = function loadingAnimation(width) {
7
- return keyframes(["0%{background:", ";left:", "px;top:0px;opacity:0.1;}50%{background:", ";left:", "px;top:0px;opacity:0.4;}100%{background:", ";left:", "px;top:0px;opacity:0.1;}"], BackgroundGradient, StartOffsetSize[width] || START_OFFSET_LEFT, BackgroundGradient, WidthSize[width] || OFFSET_LEFT, BackgroundGradient, StartOffsetSize[width] || START_OFFSET_LEFT);
7
+ return keyframes(["0%{left:", "px;opacity:0.1;}50%{left:", "px;opacity:0.4;}100%{left:", "px;opacity:0.1;}"], StartOffsetSize[width] || START_OFFSET_LEFT, WidthSize[width] || OFFSET_LEFT, StartOffsetSize[width] || START_OFFSET_LEFT);
8
8
  };
9
9
  export var Container = styled.div.withConfig({
10
10
  displayName: "Skeletonstyles__Container",
11
11
  componentId: "sc-1xxxvq3-0"
12
12
  })(["width:100%;overflow:hidden;"]);
13
- var SIZE_DEFAULT = 16;
14
13
  var SIZE_WRAPPER_DEFAULT = 16;
15
14
  export var SkeletonBar = styled.div.withConfig({
16
15
  displayName: "Skeletonstyles__SkeletonBar",
17
16
  componentId: "sc-1xxxvq3-1"
18
- })(["width:100%;height:", "px;position:relative;animation:", " 1.2s ease-in-out infinite;border-radius:", ";"], function (props) {
19
- return SkeletonSize[props.size] || SIZE_DEFAULT;
20
- }, function (props) {
17
+ })(["width:100%;height:100%;position:relative;top:0;background:", ";animation:", " 1.2s ease-in-out infinite;border-radius:", ";"], BackgroundGradient, function (props) {
21
18
  return loadingAnimation(props.width);
22
19
  }, function (props) {
23
20
  return props.width === 'M' ? '4px' : '0px';
@@ -28,6 +25,10 @@ export var Wrapper = styled.div.withConfig({
28
25
  })(["display:flex;border-right:transparent;border-left:transparent;margin:15px 0px;border-radius:", ";width:100%;height:", "px;background-color:", ";"], function (props) {
29
26
  return props.width === 'M' ? '4px' : '2px';
30
27
  }, function (props) {
28
+ if (props.height !== undefined) {
29
+ return props.height;
30
+ }
31
+
31
32
  return SkeletonSize[props.size] || SIZE_WRAPPER_DEFAULT;
32
33
  }, function (props) {
33
34
  return props.theme.palette["grey-050"];
@@ -13,6 +13,7 @@ export declare enum StartOffsetSize {
13
13
  }
14
14
  export declare type SkeletonProps = {
15
15
  size?: 'S' | 'M' | 'L';
16
+ height?: number;
16
17
  numberOfSkeletons?: number;
17
18
  width?: 'M' | 'L';
18
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-skeleton",
3
- "version": "0.2.36",
3
+ "version": "0.3.0",
4
4
  "description": "Skeleton UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -38,5 +38,5 @@
38
38
  "@synerise/ds-core": "*",
39
39
  "react": ">=16.9.0 < 17.0.0"
40
40
  },
41
- "gitHead": "beae29b9ac67f641e51fce2b108407e80342c5e9"
41
+ "gitHead": "2b2a3ea268c4cf9790e9b1b98365d08f3c8526ef"
42
42
  }