@synerise/ds-slider 1.0.21 → 1.0.23

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,22 @@
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
+ ## [1.0.23](https://github.com/Synerise/synerise-design/compare/@synerise/ds-slider@1.0.22...@synerise/ds-slider@1.0.23) (2025-09-19)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-slider
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.22](https://github.com/Synerise/synerise-design/compare/@synerise/ds-slider@1.0.21...@synerise/ds-slider@1.0.22) (2025-09-16)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-slider
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.0.21](https://github.com/Synerise/synerise-design/compare/@synerise/ds-slider@1.0.20...@synerise/ds-slider@1.0.21) (2025-08-28)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-slider
@@ -4,8 +4,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
4
4
  import React, { useEffect, useMemo, useState } from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import Tooltip from '@synerise/ds-tooltip';
7
- import { buildDefaultTracksColorMap } from '../Slider';
8
7
  import { Description, DescriptionWrapper } from '../Slider.styles';
8
+ import { buildDefaultTracksColorMap } from '../utils/Slider.utils';
9
9
  import { checkIsPercentageInBoundaries, countAllocation, mapSliderValueToVariants, mapUserAllocationToHandles, mapUserAllocationToMarks } from '../utils/allocation.utils';
10
10
  import { calculateHandlersPercentagePosition, checkIsBlockedHandlersConfigEnabled, checkIsBlockedVariantsChange, getBlockedHandlersKeys } from '../utils/allocationHandlers.utils';
11
11
  import * as S from './Allocation.styles';
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { buildDefaultTracksColorMap } from '../Slider';
3
2
  import { AntdSlider, createTracksStyles } from '../Slider.styles';
3
+ import { buildDefaultTracksColorMap } from '../utils/Slider.utils';
4
4
  var defineCssSelectorWithRule = function defineCssSelectorWithRule(_ref) {
5
5
  var indexes = _ref.indexes,
6
6
  classConstPart = _ref.classConstPart,
package/dist/Slider.d.ts CHANGED
@@ -1,11 +1,6 @@
1
+ import React from 'react';
1
2
  import '@synerise/ds-core/dist/js/style';
2
- import { type ColorMapProps, type SliderProps } from './Slider.types';
3
+ import { type SliderProps } from './Slider.types';
3
4
  import './style/index.less';
4
- /**
5
- * Converts an array of strings (e.g. colors) `["blue-600", "yellow-600"]`
6
- * into `{"0": "blue-600", "1": "yellow-600"}`.
7
- * @returns Object Record<string, string>
8
- */
9
- export declare const buildDefaultTracksColorMap: () => ColorMapProps;
10
- declare const Slider: (props: SliderProps) => JSX.Element;
5
+ declare const Slider: (props: SliderProps) => React.JSX.Element;
11
6
  export default Slider;
package/dist/Slider.js CHANGED
@@ -2,31 +2,13 @@ var _excluded = ["useColorPalette", "label", "inverted", "getTooltipPopupContain
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, { useCallback, useEffect, useMemo, useState } from 'react';
5
- import { defaultColorsOrder } from '@synerise/ds-core';
6
5
  import '@synerise/ds-core/dist/js/style';
7
6
  import { Label } from '@synerise/ds-typography';
8
7
  import Allocation from './Allocation/Allocation';
9
8
  import * as S from './Slider.styles';
10
9
  import { SliderTypes } from './Slider.types';
11
10
  import "./style/index.css";
12
- var getDefaultTooltipPopupContainer = function getDefaultTooltipPopupContainer() {
13
- return document.querySelector(".ant-slider");
14
- };
15
- var couldBeInverted = function couldBeInverted(value, inverted) {
16
- return inverted && (typeof value === 'number' || value.length < 3);
17
- };
18
- var mapToColor = function mapToColor(_, idx) {
19
- var _ref;
20
- return _ref = {}, _ref[idx] = defaultColorsOrder[idx], _ref;
21
- };
22
- /**
23
- * Converts an array of strings (e.g. colors) `["blue-600", "yellow-600"]`
24
- * into `{"0": "blue-600", "1": "yellow-600"}`.
25
- * @returns Object Record<string, string>
26
- */
27
- export var buildDefaultTracksColorMap = function buildDefaultTracksColorMap() {
28
- return Object.assign.apply(Object, [{}].concat(defaultColorsOrder.map(mapToColor)));
29
- };
11
+ import { buildDefaultTracksColorMap, couldBeInverted, getDefaultTooltipPopupContainer } from './utils/Slider.utils';
30
12
  var Slider = function Slider(props) {
31
13
  var useColorPalette = props.useColorPalette,
32
14
  label = props.label,
@@ -0,0 +1,10 @@
1
+ import { type ColorMapProps } from '../Slider.types';
2
+ export declare const getDefaultTooltipPopupContainer: () => HTMLElement;
3
+ export declare const couldBeInverted: (value: number | number[], inverted: boolean) => boolean;
4
+ export declare const mapToColor: (_: string | object, idx: number) => Record<number, string>;
5
+ /**
6
+ * Converts an array of strings (e.g. colors) `["blue-600", "yellow-600"]`
7
+ * into `{"0": "blue-600", "1": "yellow-600"}`.
8
+ * @returns Object Record<string, string>
9
+ */
10
+ export declare const buildDefaultTracksColorMap: () => ColorMapProps;
@@ -0,0 +1,20 @@
1
+ import { defaultColorsOrder } from '@synerise/ds-core';
2
+ export var getDefaultTooltipPopupContainer = function getDefaultTooltipPopupContainer() {
3
+ return document.querySelector(".ant-slider");
4
+ };
5
+ export var couldBeInverted = function couldBeInverted(value, inverted) {
6
+ return inverted && (typeof value === 'number' || value.length < 3);
7
+ };
8
+ export var mapToColor = function mapToColor(_, idx) {
9
+ var _ref;
10
+ return _ref = {}, _ref[idx] = defaultColorsOrder[idx], _ref;
11
+ };
12
+
13
+ /**
14
+ * Converts an array of strings (e.g. colors) `["blue-600", "yellow-600"]`
15
+ * into `{"0": "blue-600", "1": "yellow-600"}`.
16
+ * @returns Object Record<string, string>
17
+ */
18
+ export var buildDefaultTracksColorMap = function buildDefaultTracksColorMap() {
19
+ return Object.assign.apply(Object, [{}].concat(defaultColorsOrder.map(mapToColor)));
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-slider",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Slider UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -26,6 +26,7 @@
26
26
  "test": "jest",
27
27
  "test:watch": "npm run test -- --watchAll",
28
28
  "types": "tsc --noEmit",
29
+ "check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
29
30
  "upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
30
31
  },
31
32
  "sideEffects": [
@@ -34,9 +35,9 @@
34
35
  ],
35
36
  "types": "dist/index.d.ts",
36
37
  "dependencies": {
37
- "@synerise/ds-tooltip": "^1.1.17",
38
- "@synerise/ds-typography": "^1.0.19",
39
- "@synerise/ds-utils": "^1.4.1"
38
+ "@synerise/ds-tooltip": "^1.2.0",
39
+ "@synerise/ds-typography": "^1.0.21",
40
+ "@synerise/ds-utils": "^1.4.2"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@synerise/ds-core": "*",
@@ -45,5 +46,5 @@
45
46
  "react-intl": ">=3.12.0 <= 6.8",
46
47
  "styled-components": "^5.3.3"
47
48
  },
48
- "gitHead": "5f5d424cf8c7fa89e231c36a45f5ab3e4cfac8e7"
49
+ "gitHead": "5029af8713235b315d36bb3c73363f2feca86da0"
49
50
  }