@storybook/react-native-ui 9.0.0-beta.1 → 9.0.0-beta.9
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/index.d.ts +2 -2
- package/package.json +8 -8
- package/src/hooks/useExpanded.ts +3 -11
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const GroupNode: FC<ComponentProps<typeof BranchNode> & {
|
|
|
32
32
|
isExpandable?: boolean;
|
|
33
33
|
}>;
|
|
34
34
|
declare const ComponentNode: FC<ComponentProps<typeof BranchNode>>;
|
|
35
|
-
declare const StoryNode: React__default.
|
|
35
|
+
declare const StoryNode: React__default.NamedExoticComponent<Omit<react_native.TouchableOpacityProps & React__default.RefAttributes<View> & {
|
|
36
36
|
theme?: _storybook_react_native_theming.Theme;
|
|
37
37
|
as?: React__default.ElementType;
|
|
38
38
|
} & {
|
|
@@ -40,7 +40,7 @@ declare const StoryNode: React__default.MemoExoticComponent<React__default.Forwa
|
|
|
40
40
|
selected?: boolean;
|
|
41
41
|
} & {
|
|
42
42
|
ref?: React__default.Ref<any>;
|
|
43
|
-
}, "ref"> & React__default.RefAttributes<View
|
|
43
|
+
}, "ref"> & React__default.RefAttributes<View>>;
|
|
44
44
|
|
|
45
45
|
type Refs = State['refs'];
|
|
46
46
|
type RefType = Refs[keyof Refs] & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.9",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/jest": "^29.4.3",
|
|
52
|
-
"@types/react": "~
|
|
52
|
+
"@types/react": "~19.0.10",
|
|
53
53
|
"babel-jest": "^29.7.0",
|
|
54
54
|
"jest": "^29.7.0",
|
|
55
|
-
"react-test-renderer": "^
|
|
55
|
+
"react-test-renderer": "^19.1.0",
|
|
56
56
|
"ts-dedent": "^2.2.0",
|
|
57
57
|
"tsup": "^7.2.0",
|
|
58
|
-
"typescript": "
|
|
58
|
+
"typescript": "~5.8.3"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@storybook/react": "9.0.0-beta.
|
|
62
|
-
"@storybook/react-native-theming": "^9.0.0-beta.
|
|
61
|
+
"@storybook/react": "9.0.0-beta.9",
|
|
62
|
+
"@storybook/react-native-theming": "^9.0.0-beta.9",
|
|
63
63
|
"fuse.js": "^7.0.0",
|
|
64
64
|
"memoizerific": "^1.11.3",
|
|
65
65
|
"polished": "^4.3.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"react-native-reanimated": ">=3",
|
|
74
74
|
"react-native-safe-area-context": "*",
|
|
75
75
|
"react-native-svg": ">=14",
|
|
76
|
-
"storybook": "9.0.0-beta.
|
|
76
|
+
"storybook": "9.0.0-beta.9"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=18.0.0"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "7e1611cf3e1a2ede212f10b6dfacd3a5384e13f9"
|
|
85
85
|
}
|
package/src/hooks/useExpanded.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StoriesHash } from 'storybook/internal/manager-api';
|
|
2
|
-
import type { Dispatch
|
|
2
|
+
import type { Dispatch } from 'react';
|
|
3
3
|
import { useCallback, useEffect, useReducer } from 'react';
|
|
4
4
|
import { getAncestorIds } from '../util/tree';
|
|
5
5
|
|
|
@@ -44,16 +44,8 @@ export const useExpanded = ({
|
|
|
44
44
|
}: ExpandedProps): [ExpandedState, Dispatch<ExpandAction>] => {
|
|
45
45
|
// Track the set of currently expanded nodes within this tree.
|
|
46
46
|
// Root nodes are expanded by default.
|
|
47
|
-
const [expanded, setExpanded] = useReducer
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
refId: string;
|
|
51
|
-
data: StoriesHash;
|
|
52
|
-
rootIds: string[];
|
|
53
|
-
initialExpanded: ExpandedState;
|
|
54
|
-
}
|
|
55
|
-
>(
|
|
56
|
-
(state, { ids, value }) =>
|
|
47
|
+
const [expanded, setExpanded] = useReducer(
|
|
48
|
+
(state: ExpandedState, { ids, value }: ExpandAction) =>
|
|
57
49
|
ids.reduce((acc, id) => Object.assign(acc, { [id]: value }), { ...state }),
|
|
58
50
|
{ refId, data, rootIds, initialExpanded },
|
|
59
51
|
initializeExpanded
|