@storybook/react-native-ui 10.4.6 → 10.4.8-canary-20260711115827
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 -17
- package/dist/index.js +13 -2
- package/package.json +6 -6
- package/src/Layout.tsx +2 -0
- package/src/MobileAddonsPanel.tsx +15 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { CombinedDataset, ExpandAction, Item, SBUI, Selection } from "@storybook
|
|
|
5
5
|
import { API_IndexHash, API_LoadedRefData } from "storybook/internal/types";
|
|
6
6
|
import { ReactRenderer } from "@storybook/react";
|
|
7
7
|
import { Args, StoryContext } from "storybook/internal/csf";
|
|
8
|
-
|
|
9
8
|
//#region src/TreeNode.d.ts
|
|
10
9
|
interface NodeProps {
|
|
11
10
|
children: React.ReactNode | React.ReactNode[];
|
|
@@ -105,25 +104,11 @@ interface SidebarProps extends API_LoadedRefData {
|
|
|
105
104
|
menuHighlighted?: boolean;
|
|
106
105
|
setSelection: (selection: Selection) => void;
|
|
107
106
|
}
|
|
108
|
-
declare const Sidebar: React.MemoExoticComponent<({
|
|
109
|
-
storyId,
|
|
110
|
-
refId,
|
|
111
|
-
index,
|
|
112
|
-
indexError,
|
|
113
|
-
status,
|
|
114
|
-
previewInitialized,
|
|
115
|
-
refs,
|
|
116
|
-
setSelection
|
|
117
|
-
}: SidebarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
107
|
+
declare const Sidebar: React.MemoExoticComponent<({ storyId, refId, index, indexError, status, previewInitialized, refs, setSelection }: SidebarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
118
108
|
//#endregion
|
|
119
109
|
//#region src/Layout.d.ts
|
|
120
110
|
declare const FullUI: SBUI;
|
|
121
|
-
declare const Layout: ({
|
|
122
|
-
storyHash,
|
|
123
|
-
story,
|
|
124
|
-
storyBackgroundColor,
|
|
125
|
-
children
|
|
126
|
-
}: {
|
|
111
|
+
declare const Layout: ({ storyHash, story, storyBackgroundColor, children }: {
|
|
127
112
|
storyHash: API_IndexHash | undefined;
|
|
128
113
|
story?: StoryContext<ReactRenderer, Args>;
|
|
129
114
|
storyBackgroundColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -1182,6 +1182,9 @@ const MobileAddonsPanel = (0, react.forwardRef)(({ storyId, parameters }, ref) =
|
|
|
1182
1182
|
enableHandlePanningGesture: true,
|
|
1183
1183
|
stackBehavior: "replace",
|
|
1184
1184
|
enableDynamicSizing: false,
|
|
1185
|
+
accessible: false,
|
|
1186
|
+
accessibilityLabel: null,
|
|
1187
|
+
accessibilityRole: null,
|
|
1185
1188
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_reanimated.default.View, {
|
|
1186
1189
|
style: [contentStyle, adjustedBottomSheetSize],
|
|
1187
1190
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddonsTabs, {
|
|
@@ -1252,7 +1255,8 @@ const AddonsTabs = ({ onClose, storyId, parameters }) => {
|
|
|
1252
1255
|
style: closeIconStyle,
|
|
1253
1256
|
hitSlop,
|
|
1254
1257
|
Icon: CloseIcon,
|
|
1255
|
-
onPress: () => onClose?.()
|
|
1258
|
+
onPress: () => onClose?.(),
|
|
1259
|
+
accessibilityLabel: "Close addons panel"
|
|
1256
1260
|
})]
|
|
1257
1261
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.ScrollView, {
|
|
1258
1262
|
style: addonsScrollStyle,
|
|
@@ -1274,9 +1278,15 @@ const PanelRenderer = ({ panel }) => {
|
|
|
1274
1278
|
return panel.render({ active: true });
|
|
1275
1279
|
};
|
|
1276
1280
|
const Tab = ({ active, onPress, text }) => {
|
|
1281
|
+
const testID = `addon-tab-${text.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
1277
1282
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabButton, {
|
|
1278
1283
|
active,
|
|
1279
1284
|
onPress,
|
|
1285
|
+
testID,
|
|
1286
|
+
accessible: true,
|
|
1287
|
+
accessibilityRole: "tab",
|
|
1288
|
+
accessibilityState: { selected: active },
|
|
1289
|
+
accessibilityLabel: text,
|
|
1280
1290
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabText, {
|
|
1281
1291
|
active,
|
|
1282
1292
|
children: text
|
|
@@ -1758,7 +1768,8 @@ const Layout = ({ storyHash, story, storyBackgroundColor, children }) => {
|
|
|
1758
1768
|
}), hasEnabledPanels && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_storybook_react_native_ui_common.IconButton, {
|
|
1759
1769
|
testID: "mobile-addons-button",
|
|
1760
1770
|
onPress: () => addonPanelRef.current.setAddonsPanelOpen(true),
|
|
1761
|
-
Icon: BottomBarToggleIcon
|
|
1771
|
+
Icon: BottomBarToggleIcon,
|
|
1772
|
+
accessibilityLabel: "Open addons panel"
|
|
1762
1773
|
})] })
|
|
1763
1774
|
}) : null,
|
|
1764
1775
|
!isDesktop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectedNodeProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MobileMenuDrawer, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.8-canary-20260711115827",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@gorhom/portal": "^1.0.14",
|
|
32
32
|
"@nozbe/microfuzz": "^1.0.0",
|
|
33
|
-
"@storybook/react": "^10.
|
|
34
|
-
"@storybook/react-native-theming": "
|
|
35
|
-
"@storybook/react-native-ui-common": "
|
|
33
|
+
"@storybook/react": "^10.5.0",
|
|
34
|
+
"@storybook/react-native-theming": "10.4.8-canary-20260711115827",
|
|
35
|
+
"@storybook/react-native-ui-common": "10.4.8-canary-20260711115827",
|
|
36
36
|
"polished": "^4.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/react": "~19.2.14",
|
|
40
|
-
"storybook": "^10.
|
|
41
|
-
"tsdown": "^0.22.
|
|
40
|
+
"storybook": "^10.5.0",
|
|
41
|
+
"tsdown": "^0.22.4",
|
|
42
42
|
"typescript": "~6.0.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
package/src/Layout.tsx
CHANGED
|
@@ -133,6 +133,7 @@ export const Layout = ({
|
|
|
133
133
|
const [uiHidden, setUiHidden] = useState(false);
|
|
134
134
|
|
|
135
135
|
useLayoutEffect(() => {
|
|
136
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
136
137
|
setUiHidden(story?.parameters?.storybookUIVisibility === 'hidden');
|
|
137
138
|
}, [story?.parameters?.storybookUIVisibility]);
|
|
138
139
|
|
|
@@ -322,6 +323,7 @@ export const Layout = ({
|
|
|
322
323
|
testID="mobile-addons-button"
|
|
323
324
|
onPress={() => addonPanelRef.current.setAddonsPanelOpen(true)}
|
|
324
325
|
Icon={BottomBarToggleIcon}
|
|
326
|
+
accessibilityLabel="Open addons panel"
|
|
325
327
|
/>
|
|
326
328
|
)}
|
|
327
329
|
</Nav>
|
|
@@ -99,6 +99,9 @@ export const MobileAddonsPanel = forwardRef<MobileAddonsPanelRef, MobileAddonsPa
|
|
|
99
99
|
// enableContentPanningGesture={true}
|
|
100
100
|
stackBehavior="replace"
|
|
101
101
|
enableDynamicSizing={false}
|
|
102
|
+
accessible={false}
|
|
103
|
+
accessibilityLabel={null}
|
|
104
|
+
accessibilityRole={null}
|
|
102
105
|
>
|
|
103
106
|
<Animated.View style={[contentStyle, adjustedBottomSheetSize]}>
|
|
104
107
|
<AddonsTabs
|
|
@@ -209,6 +212,7 @@ export const AddonsTabs = ({
|
|
|
209
212
|
hitSlop={hitSlop}
|
|
210
213
|
Icon={CloseIcon}
|
|
211
214
|
onPress={() => onClose?.()}
|
|
215
|
+
accessibilityLabel="Close addons panel"
|
|
212
216
|
/>
|
|
213
217
|
</View>
|
|
214
218
|
<ScrollView
|
|
@@ -241,8 +245,18 @@ const PanelRenderer = ({ panel }: { panel: Addon_BaseType }) => {
|
|
|
241
245
|
};
|
|
242
246
|
|
|
243
247
|
const Tab = ({ active, onPress, text }: { active: boolean; onPress: () => void; text: string }) => {
|
|
248
|
+
const testID = `addon-tab-${text.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`;
|
|
249
|
+
|
|
244
250
|
return (
|
|
245
|
-
<TabButton
|
|
251
|
+
<TabButton
|
|
252
|
+
active={active}
|
|
253
|
+
onPress={onPress}
|
|
254
|
+
testID={testID}
|
|
255
|
+
accessible
|
|
256
|
+
accessibilityRole="tab"
|
|
257
|
+
accessibilityState={{ selected: active }}
|
|
258
|
+
accessibilityLabel={text}
|
|
259
|
+
>
|
|
246
260
|
<TabText active={active}>{text}</TabText>
|
|
247
261
|
</TabButton>
|
|
248
262
|
);
|