one
Version:
One is a new React Framework that makes Vite serve both native and web.
596 lines (593 loc) • 28.5 kB
JavaScript
;
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
var import_jsx_runtime = require("react/jsx-runtime");
var import_vitest = require("vitest");
var import_react = __toESM(require("react"), 1);
var import_react_native = require("react-native");
var import_StackHeaderTitle = require("../StackHeaderTitle.native.js");
var import_StackHeaderLeft = require("../StackHeaderLeft.native.js");
var import_StackHeaderRight = require("../StackHeaderRight.native.js");
var import_StackHeaderBackButton = require("../StackHeaderBackButton.native.js");
var import_StackHeaderSearchBar = require("../StackHeaderSearchBar.native.js");
var import_StackHeaderComponent = require("../StackHeaderComponent.native.js");
var import_StackScreen = require("../StackScreen.native.js");
var import__ = require("../index.native.js");
function _type_of(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
(0, import_vitest.describe)("Stack Header Composition", function () {
(0, import_vitest.describe)("StackHeaderTitle", function () {
(0, import_vitest.it)("sets title from children", function () {
var result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
children: "My Title"
});
(0, import_vitest.expect)(result.title).toBe("My Title");
});
(0, import_vitest.it)("sets headerLargeTitle when large is true", function () {
var result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
large: true
});
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
});
(0, import_vitest.it)("sets headerTitleAlign from style.textAlign", function () {
var result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
style: {
textAlign: "center"
}
});
(0, import_vitest.expect)(result.headerTitleAlign).toBe("center");
});
(0, import_vitest.it)("converts numeric fontWeight to string", function () {
var result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
style: {
fontWeight: "700"
}
});
(0, import_vitest.expect)(result.headerTitleStyle).toMatchObject({
fontWeight: "700"
});
});
(0, import_vitest.it)("preserves existing options", function () {
var result = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({
animation: "slide_from_right"
}, {
children: "Title"
});
(0, import_vitest.expect)(result.animation).toBe("slide_from_right");
(0, import_vitest.expect)(result.title).toBe("Title");
});
(0, import_vitest.it)("sets headerTransparent only on iOS when large is true", function () {
var originalOS = import_react_native.Platform.OS;
import_react_native.Platform.OS = "ios";
var iosResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
large: true
});
(0, import_vitest.expect)(iosResult.headerTransparent).toBe(true);
import_react_native.Platform.OS = "android";
var androidResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
large: true
});
(0, import_vitest.expect)(androidResult.headerTransparent).toBeUndefined();
import_react_native.Platform.OS = "web";
var webResult = (0, import_StackHeaderTitle.appendStackHeaderTitlePropsToOptions)({}, {
large: true
});
(0, import_vitest.expect)(webResult.headerTransparent).toBeUndefined();
import_react_native.Platform.OS = originalOS;
});
});
(0, import_vitest.describe)("StackHeaderLeft", function () {
(0, import_vitest.it)("does not set headerLeft without asChild", function () {
var result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
})
});
(0, import_vitest.expect)(result.headerLeft).toBeUndefined();
});
(0, import_vitest.it)("sets headerLeft with asChild", function () {
var CustomButton = function () {
return /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
});
};
var result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(CustomButton, {})
});
(0, import_vitest.expect)(result.headerLeft).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerLeft)).toBe("function");
});
(0, import_vitest.it)("sets headerLeft with asChild even without children", function () {
var result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
asChild: true
});
(0, import_vitest.expect)(result.headerLeft).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerLeft)).toBe("function");
});
(0, import_vitest.it)("preserves existing options when setting headerLeft", function () {
var result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({
title: "Existing Title",
animation: "slide_from_right"
}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
})
});
(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();
});
(0, import_vitest.it)("headerLeft function returns children when called", function () {
var _result_headerLeft;
var BackButton = function () {
return /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
});
};
var result = (0, import_StackHeaderLeft.appendStackHeaderLeftPropsToOptions)({}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(BackButton, {})
});
var headerLeftResult = (_result_headerLeft = result.headerLeft) === null || _result_headerLeft === void 0 ? void 0 : _result_headerLeft.call(result, {});
(0, import_vitest.expect)(headerLeftResult).toBeDefined();
});
});
(0, import_vitest.describe)("StackHeaderRight", function () {
(0, import_vitest.it)("does not set headerRight without asChild", function () {
var result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Action"
})
});
(0, import_vitest.expect)(result.headerRight).toBeUndefined();
});
(0, import_vitest.it)("sets headerRight with asChild", function () {
var CustomButton = function () {
return /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Action"
});
};
var result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(CustomButton, {})
});
(0, import_vitest.expect)(result.headerRight).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerRight)).toBe("function");
});
(0, import_vitest.it)("sets headerRight with asChild even without children", function () {
var result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
asChild: true
});
(0, import_vitest.expect)(result.headerRight).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerRight)).toBe("function");
});
(0, import_vitest.it)("preserves existing options when setting headerRight", function () {
var result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({
title: "Existing Title",
headerLargeTitle: true
}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Action"
})
});
(0, import_vitest.expect)(result.title).toBe("Existing Title");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerRight).toBeDefined();
});
(0, import_vitest.it)("headerRight function returns children when called", function () {
var _result_headerRight;
var ActionButton = function () {
return /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Action"
});
};
var result = (0, import_StackHeaderRight.appendStackHeaderRightPropsToOptions)({}, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(ActionButton, {})
});
var headerRightResult = (_result_headerRight = result.headerRight) === null || _result_headerRight === void 0 ? void 0 : _result_headerRight.call(result, {});
(0, import_vitest.expect)(headerRightResult).toBeDefined();
});
});
(0, import_vitest.describe)("StackHeaderBackButton", function () {
(0, import_vitest.it)("sets headerBackTitle from children", function () {
var result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
children: "Go Back"
});
(0, import_vitest.expect)(result.headerBackTitle).toBe("Go Back");
});
(0, import_vitest.it)("sets headerBackVisible to false when hidden", function () {
var result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
hidden: true
});
(0, import_vitest.expect)(result.headerBackVisible).toBe(false);
});
(0, import_vitest.it)("sets headerBackButtonMenuEnabled", function () {
var result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
withMenu: true
});
(0, import_vitest.expect)(result.headerBackButtonMenuEnabled).toBe(true);
});
(0, import_vitest.it)("sets headerBackButtonDisplayMode", function () {
var result = (0, import_StackHeaderBackButton.appendStackHeaderBackButtonPropsToOptions)({}, {
displayMode: "minimal"
});
(0, import_vitest.expect)(result.headerBackButtonDisplayMode).toBe("minimal");
});
});
(0, import_vitest.describe)("StackHeaderSearchBar", function () {
(0, import_vitest.it)("sets headerSearchBarOptions with placeholder", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
placeholder: "Search..."
});
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search..."
});
});
(0, import_vitest.it)("sets headerSearchBarOptions with autoCapitalize", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
autoCapitalize: "none"
});
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
autoCapitalize: "none"
});
});
(0, import_vitest.it)("sets headerSearchBarOptions with multiple props", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
placeholder: "Search articles...",
autoCapitalize: "words",
hideWhenScrolling: true,
obscureBackground: false
});
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search articles...",
autoCapitalize: "words",
hideWhenScrolling: true,
obscureBackground: false
});
});
(0, import_vitest.it)("preserves existing options when setting search bar", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({
title: "Articles",
headerLargeTitle: true
}, {
placeholder: "Search..."
});
(0, import_vitest.expect)(result.title).toBe("Articles");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search..."
});
});
(0, import_vitest.it)("sets headerSearchBarOptions with placement prop", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {
placeholder: "Search...",
placement: "stacked"
});
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search...",
placement: "stacked"
});
});
(0, import_vitest.it)("sets empty headerSearchBarOptions when no props", function () {
var result = (0, import_StackHeaderSearchBar.appendStackHeaderSearchBarPropsToOptions)({}, {});
(0, import_vitest.expect)(result.headerSearchBarOptions).toBeDefined();
(0, import_vitest.expect)(result.headerSearchBarOptions).toEqual({});
});
});
(0, import_vitest.describe)("StackHeaderComponent", function () {
(0, import_vitest.it)("sets headerShown false when hidden", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
hidden: true
});
(0, import_vitest.expect)(result.headerShown).toBe(false);
});
(0, import_vitest.it)("sets headerBlurEffect", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
blurEffect: "regular"
});
(0, import_vitest.expect)(result.headerBlurEffect).toBe("regular");
});
(0, import_vitest.it)("sets headerShadowVisible false when shadowColor is transparent", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
style: {
shadowColor: "transparent"
}
});
(0, import_vitest.expect)(result.headerShadowVisible).toBe(false);
});
(0, import_vitest.it)("sets headerTransparent when backgroundColor is transparent", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
style: {
backgroundColor: "transparent"
}
});
(0, import_vitest.expect)(result.headerTransparent).toBe(true);
(0, import_vitest.expect)(result.headerStyle).toMatchObject({
backgroundColor: "transparent"
});
});
(0, import_vitest.it)("sets headerTransparent with SearchBar (user controls via options if needed)", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
style: {
backgroundColor: "transparent"
},
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
placeholder: "Search..."
})
});
(0, import_vitest.expect)(result.headerTransparent).toBe(true);
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search..."
});
});
(0, import_vitest.it)("processes child Title component", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
large: true,
children: "Test Title"
})
});
(0, import_vitest.expect)(result.title).toBe("Test Title");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
});
(0, import_vitest.it)("processes child BackButton component", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
hidden: true,
children: "Back"
})
});
(0, import_vitest.expect)(result.headerBackTitle).toBe("Back");
(0, import_vitest.expect)(result.headerBackVisible).toBe(false);
});
(0, import_vitest.it)("processes multiple children", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
large: true,
children: "My Screen"
}, "title"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
hidden: true
}, "back")]
});
(0, import_vitest.expect)(result.title).toBe("My Screen");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerBackVisible).toBe(false);
});
(0, import_vitest.it)("processes child Left component", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderLeft.StackHeaderLeft, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
})
})
});
(0, import_vitest.expect)(result.headerLeft).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerLeft)).toBe("function");
});
(0, import_vitest.it)("processes child Right component", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderRight.StackHeaderRight, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Action"
})
})
});
(0, import_vitest.expect)(result.headerRight).toBeDefined();
(0, import_vitest.expect)(_type_of(result.headerRight)).toBe("function");
});
(0, import_vitest.it)("processes child SearchBar component", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
placeholder: "Search..."
})
});
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search..."
});
});
(0, import_vitest.it)("processes all child components together", function () {
var result = (0, import_StackHeaderComponent.appendStackHeaderPropsToOptions)({}, {
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
large: true,
children: "Articles"
}, "title"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderLeft.StackHeaderLeft, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
})
}, "left"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderRight.StackHeaderRight, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "More"
})
}, "right"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderSearchBar.StackHeaderSearchBar, {
placeholder: "Search articles..."
}, "search"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderBackButton.StackHeaderBackButton, {
displayMode: "minimal"
}, "back")]
});
(0, import_vitest.expect)(result.title).toBe("Articles");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerLeft).toBeDefined();
(0, import_vitest.expect)(result.headerRight).toBeDefined();
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search articles..."
});
(0, import_vitest.expect)(result.headerBackButtonDisplayMode).toBe("minimal");
});
});
(0, import_vitest.describe)("StackScreen composition", function () {
(0, import_vitest.it)("StackHeader is same reference as StackHeaderComponent", function () {
(0, import_vitest.expect)(import__.StackHeader).toBe(import_StackHeaderComponent.StackHeaderComponent);
});
(0, import_vitest.it)("merges options with Header composition", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({
animation: "slide_from_right"
}, {
options: {
gestureEnabled: true
},
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderComponent.StackHeaderComponent, {
blurEffect: "regular",
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
large: true,
children: "Composed Title"
})
})
});
(0, import_vitest.expect)(result.animation).toBe("slide_from_right");
(0, import_vitest.expect)(result.gestureEnabled).toBe(true);
(0, import_vitest.expect)(result.headerBlurEffect).toBe("regular");
(0, import_vitest.expect)(result.title).toBe("Composed Title");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
});
(0, import_vitest.it)("works with StackHeader compound component (as used via Stack.Header)", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
large: true,
children: "Large Title Test"
})
})
});
(0, import_vitest.expect)(result.title).toBe("Large Title Test");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
});
(0, import_vitest.it)("works with StackHeader compound component with Left child", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
large: true,
children: "Articles"
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Left, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Back"
})
})]
})
});
(0, import_vitest.expect)(result.title).toBe("Articles");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerLeft).toBeDefined();
});
(0, import_vitest.it)("composition overrides options prop", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
options: {
title: "Options Title"
},
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderComponent.StackHeaderComponent, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackHeaderTitle.StackHeaderTitle, {
children: "Composed Title"
})
})
});
(0, import_vitest.expect)(result.title).toBe("Composed Title");
});
(0, import_vitest.it)("works with StackHeader compound component with Right child", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
children: "Settings"
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Right, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Save"
})
})]
})
});
(0, import_vitest.expect)(result.title).toBe("Settings");
(0, import_vitest.expect)(result.headerRight).toBeDefined();
});
(0, import_vitest.it)("works with StackHeader compound component with SearchBar child", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
large: true,
children: "Articles"
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.SearchBar, {
placeholder: "Search articles..."
})]
})
});
(0, import_vitest.expect)(result.title).toBe("Articles");
(0, import_vitest.expect)(result.headerLargeTitle).toBe(true);
(0, import_vitest.expect)(result.headerSearchBarOptions).toMatchObject({
placeholder: "Search articles..."
});
});
(0, import_vitest.it)("works with full compositional setup", function () {
var result = (0, import_StackScreen.appendScreenStackPropsToOptions)({}, {
options: {
animation: "slide_from_right"
},
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import__.StackHeader, {
blurEffect: "regular",
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Title, {
large: true,
children: "My App"
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Left, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Menu"
})
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.Right, {
asChild: true,
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("button", {
children: "Settings"
})
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.BackButton, {
displayMode: "minimal"
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import__.StackHeader.SearchBar, {
placeholder: "Search...",
placement: "stacked"
})]
})
});
(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(true);
(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({
placeholder: "Search...",
placement: "stacked"
});
});
});
});
//# sourceMappingURL=composition.test.native.js.map