@yahoo/uds-mobile 2.9.0 → 2.10.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.
- package/README.md +1 -1
- package/dist/components/Tabs/Tab.cjs +174 -0
- package/dist/components/Tabs/Tab.d.cts +26 -0
- package/dist/components/Tabs/Tab.d.cts.map +1 -0
- package/dist/components/Tabs/Tab.d.ts +26 -0
- package/dist/components/Tabs/Tab.d.ts.map +1 -0
- package/dist/components/Tabs/Tab.js +174 -0
- package/dist/components/Tabs/Tab.js.map +1 -0
- package/dist/components/Tabs/TabList.cjs +142 -0
- package/dist/components/Tabs/TabList.d.cts +24 -0
- package/dist/components/Tabs/TabList.d.cts.map +1 -0
- package/dist/components/Tabs/TabList.d.ts +24 -0
- package/dist/components/Tabs/TabList.d.ts.map +1 -0
- package/dist/components/Tabs/TabList.js +141 -0
- package/dist/components/Tabs/TabList.js.map +1 -0
- package/dist/components/Tabs/TabPanel.cjs +31 -0
- package/dist/components/Tabs/TabPanel.d.cts +24 -0
- package/dist/components/Tabs/TabPanel.d.cts.map +1 -0
- package/dist/components/Tabs/TabPanel.d.ts +24 -0
- package/dist/components/Tabs/TabPanel.d.ts.map +1 -0
- package/dist/components/Tabs/TabPanel.js +31 -0
- package/dist/components/Tabs/TabPanel.js.map +1 -0
- package/dist/components/Tabs/Tabs.cjs +53 -0
- package/dist/components/Tabs/Tabs.d.cts +35 -0
- package/dist/components/Tabs/Tabs.d.cts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +35 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +53 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/index.cjs +10 -0
- package/dist/components/Tabs/index.d.cts +13 -0
- package/dist/components/Tabs/index.d.cts.map +1 -0
- package/dist/components/Tabs/index.d.ts +13 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +6 -0
- package/dist/components/Tabs/tabTheme.cjs +29 -0
- package/dist/components/Tabs/tabTheme.d.cts +23 -0
- package/dist/components/Tabs/tabTheme.d.cts.map +1 -0
- package/dist/components/Tabs/tabTheme.d.ts +23 -0
- package/dist/components/Tabs/tabTheme.d.ts.map +1 -0
- package/dist/components/Tabs/tabTheme.js +28 -0
- package/dist/components/Tabs/tabTheme.js.map +1 -0
- package/dist/components/Tabs/tabsContexts.cjs +91 -0
- package/dist/components/Tabs/tabsContexts.d.cts +35 -0
- package/dist/components/Tabs/tabsContexts.d.cts.map +1 -0
- package/dist/components/Tabs/tabsContexts.d.ts +35 -0
- package/dist/components/Tabs/tabsContexts.d.ts.map +1 -0
- package/dist/components/Tabs/tabsContexts.js +87 -0
- package/dist/components/Tabs/tabsContexts.js.map +1 -0
- package/dist/jest/mocks/styles.cjs +7 -0
- package/dist/jest/mocks/styles.d.cts +3 -2
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts +3 -2
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +7 -1
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/types/dist/index.d.cts +52 -1
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts +52 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/generated/styles.cjs +68 -0
- package/generated/styles.d.ts +46 -0
- package/generated/styles.mjs +68 -0
- package/generated/unistyles.d.ts +53 -0
- package/package.json +11 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useTabSelectionContext, useTabsVisualContext } from "./tabsContexts.js";
|
|
3
|
+
import { getTabLayerStyle } from "./tabTheme.js";
|
|
4
|
+
import { memo, useEffect, useMemo } from "react";
|
|
5
|
+
import { ScrollView, View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { tabsStyles } from "../../../generated/styles";
|
|
8
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
9
|
+
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
10
|
+
//#region src/components/Tabs/TabList.tsx
|
|
11
|
+
const TAB_INDICATOR_MS = 240;
|
|
12
|
+
const TAB_INDICATOR_EASING = Easing.bezier(.2, 0, 0, 1);
|
|
13
|
+
const PRIMARY_SLIDE_UNDERLINE_HEIGHT = 2;
|
|
14
|
+
function TabListIndicator({ visualVariant, reduceMotion }) {
|
|
15
|
+
const { selectedId, tabLayouts } = useTabSelectionContext();
|
|
16
|
+
const { theme } = useUnistyles();
|
|
17
|
+
const x = useSharedValue(0);
|
|
18
|
+
const y = useSharedValue(0);
|
|
19
|
+
const w = useSharedValue(0);
|
|
20
|
+
const h = useSharedValue(0);
|
|
21
|
+
const opacity = useSharedValue(0);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (reduceMotion || !selectedId) {
|
|
24
|
+
opacity.value = withTiming(0, {
|
|
25
|
+
duration: 120,
|
|
26
|
+
easing: Easing.out(Easing.quad)
|
|
27
|
+
});
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const layout = tabLayouts.get(selectedId);
|
|
31
|
+
if (!layout || layout.width <= 0 || layout.height <= 0) {
|
|
32
|
+
opacity.value = withTiming(0, {
|
|
33
|
+
duration: 120,
|
|
34
|
+
easing: Easing.out(Easing.quad)
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const timing = {
|
|
39
|
+
duration: TAB_INDICATOR_MS,
|
|
40
|
+
easing: TAB_INDICATOR_EASING
|
|
41
|
+
};
|
|
42
|
+
x.value = withTiming(layout.x, timing);
|
|
43
|
+
y.value = withTiming(layout.y, timing);
|
|
44
|
+
w.value = withTiming(layout.width, timing);
|
|
45
|
+
h.value = withTiming(layout.height, timing);
|
|
46
|
+
opacity.value = withTiming(1, timing);
|
|
47
|
+
}, [
|
|
48
|
+
selectedId,
|
|
49
|
+
tabLayouts,
|
|
50
|
+
reduceMotion,
|
|
51
|
+
x,
|
|
52
|
+
y,
|
|
53
|
+
w,
|
|
54
|
+
h,
|
|
55
|
+
opacity
|
|
56
|
+
]);
|
|
57
|
+
const indicatorChrome = useMemo(() => getTabLayerStyle(theme, visualVariant, "on", "root", "rest"), [theme, visualVariant]);
|
|
58
|
+
const primaryAccentColor = useMemo(() => {
|
|
59
|
+
const t = getTabLayerStyle(theme, "primary", "on", "rootText", "rest");
|
|
60
|
+
return typeof t.color === "string" ? t.color : "#7d2eff";
|
|
61
|
+
}, [theme]);
|
|
62
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
63
|
+
position: "absolute",
|
|
64
|
+
left: x.value,
|
|
65
|
+
top: y.value,
|
|
66
|
+
width: w.value,
|
|
67
|
+
height: h.value,
|
|
68
|
+
opacity: opacity.value,
|
|
69
|
+
zIndex: 0,
|
|
70
|
+
overflow: "hidden"
|
|
71
|
+
}));
|
|
72
|
+
if (reduceMotion) return null;
|
|
73
|
+
/** Primary: sliding accent line at bottom (web uses underline layer, not full pill). */
|
|
74
|
+
if (visualVariant === "primary") return /* @__PURE__ */ jsx(Animated.View, {
|
|
75
|
+
pointerEvents: "none",
|
|
76
|
+
style: [animatedStyle, { backgroundColor: "transparent" }],
|
|
77
|
+
children: /* @__PURE__ */ jsx(View, {
|
|
78
|
+
style: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
justifyContent: "flex-end"
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ jsx(View, { style: {
|
|
83
|
+
height: PRIMARY_SLIDE_UNDERLINE_HEIGHT,
|
|
84
|
+
width: "100%",
|
|
85
|
+
backgroundColor: primaryAccentColor
|
|
86
|
+
} })
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
return /* @__PURE__ */ jsx(Animated.View, {
|
|
90
|
+
pointerEvents: "none",
|
|
91
|
+
style: animatedStyle,
|
|
92
|
+
children: /* @__PURE__ */ jsx(View, { style: [indicatorChrome, { flex: 1 }] })
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* **⚙️ TabList**
|
|
97
|
+
*
|
|
98
|
+
* @description
|
|
99
|
+
* Horizontal row of {@link Tab} items. Set `scrollable` when tabs may overflow the viewport.
|
|
100
|
+
*
|
|
101
|
+
* @category Navigation
|
|
102
|
+
* @platform mobile
|
|
103
|
+
*/
|
|
104
|
+
const TabList = memo(function TabList({ children, scrollable = false, style, accessibilityLabel, ...viewProps }) {
|
|
105
|
+
const { variant: visualVariant, reduceMotion } = useTabsVisualContext();
|
|
106
|
+
tabsStyles.useVariants({ variant: visualVariant });
|
|
107
|
+
const row = /* @__PURE__ */ jsxs(View, {
|
|
108
|
+
style: {
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
position: "relative",
|
|
112
|
+
...tabsStyles.root,
|
|
113
|
+
...visualVariant === "secondary" && !scrollable ? { alignSelf: "flex-start" } : {}
|
|
114
|
+
},
|
|
115
|
+
children: [/* @__PURE__ */ jsx(TabListIndicator, {
|
|
116
|
+
visualVariant,
|
|
117
|
+
reduceMotion
|
|
118
|
+
}), children]
|
|
119
|
+
});
|
|
120
|
+
if (scrollable) return /* @__PURE__ */ jsx(ScrollView, {
|
|
121
|
+
horizontal: true,
|
|
122
|
+
showsHorizontalScrollIndicator: false,
|
|
123
|
+
accessibilityRole: "tablist",
|
|
124
|
+
accessibilityLabel,
|
|
125
|
+
...viewProps,
|
|
126
|
+
style,
|
|
127
|
+
children: row
|
|
128
|
+
});
|
|
129
|
+
return /* @__PURE__ */ jsx(View, {
|
|
130
|
+
accessibilityRole: "tablist",
|
|
131
|
+
accessibilityLabel,
|
|
132
|
+
style,
|
|
133
|
+
...viewProps,
|
|
134
|
+
children: row
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
TabList.displayName = "TabList";
|
|
138
|
+
//#endregion
|
|
139
|
+
export { TabList };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=TabList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabList.js","names":[],"sources":["../../../src/components/Tabs/TabList.tsx"],"sourcesContent":["import type { UniversalTabListProps } from '@yahoo/uds-types';\nimport { memo, useEffect, useMemo } from 'react';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { ScrollView, View } from 'react-native';\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n// eslint-disable-next-line uds/no-use-unistyles -- theme.components path lookups for tab indicator\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { tabsStyles } from '../../../generated/styles';\nimport { useTabSelectionContext, useTabsVisualContext } from './tabsContexts';\nimport { getTabLayerStyle } from './tabTheme';\n\nconst TAB_INDICATOR_MS = 240;\nconst TAB_INDICATOR_EASING = Easing.bezier(0.2, 0, 0, 1);\nconst PRIMARY_SLIDE_UNDERLINE_HEIGHT = 2;\n\n/** RN View/ScrollView aria types differ from `React.AriaAttributes` on web; keep parity fields only. */\ninterface TabListProps\n extends Omit<ViewProps, 'children' | 'style'>, Pick<UniversalTabListProps, 'scrollable'> {\n children: UniversalTabListProps['children'];\n style?: ViewStyle;\n}\n\nfunction TabListIndicator({\n visualVariant,\n reduceMotion,\n}: {\n visualVariant: 'primary' | 'secondary';\n reduceMotion: boolean;\n}) {\n const { selectedId, tabLayouts } = useTabSelectionContext();\n const { theme } = useUnistyles();\n const x = useSharedValue(0);\n const y = useSharedValue(0);\n const w = useSharedValue(0);\n const h = useSharedValue(0);\n const opacity = useSharedValue(0);\n\n useEffect(() => {\n if (reduceMotion || !selectedId) {\n opacity.value = withTiming(0, { duration: 120, easing: Easing.out(Easing.quad) });\n return;\n }\n const layout = tabLayouts.get(selectedId);\n if (!layout || layout.width <= 0 || layout.height <= 0) {\n opacity.value = withTiming(0, { duration: 120, easing: Easing.out(Easing.quad) });\n return;\n }\n const timing = { duration: TAB_INDICATOR_MS, easing: TAB_INDICATOR_EASING };\n x.value = withTiming(layout.x, timing);\n y.value = withTiming(layout.y, timing);\n w.value = withTiming(layout.width, timing);\n h.value = withTiming(layout.height, timing);\n opacity.value = withTiming(1, timing);\n }, [selectedId, tabLayouts, reduceMotion, x, y, w, h, opacity]);\n\n const indicatorChrome = useMemo(\n () => getTabLayerStyle(theme, visualVariant, 'on', 'root', 'rest') as ViewStyle,\n [theme, visualVariant],\n );\n\n const primaryAccentColor = useMemo(() => {\n const t = getTabLayerStyle(theme, 'primary', 'on', 'rootText', 'rest') as { color?: string };\n return typeof t.color === 'string' ? t.color : '#7d2eff';\n }, [theme]);\n\n const animatedStyle = useAnimatedStyle(() => ({\n position: 'absolute' as const,\n left: x.value,\n top: y.value,\n width: w.value,\n height: h.value,\n opacity: opacity.value,\n zIndex: 0,\n overflow: 'hidden' as const,\n }));\n\n if (reduceMotion) {\n return null;\n }\n\n /** Primary: sliding accent line at bottom (web uses underline layer, not full pill). */\n if (visualVariant === 'primary') {\n return (\n <Animated.View\n pointerEvents=\"none\"\n style={[animatedStyle, { backgroundColor: 'transparent' }]}\n >\n <View style={{ flex: 1, justifyContent: 'flex-end' }}>\n <View\n style={{\n height: PRIMARY_SLIDE_UNDERLINE_HEIGHT,\n width: '100%',\n backgroundColor: primaryAccentColor,\n }}\n />\n </View>\n </Animated.View>\n );\n }\n\n return (\n <Animated.View pointerEvents=\"none\" style={animatedStyle}>\n <View style={[indicatorChrome, { flex: 1 }]} />\n </Animated.View>\n );\n}\n\n/**\n * **⚙️ TabList**\n *\n * @description\n * Horizontal row of {@link Tab} items. Set `scrollable` when tabs may overflow the viewport.\n *\n * @category Navigation\n * @platform mobile\n */\nconst TabList = memo(function TabList({\n children,\n scrollable = false,\n style,\n accessibilityLabel,\n ...viewProps\n}: TabListProps) {\n const { variant: visualVariant, reduceMotion } = useTabsVisualContext();\n tabsStyles.useVariants({ variant: visualVariant });\n\n const rowStyle: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n position: 'relative',\n ...tabsStyles.root,\n // Secondary track tokens include horizontal padding; shrink-wrap so inset matches on both ends.\n ...(visualVariant === 'secondary' && !scrollable ? { alignSelf: 'flex-start' as const } : {}),\n };\n\n const row = (\n <View style={rowStyle}>\n <TabListIndicator visualVariant={visualVariant} reduceMotion={reduceMotion} />\n {children}\n </View>\n );\n\n if (scrollable) {\n return (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityRole=\"tablist\"\n accessibilityLabel={accessibilityLabel}\n {...viewProps}\n style={style}\n >\n {row}\n </ScrollView>\n );\n }\n\n return (\n <View\n accessibilityRole=\"tablist\"\n accessibilityLabel={accessibilityLabel}\n style={style}\n {...viewProps}\n >\n {row}\n </View>\n );\n});\n\nTabList.displayName = 'TabList';\n\nexport { TabList };\nexport type { TabListProps };\n"],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Tabs_tabsContexts = require("./tabsContexts.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_native = require("react-native");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/Tabs/TabPanel.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **⚙️ TabPanel**
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Content associated with a tab id. Only the panel whose `tabId` matches the current
|
|
14
|
+
* selection is rendered.
|
|
15
|
+
*
|
|
16
|
+
* @category Navigation
|
|
17
|
+
* @platform mobile
|
|
18
|
+
*/
|
|
19
|
+
const TabPanel = (0, react.memo)(function TabPanel({ tabId, children, style, ...viewProps }) {
|
|
20
|
+
const { selectedId } = require_components_Tabs_tabsContexts.useTabSelectionContext();
|
|
21
|
+
if (selectedId !== tabId) return null;
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
23
|
+
accessibilityRole: "none",
|
|
24
|
+
style,
|
|
25
|
+
...viewProps,
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
TabPanel.displayName = "TabPanel";
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.TabPanel = TabPanel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabPanelProps } from "../../types/dist/index.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { ViewProps, ViewStyle } from "react-native";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Tabs/TabPanel.d.ts
|
|
7
|
+
interface TabPanelProps extends Omit<UniversalTabPanelProps, 'className'>, Omit<ViewProps, 'style' | 'children'> {
|
|
8
|
+
children: UniversalTabPanelProps['children'];
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* **⚙️ TabPanel**
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* Content associated with a tab id. Only the panel whose `tabId` matches the current
|
|
16
|
+
* selection is rendered.
|
|
17
|
+
*
|
|
18
|
+
* @category Navigation
|
|
19
|
+
* @platform mobile
|
|
20
|
+
*/
|
|
21
|
+
declare const TabPanel: _$react.NamedExoticComponent<TabPanelProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TabPanel, type TabPanelProps };
|
|
24
|
+
//# sourceMappingURL=TabPanel.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.d.cts","names":[],"sources":["../../../src/components/Tabs/TabPanel.tsx"],"mappings":";;;;;;UAOU,aAAA,SACA,IAAA,CAAK,sBAAA,gBAAsC,IAAA,CAAK,SAAA;EACxD,QAAA,EAAU,sBAAA;EACV,KAAA,GAAQ,SAAA;AAAA;;;;;;;;;;;cAaJ,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabPanelProps } from "../../types/dist/index.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { ViewProps, ViewStyle } from "react-native";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Tabs/TabPanel.d.ts
|
|
7
|
+
interface TabPanelProps extends Omit<UniversalTabPanelProps, 'className'>, Omit<ViewProps, 'style' | 'children'> {
|
|
8
|
+
children: UniversalTabPanelProps['children'];
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* **⚙️ TabPanel**
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* Content associated with a tab id. Only the panel whose `tabId` matches the current
|
|
16
|
+
* selection is rendered.
|
|
17
|
+
*
|
|
18
|
+
* @category Navigation
|
|
19
|
+
* @platform mobile
|
|
20
|
+
*/
|
|
21
|
+
declare const TabPanel: _$react.NamedExoticComponent<TabPanelProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TabPanel, type TabPanelProps };
|
|
24
|
+
//# sourceMappingURL=TabPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.d.ts","names":[],"sources":["../../../src/components/Tabs/TabPanel.tsx"],"mappings":";;;;;;UAOU,aAAA,SACA,IAAA,CAAK,sBAAA,gBAAsC,IAAA,CAAK,SAAA;EACxD,QAAA,EAAU,sBAAA;EACV,KAAA,GAAQ,SAAA;AAAA;;;;;;;;;;;cAaJ,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useTabSelectionContext } from "./tabsContexts.js";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Tabs/TabPanel.tsx
|
|
7
|
+
/**
|
|
8
|
+
* **⚙️ TabPanel**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* Content associated with a tab id. Only the panel whose `tabId` matches the current
|
|
12
|
+
* selection is rendered.
|
|
13
|
+
*
|
|
14
|
+
* @category Navigation
|
|
15
|
+
* @platform mobile
|
|
16
|
+
*/
|
|
17
|
+
const TabPanel = memo(function TabPanel({ tabId, children, style, ...viewProps }) {
|
|
18
|
+
const { selectedId } = useTabSelectionContext();
|
|
19
|
+
if (selectedId !== tabId) return null;
|
|
20
|
+
return /* @__PURE__ */ jsx(View, {
|
|
21
|
+
accessibilityRole: "none",
|
|
22
|
+
style,
|
|
23
|
+
...viewProps,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
TabPanel.displayName = "TabPanel";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { TabPanel };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=TabPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.js","names":[],"sources":["../../../src/components/Tabs/TabPanel.tsx"],"sourcesContent":["import type { UniversalTabPanelProps } from '@yahoo/uds-types';\nimport { memo } from 'react';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\n\nimport { useTabSelectionContext } from './tabsContexts';\n\ninterface TabPanelProps\n extends Omit<UniversalTabPanelProps, 'className'>, Omit<ViewProps, 'style' | 'children'> {\n children: UniversalTabPanelProps['children'];\n style?: ViewStyle;\n}\n\n/**\n * **⚙️ TabPanel**\n *\n * @description\n * Content associated with a tab id. Only the panel whose `tabId` matches the current\n * selection is rendered.\n *\n * @category Navigation\n * @platform mobile\n */\nconst TabPanel = memo(function TabPanel({ tabId, children, style, ...viewProps }: TabPanelProps) {\n const { selectedId } = useTabSelectionContext();\n\n if (selectedId !== tabId) {\n return null;\n }\n\n return (\n <View accessibilityRole=\"none\" style={style} {...viewProps}>\n {children}\n </View>\n );\n});\n\nTabPanel.displayName = 'TabPanel';\n\nexport { TabPanel };\nexport type { TabPanelProps };\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAM,WAAW,KAAK,SAAS,SAAS,EAAE,OAAO,UAAU,OAAO,GAAG,aAA4B;CAC/F,MAAM,EAAE,eAAe,wBAAwB;AAE/C,KAAI,eAAe,MACjB,QAAO;AAGT,QACE,oBAAC,MAAD;EAAM,mBAAkB;EAAc;EAAO,GAAI;EAC9C;EACI,CAAA;EAET;AAEF,SAAS,cAAc"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Tabs_tabsContexts = require("./tabsContexts.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
8
|
+
/**
|
|
9
|
+
* **⚙️ Tabs**
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* Organizes content into sections with a tab list and tab panels. Supports `primary` and
|
|
13
|
+
* `secondary` variants. When `reduceMotion` is false, a sliding indicator animates between
|
|
14
|
+
* tabs (240ms, cubic-bezier(0.2, 0, 0, 1)) to match web UDS.
|
|
15
|
+
*
|
|
16
|
+
* @category Navigation
|
|
17
|
+
* @platform mobile
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { Tabs, TabList, Tab, TabPanel } from '@yahoo/uds-mobile/Tabs';
|
|
22
|
+
*
|
|
23
|
+
* <Tabs variant="primary" defaultSelectedId="home">
|
|
24
|
+
* <TabList accessibilityLabel="Main">
|
|
25
|
+
* <Tab value="home">Home</Tab>
|
|
26
|
+
* <Tab value="about">About</Tab>
|
|
27
|
+
* </TabList>
|
|
28
|
+
* <TabPanel tabId="home">Home content</TabPanel>
|
|
29
|
+
* <TabPanel tabId="about">About content</TabPanel>
|
|
30
|
+
* </Tabs>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
const Tabs = (0, react.memo)(function Tabs({ children, variant = "primary", reduceMotion = false, defaultSelectedId, selectedId, onSelectionChange }) {
|
|
34
|
+
const visual = (0, react.useMemo)(() => ({
|
|
35
|
+
variant,
|
|
36
|
+
reduceMotion
|
|
37
|
+
}), [variant, reduceMotion]);
|
|
38
|
+
const selection = require_components_Tabs_tabsContexts.useTabSelectionState({
|
|
39
|
+
defaultSelectedId,
|
|
40
|
+
selectedId,
|
|
41
|
+
onSelectionChange
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Tabs_tabsContexts.TabsVisualContext.Provider, {
|
|
44
|
+
value: visual,
|
|
45
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Tabs_tabsContexts.TabSelectionContext.Provider, {
|
|
46
|
+
value: selection,
|
|
47
|
+
children
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
Tabs.displayName = "Tabs";
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.Tabs = Tabs;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsProps } from "../../types/dist/index.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Tabs/Tabs.d.ts
|
|
6
|
+
interface TabsProps extends UniversalTabsProps {}
|
|
7
|
+
/**
|
|
8
|
+
* **⚙️ Tabs**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* Organizes content into sections with a tab list and tab panels. Supports `primary` and
|
|
12
|
+
* `secondary` variants. When `reduceMotion` is false, a sliding indicator animates between
|
|
13
|
+
* tabs (240ms, cubic-bezier(0.2, 0, 0, 1)) to match web UDS.
|
|
14
|
+
*
|
|
15
|
+
* @category Navigation
|
|
16
|
+
* @platform mobile
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { Tabs, TabList, Tab, TabPanel } from '@yahoo/uds-mobile/Tabs';
|
|
21
|
+
*
|
|
22
|
+
* <Tabs variant="primary" defaultSelectedId="home">
|
|
23
|
+
* <TabList accessibilityLabel="Main">
|
|
24
|
+
* <Tab value="home">Home</Tab>
|
|
25
|
+
* <Tab value="about">About</Tab>
|
|
26
|
+
* </TabList>
|
|
27
|
+
* <TabPanel tabId="home">Home content</TabPanel>
|
|
28
|
+
* <TabPanel tabId="about">About content</TabPanel>
|
|
29
|
+
* </Tabs>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const Tabs: _$react.NamedExoticComponent<TabsProps>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Tabs, type TabsProps };
|
|
35
|
+
//# sourceMappingURL=Tabs.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.cts","names":[],"sources":["../../../src/components/Tabs/Tabs.tsx"],"mappings":";;;;;UAMU,SAAA,SAAkB,kBAAA;;AAN+B;;;;;AAMb;;;;;;;;;;;;;;;;;;;cA2BxC,IAAA,EAAI,OAAA,CAAA,oBAAA,CAAA,SAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsProps } from "../../types/dist/index.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Tabs/Tabs.d.ts
|
|
6
|
+
interface TabsProps extends UniversalTabsProps {}
|
|
7
|
+
/**
|
|
8
|
+
* **⚙️ Tabs**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* Organizes content into sections with a tab list and tab panels. Supports `primary` and
|
|
12
|
+
* `secondary` variants. When `reduceMotion` is false, a sliding indicator animates between
|
|
13
|
+
* tabs (240ms, cubic-bezier(0.2, 0, 0, 1)) to match web UDS.
|
|
14
|
+
*
|
|
15
|
+
* @category Navigation
|
|
16
|
+
* @platform mobile
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { Tabs, TabList, Tab, TabPanel } from '@yahoo/uds-mobile/Tabs';
|
|
21
|
+
*
|
|
22
|
+
* <Tabs variant="primary" defaultSelectedId="home">
|
|
23
|
+
* <TabList accessibilityLabel="Main">
|
|
24
|
+
* <Tab value="home">Home</Tab>
|
|
25
|
+
* <Tab value="about">About</Tab>
|
|
26
|
+
* </TabList>
|
|
27
|
+
* <TabPanel tabId="home">Home content</TabPanel>
|
|
28
|
+
* <TabPanel tabId="about">About content</TabPanel>
|
|
29
|
+
* </Tabs>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const Tabs: _$react.NamedExoticComponent<TabsProps>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Tabs, type TabsProps };
|
|
35
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","names":[],"sources":["../../../src/components/Tabs/Tabs.tsx"],"mappings":";;;;;UAMU,SAAA,SAAkB,kBAAA;;AAN+B;;;;;AAMb;;;;;;;;;;;;;;;;;;;cA2BxC,IAAA,EAAI,OAAA,CAAA,oBAAA,CAAA,SAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { TabSelectionContext, TabsVisualContext, useTabSelectionState } from "./tabsContexts.js";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
6
|
+
/**
|
|
7
|
+
* **⚙️ Tabs**
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Organizes content into sections with a tab list and tab panels. Supports `primary` and
|
|
11
|
+
* `secondary` variants. When `reduceMotion` is false, a sliding indicator animates between
|
|
12
|
+
* tabs (240ms, cubic-bezier(0.2, 0, 0, 1)) to match web UDS.
|
|
13
|
+
*
|
|
14
|
+
* @category Navigation
|
|
15
|
+
* @platform mobile
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { Tabs, TabList, Tab, TabPanel } from '@yahoo/uds-mobile/Tabs';
|
|
20
|
+
*
|
|
21
|
+
* <Tabs variant="primary" defaultSelectedId="home">
|
|
22
|
+
* <TabList accessibilityLabel="Main">
|
|
23
|
+
* <Tab value="home">Home</Tab>
|
|
24
|
+
* <Tab value="about">About</Tab>
|
|
25
|
+
* </TabList>
|
|
26
|
+
* <TabPanel tabId="home">Home content</TabPanel>
|
|
27
|
+
* <TabPanel tabId="about">About content</TabPanel>
|
|
28
|
+
* </Tabs>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
const Tabs = memo(function Tabs({ children, variant = "primary", reduceMotion = false, defaultSelectedId, selectedId, onSelectionChange }) {
|
|
32
|
+
const visual = useMemo(() => ({
|
|
33
|
+
variant,
|
|
34
|
+
reduceMotion
|
|
35
|
+
}), [variant, reduceMotion]);
|
|
36
|
+
const selection = useTabSelectionState({
|
|
37
|
+
defaultSelectedId,
|
|
38
|
+
selectedId,
|
|
39
|
+
onSelectionChange
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ jsx(TabsVisualContext.Provider, {
|
|
42
|
+
value: visual,
|
|
43
|
+
children: /* @__PURE__ */ jsx(TabSelectionContext.Provider, {
|
|
44
|
+
value: selection,
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
Tabs.displayName = "Tabs";
|
|
50
|
+
//#endregion
|
|
51
|
+
export { Tabs };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import type { UniversalTabsProps } from '@yahoo/uds-types';\nimport { memo, useMemo } from 'react';\n\nimport { TabSelectionContext, TabsVisualContext, useTabSelectionState } from './tabsContexts';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- alias for doc extraction / parity with web\ninterface TabsProps extends UniversalTabsProps {}\n\n/**\n * **⚙️ Tabs**\n *\n * @description\n * Organizes content into sections with a tab list and tab panels. Supports `primary` and\n * `secondary` variants. When `reduceMotion` is false, a sliding indicator animates between\n * tabs (240ms, cubic-bezier(0.2, 0, 0, 1)) to match web UDS.\n *\n * @category Navigation\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Tabs, TabList, Tab, TabPanel } from '@yahoo/uds-mobile/Tabs';\n *\n * <Tabs variant=\"primary\" defaultSelectedId=\"home\">\n * <TabList accessibilityLabel=\"Main\">\n * <Tab value=\"home\">Home</Tab>\n * <Tab value=\"about\">About</Tab>\n * </TabList>\n * <TabPanel tabId=\"home\">Home content</TabPanel>\n * <TabPanel tabId=\"about\">About content</TabPanel>\n * </Tabs>\n * ```\n */\nconst Tabs = memo(function Tabs({\n children,\n variant = 'primary',\n reduceMotion = false,\n defaultSelectedId,\n selectedId,\n onSelectionChange,\n}: TabsProps) {\n const visual = useMemo(() => ({ variant, reduceMotion }), [variant, reduceMotion]);\n const selection = useTabSelectionState({\n defaultSelectedId,\n selectedId,\n onSelectionChange,\n });\n\n return (\n <TabsVisualContext.Provider value={visual}>\n <TabSelectionContext.Provider value={selection}>{children}</TabSelectionContext.Provider>\n </TabsVisualContext.Provider>\n );\n});\n\nTabs.displayName = 'Tabs';\n\nexport { Tabs };\nexport type { TabsProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,OAAO,KAAK,SAAS,KAAK,EAC9B,UACA,UAAU,WACV,eAAe,OACf,mBACA,YACA,qBACY;CACZ,MAAM,SAAS,eAAe;EAAE;EAAS;EAAc,GAAG,CAAC,SAAS,aAAa,CAAC;CAClF,MAAM,YAAY,qBAAqB;EACrC;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YACjC,oBAAC,oBAAoB,UAArB;GAA8B,OAAO;GAAY;GAAwC,CAAA;EAC9D,CAAA;EAE/B;AAEF,KAAK,cAAc"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Tabs_Tab = require("./Tab.cjs");
|
|
4
|
+
const require_components_Tabs_TabList = require("./TabList.cjs");
|
|
5
|
+
const require_components_Tabs_TabPanel = require("./TabPanel.cjs");
|
|
6
|
+
const require_components_Tabs_Tabs = require("./Tabs.cjs");
|
|
7
|
+
exports.Tab = require_components_Tabs_Tab.Tab;
|
|
8
|
+
exports.TabList = require_components_Tabs_TabList.TabList;
|
|
9
|
+
exports.TabPanel = require_components_Tabs_TabPanel.TabPanel;
|
|
10
|
+
exports.Tabs = require_components_Tabs_Tabs.Tabs;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsVariant } from "../../types/dist/index.cjs";
|
|
3
|
+
import { Tab, TabProps } from "./Tab.cjs";
|
|
4
|
+
import { TabList, TabListProps } from "./TabList.cjs";
|
|
5
|
+
import { TabPanel, TabPanelProps } from "./TabPanel.cjs";
|
|
6
|
+
import { Tabs, TabsProps } from "./Tabs.cjs";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Tabs/index.d.ts
|
|
9
|
+
/** @alias {@link UniversalTabsVariant} — matches web `TabsVariant` naming */
|
|
10
|
+
type TabsVariant = UniversalTabsVariant;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TabsVariant, type UniversalTabsVariant };
|
|
13
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/components/Tabs/index.ts"],"mappings":";;;;;;;;;KAQY,WAAA,GAAc,oBAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsVariant } from "../../types/dist/index.js";
|
|
3
|
+
import { Tab, TabProps } from "./Tab.js";
|
|
4
|
+
import { TabList, TabListProps } from "./TabList.js";
|
|
5
|
+
import { TabPanel, TabPanelProps } from "./TabPanel.js";
|
|
6
|
+
import { Tabs, TabsProps } from "./Tabs.js";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Tabs/index.d.ts
|
|
9
|
+
/** @alias {@link UniversalTabsVariant} — matches web `TabsVariant` naming */
|
|
10
|
+
type TabsVariant = UniversalTabsVariant;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TabsVariant, type UniversalTabsVariant };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/Tabs/index.ts"],"mappings":";;;;;;;;;KAQY,WAAA,GAAc,oBAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region src/components/Tabs/tabTheme.ts
|
|
4
|
+
function tabComponentPath(visual, active, layer, state) {
|
|
5
|
+
return `tab/variant/${visual}/active/${active}/${layer === "rootText" ? "rootText" : layer}/${state}`;
|
|
6
|
+
}
|
|
7
|
+
/** Default tab dimensions / spacing from tokens (`tab/size/default/...`). */
|
|
8
|
+
function getTabSizeLayerStyle(theme, layer) {
|
|
9
|
+
const path = `tab/size/default/${layer}/rest`;
|
|
10
|
+
const s = theme.components[path];
|
|
11
|
+
return s && typeof s === "object" ? s : {};
|
|
12
|
+
}
|
|
13
|
+
/** Variant + interaction layer (active on/off, pressed/rest). */
|
|
14
|
+
function getTabLayerStyle(theme, visual, active, layer, state) {
|
|
15
|
+
const path = tabComponentPath(visual, active, layer, state);
|
|
16
|
+
const s = theme.components[path];
|
|
17
|
+
return s && typeof s === "object" ? s : {};
|
|
18
|
+
}
|
|
19
|
+
/** Size tokens + variant state (matches web stacking size + variant classes). */
|
|
20
|
+
function getMergedTabLayerStyle(theme, visual, active, layer, state) {
|
|
21
|
+
return {
|
|
22
|
+
...getTabSizeLayerStyle(theme, layer === "rootText" ? "rootText" : layer === "icon" ? "icon" : "root"),
|
|
23
|
+
...getTabLayerStyle(theme, visual, active, layer, state)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.getMergedTabLayerStyle = getMergedTabLayerStyle;
|
|
28
|
+
exports.getTabLayerStyle = getTabLayerStyle;
|
|
29
|
+
exports.getTabSizeLayerStyle = getTabSizeLayerStyle;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsVariant } from "../../types/dist/index.cjs";
|
|
3
|
+
import { TextStyle, ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Tabs/tabTheme.d.ts
|
|
6
|
+
type TabActiveState = 'on' | 'off';
|
|
7
|
+
type TabLayer = 'root' | 'rootText' | 'icon';
|
|
8
|
+
type InteractionState = 'rest' | 'pressed';
|
|
9
|
+
/** Default tab dimensions / spacing from tokens (`tab/size/default/...`). */
|
|
10
|
+
declare function getTabSizeLayerStyle(theme: {
|
|
11
|
+
components: Record<string, any>;
|
|
12
|
+
}, layer: 'root' | 'rootText' | 'icon'): ViewStyle | TextStyle;
|
|
13
|
+
/** Variant + interaction layer (active on/off, pressed/rest). */
|
|
14
|
+
declare function getTabLayerStyle(theme: {
|
|
15
|
+
components: Record<string, any>;
|
|
16
|
+
}, visual: UniversalTabsVariant, active: TabActiveState, layer: TabLayer, state: InteractionState): ViewStyle | TextStyle;
|
|
17
|
+
/** Size tokens + variant state (matches web stacking size + variant classes). */
|
|
18
|
+
declare function getMergedTabLayerStyle(theme: {
|
|
19
|
+
components: Record<string, any>;
|
|
20
|
+
}, visual: UniversalTabsVariant, active: TabActiveState, layer: TabLayer, state: InteractionState): ViewStyle | TextStyle;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getMergedTabLayerStyle, getTabLayerStyle, getTabSizeLayerStyle };
|
|
23
|
+
//# sourceMappingURL=tabTheme.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabTheme.d.cts","names":[],"sources":["../../../src/components/Tabs/tabTheme.ts"],"mappings":";;;;;KAGK,cAAA;AAAA,KACA,QAAA;AAAA,KACA,gBAAA;;iBAaW,oBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,KAAA,iCACC,SAAA,GAAY,SAAA;AAnBI;AAAA,iBA0BH,gBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,MAAA,EAAQ,oBAAA,EACR,MAAA,EAAQ,cAAA,EACR,KAAA,EAAO,QAAA,EACP,KAAA,EAAO,gBAAA,GACN,SAAA,GAAY,SAAA;;iBAOC,sBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,MAAA,EAAQ,oBAAA,EACR,MAAA,EAAQ,cAAA,EACR,KAAA,EAAO,QAAA,EACP,KAAA,EAAO,gBAAA,GACN,SAAA,GAAY,SAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabsVariant } from "../../types/dist/index.js";
|
|
3
|
+
import { TextStyle, ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Tabs/tabTheme.d.ts
|
|
6
|
+
type TabActiveState = 'on' | 'off';
|
|
7
|
+
type TabLayer = 'root' | 'rootText' | 'icon';
|
|
8
|
+
type InteractionState = 'rest' | 'pressed';
|
|
9
|
+
/** Default tab dimensions / spacing from tokens (`tab/size/default/...`). */
|
|
10
|
+
declare function getTabSizeLayerStyle(theme: {
|
|
11
|
+
components: Record<string, any>;
|
|
12
|
+
}, layer: 'root' | 'rootText' | 'icon'): ViewStyle | TextStyle;
|
|
13
|
+
/** Variant + interaction layer (active on/off, pressed/rest). */
|
|
14
|
+
declare function getTabLayerStyle(theme: {
|
|
15
|
+
components: Record<string, any>;
|
|
16
|
+
}, visual: UniversalTabsVariant, active: TabActiveState, layer: TabLayer, state: InteractionState): ViewStyle | TextStyle;
|
|
17
|
+
/** Size tokens + variant state (matches web stacking size + variant classes). */
|
|
18
|
+
declare function getMergedTabLayerStyle(theme: {
|
|
19
|
+
components: Record<string, any>;
|
|
20
|
+
}, visual: UniversalTabsVariant, active: TabActiveState, layer: TabLayer, state: InteractionState): ViewStyle | TextStyle;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getMergedTabLayerStyle, getTabLayerStyle, getTabSizeLayerStyle };
|
|
23
|
+
//# sourceMappingURL=tabTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabTheme.d.ts","names":[],"sources":["../../../src/components/Tabs/tabTheme.ts"],"mappings":";;;;;KAGK,cAAA;AAAA,KACA,QAAA;AAAA,KACA,gBAAA;;iBAaW,oBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,KAAA,iCACC,SAAA,GAAY,SAAA;AAnBI;AAAA,iBA0BH,gBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,MAAA,EAAQ,oBAAA,EACR,MAAA,EAAQ,cAAA,EACR,KAAA,EAAO,QAAA,EACP,KAAA,EAAO,gBAAA,GACN,SAAA,GAAY,SAAA;;iBAOC,sBAAA,CAEd,KAAA;EAAS,UAAA,EAAY,MAAA;AAAA,GACrB,MAAA,EAAQ,oBAAA,EACR,MAAA,EAAQ,cAAA,EACR,KAAA,EAAO,QAAA,EACP,KAAA,EAAO,gBAAA,GACN,SAAA,GAAY,SAAA"}
|