@nulogy/components 8.7.0 → 8.7.1

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/dist/main.js CHANGED
@@ -25772,6 +25772,8 @@
25772
25772
  focusedIndex = _useState[0],
25773
25773
  setFocusedIndex = _useState[1];
25774
25774
 
25775
+ var prevFocusedIndex = React.useRef(focusedIndex);
25776
+
25775
25777
  var focusPrevious = function focusPrevious() {
25776
25778
  setFocusedIndex(function (prevFocusedIndex) {
25777
25779
  return (prevFocusedIndex - 1 + refs.length) % refs.length;
@@ -25803,7 +25805,10 @@
25803
25805
  refs[focusedIndex].focus();
25804
25806
  };
25805
25807
 
25806
- updateFocused();
25808
+ if (prevFocusedIndex.current !== focusedIndex) {
25809
+ updateFocused();
25810
+ prevFocusedIndex.current = focusedIndex;
25811
+ }
25807
25812
  }, [focusedIndex, refs]);
25808
25813
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, children({
25809
25814
  focusedIndex: focusedIndex,
@@ -25746,6 +25746,8 @@ var FocusManager = function FocusManager(_ref) {
25746
25746
  focusedIndex = _useState[0],
25747
25747
  setFocusedIndex = _useState[1];
25748
25748
 
25749
+ var prevFocusedIndex = useRef(focusedIndex);
25750
+
25749
25751
  var focusPrevious = function focusPrevious() {
25750
25752
  setFocusedIndex(function (prevFocusedIndex) {
25751
25753
  return (prevFocusedIndex - 1 + refs.length) % refs.length;
@@ -25777,7 +25779,10 @@ var FocusManager = function FocusManager(_ref) {
25777
25779
  refs[focusedIndex].focus();
25778
25780
  };
25779
25781
 
25780
- updateFocused();
25782
+ if (prevFocusedIndex.current !== focusedIndex) {
25783
+ updateFocused();
25784
+ prevFocusedIndex.current = focusedIndex;
25785
+ }
25781
25786
  }, [focusedIndex, refs]);
25782
25787
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children({
25783
25788
  focusedIndex: focusedIndex,
@@ -19,6 +19,11 @@ export declare const RadioGroupWithAllProps: {
19
19
  story: {
20
20
  name: string;
21
21
  };
22
+ parameters: {
23
+ chromatic: {
24
+ diffThreshold: number;
25
+ };
26
+ };
22
27
  };
23
28
  export declare const WithErrorMessage: {
24
29
  (): JSX.Element;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const WithSelectedValue: () => JSX.Element;
3
+ export declare const WithOtherInteractiveElements: () => JSX.Element;
3
4
  export declare const WithContent: () => JSX.Element;
4
5
  declare const _default: {
5
6
  title: string;
@@ -10,6 +10,7 @@ export declare const WithADefaultSelectedIndex: {
10
10
  name: string;
11
11
  };
12
12
  };
13
+ export declare const WithOtherInteractiveElements: () => JSX.Element;
13
14
  export declare const SetToFitted: {
14
15
  (): JSX.Element;
15
16
  story: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {