@storybook/react-native-ui-lite 10.2.3 → 10.2.4-canary-20260216224255
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 -1
- package/dist/index.js +22 -5
- package/package.json +3 -3
- package/src/Layout.tsx +20 -5
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 = ({
|
|
2227
|
-
|
|
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)();
|
|
@@ -2288,19 +2304,20 @@ var Layout = ({
|
|
|
2288
2304
|
[desktopAddonsPanelOpen, addonsPanelHeight, theme.appBorderColor]
|
|
2289
2305
|
);
|
|
2290
2306
|
const containerStyle2 = (0, import_react_native_ui_common7.useStyle)(() => {
|
|
2307
|
+
const backgroundColor = storyBackgroundColor || theme.background.content;
|
|
2291
2308
|
if (isDesktop) {
|
|
2292
2309
|
return {
|
|
2293
2310
|
flex: 1,
|
|
2294
|
-
backgroundColor
|
|
2311
|
+
backgroundColor,
|
|
2295
2312
|
flexDirection: "row"
|
|
2296
2313
|
};
|
|
2297
2314
|
}
|
|
2298
2315
|
return {
|
|
2299
2316
|
flex: 1,
|
|
2300
|
-
backgroundColor
|
|
2317
|
+
backgroundColor,
|
|
2301
2318
|
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top
|
|
2302
2319
|
};
|
|
2303
|
-
}, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
2320
|
+
}, [storyBackgroundColor, theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
2304
2321
|
const navContainerStyle = (0, import_react_native_ui_common7.useStyle)(
|
|
2305
2322
|
() => ({
|
|
2306
2323
|
paddingBottom: insets.bottom
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui-lite",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.4-canary-20260216224255",
|
|
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": "
|
|
42
|
-
"@storybook/react-native-ui-common": "
|
|
41
|
+
"@storybook/react-native-theming": "10.2.4-canary-20260216224255",
|
|
42
|
+
"@storybook/react-native-ui-common": "10.2.4-canary-20260216224255",
|
|
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 = ({
|
|
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
|
|
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();
|
|
@@ -163,20 +176,22 @@ export const Layout = ({
|
|
|
163
176
|
);
|
|
164
177
|
|
|
165
178
|
const containerStyle = useStyle(() => {
|
|
179
|
+
const backgroundColor = storyBackgroundColor || theme.background.content;
|
|
180
|
+
|
|
166
181
|
if (isDesktop) {
|
|
167
182
|
return {
|
|
168
183
|
flex: 1,
|
|
169
|
-
backgroundColor
|
|
184
|
+
backgroundColor,
|
|
170
185
|
flexDirection: 'row',
|
|
171
186
|
};
|
|
172
187
|
}
|
|
173
188
|
|
|
174
189
|
return {
|
|
175
190
|
flex: 1,
|
|
176
|
-
backgroundColor
|
|
191
|
+
backgroundColor,
|
|
177
192
|
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
178
193
|
};
|
|
179
|
-
}, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
194
|
+
}, [storyBackgroundColor, theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
180
195
|
|
|
181
196
|
const navContainerStyle = useStyle(
|
|
182
197
|
() => ({
|