@synerise/ds-scrollbar 0.6.13 → 0.7.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,25 @@
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.7.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.6.14...@synerise/ds-scrollbar@0.7.0) (2023-12-13)
7
+
8
+
9
+ ### Features
10
+
11
+ * **scrollbar:** added new design for scrollbar ([0fe6588](https://github.com/Synerise/synerise-design/commit/0fe65884204bdc2fabae4b54d559f84e5761d7fb))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.6.14](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.6.13...@synerise/ds-scrollbar@0.6.14) (2023-12-11)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-scrollbar
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.6.13](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.6.12...@synerise/ds-scrollbar@0.6.13) (2023-11-16)
7
26
 
8
27
 
package/README.md CHANGED
@@ -31,6 +31,7 @@ import Scrollbar from '@synerise/ds-scrollbar'
31
31
  | Property | Description | Type | Default |
32
32
  |-----------|----------------------------------------------------------------------|--------------------------|---------|
33
33
  | absolute | Whether the scrollbar is over content | boolean | `true` |
34
+ | largeSize | Larger scrollbar | boolean | boolean | false
34
35
  | children | Scrolled component | React.ReactNode / string | - |
35
36
  | classes | String with optional classes | string | - |
36
37
  | fetchData | Callback called when scrollbar has been scrolled to the end in Y axis | () => void | - |
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "classes", "maxHeight", "absolute", "loading", "onScroll", "onYReachEnd", "fetchData", "hasMore"];
1
+ var _excluded = ["children", "classes", "maxHeight", "absolute", "loading", "largeSize", "onScroll", "onYReachEnd", "fetchData", "hasMore"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -13,6 +13,7 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
13
13
  maxHeight = _ref.maxHeight,
14
14
  absolute = _ref.absolute,
15
15
  loading = _ref.loading,
16
+ largeSize = _ref.largeSize,
16
17
  onScroll = _ref.onScroll,
17
18
  onYReachEnd = _ref.onYReachEnd,
18
19
  fetchData = _ref.fetchData,
@@ -173,8 +174,11 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
173
174
  }), /*#__PURE__*/React.createElement(S.ScrollbarWrapper, {
174
175
  ref: wrapperRef,
175
176
  loading: loading,
176
- absolute: absolute
177
- }, children)), /*#__PURE__*/React.createElement(S.ScrollbarTrackWrapper, null, /*#__PURE__*/React.createElement(S.TrackVertical, {
177
+ absolute: absolute,
178
+ largeSize: largeSize
179
+ }, children)), /*#__PURE__*/React.createElement(S.ScrollbarTrackWrapper, {
180
+ largeSize: largeSize
181
+ }, /*#__PURE__*/React.createElement(S.TrackVertical, {
178
182
  ref: scrollTrackRef,
179
183
  onClick: handleTrackClick
180
184
  }), /*#__PURE__*/React.createElement(S.ThumbVertical, {
@@ -3,9 +3,14 @@ export declare const ScrollbarContent: import("styled-components").StyledCompone
3
3
  export declare const ScrollbarWrapper: import("styled-components").StyledComponent<"div", any, {
4
4
  absolute?: boolean | undefined;
5
5
  loading?: boolean | undefined;
6
+ largeSize?: boolean | undefined;
7
+ }, never>;
8
+ export declare const ThumbVertical: import("styled-components").StyledComponent<"div", any, {
9
+ largeSize?: boolean | undefined;
10
+ }, never>;
11
+ export declare const ScrollbarTrackWrapper: import("styled-components").StyledComponent<"div", any, {
12
+ largeSize?: boolean | undefined;
6
13
  }, never>;
7
- export declare const ThumbVertical: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const ScrollbarTrackWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
9
14
  export declare const TrackVertical: import("styled-components").StyledComponent<"div", any, {}, never>;
10
15
  export declare const Loader: import("styled-components").StyledComponent<"div", any, {
11
16
  loading?: boolean | undefined;
@@ -10,22 +10,54 @@ export var ScrollbarContent = styled.div.withConfig({
10
10
  export var ScrollbarWrapper = styled.div.withConfig({
11
11
  displayName: "DnDScrollbarstyles__ScrollbarWrapper",
12
12
  componentId: "sc-12t6y2d-2"
13
- })(["padding-right:", ";& > *{opacity:", ";transition:all 0.25s ease-in-out;}"], function (props) {
14
- return props.absolute ? '' : '11px !important';
13
+ })(["padding-right:", ";padding-bottom:", ";& > *{opacity:", ";transition:all 0.25s ease-in-out;}"], function (props) {
14
+ if (props.absolute) {
15
+ return '';
16
+ }
17
+
18
+ return props.largeSize ? '24px !important' : '11px !important';
19
+ }, function (props) {
20
+ if (props.absolute) {
21
+ return '';
22
+ }
23
+
24
+ return props.largeSize ? '20px !important' : '11px !important';
15
25
  }, function (props) {
16
26
  return props.loading ? '0.2' : '1';
17
27
  });
18
28
  export var ThumbVertical = styled.div.withConfig({
19
29
  displayName: "DnDScrollbarstyles__ThumbVertical",
20
30
  componentId: "sc-12t6y2d-3"
21
- })(["width:3px;background-color:", ";border-radius:2px;right:4px;position:absolute;"], function (props) {
22
- return props.theme.palette['grey-300'];
31
+ })(["width:", ";background-color:", ";border-radius:3px;right:", ";position:absolute;border:", ";&:hover,&:active{background-color:", ";border:", ";}"], function (props) {
32
+ return props.largeSize ? '16px' : '3px';
33
+ }, function (props) {
34
+ return props.largeSize ? props.theme.palette['blue-050'] : props.theme.palette['grey-300'];
35
+ }, function (props) {
36
+ return props.largeSize ? '0' : '4px';
37
+ }, function (props) {
38
+ return props.largeSize ? "1px solid " + props.theme.palette['grey-300'] : 'none';
39
+ }, function (props) {
40
+ return props.largeSize ? props.theme.palette['blue-100'] : props.theme.palette['grey-500'];
41
+ }, function (props) {
42
+ return props.largeSize ? "1px solid " + props.theme.palette['grey-400'] : 'none';
23
43
  });
24
44
  export var ScrollbarTrackWrapper = styled.div.withConfig({
25
45
  displayName: "DnDScrollbarstyles__ScrollbarTrackWrapper",
26
46
  componentId: "sc-12t6y2d-4"
27
- })(["display:block;height:100%;position:absolute;width:11px;top:0;right:0;bottom:0;user-select:none;&:hover{", "{background-color:", ";}}"], ThumbVertical, function (props) {
28
- return props.theme.palette['grey-500'];
47
+ })(["display:block;height:100%;position:absolute;width:", ";top:0;right:", ";bottom:0;user-select:none;", "{width:", ";background-color:", ";border:", ";}&:hover{", "{background-color:", ";border:", ";}}"], function (props) {
48
+ return props.largeSize ? '24px' : '11px';
49
+ }, function (props) {
50
+ return props.largeSize ? '3px' : '0';
51
+ }, ThumbVertical, function (props) {
52
+ return props.largeSize ? '16px' : '3px';
53
+ }, function (props) {
54
+ return props.largeSize ? props.theme.palette['blue-050'] : props.theme.palette['grey-300'];
55
+ }, function (props) {
56
+ return props.largeSize ? "1px solid " + props.theme.palette['grey-300'] : 'none';
57
+ }, ThumbVertical, function (props) {
58
+ return props.largeSize ? props.theme.palette['blue-100'] : props.theme.palette['grey-500'];
59
+ }, function (props) {
60
+ return props.largeSize ? "1px solid " + props.theme.palette['grey-400'] : 'none';
29
61
  });
30
62
  export var TrackVertical = styled.div.withConfig({
31
63
  displayName: "DnDScrollbarstyles__TrackVertical",
@@ -6,6 +6,7 @@ export type ScrollbarAdditionalProps = {
6
6
  hasMore?: boolean;
7
7
  loading?: boolean;
8
8
  maxHeight?: string | number;
9
+ largeSize?: boolean;
9
10
  style?: React.CSSProperties;
10
11
  fetchData?: () => void;
11
12
  onScroll?: (e: React.UIEvent) => void;
@@ -13,6 +13,7 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
13
13
  hasMore = _ref.hasMore,
14
14
  loading = _ref.loading,
15
15
  maxHeight = _ref.maxHeight,
16
+ largeSize = _ref.largeSize,
16
17
  style = _ref.style,
17
18
  fetchData = _ref.fetchData,
18
19
  onScroll = _ref.onScroll,
@@ -79,9 +80,10 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
79
80
  options: {
80
81
  minScrollbarLength: 48
81
82
  },
82
- onYReachEnd: handleReachEnd
83
+ onYReachEnd: handleReachEnd,
84
+ className: "" + (largeSize ? 'large-size' : '')
83
85
  }, /*#__PURE__*/React.createElement(S.ScrollbarContent, {
84
- className: classes,
86
+ className: "" + classes,
85
87
  style: {
86
88
  maxHeight: maxHeight
87
89
  },
@@ -90,6 +92,7 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
90
92
  ref: wrapperRef,
91
93
  absolute: absolute,
92
94
  loading: loading,
93
- style: style
95
+ style: style,
96
+ largeSize: largeSize
94
97
  }, children)));
95
98
  });
@@ -2,4 +2,5 @@ export declare const ScrollbarContent: import("styled-components").StyledCompone
2
2
  export declare const ScrollbarWrapper: import("styled-components").StyledComponent<"div", any, {
3
3
  absolute?: boolean | undefined;
4
4
  loading?: boolean | undefined;
5
+ largeSize?: boolean | undefined;
5
6
  }, never>;
@@ -6,8 +6,18 @@ export var ScrollbarContent = styled.div.withConfig({
6
6
  export var ScrollbarWrapper = styled.div.withConfig({
7
7
  displayName: "VirtualScrollbarstyles__ScrollbarWrapper",
8
8
  componentId: "hoiad9-1"
9
- })(["padding-right:", ";& > *{opacity:", ";transition:all 0.25s ease-in-out;}"], function (props) {
10
- return props.absolute ? '' : '11px !important';
9
+ })(["padding-right:", ";padding-bottom:", ";& > *{opacity:", ";transition:all 0.25s ease-in-out;}"], function (props) {
10
+ if (props.absolute) {
11
+ return '';
12
+ }
13
+
14
+ return props.largeSize ? '24px !important' : '11px !important';
15
+ }, function (props) {
16
+ if (props.absolute) {
17
+ return '';
18
+ }
19
+
20
+ return props.largeSize ? '20px !important' : '11px !important';
11
21
  }, function (props) {
12
22
  return props.loading ? '0.2' : '1';
13
23
  });
@@ -1 +1 @@
1
- @import '~react-perfect-scrollbar/dist/css/styles.css';.ps__rail-x.ps__rail-x{opacity:1;height:11px;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden}.ps__rail-y.ps__rail-y{opacity:1;width:11px;position:absolute;height:calc(100% - 8px)!important;transform:translateY(4px);overflow:hidden}.ps:hover .ps__rail-x,.ps:hover .ps__rail-y{opacity:1}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:unset}.ps__thumb-x{background-color:#dbe0e3;border-radius:2px;height:3px;bottom:4px;margin:0 4px}.ps__thumb-y{background-color:#dbe0e3;border-radius:2px;width:3px;right:4px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#949ea6;height:3px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#949ea6;width:3px}
1
+ @import '~react-perfect-scrollbar/dist/css/styles.css';.ps__rail-x.ps__rail-x{opacity:1;height:11px;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden;margin-right:12px}.ps__rail-y.ps__rail-y{opacity:1;width:11px;position:absolute;height:calc(100% - 8px)!important;transform:translateY(4px);overflow:hidden;margin-bottom:12px}.ps:hover .ps__rail-x,.ps:hover .ps__rail-y{opacity:1}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:unset}.ps__thumb-x{background-color:#dbe0e3;border-radius:3px;height:3px;bottom:4px;margin:0 4px}.ps__thumb-y{background-color:#dbe0e3;border-radius:3px;width:3px;right:4px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#949ea6;height:3px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y,.ps__thumb-y{background-color:#949ea6;width:3px}.large-size .ps__rail-x.ps__rail-x,.large-size .ps__rail-y.ps__rail-y{opacity:1;width:26px;height:26px;position:absolute;overflow:hidden}.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y,.large-size .ps__thumb-x,.large-size .ps__thumb-y,.large-size .ps__thumb-y--clicking,.large-size .ps__thumb-y:hover{background-color:#f4faff;border-radius:3px;width:16px;height:16px;border:1px solid #dbe0e3}.large-size .ps__rail-x.ps--clicking .ps__thumb-x,.large-size .ps__rail-x:focus>.ps__thumb-x,.large-size .ps__rail-x:hover>.ps__thumb-x,.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y{background-color:#d9eeff;border:1px solid #b5bdc3;height:16px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-scrollbar",
3
- "version": "0.6.13",
3
+ "version": "0.7.0",
4
4
  "description": "Scrollbar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -18,7 +18,7 @@
18
18
  "scripts": {
19
19
  "build": "npm run build:js && npm run build:css && npm run defs",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
- "build:js": "babel --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
21
+ "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
22
  "build:watch": "npm run build:js -- --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "npm pack --pack-destination ../../portal/storybook-static/static",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.58.7",
36
+ "@synerise/ds-icon": "^0.58.9",
37
37
  "react-perfect-scrollbar": "^1.5.8"
38
38
  },
39
39
  "peerDependencies": {
@@ -42,9 +42,9 @@
42
42
  "styled-components": "5.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@synerise/ds-utils": "^0.24.21",
45
+ "@synerise/ds-utils": "^0.24.23",
46
46
  "@testing-library/jest-dom": "5.1.1",
47
47
  "@types/resize-observer-browser": "^0.1.7"
48
48
  },
49
- "gitHead": "7c20a32482f03300c9a6c6cd3c644d307371bb0d"
49
+ "gitHead": "76edb4723a30c59f1a54f666f66fcd814de0af70"
50
50
  }