@storybook/react-native-ui 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 +28 -5
- package/package.json +3 -3
- package/src/Layout.tsx +26 -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 FullUI: 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
|
@@ -1876,15 +1876,31 @@ var mobileMenuDrawerContentStyle = {
|
|
|
1876
1876
|
paddingBottom: 4
|
|
1877
1877
|
};
|
|
1878
1878
|
var flex1 = { flex: 1 };
|
|
1879
|
-
var FullUI = ({
|
|
1879
|
+
var FullUI = ({
|
|
1880
|
+
storage,
|
|
1881
|
+
theme,
|
|
1882
|
+
storyHash,
|
|
1883
|
+
story,
|
|
1884
|
+
storyBackgroundColor,
|
|
1885
|
+
children
|
|
1886
|
+
}) => {
|
|
1880
1887
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native_theming15.ThemeProvider, { theme, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native_safe_area_context3.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native_gesture_handler2.GestureHandlerRootView, { style: flex1, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_bottom_sheet4.BottomSheetModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native_ui_common7.StorageProvider, { storage, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native_ui_common7.LayoutProvider, { children: [
|
|
1881
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1889
|
+
Layout,
|
|
1890
|
+
{
|
|
1891
|
+
storyHash,
|
|
1892
|
+
story,
|
|
1893
|
+
storyBackgroundColor,
|
|
1894
|
+
children
|
|
1895
|
+
}
|
|
1896
|
+
),
|
|
1882
1897
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_portal.PortalHost, { name: "storybook-lite-ui-root" })
|
|
1883
1898
|
] }) }) }) }) }) });
|
|
1884
1899
|
};
|
|
1885
1900
|
var Layout = ({
|
|
1886
1901
|
storyHash,
|
|
1887
1902
|
story,
|
|
1903
|
+
storyBackgroundColor,
|
|
1888
1904
|
children
|
|
1889
1905
|
}) => {
|
|
1890
1906
|
const theme = (0, import_react_native_theming15.useTheme)();
|
|
@@ -1930,20 +1946,27 @@ var Layout = ({
|
|
|
1930
1946
|
[desktopAddonsPanelOpen, theme.appBorderColor]
|
|
1931
1947
|
);
|
|
1932
1948
|
const containerStyle = (0, import_react_native_ui_common7.useStyle)(() => {
|
|
1949
|
+
const backgroundColor = storyBackgroundColor || theme.background.content;
|
|
1933
1950
|
if (isDesktop) {
|
|
1934
1951
|
return {
|
|
1935
1952
|
flex: 1,
|
|
1936
1953
|
paddingTop: insets.top,
|
|
1937
|
-
backgroundColor
|
|
1954
|
+
backgroundColor,
|
|
1938
1955
|
flexDirection: "row"
|
|
1939
1956
|
};
|
|
1940
1957
|
}
|
|
1941
1958
|
return {
|
|
1942
1959
|
flex: 1,
|
|
1943
1960
|
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
1944
|
-
backgroundColor
|
|
1961
|
+
backgroundColor
|
|
1945
1962
|
};
|
|
1946
|
-
}, [
|
|
1963
|
+
}, [
|
|
1964
|
+
storyBackgroundColor,
|
|
1965
|
+
theme.background.content,
|
|
1966
|
+
insets.top,
|
|
1967
|
+
story?.parameters?.noSafeArea,
|
|
1968
|
+
isDesktop
|
|
1969
|
+
]);
|
|
1947
1970
|
const fullScreenButtonStyle = (0, import_react_native_ui_common7.useStyle)(
|
|
1948
1971
|
() => ({
|
|
1949
1972
|
position: "absolute",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.4-canary-20260216224255",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@gorhom/portal": "^1.0.14",
|
|
37
37
|
"@nozbe/microfuzz": "^1.0.0",
|
|
38
38
|
"@storybook/react": "^10.2.3",
|
|
39
|
-
"@storybook/react-native-theming": "
|
|
40
|
-
"@storybook/react-native-ui-common": "
|
|
39
|
+
"@storybook/react-native-theming": "10.2.4-canary-20260216224255",
|
|
40
|
+
"@storybook/react-native-ui-common": "10.2.4-canary-20260216224255",
|
|
41
41
|
"polished": "^4.3.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
package/src/Layout.tsx
CHANGED
|
@@ -60,7 +60,14 @@ const mobileMenuDrawerContentStyle = {
|
|
|
60
60
|
|
|
61
61
|
const flex1 = { flex: 1 } satisfies ViewStyle;
|
|
62
62
|
|
|
63
|
-
export const FullUI: SBUI = ({
|
|
63
|
+
export const FullUI: SBUI = ({
|
|
64
|
+
storage,
|
|
65
|
+
theme,
|
|
66
|
+
storyHash,
|
|
67
|
+
story,
|
|
68
|
+
storyBackgroundColor,
|
|
69
|
+
children,
|
|
70
|
+
}) => {
|
|
64
71
|
return (
|
|
65
72
|
<ThemeProvider theme={theme}>
|
|
66
73
|
<SafeAreaProvider>
|
|
@@ -68,7 +75,11 @@ export const FullUI: SBUI = ({ storage, theme, storyHash, story, children }) =>
|
|
|
68
75
|
<BottomSheetModalProvider>
|
|
69
76
|
<StorageProvider storage={storage}>
|
|
70
77
|
<LayoutProvider>
|
|
71
|
-
<Layout
|
|
78
|
+
<Layout
|
|
79
|
+
storyHash={storyHash}
|
|
80
|
+
story={story}
|
|
81
|
+
storyBackgroundColor={storyBackgroundColor}
|
|
82
|
+
>
|
|
72
83
|
{children}
|
|
73
84
|
</Layout>
|
|
74
85
|
<PortalHost name="storybook-lite-ui-root" />
|
|
@@ -84,10 +95,12 @@ export const FullUI: SBUI = ({ storage, theme, storyHash, story, children }) =>
|
|
|
84
95
|
export const Layout = ({
|
|
85
96
|
storyHash,
|
|
86
97
|
story,
|
|
98
|
+
storyBackgroundColor,
|
|
87
99
|
children,
|
|
88
100
|
}: {
|
|
89
101
|
storyHash: API_IndexHash | undefined;
|
|
90
102
|
story?: StoryContext<ReactRenderer, Args>;
|
|
103
|
+
storyBackgroundColor?: string;
|
|
91
104
|
children: ReactNode | ReactNode[];
|
|
92
105
|
}) => {
|
|
93
106
|
const theme = useTheme();
|
|
@@ -141,11 +154,13 @@ export const Layout = ({
|
|
|
141
154
|
);
|
|
142
155
|
|
|
143
156
|
const containerStyle = useStyle(() => {
|
|
157
|
+
const backgroundColor = storyBackgroundColor || theme.background.content;
|
|
158
|
+
|
|
144
159
|
if (isDesktop) {
|
|
145
160
|
return {
|
|
146
161
|
flex: 1,
|
|
147
162
|
paddingTop: insets.top,
|
|
148
|
-
backgroundColor
|
|
163
|
+
backgroundColor,
|
|
149
164
|
flexDirection: 'row',
|
|
150
165
|
};
|
|
151
166
|
}
|
|
@@ -153,9 +168,15 @@ export const Layout = ({
|
|
|
153
168
|
return {
|
|
154
169
|
flex: 1,
|
|
155
170
|
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
156
|
-
backgroundColor
|
|
171
|
+
backgroundColor,
|
|
157
172
|
};
|
|
158
|
-
}, [
|
|
173
|
+
}, [
|
|
174
|
+
storyBackgroundColor,
|
|
175
|
+
theme.background.content,
|
|
176
|
+
insets.top,
|
|
177
|
+
story?.parameters?.noSafeArea,
|
|
178
|
+
isDesktop,
|
|
179
|
+
]);
|
|
159
180
|
|
|
160
181
|
const fullScreenButtonStyle = useStyle(
|
|
161
182
|
() => ({
|