@synerise/ds-scrollbar 1.1.1 → 1.1.3

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/README.md CHANGED
@@ -27,6 +27,7 @@ import Scrollbar from '@synerise/ds-scrollbar'
27
27
  <iframe src="/storybook-static/iframe.html?id=components-scrollbar--default"></iframe>
28
28
 
29
29
  ## API
30
+
30
31
  | Property | Description | Type | Default |
31
32
  | ------------- | -------------------------------------------------------------------------------- | ------------------------ | ------- |
32
33
  | absolute | Whether the scrollbar is over content | boolean | `true` |
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ScrollbarProps } from '../Scrollbar.types';
2
+ import { type ScrollbarProps } from '../Scrollbar.types';
3
3
  export declare const DnDScrollbar: ({ children, classes, maxHeight, absolute, loading, largeSize, onScroll, onYReachEnd, fetchData, hasMore, confineScroll, ...props }: ScrollbarProps) => React.JSX.Element;
@@ -1,9 +1,8 @@
1
1
  var _excluded = ["children", "classes", "maxHeight", "absolute", "loading", "largeSize", "onScroll", "onYReachEnd", "fetchData", "hasMore", "confineScroll"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useRef, useState, useCallback, useEffect } from 'react';
4
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
5
5
  import * as S from './DnDScrollbar.styles';
6
- // eslint-disable-next-line import/prefer-default-export
7
6
  export var DnDScrollbar = function DnDScrollbar(_ref) {
8
7
  var children = _ref.children,
9
8
  classes = _ref.classes,
@@ -69,7 +68,9 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
69
68
  var handleThumbMousedown = useCallback(function (event) {
70
69
  event.stopPropagation();
71
70
  setScrollStartPosition(event.clientY);
72
- if (contentRef.current) setInitialScrollTop(contentRef.current.scrollTop);
71
+ if (contentRef.current) {
72
+ setInitialScrollTop(contentRef.current.scrollTop);
73
+ }
73
74
  setIsDragging(true);
74
75
  }, []);
75
76
  var handleThumbMouseup = useCallback(function (event) {
@@ -125,7 +126,6 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
125
126
  var ref = wrapperRef.current;
126
127
  var content = contentRef.current;
127
128
  var trackSize = scrollTrackRef.current.clientHeight;
128
- // eslint-disable-next-line no-undef
129
129
  observer.current = new ResizeObserver(function () {
130
130
  handleResize(trackSize);
131
131
  });
@@ -10,7 +10,7 @@ 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:", ";padding-bottom:", ";& > *{opacity:", ";transition:all 0.25s ease-in-out;}"], function (props) {
13
+ })(["padding-right:", ";padding-bottom:", ";& > *{opacity:", ";transition:opacity 0.25s ease-in-out;}"], function (props) {
14
14
  if (props.absolute) {
15
15
  return '';
16
16
  }
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { ScrollbarProps, VirtualScrollbarProps } from './Scrollbar.types';
2
+ import { type ScrollbarProps, type VirtualScrollbarProps } from './Scrollbar.types';
3
3
  declare const Scrollbar: React.ForwardRefExoticComponent<(ScrollbarProps | VirtualScrollbarProps) & React.RefAttributes<HTMLElement>>;
4
4
  export default Scrollbar;
package/dist/Scrollbar.js CHANGED
@@ -2,10 +2,10 @@ var _excluded = ["children", "className", "loading", "withDnd", "fetchData"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React, { forwardRef } from 'react';
5
+ import { useTheme } from '@synerise/ds-core';
5
6
  import Icon, { SpinnerM } from '@synerise/ds-icon';
6
- import { theme } from '@synerise/ds-core';
7
- import * as S from './Scrollbar.styles';
8
7
  import { DnDScrollbar } from './DnDScrollbar';
8
+ import * as S from './Scrollbar.styles';
9
9
  import { VirtualScrollbar } from './VirtualScrollbar';
10
10
  var Scrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
11
11
  var children = _ref.children,
@@ -14,6 +14,7 @@ var Scrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
14
14
  withDnd = _ref.withDnd,
15
15
  fetchData = _ref.fetchData,
16
16
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
17
+ var theme = useTheme();
17
18
  var Component = withDnd ? DnDScrollbar : VirtualScrollbar;
18
19
  return /*#__PURE__*/React.createElement(S.ScrollbarContainer, {
19
20
  className: className
@@ -1,5 +1,5 @@
1
- import { CSSProperties, ReactNode, UIEvent } from 'react';
2
- import { ScrollBarProps } from '@ofsajd/react-perfect-scrollbar';
1
+ import { type CSSProperties, type ReactNode, type UIEvent } from 'react';
2
+ import { type ScrollBarProps } from '@ofsajd/react-perfect-scrollbar';
3
3
  export type ScrollbarAdditionalProps = {
4
4
  absolute?: boolean;
5
5
  classes?: string;
@@ -1,11 +1,10 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, forwardRef, useRef, useEffect, useState } from 'react';
3
- import PerfectScrollbar from '@ofsajd/react-perfect-scrollbar';
4
2
  import classnames from 'classnames';
3
+ import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
4
+ import PerfectScrollbar from '@ofsajd/react-perfect-scrollbar';
5
5
  import { useCombinedRefs, useResizeObserver } from '@synerise/ds-utils';
6
6
  import "../style/index.css";
7
7
  import * as S from './VirtualScrollbar.styles';
8
- // eslint-disable-next-line import/prefer-default-export
9
8
  export var VirtualScrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
10
9
  var _ref$absolute = _ref.absolute,
11
10
  absolute = _ref$absolute === void 0 ? false : _ref$absolute,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-scrollbar",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Scrollbar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,8 +35,8 @@
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
37
  "@ofsajd/react-perfect-scrollbar": "1.0.0",
38
- "@synerise/ds-icon": "^1.5.3",
39
- "@synerise/ds-utils": "^1.3.0",
38
+ "@synerise/ds-icon": "^1.6.0",
39
+ "@synerise/ds-utils": "^1.3.1",
40
40
  "classnames": "^2.3.2",
41
41
  "lodash": "^4.7.21"
42
42
  },
@@ -45,5 +45,5 @@
45
45
  "react": ">=16.9.0 <= 18.3.1",
46
46
  "styled-components": "^5.3.3"
47
47
  },
48
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
48
+ "gitHead": "f7c362a4f370d86b51df9aba9e91ac8f7fe4ed8f"
49
49
  }