@sima-land/ui-nucleons 43.0.2 → 43.1.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.
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
- declare type Size = 's' | 'l';
3
- declare type Direction = 'up' | 'right' | 'down' | 'left';
2
+ export declare type ArrowButtonSize = 's' | 'l';
3
+ export declare type ArrowDirection = 'up' | 'right' | 'down' | 'left';
4
4
  export interface ArrowButtonProps extends Omit<JSX.IntrinsicElements['button'], 'size' | 'children'> {
5
5
  /** Размер. */
6
- size?: Size;
6
+ size?: ArrowButtonSize;
7
7
  /** Направление (отвечает за иконку). */
8
- direction?: Direction;
8
+ direction?: ArrowDirection;
9
9
  /** Идентификатор для систем автоматизированного тестирования. */
10
10
  'data-testid'?: string;
11
11
  }
@@ -15,4 +15,3 @@ export interface ArrowButtonProps extends Omit<JSX.IntrinsicElements['button'],
15
15
  * @return Элемент.
16
16
  */
17
17
  export declare const ArrowButton: ({ size, direction, className, "data-testid": testId, ...buttonProps }: ArrowButtonProps) => JSX.Element;
18
- export {};
@@ -1,3 +1,5 @@
1
+ @use '../utils';
2
+
1
3
  .reset {
2
4
  border: 0;
3
5
  box-sizing: border-box;
@@ -38,14 +40,7 @@
38
40
  }
39
41
  &.multiline {
40
42
  resize: none;
41
-
42
- // скрытие полосы прокрутки
43
- scrollbar-width: none; // Firefox
44
- overflow: -moz-scrollbars-none; // old Firefox
45
- -ms-overflow-style: none; // IE, old Edge
46
- &::-webkit-scrollbar {
47
- display: none; // Chrome, Safari, Opera
48
- }
43
+ @include utils.hidden-scrollbars;
49
44
  }
50
45
  }
51
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sima-land/ui-nucleons",
3
- "version": "43.0.2",
3
+ "version": "43.1.0",
4
4
  "repository": "ssh://git@github.com:sima-land/ui-nucleons.git",
5
5
  "author": "www.sima-land.ru team",
6
6
  "license": "Apache-2.0",
package/range/index.d.ts CHANGED
@@ -35,7 +35,7 @@ export declare class Range extends Component<RangeProps> {
35
35
  start: Container<number>;
36
36
  finish: Container<number>;
37
37
  activeBounds: [number, number];
38
- unsubscribeList?: Array<() => void>;
38
+ unsubscribeList: Array<() => void>;
39
39
  activeThumbEl?: HTMLElement;
40
40
  isGrabbed?: boolean;
41
41
  /**
package/range/index.js CHANGED
@@ -67,6 +67,7 @@ class Range extends react_1.Component {
67
67
  this.rangeRef = (0, react_1.createRef)();
68
68
  this.startThumbRef = (0, react_1.createRef)();
69
69
  this.finishThumbRef = (0, react_1.createRef)();
70
+ this.unsubscribeList = [];
70
71
  this.start = (0, create_container_1.default)(readyStart);
71
72
  this.finish = (0, create_container_1.default)(readyFinish);
72
73
  this.activeBounds = [0, 0];
@@ -5,6 +5,7 @@ export interface TouchSliderProps {
5
5
  }
6
6
  /**
7
7
  * Компонент блока, прокручиваемого по горизонтали. Реализует отступы MobileLayout.
8
+ * Предназначен для использования на странице без дополнительных отступов по горизонтали.
8
9
  * @param props Свойства.
9
10
  * @return Элемент.
10
11
  */
@@ -7,15 +7,14 @@ exports.TouchSlider = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const layout_1 = require("../layout");
9
9
  const constants_1 = require("../constants");
10
- const bind_1 = __importDefault(require("classnames/bind"));
11
10
  const touch_slider_module_scss_1 = __importDefault(require("./touch-slider.module.scss"));
12
- const cx = bind_1.default.bind(touch_slider_module_scss_1.default);
13
11
  /**
14
12
  * Компонент блока, прокручиваемого по горизонтали. Реализует отступы MobileLayout.
13
+ * Предназначен для использования на странице без дополнительных отступов по горизонтали.
15
14
  * @param props Свойства.
16
15
  * @return Элемент.
17
16
  */
18
17
  const TouchSlider = ({ children }) => (react_1.default.createElement(layout_1.MobileLayout, null,
19
- react_1.default.createElement("div", Object.assign({ className: cx('outer', 'invisible-scroll') }, { [constants_1.BSL_IGNORE_ATTR]: true }),
20
- react_1.default.createElement("div", { className: cx('inner') }, children))));
18
+ react_1.default.createElement("div", Object.assign({ className: touch_slider_module_scss_1.default.outer }, { [constants_1.BSL_IGNORE_ATTR]: true }),
19
+ react_1.default.createElement("div", { className: touch_slider_module_scss_1.default.inner }, children))));
21
20
  exports.TouchSlider = TouchSlider;
@@ -1,22 +1,24 @@
1
+ @use '../breakpoints';
2
+ @use '../utils';
3
+
1
4
  .outer {
2
5
  display: flex;
3
6
  overflow: hidden;
4
7
  overflow-x: auto;
5
8
  -webkit-overflow-scrolling: touch;
6
- --slider-gutter: calc((100vw - var(--l-width)) / 2);
7
- margin: 0 calc(-1 * var(--slider-gutter));
9
+ @include utils.hidden-scrollbars;
8
10
  }
9
11
 
10
12
  .inner {
11
13
  display: flex;
12
- padding: 0 var(--slider-gutter);
13
14
  }
14
15
 
15
- .invisible-scroll {
16
- scrollbar-width: none; // Firefox
17
- overflow: -moz-scrollbars-none; // old Firefox
18
- -ms-overflow-style: none; // IE, old Edge
19
- &::-webkit-scrollbar {
20
- display: none; // Chrome, Safari, Opera
16
+ @include breakpoints.down('mm') {
17
+ .outer {
18
+ --slider-gutter: calc((100vw - var(--l-width)) / 2);
19
+ margin: 0 calc(-1 * var(--slider-gutter));
20
+ }
21
+ .inner {
22
+ padding: 0 var(--slider-gutter);
21
23
  }
22
24
  }
package/utils.scss ADDED
@@ -0,0 +1,9 @@
1
+ // скрывает полосы прокрутки у элемента
2
+ @mixin hidden-scrollbars {
3
+ scrollbar-width: none; // Firefox
4
+ overflow: -moz-scrollbars-none; // old Firefox
5
+ -ms-overflow-style: none; // IE, old Edge
6
+ &::-webkit-scrollbar {
7
+ display: none; // Chrome, Safari, Opera
8
+ }
9
+ }