@cloud-ru/ds-toggles 1.1.6-preview-b174c2b1.0 → 1.1.6

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,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.6 (2026-09-28)
7
+
8
+ **Note:** Version bump only for package @ds/toggles
9
+
6
10
  ## 1.1.5 (2026-09-25)
7
11
 
8
12
  ### Bug Fixes
@@ -29,8 +29,5 @@ function ToggleGroup({ children, value: valueProp, onChange: onChangeProp, selec
29
29
  return undefined;
30
30
  });
31
31
  }, [selectionMode, setValue]);
32
- // Значение провайдера стабильно, пока не меняется состояние: иначе каждый рендер группы
33
- // перерисовывает всех потребителей контекста (например, все блоки аккордеона).
34
- const contextValue = (0, react_1.useMemo)(() => ({ value, onChange, selectionMode }), [value, onChange, selectionMode]);
35
- return (0, jsx_runtime_1.jsx)(context_1.ToggleGroupContext.Provider, { value: contextValue, children: children });
32
+ return ((0, jsx_runtime_1.jsx)(context_1.ToggleGroupContext.Provider, { value: { value, onChange, selectionMode }, children: children }));
36
33
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useUncontrolledProp } from '@cloud-ru/ds-utils';
3
- import { useCallback, useMemo } from 'react';
3
+ import { useCallback } from 'react';
4
4
  import { SELECTION_MODE } from '../../constants.js';
5
5
  import { ToggleGroupContext } from '../../context.js';
6
6
  export function ToggleGroup({ children, value: valueProp, onChange: onChangeProp, selectionMode = SELECTION_MODE.Single, defaultValue, }) {
@@ -26,8 +26,5 @@ export function ToggleGroup({ children, value: valueProp, onChange: onChangeProp
26
26
  return undefined;
27
27
  });
28
28
  }, [selectionMode, setValue]);
29
- // Значение провайдера стабильно, пока не меняется состояние: иначе каждый рендер группы
30
- // перерисовывает всех потребителей контекста (например, все блоки аккордеона).
31
- const contextValue = useMemo(() => ({ value, onChange, selectionMode }), [value, onChange, selectionMode]);
32
- return _jsx(ToggleGroupContext.Provider, { value: contextValue, children: children });
29
+ return (_jsx(ToggleGroupContext.Provider, { value: { value, onChange, selectionMode }, children: children }));
33
30
  }