@artsy/palette-mobile 24.16.0 → 24.17.0
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.
|
@@ -48,10 +48,10 @@ var DefaultTabItem = function (props) {
|
|
|
48
48
|
return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { flex: 1, children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { position: "absolute", width: "100%", children: !!(Indicator === null || Indicator === void 0 ? void 0 : Indicator.Component) && (0, jsx_runtime_1.jsx)(Indicator.Component, __assign({}, props)) }), (0, jsx_runtime_1.jsx)(react_native_collapsible_tab_view_1.MaterialTabItem, __assign({ pressOpacity: constants_1.DEFAULT_ACTIVE_OPACITY }, props))] }));
|
|
49
49
|
};
|
|
50
50
|
var TabsContainer = function (_a) {
|
|
51
|
-
var children = _a.children, _b = _a.indicators, indicators = _b === void 0 ? [] : _b, initialTabName = _a.initialTabName, onTabPress = _a.onTabPress, renderHeader = _a.renderHeader, stickyTabBarComponent = _a.stickyTabBarComponent, _c = _a.tabScrollEnabled, tabScrollEnabled = _c === void 0 ? false : _c, _d = _a.variant, variant = _d === void 0 ? "tabs" : _d, tabContainerProps = __rest(_a, ["children", "indicators", "initialTabName", "onTabPress", "renderHeader", "stickyTabBarComponent", "tabScrollEnabled", "variant"]);
|
|
51
|
+
var children = _a.children, _b = _a.indicators, indicators = _b === void 0 ? [] : _b, initialTabName = _a.initialTabName, onTabPress = _a.onTabPress, renderHeader = _a.renderHeader, stickyTabBarComponent = _a.stickyTabBarComponent, _c = _a.tabScrollEnabled, tabScrollEnabled = _c === void 0 ? false : _c, _d = _a.variant, variant = _d === void 0 ? "tabs" : _d, _e = _a.allowHeaderOverscroll, allowHeaderOverscroll = _e === void 0 ? true : _e, tabContainerProps = __rest(_a, ["children", "indicators", "initialTabName", "onTabPress", "renderHeader", "stickyTabBarComponent", "tabScrollEnabled", "variant", "allowHeaderOverscroll"]);
|
|
52
52
|
var space = (0, useSpace_1.useSpace)();
|
|
53
53
|
var color = (0, useColor_1.useColor)();
|
|
54
|
-
var
|
|
54
|
+
var _f = (0, react_1.useState)(initialTabName), focusedTabState = _f[0], setFocusedTabState = _f[1];
|
|
55
55
|
var isIOS = react_native_1.Platform.OS === "ios";
|
|
56
56
|
return ((0, jsx_runtime_1.jsx)(react_native_collapsible_tab_view_1.Tabs.Container, __assign({ renderHeader: renderHeader, headerContainerStyle: {
|
|
57
57
|
shadowOpacity: 0,
|
|
@@ -85,6 +85,6 @@ var TabsContainer = function (_a) {
|
|
|
85
85
|
// to prevent linebreaks on the tab titles
|
|
86
86
|
paddingHorizontal: 0,
|
|
87
87
|
} })) }));
|
|
88
|
-
} }, tabContainerProps, { children: children })));
|
|
88
|
+
}, allowHeaderOverscroll: allowHeaderOverscroll }, tabContainerProps, { children: children })));
|
|
89
89
|
};
|
|
90
90
|
exports.TabsContainer = TabsContainer;
|
|
@@ -37,9 +37,9 @@ var TabsWithHeader = function (_a) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.TabsWithHeader = TabsWithHeader;
|
|
39
39
|
var Content = function (_a) {
|
|
40
|
-
var BelowTitleHeaderComponent = _a.BelowTitleHeaderComponent, children = _a.children, _b = _a.showLargeHeaderText, showLargeHeaderText = _b === void 0 ? true : _b, title = _a.title,
|
|
40
|
+
var BelowTitleHeaderComponent = _a.BelowTitleHeaderComponent, children = _a.children, _b = _a.showLargeHeaderText, showLargeHeaderText = _b === void 0 ? true : _b, title = _a.title, rest = __rest(_a, ["BelowTitleHeaderComponent", "children", "showLargeHeaderText", "title"]);
|
|
41
41
|
var showTitle = showLargeHeaderText && !!title;
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(TabsContainer_1.TabsContainer, __assign({
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(TabsContainer_1.TabsContainer, __assign({}, rest, { renderHeader: function () {
|
|
43
43
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!showTitle && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { my: 1, px: 2, justifyContent: "center", pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display", numberOfLines: 2, children: title }) })), !!BelowTitleHeaderComponent && (0, jsx_runtime_1.jsx)(BelowTitleHeaderComponent, {})] }));
|
|
44
44
|
}, children: children })));
|
|
45
45
|
};
|