@utahdts/utah-design-system 2.0.1 → 2.0.3
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.
|
@@ -16,7 +16,7 @@ import React__default, { useRef, useState, useEffect, createContext, useCallback
|
|
|
16
16
|
const name = "@utahdts/utah-design-system";
|
|
17
17
|
const description = "Utah Design System React Library";
|
|
18
18
|
const displayName = "Utah Design System React Library";
|
|
19
|
-
const version$1 = "2.0.
|
|
19
|
+
const version$1 = "2.0.3";
|
|
20
20
|
const exports = {
|
|
21
21
|
".": {
|
|
22
22
|
"development-local": "./index.js",
|
|
@@ -83,7 +83,7 @@ const bugs = {
|
|
|
83
83
|
};
|
|
84
84
|
const homepage = "https://github.com/utahdts/utah-design-system";
|
|
85
85
|
const dependencies = {
|
|
86
|
-
"@utahdts/utah-design-system-header": "2.0.
|
|
86
|
+
"@utahdts/utah-design-system-header": "2.0.3",
|
|
87
87
|
"date-fns": "3.6.0",
|
|
88
88
|
immer: "10.1.1",
|
|
89
89
|
lodash: "4.17.21",
|
|
@@ -38092,6 +38092,16 @@ function TabGroup({
|
|
|
38092
38092
|
},
|
|
38093
38093
|
[]
|
|
38094
38094
|
);
|
|
38095
|
+
useEffect(
|
|
38096
|
+
() => {
|
|
38097
|
+
if (value !== void 0) {
|
|
38098
|
+
setTabGroupState((draftState) => {
|
|
38099
|
+
draftState.selectedTabId = value;
|
|
38100
|
+
});
|
|
38101
|
+
}
|
|
38102
|
+
},
|
|
38103
|
+
[value]
|
|
38104
|
+
);
|
|
38095
38105
|
const contextValue = useMemo(
|
|
38096
38106
|
() => ({
|
|
38097
38107
|
isVertical: !!isVertical,
|
|
@@ -33,7 +33,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
33
33
|
const name = "@utahdts/utah-design-system";
|
|
34
34
|
const description = "Utah Design System React Library";
|
|
35
35
|
const displayName = "Utah Design System React Library";
|
|
36
|
-
const version$1 = "2.0.
|
|
36
|
+
const version$1 = "2.0.3";
|
|
37
37
|
const exports$1 = {
|
|
38
38
|
".": {
|
|
39
39
|
"development-local": "./index.js",
|
|
@@ -100,7 +100,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
100
100
|
};
|
|
101
101
|
const homepage = "https://github.com/utahdts/utah-design-system";
|
|
102
102
|
const dependencies = {
|
|
103
|
-
"@utahdts/utah-design-system-header": "2.0.
|
|
103
|
+
"@utahdts/utah-design-system-header": "2.0.3",
|
|
104
104
|
"date-fns": "3.6.0",
|
|
105
105
|
immer: "10.1.1",
|
|
106
106
|
lodash: "4.17.21",
|
|
@@ -38109,6 +38109,16 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
38109
38109
|
},
|
|
38110
38110
|
[]
|
|
38111
38111
|
);
|
|
38112
|
+
React.useEffect(
|
|
38113
|
+
() => {
|
|
38114
|
+
if (value !== void 0) {
|
|
38115
|
+
setTabGroupState((draftState) => {
|
|
38116
|
+
draftState.selectedTabId = value;
|
|
38117
|
+
});
|
|
38118
|
+
}
|
|
38119
|
+
},
|
|
38120
|
+
[value]
|
|
38121
|
+
);
|
|
38112
38122
|
const contextValue = React.useMemo(
|
|
38113
38123
|
() => ({
|
|
38114
38124
|
isVertical: !!isVertical,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@utahdts/utah-design-system",
|
|
3
3
|
"description": "Utah Design System React Library",
|
|
4
4
|
"displayName": "Utah Design System React Library",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"development-local": "./index.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"homepage": "https://github.com/utahdts/utah-design-system",
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@utahdts/utah-design-system-header": "2.0.
|
|
72
|
+
"@utahdts/utah-design-system-header": "2.0.3",
|
|
73
73
|
"date-fns": "3.6.0",
|
|
74
74
|
"immer": "10.1.1",
|
|
75
75
|
"lodash": "4.17.21",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useId, useMemo, useRef } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useId, useMemo, useRef } from 'react';
|
|
2
2
|
import { useImmer } from 'use-immer';
|
|
3
3
|
import { joinClassNames } from '../../../util/joinClassNames';
|
|
4
4
|
import { TabGroupContext } from './context/TabGroupContext';
|
|
@@ -29,7 +29,7 @@ export function TabGroup({
|
|
|
29
29
|
const [tabGroupState, setTabGroupState] = useImmer(() => ({
|
|
30
30
|
selectedTabId: defaultValue || '',
|
|
31
31
|
tabGroupId,
|
|
32
|
-
tabs: /** @type {NodeList | []} */
|
|
32
|
+
tabs: /** @type {NodeList | []} */[],
|
|
33
33
|
}));
|
|
34
34
|
const navigateTab = useCallback((/** @type {HTMLButtonElement | null} */ tab) => {
|
|
35
35
|
if (tab) {
|
|
@@ -69,6 +69,18 @@ export function TabGroup({
|
|
|
69
69
|
[]
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
+
// check if "controlled" component's value changed
|
|
73
|
+
useEffect(
|
|
74
|
+
() => {
|
|
75
|
+
if (value !== undefined) {
|
|
76
|
+
setTabGroupState((draftState) => {
|
|
77
|
+
draftState.selectedTabId = value;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[value]
|
|
82
|
+
);
|
|
83
|
+
|
|
72
84
|
/** @type {TabGroupContextValue} */
|
|
73
85
|
const contextValue = useMemo(
|
|
74
86
|
() => ({
|