@synerise/ds-slider 1.1.11 → 1.1.12

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +29 -49
  3. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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.1.12](https://github.com/Synerise/synerise-design/compare/@synerise/ds-slider@1.1.11...@synerise/ds-slider@1.1.12) (2026-03-20)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-slider
9
+
6
10
  ## [1.1.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-slider@1.1.10...@synerise/ds-slider@1.1.11) (2026-03-09)
7
11
 
8
12
  ### Bug Fixes
package/README.md CHANGED
@@ -5,7 +5,7 @@ title: Slider
5
5
 
6
6
  Slider UI Component
7
7
 
8
- Based on [Ant Design Slider](https://ant.design/components/slider/)
8
+ Built on `@tanstack/react-ranger`. Supports single-value, range (dual-thumb), and allocation modes.
9
9
 
10
10
  ## Installation
11
11
 
@@ -20,16 +20,11 @@ yarn add @synerise/ds-slider
20
20
  ```jsx
21
21
  import Slider from '@synerise/ds-slider';
22
22
 
23
- <Slider
24
- label="Label"
25
- max={100}
26
- min={0}
27
- range
28
- step={5}
29
- onAfterChange={props.onAfterChange}
30
- OnChange={props.onChange}
31
- tooltipPlacement="topLeft"
32
- />;
23
+ // Single value
24
+ <Slider label="Label" max={100} min={0} step={5} value={50} onChange={v => setValue(v)} />;
25
+
26
+ // Range
27
+ <Slider range min={0} max={100} value={[20, 80]} onChange={v => setRange(v)} />;
33
28
  ```
34
29
 
35
30
  ## Slider Default
@@ -42,49 +37,34 @@ import Slider from '@synerise/ds-slider';
42
37
 
43
38
  ## API
44
39
 
45
- | Property | Description | Type | Default |
46
- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------- |
47
- | autoFocus | get focus when component mounted | boolean | `false` |
48
- | defaultValue | The default value of slider. When range is false, use number, otherwise, use `[number, number]` | number / number[] | `0 / [0, 0]` |
49
- | disabled | If true, the slider will not be interactable. | boolean | `false` |
50
- | dots | Whether the thumb can drag over tick only. | boolean | `false` |
51
- | included | Make effect when marks not null, `true` means containment and`false`means coordinative | boolean | `true` |
52
- | marks | Tick mark of Slider, type of key must be number, and must in closed interval [min, max], each mark can declare its own style. | object | `{number: string / ReactNode} / {number: {style: object, label: string or ReactNode}}` |
53
- | max | The maximum value the slider can slide to | number | 100 |
54
- | min | The minimum value the slider can slide to. | number | 0 |
55
- | range | dual thumb mode | boolean | `false` |
56
- | step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When marks no null, step can be null. | number / null | 1 |
57
- | tipFormatter | Slider will pass its value to tipFormatter, and display its value in Tooltip, and hide Tooltip when return value is null. | ((value: number) => React.ReactNode) / null | IDENTITY |
58
- | value | The value of slider. When range is false, use number, otherwise, use [number, number] | number / number[] | |
59
- | vertical | If true, the slider will be vertical. | Boolean | `false` |
60
- | onAfterChange | Fire when onmouseup is fired. | (value) | - |
61
- | onChange | Callback function that is fired when the user changes the slider's value. | (value) | - |
62
- | thick | Set thickness of the slider | Boolean | `false` |
63
- | type | Defines a way of handling slider ranges | `default` / `allocation` | `default` |
64
- | tooltipPlacement | Set Tooltip display position. Ref Tooltip. | string | |
65
- | tooltipVisible | If true, Tooltip will show always, or it will not show anyway, even if dragging or hovering. | Boolean | |
66
- | getTooltipPopupContainer | The DOM container of the Tooltip, the default behavior is to create a div element in body. | () => React.HTMLElement | `() => document.body` |
67
- | inverted | Allow to use slider in inverted mode. Applies only when value is `number or [number, number]` | Boolean | `false` |
68
- | useColorPalette | Allow the usage of predefined palette for slider tracks | Boolean | `false` |
69
- | tracksColorMap | Allow to import your 10 colors color map. | Object | |
70
- | handlers | Handlers config object for allocation slider. Allow to manipulate handlers e.g. enable to block handler. First handler index is 1. | HandlerConfig | - |
71
-
72
- ### AllocationConfig
73
-
74
- | Property | Description | Type | Default |
75
- | ------------------- | --------------------------------------------------------- | ---------------------------------------- | --------------- |
76
- | controlGroupEnabled | Enables treating the rest of the range as control group. | boolean | `false` |
77
- | controlGroupLabel | Label displayed over control group range | string / React.ReactNode | `Control group` |
78
- | controlGroupTooltip | Tooltip displayed when hovering over control group label. | string / React.ReactNode | `CG` |
79
- | variants | Whether the thumb can drag over tick only. | AllocationVariant[] | `false` |
80
- | onAllocationChange | Callback executed when user changes slider value. | (variants?: AllocationVariant[]) => void | `false` |
40
+ | Property | Description | Type | Default |
41
+ | -------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------- |
42
+ | label | Label rendered above the slider | React.ReactNode | - |
43
+ | description | Description text rendered above the slider | React.ReactNode | - |
44
+ | autoFocus | get focus when component mounted | boolean | `false` |
45
+ | disabled | If true, the slider will not be interactable. | boolean | `false` |
46
+ | dots | Show dots at step positions | boolean | `false` |
47
+ | marks | Tick mark of Slider. Key must be a number in [min, max]. Each mark can have its own style. | `Record<string \| number, ReactNode \| MarkObj>` | - |
48
+ | max | The maximum value the slider can slide to | number | - |
49
+ | min | The minimum value the slider can slide to. | number | - |
50
+ | range | Dual thumb mode (activates RangeSlider) | boolean | - |
51
+ | step | The granularity the slider can step through values. | number | - |
52
+ | tipFormatter | Custom tooltip formatter; pass `false` to hide tooltip. | `((value?: number) => React.ReactNode) \| false` | - |
53
+ | value | The value of slider. When `range` is false, use number; otherwise, use `[number, number]` | `number \| number[]` | - |
54
+ | onAfterChange | Fire when mouse/touch up is fired. | `(value: number \| number[]) => void` | - |
55
+ | onChange | Callback function that is fired when the user changes the slider's value. | `(value: number \| number[]) => void` | - |
56
+ | thick | Set thickness of the slider | boolean | `false` |
57
+ | type | Defines a way of handling slider ranges | `'default'` / `'allocation'` | - |
58
+ | inverted | Allow to use slider in inverted mode. Applies only when `value` is `number` or `[number, number]` | boolean | `false` |
59
+ | tracksColorMap | Custom colour map for track sections (keys are numeric values) | `Record<number, string>` | - |
60
+ | handlers | Handlers config for allocation slider. Allows blocking handlers. First handler index is 1. | HandlerConfig | - |
81
61
 
82
62
  ### AllocationConfig
83
63
 
84
64
  | Property | Description | Type | Default |
85
65
  | ------------------- | --------------------------------------------------------- | ---------------------------------------- | --------------- |
66
+ | variants | Allocation variants with name, percentage and tab info | AllocationVariant[] | - |
67
+ | onAllocationChange | Callback executed when user changes slider value. | (variants?: AllocationVariant[]) => void | - |
86
68
  | controlGroupEnabled | Enables treating the rest of the range as control group. | boolean | `false` |
87
69
  | controlGroupLabel | Label displayed over control group range | string / React.ReactNode | `Control group` |
88
70
  | controlGroupTooltip | Tooltip displayed when hovering over control group label. | string / React.ReactNode | `CG` |
89
- | variants | Whether the thumb can drag over tick only. | AllocationVariant[] | `false` |
90
- | onAllocationChange | Callback executed when user changes slider value. | (variants?: AllocationVariant[]) => void | `false` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-slider",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Slider UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -23,8 +23,8 @@
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
26
- "test": "vitest",
27
- "test:watch": "pnpm run test -- --watch",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
28
  "types": "tsc --noEmit",
29
29
  "check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
30
30
  "upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
@@ -35,10 +35,10 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-form-field": "^1.3.8",
39
- "@synerise/ds-tooltip": "^1.4.8",
40
- "@synerise/ds-typography": "^1.1.11",
41
- "@synerise/ds-utils": "^1.6.0",
38
+ "@synerise/ds-form-field": "^1.3.9",
39
+ "@synerise/ds-tooltip": "^1.4.9",
40
+ "@synerise/ds-typography": "^1.1.12",
41
+ "@synerise/ds-utils": "^1.7.0",
42
42
  "@tanstack/react-ranger": "^0.0.5"
43
43
  },
44
44
  "devDependencies": {
@@ -51,5 +51,5 @@
51
51
  "react-intl": ">=3.12.0 <= 6.8",
52
52
  "styled-components": "^5.3.3"
53
53
  },
54
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
54
+ "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
55
55
  }