one 1.2.68 → 1.2.70
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/cjs/__mocks__/@react-navigation/native-stack.cjs +29 -0
- package/dist/cjs/__mocks__/@react-navigation/native-stack.js +24 -0
- package/dist/cjs/__mocks__/@react-navigation/native-stack.js.map +6 -0
- package/dist/cjs/__mocks__/@react-navigation/native-stack.native.js +38 -0
- package/dist/cjs/__mocks__/@react-navigation/native-stack.native.js.map +1 -0
- package/dist/cjs/__mocks__/@react-navigation/native.js +45 -0
- package/dist/cjs/__mocks__/@react-navigation/native.js.map +1 -0
- package/dist/cjs/__mocks__/expo-linking.cjs +36 -0
- package/dist/cjs/__mocks__/expo-linking.js +25 -0
- package/dist/cjs/__mocks__/expo-linking.js.map +6 -0
- package/dist/cjs/__mocks__/expo-linking.native.js +47 -0
- package/dist/cjs/__mocks__/expo-linking.native.js.map +1 -0
- package/dist/cjs/__mocks__/expo-modules-core.cjs +36 -0
- package/dist/cjs/__mocks__/expo-modules-core.js +31 -0
- package/dist/cjs/__mocks__/expo-modules-core.js.map +6 -0
- package/dist/cjs/__mocks__/expo-modules-core.native.js +67 -0
- package/dist/cjs/__mocks__/expo-modules-core.native.js.map +1 -0
- package/dist/cjs/__mocks__/react-native-screens.cjs +28 -0
- package/dist/cjs/__mocks__/react-native-screens.js +22 -0
- package/dist/cjs/__mocks__/react-native-screens.js.map +6 -0
- package/dist/cjs/__mocks__/react-native-screens.native.js +31 -0
- package/dist/cjs/__mocks__/react-native-screens.native.js.map +1 -0
- package/dist/cjs/__mocks__/react-native.js +49 -0
- package/dist/cjs/__mocks__/react-native.js.map +1 -0
- package/dist/cjs/fork/NavigationContainer.js.map +1 -1
- package/dist/cjs/fork/NavigationContainer.native.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/Stack.cjs +6 -1
- package/dist/cjs/layouts/Stack.js +5 -2
- package/dist/cjs/layouts/Stack.js.map +1 -1
- package/dist/cjs/layouts/Stack.native.js +6 -1
- package/dist/cjs/layouts/Stack.native.js.map +1 -1
- package/dist/cjs/layouts/stack-utils/StackHeaderBackButton.cjs +40 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderBackButton.js +35 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderBackButton.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderBackButton.native.js +43 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderBackButton.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderComponent.cjs +90 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderComponent.js +64 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderComponent.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderComponent.native.js +99 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderComponent.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderLeft.cjs +35 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderLeft.js +30 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderLeft.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderLeft.native.js +40 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderLeft.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderRight.cjs +35 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderRight.js +30 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderRight.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderRight.native.js +40 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderRight.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderSearchBar.cjs +35 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderSearchBar.js +30 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderSearchBar.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderSearchBar.native.js +38 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderSearchBar.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderTitle.cjs +65 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderTitle.js +46 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderTitle.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderTitle.native.js +68 -0
- package/dist/cjs/layouts/stack-utils/StackHeaderTitle.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackScreen.cjs +57 -0
- package/dist/cjs/layouts/stack-utils/StackScreen.js +43 -0
- package/dist/cjs/layouts/stack-utils/StackScreen.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js +64 -0
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.cjs +455 -0
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.js +406 -0
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.native.js +480 -0
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/index.cjs +47 -0
- package/dist/cjs/layouts/stack-utils/index.js +36 -0
- package/dist/cjs/layouts/stack-utils/index.js.map +6 -0
- package/dist/cjs/layouts/stack-utils/index.native.js +50 -0
- package/dist/cjs/layouts/stack-utils/index.native.js.map +1 -0
- package/dist/cjs/layouts/withLayoutContext.cjs +2 -1
- package/dist/cjs/layouts/withLayoutContext.js +2 -2
- package/dist/cjs/layouts/withLayoutContext.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.js +3 -2
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/cjs/utils/children.cjs +46 -0
- package/dist/cjs/utils/children.js +47 -0
- package/dist/cjs/utils/children.js.map +6 -0
- package/dist/cjs/utils/children.native.js +76 -0
- package/dist/cjs/utils/children.native.js.map +1 -0
- package/dist/cjs/utils/style.cjs +28 -0
- package/dist/cjs/utils/style.js +24 -0
- package/dist/cjs/utils/style.js.map +6 -0
- package/dist/cjs/utils/style.native.js +31 -0
- package/dist/cjs/utils/style.native.js.map +1 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.js +8 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.js.map +6 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.mjs +6 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.mjs.map +1 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.native.js +12 -0
- package/dist/esm/__mocks__/@react-navigation/native-stack.native.js.map +1 -0
- package/dist/esm/__mocks__/@react-navigation/native.js +18 -0
- package/dist/esm/__mocks__/@react-navigation/native.js.map +1 -0
- package/dist/esm/__mocks__/expo-linking.js +9 -0
- package/dist/esm/__mocks__/expo-linking.js.map +6 -0
- package/dist/esm/__mocks__/expo-linking.mjs +10 -0
- package/dist/esm/__mocks__/expo-linking.mjs.map +1 -0
- package/dist/esm/__mocks__/expo-linking.native.js +18 -0
- package/dist/esm/__mocks__/expo-linking.native.js.map +1 -0
- package/dist/esm/__mocks__/expo-modules-core.js +15 -0
- package/dist/esm/__mocks__/expo-modules-core.js.map +6 -0
- package/dist/esm/__mocks__/expo-modules-core.mjs +10 -0
- package/dist/esm/__mocks__/expo-modules-core.mjs.map +1 -0
- package/dist/esm/__mocks__/expo-modules-core.native.js +38 -0
- package/dist/esm/__mocks__/expo-modules-core.native.js.map +1 -0
- package/dist/esm/__mocks__/react-native-screens.js +6 -0
- package/dist/esm/__mocks__/react-native-screens.js.map +6 -0
- package/dist/esm/__mocks__/react-native-screens.mjs +4 -0
- package/dist/esm/__mocks__/react-native-screens.mjs.map +1 -0
- package/dist/esm/__mocks__/react-native-screens.native.js +4 -0
- package/dist/esm/__mocks__/react-native-screens.native.js.map +1 -0
- package/dist/esm/__mocks__/react-native.js +19 -0
- package/dist/esm/__mocks__/react-native.js.map +1 -0
- package/dist/esm/fork/NavigationContainer.js.map +1 -1
- package/dist/esm/fork/NavigationContainer.mjs.map +1 -1
- package/dist/esm/fork/NavigationContainer.native.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/Stack.js +5 -1
- package/dist/esm/layouts/Stack.js.map +1 -1
- package/dist/esm/layouts/Stack.mjs +6 -1
- package/dist/esm/layouts/Stack.mjs.map +1 -1
- package/dist/esm/layouts/Stack.native.js +6 -1
- package/dist/esm/layouts/Stack.native.js.map +1 -1
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.js +19 -0
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.mjs +16 -0
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.native.js +16 -0
- package/dist/esm/layouts/stack-utils/StackHeaderBackButton.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.js +61 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.mjs +66 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.native.js +72 -0
- package/dist/esm/layouts/stack-utils/StackHeaderComponent.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.js +14 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.mjs +11 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.native.js +13 -0
- package/dist/esm/layouts/stack-utils/StackHeaderLeft.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.js +14 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.mjs +11 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.native.js +13 -0
- package/dist/esm/layouts/stack-utils/StackHeaderRight.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.js +14 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.mjs +11 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.native.js +11 -0
- package/dist/esm/layouts/stack-utils/StackHeaderSearchBar.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.js +31 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.mjs +41 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.native.js +41 -0
- package/dist/esm/layouts/stack-utils/StackHeaderTitle.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackScreen.js +33 -0
- package/dist/esm/layouts/stack-utils/StackScreen.js.map +6 -0
- package/dist/esm/layouts/stack-utils/StackScreen.mjs +33 -0
- package/dist/esm/layouts/stack-utils/StackScreen.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackScreen.native.js +38 -0
- package/dist/esm/layouts/stack-utils/StackScreen.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.js +422 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.js.map +6 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.mjs +456 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.native.js +478 -0
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/index.js +26 -0
- package/dist/esm/layouts/stack-utils/index.js.map +6 -0
- package/dist/esm/layouts/stack-utils/index.mjs +16 -0
- package/dist/esm/layouts/stack-utils/index.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/index.native.js +16 -0
- package/dist/esm/layouts/stack-utils/index.native.js.map +1 -0
- package/dist/esm/layouts/withLayoutContext.js +2 -1
- package/dist/esm/layouts/withLayoutContext.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.mjs +2 -1
- package/dist/esm/layouts/withLayoutContext.mjs.map +1 -1
- package/dist/esm/layouts/withLayoutContext.native.js +2 -1
- package/dist/esm/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/esm/utils/children.js +33 -0
- package/dist/esm/utils/children.js.map +6 -0
- package/dist/esm/utils/children.mjs +19 -0
- package/dist/esm/utils/children.mjs.map +1 -0
- package/dist/esm/utils/children.native.js +46 -0
- package/dist/esm/utils/children.native.js.map +1 -0
- package/dist/esm/utils/style.js +8 -0
- package/dist/esm/utils/style.js.map +6 -0
- package/dist/esm/utils/style.mjs +5 -0
- package/dist/esm/utils/style.mjs.map +1 -0
- package/dist/esm/utils/style.native.js +5 -0
- package/dist/esm/utils/style.native.js.map +1 -0
- package/package.json +9 -9
- package/src/__mocks__/@react-navigation/native-stack.ts +32 -0
- package/src/__mocks__/@react-navigation/native.ts +21 -0
- package/src/__mocks__/expo-linking.ts +6 -0
- package/src/__mocks__/expo-modules-core.ts +11 -0
- package/src/__mocks__/react-native-screens.ts +17 -0
- package/src/__mocks__/react-native.ts +20 -0
- package/src/fork/NavigationContainer.tsx +2 -0
- package/src/index.ts +10 -0
- package/src/layouts/Stack.tsx +7 -1
- package/src/layouts/stack-utils/README.md +211 -0
- package/src/layouts/stack-utils/StackHeaderBackButton.tsx +34 -0
- package/src/layouts/stack-utils/StackHeaderComponent.tsx +123 -0
- package/src/layouts/stack-utils/StackHeaderLeft.tsx +29 -0
- package/src/layouts/stack-utils/StackHeaderRight.tsx +29 -0
- package/src/layouts/stack-utils/StackHeaderSearchBar.tsx +21 -0
- package/src/layouts/stack-utils/StackHeaderTitle.tsx +72 -0
- package/src/layouts/stack-utils/StackScreen.tsx +66 -0
- package/src/layouts/stack-utils/__tests__/composition.test.tsx +634 -0
- package/src/layouts/stack-utils/index.tsx +35 -0
- package/src/layouts/withLayoutContext.tsx +3 -2
- package/src/router/router.ts +1 -1
- package/src/utils/children.ts +72 -0
- package/src/utils/style.ts +17 -0
- package/types/__mocks__/@react-navigation/native-stack.d.ts +30 -0
- package/types/__mocks__/@react-navigation/native-stack.d.ts.map +1 -0
- package/types/__mocks__/@react-navigation/native.d.ts +17 -0
- package/types/__mocks__/@react-navigation/native.d.ts.map +1 -0
- package/types/__mocks__/expo-linking.d.ts +9 -0
- package/types/__mocks__/expo-linking.d.ts.map +1 -0
- package/types/__mocks__/expo-modules-core.d.ts +11 -0
- package/types/__mocks__/expo-modules-core.d.ts.map +1 -0
- package/types/__mocks__/react-native-screens.d.ts +14 -0
- package/types/__mocks__/react-native-screens.d.ts.map +1 -0
- package/types/__mocks__/react-native.d.ts +12 -0
- package/types/__mocks__/react-native.d.ts.map +1 -0
- package/types/fork/NavigationContainer.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/Stack.d.ts +10 -0
- package/types/layouts/Stack.d.ts.map +1 -1
- package/types/layouts/stack-utils/StackHeaderBackButton.d.ts +17 -0
- package/types/layouts/stack-utils/StackHeaderBackButton.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackHeaderComponent.d.ts +36 -0
- package/types/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackHeaderLeft.d.ts +13 -0
- package/types/layouts/stack-utils/StackHeaderLeft.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackHeaderRight.d.ts +13 -0
- package/types/layouts/stack-utils/StackHeaderRight.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackHeaderSearchBar.d.ts +10 -0
- package/types/layouts/stack-utils/StackHeaderSearchBar.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackHeaderTitle.d.ts +26 -0
- package/types/layouts/stack-utils/StackHeaderTitle.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackScreen.d.ts +22 -0
- package/types/layouts/stack-utils/StackScreen.d.ts.map +1 -0
- package/types/layouts/stack-utils/index.d.ts +20 -0
- package/types/layouts/stack-utils/index.d.ts.map +1 -0
- package/types/layouts/withLayoutContext.d.ts.map +1 -1
- package/types/utils/children.d.ts +23 -0
- package/types/utils/children.d.ts.map +1 -0
- package/types/utils/style.d.ts +7 -0
- package/types/utils/style.d.ts.map +1 -0
- /package/types/vercel/build/generate/{createSSRServerlessFunction.d.ts → createSsrServerlessFunction.d.ts} +0 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
var import_vitest = require("vitest"),
|
|
2
|
+
import_react_native = require("react-native-web"),
|
|
3
|
+
import_StackHeaderTitle = require("../StackHeaderTitle.cjs"),
|
|
4
|
+
import_StackHeaderLeft = require("../StackHeaderLeft.cjs"),
|
|
5
|
+
import_StackHeaderRight = require("../StackHeaderRight.cjs"),
|
|
6
|
+
import_StackHeaderBackButton = require("../StackHeaderBackButton.cjs"),
|
|
7
|
+
import_StackHeaderSearchBar = require("../StackHeaderSearchBar.cjs"),
|
|
8
|
+
import_StackHeaderComponent = require("../StackHeaderComponent.cjs"),
|
|
9
|
+
import_StackScreen = require("../StackScreen.cjs"),
|
|
10
|
+
import__ = require("../index.cjs"),
|
|
11
|
+
import_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
(0, import_vitest.describe)("Stack Header Composition", () => {
|
|
13
|
+
(0, import_vitest.describe)("StackHeaderTitle", () => {
|
|
14
|
+
(0, import_vitest.it)("sets title from children", () => {
|
|
15
|
+
const result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
16
|
+
children: "My Title"
|
|
17
|
+
});
|
|
18
|
+
(0, import_vitest.expect)(result.title).toBe("My Title");
|
|
19
|
+
}), (0, import_vitest.it)("sets headerLargeTitle when large is true", () => {
|
|
20
|
+
const result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
21
|
+
large: !0
|
|
22
|
+
});
|
|
23
|
+
(0, import_vitest.expect)(result.headerLargeTitle).toBe(!0);
|
|
24
|
+
}), (0, import_vitest.it)("sets headerTitleAlign from style.textAlign", () => {
|
|
25
|
+
const result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
26
|
+
style: {
|
|
27
|
+
textAlign: "center"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
(0, import_vitest.expect)(result.headerTitleAlign).toBe("center");
|
|
31
|
+
}), (0, import_vitest.it)("converts numeric fontWeight to string", () => {
|
|
32
|
+
const result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
33
|
+
style: {
|
|
34
|
+
fontWeight: "700"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
(0, import_vitest.expect)(result.headerTitleStyle).toMatchObject({
|
|
38
|
+
fontWeight: "700"
|
|
39
|
+
});
|
|
40
|
+
}), (0, import_vitest.it)("preserves existing options", () => {
|
|
41
|
+
const result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({
|
|
42
|
+
animation: "slide_from_right"
|
|
43
|
+
}, {
|
|
44
|
+
children: "Title"
|
|
45
|
+
});
|
|
46
|
+
(0, import_vitest.expect)(result.animation).toBe("slide_from_right"), (0, import_vitest.expect)(result.title).toBe("Title");
|
|
47
|
+
}), (0, import_vitest.it)("sets headerTransparent only on iOS when large is true", () => {
|
|
48
|
+
const originalOS = import_react_native.Platform.OS;
|
|
49
|
+
import_react_native.Platform.OS = "ios";
|
|
50
|
+
const iosResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
51
|
+
large: !0
|
|
52
|
+
});
|
|
53
|
+
(0, import_vitest.expect)(iosResult.headerTransparent).toBe(!0), import_react_native.Platform.OS = "android";
|
|
54
|
+
const androidResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
55
|
+
large: !0
|
|
56
|
+
});
|
|
57
|
+
(0, import_vitest.expect)(androidResult.headerTransparent).toBeUndefined(), import_react_native.Platform.OS = "web";
|
|
58
|
+
const webResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
|
|
59
|
+
large: !0
|
|
60
|
+
});
|
|
61
|
+
(0, import_vitest.expect)(webResult.headerTransparent).toBeUndefined(), import_react_native.Platform.OS = originalOS;
|
|
62
|
+
});
|
|
63
|
+
}), (0, import_vitest.describe)("StackHeaderLeft", () => {
|
|
64
|
+
(0, import_vitest.it)("does not set headerLeft without asChild", () => {
|
|
65
|
+
const result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
|
|
66
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
67
|
+
children: "Back"
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
(0, import_vitest.expect)(result.headerLeft).toBeUndefined();
|
|
71
|
+
}), (0, import_vitest.it)("sets headerLeft with asChild", () => {
|
|
72
|
+
const result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
|
|
73
|
+
asChild: !0,
|
|
74
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(() => /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
75
|
+
children: "Back"
|
|
76
|
+
}), {})
|
|
77
|
+
});
|
|
78
|
+
(0, import_vitest.expect)(result.headerLeft).toBeDefined(), (0, import_vitest.expect)(typeof result.headerLeft).toBe("function");
|
|
79
|
+
}), (0, import_vitest.it)("sets headerLeft with asChild even without children", () => {
|
|
80
|
+
const result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
|
|
81
|
+
asChild: !0
|
|
82
|
+
});
|
|
83
|
+
(0, import_vitest.expect)(result.headerLeft).toBeDefined(), (0, import_vitest.expect)(typeof result.headerLeft).toBe("function");
|
|
84
|
+
}), (0, import_vitest.it)("preserves existing options when setting headerLeft", () => {
|
|
85
|
+
const result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({
|
|
86
|
+
title: "Existing Title",
|
|
87
|
+
animation: "slide_from_right"
|
|
88
|
+
}, {
|
|
89
|
+
asChild: !0,
|
|
90
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
91
|
+
children: "Back"
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
(0, import_vitest.expect)(result.title).toBe("Existing Title"), (0, import_vitest.expect)(result.animation).toBe("slide_from_right"), (0, import_vitest.expect)(result.headerLeft).toBeDefined();
|
|
95
|
+
}), (0, import_vitest.it)("headerLeft function returns children when called", () => {
|
|
96
|
+
const headerLeftResult = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
|
|
97
|
+
asChild: !0,
|
|
98
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(() => /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
99
|
+
children: "Back"
|
|
100
|
+
}), {})
|
|
101
|
+
}).headerLeft?.({});
|
|
102
|
+
(0, import_vitest.expect)(headerLeftResult).toBeDefined();
|
|
103
|
+
});
|
|
104
|
+
}), (0, import_vitest.describe)("StackHeaderRight", () => {
|
|
105
|
+
(0, import_vitest.it)("does not set headerRight without asChild", () => {
|
|
106
|
+
const result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
|
|
107
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
108
|
+
children: "Action"
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
(0, import_vitest.expect)(result.headerRight).toBeUndefined();
|
|
112
|
+
}), (0, import_vitest.it)("sets headerRight with asChild", () => {
|
|
113
|
+
const result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
|
|
114
|
+
asChild: !0,
|
|
115
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(() => /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
116
|
+
children: "Action"
|
|
117
|
+
}), {})
|
|
118
|
+
});
|
|
119
|
+
(0, import_vitest.expect)(result.headerRight).toBeDefined(), (0, import_vitest.expect)(typeof result.headerRight).toBe("function");
|
|
120
|
+
}), (0, import_vitest.it)("sets headerRight with asChild even without children", () => {
|
|
121
|
+
const result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
|
|
122
|
+
asChild: !0
|
|
123
|
+
});
|
|
124
|
+
(0, import_vitest.expect)(result.headerRight).toBeDefined(), (0, import_vitest.expect)(typeof result.headerRight).toBe("function");
|
|
125
|
+
}), (0, import_vitest.it)("preserves existing options when setting headerRight", () => {
|
|
126
|
+
const result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({
|
|
127
|
+
title: "Existing Title",
|
|
128
|
+
headerLargeTitle: !0
|
|
129
|
+
}, {
|
|
130
|
+
asChild: !0,
|
|
131
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
132
|
+
children: "Action"
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
(0, import_vitest.expect)(result.title).toBe("Existing Title"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerRight).toBeDefined();
|
|
136
|
+
}), (0, import_vitest.it)("headerRight function returns children when called", () => {
|
|
137
|
+
const headerRightResult = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
|
|
138
|
+
asChild: !0,
|
|
139
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(() => /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
140
|
+
children: "Action"
|
|
141
|
+
}), {})
|
|
142
|
+
}).headerRight?.({});
|
|
143
|
+
(0, import_vitest.expect)(headerRightResult).toBeDefined();
|
|
144
|
+
});
|
|
145
|
+
}), (0, import_vitest.describe)("StackHeaderBackButton", () => {
|
|
146
|
+
(0, import_vitest.it)("sets headerBackTitle from children", () => {
|
|
147
|
+
const result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
|
|
148
|
+
children: "Go Back"
|
|
149
|
+
});
|
|
150
|
+
(0, import_vitest.expect)(result.headerBackTitle).toBe("Go Back");
|
|
151
|
+
}), (0, import_vitest.it)("sets headerBackVisible to false when hidden", () => {
|
|
152
|
+
const result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
|
|
153
|
+
hidden: !0
|
|
154
|
+
});
|
|
155
|
+
(0, import_vitest.expect)(result.headerBackVisible).toBe(!1);
|
|
156
|
+
}), (0, import_vitest.it)("sets headerBackButtonMenuEnabled", () => {
|
|
157
|
+
const result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
|
|
158
|
+
withMenu: !0
|
|
159
|
+
});
|
|
160
|
+
(0, import_vitest.expect)(result.headerBackButtonMenuEnabled).toBe(!0);
|
|
161
|
+
}), (0, import_vitest.it)("sets headerBackButtonDisplayMode", () => {
|
|
162
|
+
const result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
|
|
163
|
+
displayMode: "minimal"
|
|
164
|
+
});
|
|
165
|
+
(0, import_vitest.expect)(result.headerBackButtonDisplayMode).toBe("minimal");
|
|
166
|
+
});
|
|
167
|
+
}), (0, import_vitest.describe)("StackHeaderSearchBar", () => {
|
|
168
|
+
(0, import_vitest.it)("sets headerSearchBarOptions with placeholder", () => {
|
|
169
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
|
|
170
|
+
placeholder: "Search..."
|
|
171
|
+
});
|
|
172
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
173
|
+
placeholder: "Search..."
|
|
174
|
+
});
|
|
175
|
+
}), (0, import_vitest.it)("sets headerSearchBarOptions with autoCapitalize", () => {
|
|
176
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
|
|
177
|
+
autoCapitalize: "none"
|
|
178
|
+
});
|
|
179
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
180
|
+
autoCapitalize: "none"
|
|
181
|
+
});
|
|
182
|
+
}), (0, import_vitest.it)("sets headerSearchBarOptions with multiple props", () => {
|
|
183
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
|
|
184
|
+
placeholder: "Search articles...",
|
|
185
|
+
autoCapitalize: "words",
|
|
186
|
+
hideWhenScrolling: !0,
|
|
187
|
+
obscureBackground: !1
|
|
188
|
+
});
|
|
189
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
190
|
+
placeholder: "Search articles...",
|
|
191
|
+
autoCapitalize: "words",
|
|
192
|
+
hideWhenScrolling: !0,
|
|
193
|
+
obscureBackground: !1
|
|
194
|
+
});
|
|
195
|
+
}), (0, import_vitest.it)("preserves existing options when setting search bar", () => {
|
|
196
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({
|
|
197
|
+
title: "Articles",
|
|
198
|
+
headerLargeTitle: !0
|
|
199
|
+
}, {
|
|
200
|
+
placeholder: "Search..."
|
|
201
|
+
});
|
|
202
|
+
(0, import_vitest.expect)(result.title).toBe("Articles"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
203
|
+
placeholder: "Search..."
|
|
204
|
+
});
|
|
205
|
+
}), (0, import_vitest.it)("sets headerSearchBarOptions with placement prop", () => {
|
|
206
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
|
|
207
|
+
placeholder: "Search...",
|
|
208
|
+
placement: "stacked"
|
|
209
|
+
});
|
|
210
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
211
|
+
placeholder: "Search...",
|
|
212
|
+
placement: "stacked"
|
|
213
|
+
});
|
|
214
|
+
}), (0, import_vitest.it)("sets empty headerSearchBarOptions when no props", () => {
|
|
215
|
+
const result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {});
|
|
216
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toBeDefined(), (0, import_vitest.expect)(result.headerSearchBarOptions).toEqual({});
|
|
217
|
+
});
|
|
218
|
+
}), (0, import_vitest.describe)("StackHeaderComponent", () => {
|
|
219
|
+
(0, import_vitest.it)("sets headerShown false when hidden", () => {
|
|
220
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
221
|
+
hidden: !0
|
|
222
|
+
});
|
|
223
|
+
(0, import_vitest.expect)(result.headerShown).toBe(!1);
|
|
224
|
+
}), (0, import_vitest.it)("sets headerBlurEffect", () => {
|
|
225
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
226
|
+
blurEffect: "regular"
|
|
227
|
+
});
|
|
228
|
+
(0, import_vitest.expect)(result.headerBlurEffect).toBe("regular");
|
|
229
|
+
}), (0, import_vitest.it)("sets headerShadowVisible false when shadowColor is transparent", () => {
|
|
230
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
231
|
+
style: {
|
|
232
|
+
shadowColor: "transparent"
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
(0, import_vitest.expect)(result.headerShadowVisible).toBe(!1);
|
|
236
|
+
}), (0, import_vitest.it)("sets headerTransparent when backgroundColor is transparent", () => {
|
|
237
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
238
|
+
style: {
|
|
239
|
+
backgroundColor: "transparent"
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
(0, import_vitest.expect)(result.headerTransparent).toBe(!0), (0, import_vitest.expect)(result.headerStyle).toMatchObject({
|
|
243
|
+
backgroundColor: "transparent"
|
|
244
|
+
});
|
|
245
|
+
}), (0, import_vitest.it)("sets headerTransparent with SearchBar (user controls via options if needed)", () => {
|
|
246
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
247
|
+
style: {
|
|
248
|
+
backgroundColor: "transparent"
|
|
249
|
+
},
|
|
250
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
|
|
251
|
+
placeholder: "Search..."
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
(0, import_vitest.expect)(result.headerTransparent).toBe(!0), (0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
255
|
+
placeholder: "Search..."
|
|
256
|
+
});
|
|
257
|
+
}), (0, import_vitest.it)("processes child Title component", () => {
|
|
258
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
259
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
|
|
260
|
+
large: !0,
|
|
261
|
+
children: "Test Title"
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
(0, import_vitest.expect)(result.title).toBe("Test Title"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0);
|
|
265
|
+
}), (0, import_vitest.it)("processes child BackButton component", () => {
|
|
266
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
267
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
|
|
268
|
+
hidden: !0,
|
|
269
|
+
children: "Back"
|
|
270
|
+
})
|
|
271
|
+
});
|
|
272
|
+
(0, import_vitest.expect)(result.headerBackTitle).toBe("Back"), (0, import_vitest.expect)(result.headerBackVisible).toBe(!1);
|
|
273
|
+
}), (0, import_vitest.it)("processes multiple children", () => {
|
|
274
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
275
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
|
|
276
|
+
large: !0,
|
|
277
|
+
children: "My Screen"
|
|
278
|
+
}, "title"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
|
|
279
|
+
hidden: !0
|
|
280
|
+
}, "back")]
|
|
281
|
+
});
|
|
282
|
+
(0, import_vitest.expect)(result.title).toBe("My Screen"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerBackVisible).toBe(!1);
|
|
283
|
+
}), (0, import_vitest.it)("processes child Left component", () => {
|
|
284
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
285
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderLeft.StackHeaderLeft, {
|
|
286
|
+
asChild: !0,
|
|
287
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
288
|
+
children: "Back"
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
(0, import_vitest.expect)(result.headerLeft).toBeDefined(), (0, import_vitest.expect)(typeof result.headerLeft).toBe("function");
|
|
293
|
+
}), (0, import_vitest.it)("processes child Right component", () => {
|
|
294
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
295
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderRight.StackHeaderRight, {
|
|
296
|
+
asChild: !0,
|
|
297
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
298
|
+
children: "Action"
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
});
|
|
302
|
+
(0, import_vitest.expect)(result.headerRight).toBeDefined(), (0, import_vitest.expect)(typeof result.headerRight).toBe("function");
|
|
303
|
+
}), (0, import_vitest.it)("processes child SearchBar component", () => {
|
|
304
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
305
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
|
|
306
|
+
placeholder: "Search..."
|
|
307
|
+
})
|
|
308
|
+
});
|
|
309
|
+
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
310
|
+
placeholder: "Search..."
|
|
311
|
+
});
|
|
312
|
+
}), (0, import_vitest.it)("processes all child components together", () => {
|
|
313
|
+
const result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
|
|
314
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
|
|
315
|
+
large: !0,
|
|
316
|
+
children: "Articles"
|
|
317
|
+
}, "title"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderLeft.StackHeaderLeft, {
|
|
318
|
+
asChild: !0,
|
|
319
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
320
|
+
children: "Back"
|
|
321
|
+
})
|
|
322
|
+
}, "left"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderRight.StackHeaderRight, {
|
|
323
|
+
asChild: !0,
|
|
324
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
325
|
+
children: "More"
|
|
326
|
+
})
|
|
327
|
+
}, "right"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
|
|
328
|
+
placeholder: "Search articles..."
|
|
329
|
+
}, "search"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
|
|
330
|
+
displayMode: "minimal"
|
|
331
|
+
}, "back")]
|
|
332
|
+
});
|
|
333
|
+
(0, import_vitest.expect)(result.title).toBe("Articles"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerLeft).toBeDefined(), (0, import_vitest.expect)(result.headerRight).toBeDefined(), (0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
334
|
+
placeholder: "Search articles..."
|
|
335
|
+
}), (0, import_vitest.expect)(result.headerBackButtonDisplayMode).toBe("minimal");
|
|
336
|
+
});
|
|
337
|
+
}), (0, import_vitest.describe)("StackScreen composition", () => {
|
|
338
|
+
(0, import_vitest.it)("StackHeader is same reference as StackHeaderComponent", () => {
|
|
339
|
+
(0, import_vitest.expect)(import__.StackHeader).toBe(import_StackHeaderComponent.StackHeaderComponent);
|
|
340
|
+
}), (0, import_vitest.it)("merges options with Header composition", () => {
|
|
341
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({
|
|
342
|
+
animation: "slide_from_right"
|
|
343
|
+
}, {
|
|
344
|
+
options: {
|
|
345
|
+
gestureEnabled: !0
|
|
346
|
+
},
|
|
347
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderComponent.StackHeaderComponent, {
|
|
348
|
+
blurEffect: "regular",
|
|
349
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
|
|
350
|
+
large: !0,
|
|
351
|
+
children: "Composed Title"
|
|
352
|
+
})
|
|
353
|
+
})
|
|
354
|
+
});
|
|
355
|
+
(0, import_vitest.expect)(result.animation).toBe("slide_from_right"), (0, import_vitest.expect)(result.gestureEnabled).toBe(!0), (0, import_vitest.expect)(result.headerBlurEffect).toBe("regular"), (0, import_vitest.expect)(result.title).toBe("Composed Title"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0);
|
|
356
|
+
}), (0, import_vitest.it)("works with StackHeader compound component (as used via Stack.Header)", () => {
|
|
357
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
358
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader, {
|
|
359
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
|
|
360
|
+
large: !0,
|
|
361
|
+
children: "Large Title Test"
|
|
362
|
+
})
|
|
363
|
+
})
|
|
364
|
+
});
|
|
365
|
+
(0, import_vitest.expect)(result.title).toBe("Large Title Test"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0);
|
|
366
|
+
}), (0, import_vitest.it)("works with StackHeader compound component with Left child", () => {
|
|
367
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
368
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
|
|
369
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
|
|
370
|
+
large: !0,
|
|
371
|
+
children: "Articles"
|
|
372
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Left, {
|
|
373
|
+
asChild: !0,
|
|
374
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
375
|
+
children: "Back"
|
|
376
|
+
})
|
|
377
|
+
})]
|
|
378
|
+
})
|
|
379
|
+
});
|
|
380
|
+
(0, import_vitest.expect)(result.title).toBe("Articles"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerLeft).toBeDefined();
|
|
381
|
+
}), (0, import_vitest.it)("composition overrides options prop", () => {
|
|
382
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
383
|
+
options: {
|
|
384
|
+
title: "Options Title"
|
|
385
|
+
},
|
|
386
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderComponent.StackHeaderComponent, {
|
|
387
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
|
|
388
|
+
children: "Composed Title"
|
|
389
|
+
})
|
|
390
|
+
})
|
|
391
|
+
});
|
|
392
|
+
(0, import_vitest.expect)(result.title).toBe("Composed Title");
|
|
393
|
+
}), (0, import_vitest.it)("works with StackHeader compound component with Right child", () => {
|
|
394
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
395
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
|
|
396
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
|
|
397
|
+
children: "Settings"
|
|
398
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Right, {
|
|
399
|
+
asChild: !0,
|
|
400
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
401
|
+
children: "Save"
|
|
402
|
+
})
|
|
403
|
+
})]
|
|
404
|
+
})
|
|
405
|
+
});
|
|
406
|
+
(0, import_vitest.expect)(result.title).toBe("Settings"), (0, import_vitest.expect)(result.headerRight).toBeDefined();
|
|
407
|
+
}), (0, import_vitest.it)("works with StackHeader compound component with SearchBar child", () => {
|
|
408
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
409
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
|
|
410
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
|
|
411
|
+
large: !0,
|
|
412
|
+
children: "Articles"
|
|
413
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.SearchBar, {
|
|
414
|
+
placeholder: "Search articles..."
|
|
415
|
+
})]
|
|
416
|
+
})
|
|
417
|
+
});
|
|
418
|
+
(0, import_vitest.expect)(result.title).toBe("Articles"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
419
|
+
placeholder: "Search articles..."
|
|
420
|
+
});
|
|
421
|
+
}), (0, import_vitest.it)("works with full compositional setup", () => {
|
|
422
|
+
const result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
|
|
423
|
+
options: {
|
|
424
|
+
animation: "slide_from_right"
|
|
425
|
+
},
|
|
426
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
|
|
427
|
+
blurEffect: "regular",
|
|
428
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
|
|
429
|
+
large: !0,
|
|
430
|
+
children: "My App"
|
|
431
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Left, {
|
|
432
|
+
asChild: !0,
|
|
433
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
434
|
+
children: "Menu"
|
|
435
|
+
})
|
|
436
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Right, {
|
|
437
|
+
asChild: !0,
|
|
438
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
|
|
439
|
+
children: "Settings"
|
|
440
|
+
})
|
|
441
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.BackButton, {
|
|
442
|
+
displayMode: "minimal"
|
|
443
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.SearchBar, {
|
|
444
|
+
placeholder: "Search...",
|
|
445
|
+
placement: "stacked"
|
|
446
|
+
})]
|
|
447
|
+
})
|
|
448
|
+
});
|
|
449
|
+
(0, import_vitest.expect)(result.animation).toBe("slide_from_right"), (0, import_vitest.expect)(result.headerBlurEffect).toBe("regular"), (0, import_vitest.expect)(result.title).toBe("My App"), (0, import_vitest.expect)(result.headerLargeTitle).toBe(!0), (0, import_vitest.expect)(result.headerTransparent).toBeUndefined(), (0, import_vitest.expect)(result.headerLeft).toBeDefined(), (0, import_vitest.expect)(result.headerRight).toBeDefined(), (0, import_vitest.expect)(result.headerBackButtonDisplayMode).toBe("minimal"), (0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
|
|
450
|
+
placeholder: "Search...",
|
|
451
|
+
placement: "stacked"
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
});
|