@storybook/react-native-ui-lite 10.2.3 → 10.3.0-canary-20260217005118

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 CHANGED
@@ -108,9 +108,10 @@ interface SidebarProps extends API_LoadedRefData {
108
108
  declare const Sidebar: React.NamedExoticComponent<SidebarProps>;
109
109
 
110
110
  declare const LiteUI: SBUI;
111
- declare const Layout: ({ storyHash, story, children, }: {
111
+ declare const Layout: ({ storyHash, story, storyBackgroundColor, children, }: {
112
112
  storyHash: API_IndexHash | undefined;
113
113
  story?: StoryContext<ReactRenderer, Args>;
114
+ storyBackgroundColor?: string;
114
115
  children: ReactNode | ReactNode[];
115
116
  }) => react_jsx_runtime.JSX.Element;
116
117
 
package/dist/index.js CHANGED
@@ -2223,13 +2223,29 @@ var mobileMenuDrawerContentStyle = {
2223
2223
  paddingBottom: 4
2224
2224
  };
2225
2225
  var flexStyle6 = { flex: 1 };
2226
- var LiteUI = ({ storage, theme, storyHash, story, children }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_safe_area_context4.SafeAreaProvider, { style: flexStyle6, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectedNodeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_theming11.ThemeProvider, { theme, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.StorageProvider, { storage, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.LayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_portal2.PortalProvider, { shouldAddRootHost: false, children: [
2227
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Layout, { storyHash, story, children }),
2226
+ var LiteUI = ({
2227
+ storage,
2228
+ theme,
2229
+ storyHash,
2230
+ story,
2231
+ storyBackgroundColor,
2232
+ children
2233
+ }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_safe_area_context4.SafeAreaProvider, { style: flexStyle6, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectedNodeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_theming11.ThemeProvider, { theme, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.StorageProvider, { storage, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.LayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_portal2.PortalProvider, { shouldAddRootHost: false, children: [
2234
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2235
+ Layout,
2236
+ {
2237
+ storyHash,
2238
+ story,
2239
+ storyBackgroundColor,
2240
+ children
2241
+ }
2242
+ ),
2228
2243
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_portal2.PortalHost, { name: "storybook-lite-ui-root" })
2229
2244
  ] }) }) }) }) }) });
2230
2245
  var Layout = ({
2231
2246
  storyHash,
2232
2247
  story,
2248
+ storyBackgroundColor,
2233
2249
  children
2234
2250
  }) => {
2235
2251
  const theme = (0, import_react_native_theming11.useTheme)();
@@ -2297,10 +2313,18 @@ var Layout = ({
2297
2313
  }
2298
2314
  return {
2299
2315
  flex: 1,
2300
- backgroundColor: theme.background.content,
2316
+ backgroundColor: storyBackgroundColor || theme.background.content,
2301
2317
  paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top
2302
2318
  };
2303
- }, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
2319
+ }, [storyBackgroundColor, theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
2320
+ const storyContentStyle = (0, import_react_native_ui_common7.useStyle)(
2321
+ () => ({
2322
+ flex: 1,
2323
+ overflow: "hidden",
2324
+ backgroundColor: storyBackgroundColor || theme.background.content
2325
+ }),
2326
+ [storyBackgroundColor, theme.background.content]
2327
+ );
2304
2328
  const navContainerStyle = (0, import_react_native_ui_common7.useStyle)(
2305
2329
  () => ({
2306
2330
  paddingBottom: insets.bottom
@@ -2386,7 +2410,14 @@ var Layout = ({
2386
2410
  ) : null
2387
2411
  ] }) : null,
2388
2412
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: mobileContentStyle, children: [
2389
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: contentContainerStyle, pointerEvents: isResizing ? "none" : "auto", children }),
2413
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2414
+ import_react_native12.View,
2415
+ {
2416
+ style: isDesktop ? storyContentStyle : contentContainerStyle,
2417
+ pointerEvents: isResizing ? "none" : "auto",
2418
+ children
2419
+ }
2420
+ ),
2390
2421
  story?.parameters?.hideFullScreenButton || isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2391
2422
  import_react_native12.TouchableOpacity,
2392
2423
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-native-ui-lite",
3
- "version": "10.2.3",
3
+ "version": "10.3.0-canary-20260217005118",
4
4
  "description": "lightweight ui components for react native storybook",
5
5
  "keywords": [
6
6
  "react",
@@ -38,8 +38,8 @@
38
38
  "@legendapp/list": "3.0.0-beta.31",
39
39
  "@nozbe/microfuzz": "^1.0.0",
40
40
  "@storybook/react": "^10.2.3",
41
- "@storybook/react-native-theming": "^10.2.3",
42
- "@storybook/react-native-ui-common": "^10.2.3",
41
+ "@storybook/react-native-theming": "10.3.0-canary-20260217005118",
42
+ "@storybook/react-native-ui-common": "10.3.0-canary-20260217005118",
43
43
  "polished": "^4.3.1",
44
44
  "react-native-safe-area-context": "^5"
45
45
  },
package/src/Layout.tsx CHANGED
@@ -63,14 +63,25 @@ const mobileMenuDrawerContentStyle = {
63
63
 
64
64
  const flexStyle = { flex: 1 } satisfies ViewStyle;
65
65
 
66
- export const LiteUI: SBUI = ({ storage, theme, storyHash, story, children }): ReactElement => (
66
+ export const LiteUI: SBUI = ({
67
+ storage,
68
+ theme,
69
+ storyHash,
70
+ story,
71
+ storyBackgroundColor,
72
+ children,
73
+ }): ReactElement => (
67
74
  <SafeAreaProvider style={flexStyle}>
68
75
  <SelectedNodeProvider>
69
76
  <ThemeProvider theme={theme}>
70
77
  <StorageProvider storage={storage}>
71
78
  <LayoutProvider>
72
79
  <PortalProvider shouldAddRootHost={false}>
73
- <Layout storyHash={storyHash} story={story}>
80
+ <Layout
81
+ storyHash={storyHash}
82
+ story={story}
83
+ storyBackgroundColor={storyBackgroundColor}
84
+ >
74
85
  {children}
75
86
  </Layout>
76
87
  <PortalHost name="storybook-lite-ui-root" />
@@ -85,10 +96,12 @@ export const LiteUI: SBUI = ({ storage, theme, storyHash, story, children }): Re
85
96
  export const Layout = ({
86
97
  storyHash,
87
98
  story,
99
+ storyBackgroundColor,
88
100
  children,
89
101
  }: {
90
102
  storyHash: API_IndexHash | undefined;
91
103
  story?: StoryContext<ReactRenderer, Args>;
104
+ storyBackgroundColor?: string;
92
105
  children: ReactNode | ReactNode[];
93
106
  }) => {
94
107
  const theme = useTheme();
@@ -173,10 +186,19 @@ export const Layout = ({
173
186
 
174
187
  return {
175
188
  flex: 1,
176
- backgroundColor: theme.background.content,
189
+ backgroundColor: storyBackgroundColor || theme.background.content,
177
190
  paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
178
191
  };
179
- }, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
192
+ }, [storyBackgroundColor, theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
193
+
194
+ const storyContentStyle = useStyle(
195
+ () => ({
196
+ flex: 1,
197
+ overflow: 'hidden' as const,
198
+ backgroundColor: storyBackgroundColor || theme.background.content,
199
+ }),
200
+ [storyBackgroundColor, theme.background.content]
201
+ );
180
202
 
181
203
  const navContainerStyle = useStyle(
182
204
  () => ({
@@ -271,7 +293,10 @@ export const Layout = ({
271
293
  ) : null}
272
294
 
273
295
  <View style={mobileContentStyle}>
274
- <View style={contentContainerStyle} pointerEvents={isResizing ? 'none' : 'auto'}>
296
+ <View
297
+ style={isDesktop ? storyContentStyle : contentContainerStyle}
298
+ pointerEvents={isResizing ? 'none' : 'auto'}
299
+ >
275
300
  {children}
276
301
  </View>
277
302