@tamagui/tabs 3.0.0-beta.1313.1 → 3.0.0-beta.1341.1

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/Tabs.cjs CHANGED
@@ -42,32 +42,23 @@ var import_core = require("@tamagui/core");
42
42
  var import_group = require("@tamagui/group");
43
43
  var import_helpers = require("@tamagui/helpers");
44
44
  var import_roving_focus = require("@tamagui/roving-focus");
45
- var import_size = require("@tamagui/size");
46
45
  var import_tabs_headless = require("@tamagui/tabs-headless");
47
46
  var import_web = require("@tamagui/web");
48
47
  var React = __toESM(require("react"), 1);
49
48
  var import_StyledContext = require("./StyledContext.cjs");
50
49
  var import_jsx_runtime = require("react/jsx-runtime");
51
50
  const TABS_CONTEXT = "TabsContext";
52
- const TabsFrame = (0, import_core.styled)(import_core.View, {
53
- displayName: "Tabs",
54
- context: import_size.SizeContext
55
- });
51
+ const TabsFrame = (0, import_core.styled)(import_core.View, { displayName: "Tabs" });
56
52
  const TabsListFrame = (0, import_core.styled)(import_group.Group, {
57
53
  displayName: "TabsList",
58
- context: import_size.SizeContext,
59
54
  role: "tablist"
60
55
  });
61
56
  const TabsTabFrame = (0, import_core.styled)(import_core.View, {
62
57
  displayName: "TabsTrigger",
63
- context: import_size.SizeContext,
64
58
  role: "tab",
65
59
  variants: { disabled: { true: { pointerEvents: "none" } } }
66
60
  });
67
- const TabsContentFrame = (0, import_core.styled)(import_core.View, {
68
- displayName: "TabsContent",
69
- context: import_size.SizeContext
70
- });
61
+ const TabsContentFrame = (0, import_core.styled)(import_core.View, { displayName: "TabsContent" });
71
62
  const TabsListDisabledContext = React.createContext(false);
72
63
  const TabsList = (0, import_core.createStyledHOC)(TabsListFrame, function TabsList2(props, forwardedRef) {
73
64
  const { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;
@@ -167,7 +158,6 @@ const TabsTab = (0, import_core.createStyledHOC)(TabsTabFrame, function TabsTab2
167
158
  }),
168
159
  ...tabA11yProps,
169
160
  theme: isSelected ? activeTheme ?? null : null,
170
- size: context.size,
171
161
  ...groupItemProps,
172
162
  ...triggerProps,
173
163
  style: [triggerProps.style, isSelected && activeStyle],
@@ -208,7 +198,7 @@ const TabsContent = (0, import_core.createStyledHOC)(TabsContentFrame, function
208
198
  }, value);
209
199
  });
210
200
  const TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(props, forwardedRef) {
211
- const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size = true, ...tabsProps } = props;
201
+ const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
212
202
  const { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = (0, import_tabs_headless.useTabs)({
213
203
  value: valueProp,
214
204
  onValueChange,
@@ -217,26 +207,22 @@ const TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(
217
207
  dir,
218
208
  activationMode
219
209
  });
220
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_size.SizeContext.Provider, {
221
- size,
222
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
223
- scope: __scopeTabs,
224
- baseId,
225
- value,
226
- onChange: setValue,
227
- orientation,
228
- dir: direction,
229
- activationMode,
230
- size,
231
- registerTrigger,
232
- triggersCount,
233
- unregisterTrigger,
234
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
235
- direction,
236
- ...headlessTabsProps,
237
- ...tabsProps,
238
- ref: forwardedRef
239
- })
210
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
211
+ scope: __scopeTabs,
212
+ baseId,
213
+ value,
214
+ onChange: setValue,
215
+ orientation,
216
+ dir: direction,
217
+ activationMode,
218
+ registerTrigger,
219
+ triggersCount,
220
+ unregisterTrigger,
221
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
222
+ direction,
223
+ ...headlessTabsProps,
224
+ ...tabsProps,
225
+ ref: forwardedRef
240
226
  })
241
227
  });
242
228
  });
@@ -45,31 +45,22 @@ var import_core = require("@tamagui/core");
45
45
  var import_group = require("@tamagui/group");
46
46
  var import_helpers = require("@tamagui/helpers");
47
47
  var import_roving_focus = require("@tamagui/roving-focus");
48
- var import_size = require("@tamagui/size");
49
48
  var import_tabs_headless = require("@tamagui/tabs-headless");
50
49
  var import_web = require("@tamagui/web");
51
50
  var React = __toESM(require("react"), 1);
52
51
  var import_StyledContext = require("./StyledContext.native.js");
53
52
  var TABS_CONTEXT = "TabsContext";
54
- var TabsFrame = (0, import_core.styled)(import_core.View, {
55
- displayName: "Tabs",
56
- context: import_size.SizeContext
57
- });
53
+ var TabsFrame = (0, import_core.styled)(import_core.View, { displayName: "Tabs" });
58
54
  var TabsListFrame = (0, import_core.styled)(import_group.Group, {
59
55
  displayName: "TabsList",
60
- context: import_size.SizeContext,
61
56
  role: "tablist"
62
57
  });
63
58
  var TabsTabFrame = (0, import_core.styled)(import_core.View, {
64
59
  displayName: "TabsTrigger",
65
- context: import_size.SizeContext,
66
60
  role: "tab",
67
61
  variants: { disabled: { true: { pointerEvents: "none" } } }
68
62
  });
69
- var TabsContentFrame = (0, import_core.styled)(import_core.View, {
70
- displayName: "TabsContent",
71
- context: import_size.SizeContext
72
- });
63
+ var TabsContentFrame = (0, import_core.styled)(import_core.View, { displayName: "TabsContent" });
73
64
  var TabsListDisabledContext = /* @__PURE__ */ React.createContext(false);
74
65
  var TabsList = (0, import_core.createStyledHOC)(TabsListFrame, function TabsList2(props, forwardedRef) {
75
66
  var { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;
@@ -175,7 +166,6 @@ var TabsTab = (0, import_core.createStyledHOC)(TabsTabFrame, function TabsTab2(p
175
166
  }),
176
167
  ...tabA11yProps,
177
168
  theme: isSelected ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
178
- size: context.size,
179
169
  ...groupItemProps,
180
170
  ...triggerProps,
181
171
  style: [triggerProps.style, isSelected && activeStyle],
@@ -216,7 +206,7 @@ var TabsContent = (0, import_core.createStyledHOC)(TabsContentFrame, function Ta
216
206
  }, value);
217
207
  });
218
208
  var TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(props, forwardedRef) {
219
- var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size = true, ...tabsProps } = props;
209
+ var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
220
210
  var { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = (0, import_tabs_headless.useTabs)({
221
211
  value: valueProp,
222
212
  onValueChange,
@@ -225,26 +215,22 @@ var TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(pr
225
215
  dir,
226
216
  activationMode
227
217
  });
228
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_size.SizeContext.Provider, {
229
- size,
230
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
231
- scope: __scopeTabs,
232
- baseId,
233
- value,
234
- onChange: setValue,
235
- orientation,
236
- dir: direction,
237
- activationMode,
238
- size,
239
- registerTrigger,
240
- triggersCount,
241
- unregisterTrigger,
242
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
243
- direction,
244
- ...headlessTabsProps,
245
- ...tabsProps,
246
- ref: forwardedRef
247
- })
218
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
219
+ scope: __scopeTabs,
220
+ baseId,
221
+ value,
222
+ onChange: setValue,
223
+ orientation,
224
+ dir: direction,
225
+ activationMode,
226
+ registerTrigger,
227
+ triggersCount,
228
+ unregisterTrigger,
229
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
230
+ direction,
231
+ ...headlessTabsProps,
232
+ ...tabsProps,
233
+ ref: forwardedRef
248
234
  })
249
235
  });
250
236
  });
@@ -45,31 +45,22 @@ var import_core = require("@tamagui/core");
45
45
  var import_group = require("@tamagui/group");
46
46
  var import_helpers = require("@tamagui/helpers");
47
47
  var import_roving_focus = require("@tamagui/roving-focus");
48
- var import_size = require("@tamagui/size");
49
48
  var import_tabs_headless = require("@tamagui/tabs-headless");
50
49
  var import_web = require("@tamagui/web");
51
50
  var React = __toESM(require("react"), 1);
52
51
  var import_StyledContext = require("./StyledContext.native.js");
53
52
  var TABS_CONTEXT = "TabsContext";
54
- var TabsFrame = (0, import_core.styled)(import_core.View, {
55
- displayName: "Tabs",
56
- context: import_size.SizeContext
57
- });
53
+ var TabsFrame = (0, import_core.styled)(import_core.View, { displayName: "Tabs" });
58
54
  var TabsListFrame = (0, import_core.styled)(import_group.Group, {
59
55
  displayName: "TabsList",
60
- context: import_size.SizeContext,
61
56
  role: "tablist"
62
57
  });
63
58
  var TabsTabFrame = (0, import_core.styled)(import_core.View, {
64
59
  displayName: "TabsTrigger",
65
- context: import_size.SizeContext,
66
60
  role: "tab",
67
61
  variants: { disabled: { true: { pointerEvents: "none" } } }
68
62
  });
69
- var TabsContentFrame = (0, import_core.styled)(import_core.View, {
70
- displayName: "TabsContent",
71
- context: import_size.SizeContext
72
- });
63
+ var TabsContentFrame = (0, import_core.styled)(import_core.View, { displayName: "TabsContent" });
73
64
  var TabsListDisabledContext = /* @__PURE__ */ React.createContext(false);
74
65
  var TabsList = (0, import_core.createStyledHOC)(TabsListFrame, function TabsList2(props, forwardedRef) {
75
66
  var { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;
@@ -175,7 +166,6 @@ var TabsTab = (0, import_core.createStyledHOC)(TabsTabFrame, function TabsTab2(p
175
166
  }),
176
167
  ...tabA11yProps,
177
168
  theme: isSelected ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
178
- size: context.size,
179
169
  ...groupItemProps,
180
170
  ...triggerProps,
181
171
  style: [triggerProps.style, isSelected && activeStyle],
@@ -216,7 +206,7 @@ var TabsContent = (0, import_core.createStyledHOC)(TabsContentFrame, function Ta
216
206
  }, value);
217
207
  });
218
208
  var TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(props, forwardedRef) {
219
- var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size = true, ...tabsProps } = props;
209
+ var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
220
210
  var { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = (0, import_tabs_headless.useTabs)({
221
211
  value: valueProp,
222
212
  onValueChange,
@@ -225,26 +215,22 @@ var TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(pr
225
215
  dir,
226
216
  activationMode
227
217
  });
228
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_size.SizeContext.Provider, {
229
- size,
230
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
231
- scope: __scopeTabs,
232
- baseId,
233
- value,
234
- onChange: setValue,
235
- orientation,
236
- dir: direction,
237
- activationMode,
238
- size,
239
- registerTrigger,
240
- triggersCount,
241
- unregisterTrigger,
242
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
243
- direction,
244
- ...headlessTabsProps,
245
- ...tabsProps,
246
- ref: forwardedRef
247
- })
218
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {
219
+ scope: __scopeTabs,
220
+ baseId,
221
+ value,
222
+ onChange: setValue,
223
+ orientation,
224
+ dir: direction,
225
+ activationMode,
226
+ registerTrigger,
227
+ triggersCount,
228
+ unregisterTrigger,
229
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {
230
+ direction,
231
+ ...headlessTabsProps,
232
+ ...tabsProps,
233
+ ref: forwardedRef
248
234
  })
249
235
  });
250
236
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.native.js","names":[],"sources":["cjs/Tabs.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Tabs_exports = {};\n__export(Tabs_exports, {\n Tabs: () => Tabs2,\n TabsContent: () => TabsContent,\n TabsContentFrame: () => TabsContentFrame,\n TabsFrame: () => TabsFrame,\n TabsList: () => TabsList,\n TabsListFrame: () => TabsListFrame,\n TabsTab: () => TabsTab,\n TabsTabFrame: () => TabsTabFrame\n});\nmodule.exports = __toCommonJS(Tabs_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_group = require(\"@tamagui/group\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_roving_focus = require(\"@tamagui/roving-focus\");\nvar import_size = require(\"@tamagui/size\");\nvar import_tabs_headless = require(\"@tamagui/tabs-headless\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_StyledContext = require(\"./StyledContext\");\nvar TABS_CONTEXT = \"TabsContext\";\nvar TabsFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"Tabs\",\n context: import_size.SizeContext\n});\nvar TabsListFrame = (0, import_core.styled)(import_group.Group, {\n displayName: \"TabsList\",\n context: import_size.SizeContext,\n role: \"tablist\"\n});\nvar TabsTabFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"TabsTrigger\",\n context: import_size.SizeContext,\n role: \"tab\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar TabsContentFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"TabsContent\",\n context: import_size.SizeContext\n});\nvar TabsListDisabledContext = /* @__PURE__ */ React.createContext(false);\nvar TabsList = (0, import_core.createStyledHOC)(TabsListFrame, function TabsList2(props, forwardedRef) {\n var { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var { listProps: headlessListProps } = (0, import_tabs_headless.useTabsList)({\n orientation: context.orientation,\n disabled\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsListDisabledContext.Provider, {\n value: disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup, {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n asChild: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsListFrame, {\n ...headlessListProps,\n orientation: context.orientation,\n ref: forwardedRef,\n ...listProps,\n children\n })\n })\n });\n});\nvar TabsTab = (0, import_core.createStyledHOC)(TabsTabFrame, function TabsTab2(props, forwardedRef) {\n var { __scopeTabs, value, disabled: disabledProp, onInteraction, activeStyle, activeTheme, onLayout, onMouseEnter, onMouseLeave, onPress, onKeyDown, onFocus, onBlur, ...triggerProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var listDisabled = React.useContext(TabsListDisabledContext);\n var disabled = (disabledProp !== null && disabledProp !== void 0 ? disabledProp : listDisabled) === true;\n var groupItemProps = (0, import_group.useGroupItem)({\n disabled\n });\n var { isSelected, tabProps } = (0, import_tabs_headless.useTab)({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n disabled,\n activationMode: context.activationMode,\n onChange: context.onChange\n });\n var { onPress: activateOnPress, onKeyDown: activateOnKeyDown, onFocus: activateOnFocus, ...tabA11yProps } = tabProps;\n var [layout, setLayout] = React.useState(null);\n var triggerRef = React.useRef(null);\n var emitInteraction = (0, import_web.useEvent)(function(type, layout2) {\n onInteraction === null || onInteraction === void 0 ? void 0 : onInteraction(type, layout2);\n });\n React.useEffect(function() {\n context.registerTrigger();\n return function() {\n return context.unregisterTrigger();\n };\n }, []);\n React.useEffect(function() {\n if (!triggerRef.current || !import_constants.isWeb) return;\n var element = triggerRef.current;\n function updateTriggerSize() {\n var next = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop\n };\n setLayout(function(previous) {\n return previous && previous.width === next.width && previous.height === next.height && previous.x === next.x && previous.y === next.y ? previous : next;\n });\n }\n updateTriggerSize();\n var observer = new ResizeObserver(updateTriggerSize);\n observer.observe(element);\n var offsetParent = element.offsetParent;\n if (offsetParent) {\n observer.observe(offsetParent);\n }\n return function() {\n return observer.disconnect();\n };\n }, [\n context.triggersCount\n ]);\n React.useEffect(function() {\n if (isSelected && layout) {\n emitInteraction(\"select\", layout);\n }\n }, [\n emitInteraction,\n isSelected,\n layout\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup.Item, {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n asChild: true,\n tabIndex: disabled ? -1 : 0,\n active: isSelected,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsTabFrame, {\n onLayout: import_constants.isWeb ? onLayout : (0, import_helpers.composeEventHandlers)(onLayout, function(event) {\n setLayout(event.nativeEvent.layout);\n }),\n onMouseEnter: (0, import_helpers.composeEventHandlers)(onMouseEnter, function() {\n if (layout) {\n emitInteraction(\"hover\", layout);\n }\n }),\n onMouseLeave: (0, import_helpers.composeEventHandlers)(onMouseLeave, function() {\n emitInteraction(\"hover\", null);\n }),\n ...tabA11yProps,\n theme: isSelected ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,\n size: context.size,\n ...groupItemProps,\n ...triggerProps,\n // after triggerProps so active styles beat base styles from styled() skins\n style: [\n triggerProps.style,\n isSelected && activeStyle\n ],\n ref: (0, import_compose_refs.composeRefs)(forwardedRef, triggerRef),\n onPress: (0, import_helpers.composeEventHandlers)(onPress !== null && onPress !== void 0 ? onPress : void 0, activateOnPress),\n ...import_constants.isWeb && {\n onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, activateOnKeyDown),\n // emit the focus interaction before activating, matching the order\n // the indicator animations were built against\n onFocus: (0, import_helpers.composeEventHandlers)(onFocus, (0, import_helpers.composeEventHandlers)(function() {\n if (layout) {\n emitInteraction(\"focus\", layout);\n }\n }, activateOnFocus)),\n onBlur: (0, import_helpers.composeEventHandlers)(onBlur, function() {\n emitInteraction(\"focus\", null);\n })\n }\n })\n });\n});\nvar TabsContent = (0, import_core.createStyledHOC)(TabsContentFrame, function TabsContent2(props, forwardedRef) {\n var { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var { shouldMount, contentProps: headlessContentProps } = (0, import_tabs_headless.useTabContent)({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n orientation: context.orientation,\n forceMount\n });\n if (!shouldMount) {\n return null;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsContentFrame, {\n // @ts-ignore hidden is a web-only accessibility attribute\n ...headlessContentProps,\n ...contentProps,\n ref: forwardedRef,\n children\n }, value);\n});\nvar TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(props, forwardedRef) {\n var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = \"horizontal\", dir, activationMode = \"automatic\", size = true, ...tabsProps } = props;\n var { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = (0, import_tabs_headless.useTabs)({\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation,\n dir,\n activationMode\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_size.SizeContext.Provider, {\n size,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {\n scope: __scopeTabs,\n baseId,\n value,\n onChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n size,\n registerTrigger,\n triggersCount,\n unregisterTrigger,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {\n direction,\n ...headlessTabsProps,\n ...tabsProps,\n ref: forwardedRef\n })\n })\n });\n});\nvar Tabs2 = (0, import_helpers.withStaticProperties)(TabsComponent, {\n Frame: TabsFrame,\n List: TabsList,\n Tab: TabsTab,\n Content: TabsContent\n});\n//# sourceMappingURL=Tabs.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MA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qBAAqB,QAAO,CAAE;EAC9J,OAAO;EACP;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,YAAY,YAAY,UAAU;EACnF;EACA,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,qBAAqB,cAAc;GACvF,OAAO;GACP;GACA;GACA,UAAU;GACV;GACA,KAAK;GACL;GACA;GACA;GACA;GACA;GACA,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,WAAW;IAC/D;IACA,GAAG;IACH,GAAG;IACH,KAAK;GACP,CAAC;EACH,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,SAAS,GAAG,eAAe,qBAAoB,CAAE,eAAe;CAClE,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Tabs.native.js","names":[],"sources":["cjs/Tabs.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Tabs_exports = {};\n__export(Tabs_exports, {\n Tabs: () => Tabs2,\n TabsContent: () => TabsContent,\n TabsContentFrame: () => TabsContentFrame,\n TabsFrame: () => TabsFrame,\n TabsList: () => TabsList,\n TabsListFrame: () => TabsListFrame,\n TabsTab: () => TabsTab,\n TabsTabFrame: () => TabsTabFrame\n});\nmodule.exports = __toCommonJS(Tabs_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_group = require(\"@tamagui/group\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_roving_focus = require(\"@tamagui/roving-focus\");\nvar import_tabs_headless = require(\"@tamagui/tabs-headless\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_StyledContext = require(\"./StyledContext\");\nvar TABS_CONTEXT = \"TabsContext\";\nvar TabsFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"Tabs\"\n});\nvar TabsListFrame = (0, import_core.styled)(import_group.Group, {\n displayName: \"TabsList\",\n role: \"tablist\"\n});\nvar TabsTabFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"TabsTrigger\",\n role: \"tab\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar TabsContentFrame = (0, import_core.styled)(import_core.View, {\n displayName: \"TabsContent\"\n});\nvar TabsListDisabledContext = /* @__PURE__ */ React.createContext(false);\nvar TabsList = (0, import_core.createStyledHOC)(TabsListFrame, function TabsList2(props, forwardedRef) {\n var { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var { listProps: headlessListProps } = (0, import_tabs_headless.useTabsList)({\n orientation: context.orientation,\n disabled\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsListDisabledContext.Provider, {\n value: disabled,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup, {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n asChild: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsListFrame, {\n ...headlessListProps,\n orientation: context.orientation,\n ref: forwardedRef,\n ...listProps,\n children\n })\n })\n });\n});\nvar TabsTab = (0, import_core.createStyledHOC)(TabsTabFrame, function TabsTab2(props, forwardedRef) {\n var { __scopeTabs, value, disabled: disabledProp, onInteraction, activeStyle, activeTheme, onLayout, onMouseEnter, onMouseLeave, onPress, onKeyDown, onFocus, onBlur, ...triggerProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var listDisabled = React.useContext(TabsListDisabledContext);\n var disabled = (disabledProp !== null && disabledProp !== void 0 ? disabledProp : listDisabled) === true;\n var groupItemProps = (0, import_group.useGroupItem)({\n disabled\n });\n var { isSelected, tabProps } = (0, import_tabs_headless.useTab)({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n disabled,\n activationMode: context.activationMode,\n onChange: context.onChange\n });\n var { onPress: activateOnPress, onKeyDown: activateOnKeyDown, onFocus: activateOnFocus, ...tabA11yProps } = tabProps;\n var [layout, setLayout] = React.useState(null);\n var triggerRef = React.useRef(null);\n var emitInteraction = (0, import_web.useEvent)(function(type, layout2) {\n onInteraction === null || onInteraction === void 0 ? void 0 : onInteraction(type, layout2);\n });\n React.useEffect(function() {\n context.registerTrigger();\n return function() {\n return context.unregisterTrigger();\n };\n }, []);\n React.useEffect(function() {\n if (!triggerRef.current || !import_constants.isWeb) return;\n var element = triggerRef.current;\n function updateTriggerSize() {\n var next = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop\n };\n setLayout(function(previous) {\n return previous && previous.width === next.width && previous.height === next.height && previous.x === next.x && previous.y === next.y ? previous : next;\n });\n }\n updateTriggerSize();\n var observer = new ResizeObserver(updateTriggerSize);\n observer.observe(element);\n var offsetParent = element.offsetParent;\n if (offsetParent) {\n observer.observe(offsetParent);\n }\n return function() {\n return observer.disconnect();\n };\n }, [\n context.triggersCount\n ]);\n React.useEffect(function() {\n if (isSelected && layout) {\n emitInteraction(\"select\", layout);\n }\n }, [\n emitInteraction,\n isSelected,\n layout\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup.Item, {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n asChild: true,\n tabIndex: disabled ? -1 : 0,\n active: isSelected,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsTabFrame, {\n onLayout: import_constants.isWeb ? onLayout : (0, import_helpers.composeEventHandlers)(onLayout, function(event) {\n setLayout(event.nativeEvent.layout);\n }),\n onMouseEnter: (0, import_helpers.composeEventHandlers)(onMouseEnter, function() {\n if (layout) {\n emitInteraction(\"hover\", layout);\n }\n }),\n onMouseLeave: (0, import_helpers.composeEventHandlers)(onMouseLeave, function() {\n emitInteraction(\"hover\", null);\n }),\n ...tabA11yProps,\n theme: isSelected ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,\n ...groupItemProps,\n ...triggerProps,\n // after triggerProps so active styles beat base styles from styled() skins\n style: [\n triggerProps.style,\n isSelected && activeStyle\n ],\n ref: (0, import_compose_refs.composeRefs)(forwardedRef, triggerRef),\n onPress: (0, import_helpers.composeEventHandlers)(onPress !== null && onPress !== void 0 ? onPress : void 0, activateOnPress),\n ...import_constants.isWeb && {\n onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, activateOnKeyDown),\n // emit the focus interaction before activating, matching the order\n // the indicator animations were built against\n onFocus: (0, import_helpers.composeEventHandlers)(onFocus, (0, import_helpers.composeEventHandlers)(function() {\n if (layout) {\n emitInteraction(\"focus\", layout);\n }\n }, activateOnFocus)),\n onBlur: (0, import_helpers.composeEventHandlers)(onBlur, function() {\n emitInteraction(\"focus\", null);\n })\n }\n })\n });\n});\nvar TabsContent = (0, import_core.createStyledHOC)(TabsContentFrame, function TabsContent2(props, forwardedRef) {\n var { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n var context = (0, import_StyledContext.useTabsContext)(__scopeTabs);\n var { shouldMount, contentProps: headlessContentProps } = (0, import_tabs_headless.useTabContent)({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n orientation: context.orientation,\n forceMount\n });\n if (!shouldMount) {\n return null;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsContentFrame, {\n // @ts-ignore hidden is a web-only accessibility attribute\n ...headlessContentProps,\n ...contentProps,\n ref: forwardedRef,\n children\n }, value);\n});\nvar TabsComponent = (0, import_core.createStyledHOC)(TabsFrame, function Tabs(props, forwardedRef) {\n var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = \"horizontal\", dir, activationMode = \"automatic\", ...tabsProps } = props;\n var { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = (0, import_tabs_headless.useTabs)({\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation,\n dir,\n activationMode\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledContext.TabsProvider, {\n scope: __scopeTabs,\n baseId,\n value,\n onChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n registerTrigger,\n triggersCount,\n unregisterTrigger,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsFrame, {\n direction,\n ...headlessTabsProps,\n ...tabsProps,\n ref: forwardedRef\n })\n });\n});\nvar Tabs2 = (0, import_helpers.withStaticProperties)(TabsComponent, {\n Frame: TabsFrame,\n List: TabsList,\n Tab: TabsTab,\n Content: TabsContent\n});\n//# sourceMappingURL=Tabs.js.map\n"],"mappings":";;;AACA,IAAI,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AAc;CAClJ,IAAI,EAAE,OAAO,UAAU,QAAQ,WAAW,eAAe,iBAAiB,mBAAmB,WAAW,uBAAuB,GAAG,qBAAqB,QAAO,CAAE;EAC9J,OAAO;EACP;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,qBAAqB,cAAc;EACpF,OAAO;EACP;EACA;EACA,UAAU;EACV;EACA,KAAK;EACL;EACA;EACA;EACA;EACA,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,WAAW;GAC/D;GACA,GAAG;GACH,GAAG;GACH,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC;AACD,IAAI,SAAS,GAAG,eAAe,qBAAoB,CAAE,eAAe;CAClE,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;AACX,CAAC"}
package/dist/esm/Tabs.mjs CHANGED
@@ -4,7 +4,6 @@ import { View, createStyledHOC, styled } from "@tamagui/core";
4
4
  import { Group, useGroupItem } from "@tamagui/group";
5
5
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
6
6
  import { RovingFocusGroup } from "@tamagui/roving-focus";
7
- import { SizeContext } from "@tamagui/size";
8
7
  import { useTab, useTabContent, useTabs, useTabsList } from "@tamagui/tabs-headless";
9
8
  import { useEvent } from "@tamagui/web";
10
9
  import * as React from "react";
@@ -12,25 +11,17 @@ import { TabsProvider, useTabsContext } from "./StyledContext.mjs";
12
11
  import { jsx } from "react/jsx-runtime";
13
12
 
14
13
  const TABS_CONTEXT = "TabsContext";
15
- const TabsFrame = styled(View, {
16
- displayName: "Tabs",
17
- context: SizeContext
18
- });
14
+ const TabsFrame = styled(View, { displayName: "Tabs" });
19
15
  const TabsListFrame = styled(Group, {
20
16
  displayName: "TabsList",
21
- context: SizeContext,
22
17
  role: "tablist"
23
18
  });
24
19
  const TabsTabFrame = styled(View, {
25
20
  displayName: "TabsTrigger",
26
- context: SizeContext,
27
21
  role: "tab",
28
22
  variants: { disabled: { true: { pointerEvents: "none" } } }
29
23
  });
30
- const TabsContentFrame = styled(View, {
31
- displayName: "TabsContent",
32
- context: SizeContext
33
- });
24
+ const TabsContentFrame = styled(View, { displayName: "TabsContent" });
34
25
  const TabsListDisabledContext = React.createContext(false);
35
26
  const TabsList = createStyledHOC(TabsListFrame, function TabsList2(props, forwardedRef) {
36
27
  const { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;
@@ -130,7 +121,6 @@ const TabsTab = createStyledHOC(TabsTabFrame, function TabsTab2(props, forwarded
130
121
  }),
131
122
  ...tabA11yProps,
132
123
  theme: isSelected ? activeTheme ?? null : null,
133
- size: context.size,
134
124
  ...groupItemProps,
135
125
  ...triggerProps,
136
126
  style: [triggerProps.style, isSelected && activeStyle],
@@ -171,7 +161,7 @@ const TabsContent = createStyledHOC(TabsContentFrame, function TabsContent2(prop
171
161
  }, value);
172
162
  });
173
163
  const TabsComponent = createStyledHOC(TabsFrame, function Tabs(props, forwardedRef) {
174
- const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size = true, ...tabsProps } = props;
164
+ const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
175
165
  const { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = useTabs({
176
166
  value: valueProp,
177
167
  onValueChange,
@@ -180,26 +170,22 @@ const TabsComponent = createStyledHOC(TabsFrame, function Tabs(props, forwardedR
180
170
  dir,
181
171
  activationMode
182
172
  });
183
- return /* @__PURE__ */ jsx(SizeContext.Provider, {
184
- size,
185
- children: /* @__PURE__ */ jsx(TabsProvider, {
186
- scope: __scopeTabs,
187
- baseId,
188
- value,
189
- onChange: setValue,
190
- orientation,
191
- dir: direction,
192
- activationMode,
193
- size,
194
- registerTrigger,
195
- triggersCount,
196
- unregisterTrigger,
197
- children: /* @__PURE__ */ jsx(TabsFrame, {
198
- direction,
199
- ...headlessTabsProps,
200
- ...tabsProps,
201
- ref: forwardedRef
202
- })
173
+ return /* @__PURE__ */ jsx(TabsProvider, {
174
+ scope: __scopeTabs,
175
+ baseId,
176
+ value,
177
+ onChange: setValue,
178
+ orientation,
179
+ dir: direction,
180
+ activationMode,
181
+ registerTrigger,
182
+ triggersCount,
183
+ unregisterTrigger,
184
+ children: /* @__PURE__ */ jsx(TabsFrame, {
185
+ direction,
186
+ ...headlessTabsProps,
187
+ ...tabsProps,
188
+ ref: forwardedRef
203
189
  })
204
190
  });
205
191
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":[],"sources":["esm/Tabs.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { Group, useGroupItem } from \"@tamagui/group\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { RovingFocusGroup } from \"@tamagui/roving-focus\";\nimport { SizeContext } from \"@tamagui/size\";\nimport { useTab, useTabContent, useTabs, useTabsList } from \"@tamagui/tabs-headless\";\nimport { useEvent } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { TabsProvider, useTabsContext } from \"./StyledContext\";\nimport { jsx } from \"react/jsx-runtime\";\nconst TABS_CONTEXT = \"TabsContext\";\nconst TabsFrame = styled(View, {\n displayName: \"Tabs\",\n context: SizeContext\n});\nconst TabsListFrame = styled(Group, {\n displayName: \"TabsList\",\n context: SizeContext,\n role: \"tablist\"\n});\nconst TabsTabFrame = styled(View, {\n displayName: \"TabsTrigger\",\n context: SizeContext,\n role: \"tab\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst TabsContentFrame = styled(View, {\n displayName: \"TabsContent\",\n context: SizeContext\n});\nconst TabsListDisabledContext = React.createContext(false);\nconst TabsList = createStyledHOC(\n TabsListFrame,\n function TabsList2(props, forwardedRef) {\n const { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;\n const context = useTabsContext(__scopeTabs);\n const { listProps: headlessListProps } = useTabsList({\n orientation: context.orientation,\n disabled\n });\n return /* @__PURE__ */ jsx(TabsListDisabledContext.Provider, { value: disabled, children: /* @__PURE__ */ jsx(\n RovingFocusGroup,\n {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n asChild: true,\n children: /* @__PURE__ */ jsx(\n TabsListFrame,\n {\n ...headlessListProps,\n orientation: context.orientation,\n ref: forwardedRef,\n ...listProps,\n children\n }\n )\n }\n ) });\n }\n);\nconst TabsTab = createStyledHOC(\n TabsTabFrame,\n function TabsTab2(props, forwardedRef) {\n const {\n __scopeTabs,\n value,\n disabled: disabledProp,\n onInteraction,\n activeStyle,\n activeTheme,\n onLayout,\n onMouseEnter,\n onMouseLeave,\n onPress,\n onKeyDown,\n onFocus,\n onBlur,\n ...triggerProps\n } = props;\n const context = useTabsContext(__scopeTabs);\n const listDisabled = React.useContext(TabsListDisabledContext);\n const disabled = (disabledProp ?? listDisabled) === true;\n const groupItemProps = useGroupItem({ disabled });\n const { isSelected, tabProps } = useTab({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n disabled,\n activationMode: context.activationMode,\n onChange: context.onChange\n });\n const {\n onPress: activateOnPress,\n onKeyDown: activateOnKeyDown,\n onFocus: activateOnFocus,\n ...tabA11yProps\n } = tabProps;\n const [layout, setLayout] = React.useState(null);\n const triggerRef = React.useRef(null);\n const emitInteraction = useEvent(\n (type, layout2) => {\n onInteraction?.(type, layout2);\n }\n );\n React.useEffect(() => {\n context.registerTrigger();\n return () => context.unregisterTrigger();\n }, []);\n React.useEffect(() => {\n if (!triggerRef.current || !isWeb) return;\n const element = triggerRef.current;\n function updateTriggerSize() {\n const next = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop\n };\n setLayout(\n (previous) => previous && previous.width === next.width && previous.height === next.height && previous.x === next.x && previous.y === next.y ? previous : next\n );\n }\n updateTriggerSize();\n const observer = new ResizeObserver(updateTriggerSize);\n observer.observe(element);\n const offsetParent = element.offsetParent;\n if (offsetParent) {\n observer.observe(offsetParent);\n }\n return () => observer.disconnect();\n }, [context.triggersCount]);\n React.useEffect(() => {\n if (isSelected && layout) {\n emitInteraction(\"select\", layout);\n }\n }, [emitInteraction, isSelected, layout]);\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n asChild: true,\n tabIndex: disabled ? -1 : 0,\n active: isSelected,\n children: /* @__PURE__ */ jsx(\n TabsTabFrame,\n {\n onLayout: isWeb ? onLayout : composeEventHandlers(onLayout, (event) => {\n setLayout(event.nativeEvent.layout);\n }),\n onMouseEnter: composeEventHandlers(onMouseEnter, () => {\n if (layout) {\n emitInteraction(\"hover\", layout);\n }\n }),\n onMouseLeave: composeEventHandlers(onMouseLeave, () => {\n emitInteraction(\"hover\", null);\n }),\n ...tabA11yProps,\n theme: isSelected ? activeTheme ?? null : null,\n size: context.size,\n ...groupItemProps,\n ...triggerProps,\n style: [triggerProps.style, isSelected && activeStyle],\n ref: composeRefs(forwardedRef, triggerRef),\n onPress: composeEventHandlers(onPress ?? void 0, activateOnPress),\n ...isWeb && {\n onKeyDown: composeEventHandlers(onKeyDown, activateOnKeyDown),\n // emit the focus interaction before activating, matching the order\n // the indicator animations were built against\n onFocus: composeEventHandlers(\n onFocus,\n composeEventHandlers(() => {\n if (layout) {\n emitInteraction(\"focus\", layout);\n }\n }, activateOnFocus)\n ),\n onBlur: composeEventHandlers(onBlur, () => {\n emitInteraction(\"focus\", null);\n })\n }\n }\n )\n }\n );\n }\n);\nconst TabsContent = createStyledHOC(\n TabsContentFrame,\n function TabsContent2(props, forwardedRef) {\n const { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n const context = useTabsContext(__scopeTabs);\n const { shouldMount, contentProps: headlessContentProps } = useTabContent({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n orientation: context.orientation,\n forceMount\n });\n if (!shouldMount) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n TabsContentFrame,\n {\n ...headlessContentProps,\n ...contentProps,\n ref: forwardedRef,\n children\n },\n value\n );\n }\n);\nconst TabsComponent = createStyledHOC(\n TabsFrame,\n function Tabs(props, forwardedRef) {\n const {\n __scopeTabs,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n dir,\n activationMode = \"automatic\",\n size = true,\n ...tabsProps\n } = props;\n const {\n value,\n setValue,\n baseId,\n direction,\n triggersCount,\n registerTrigger,\n unregisterTrigger,\n tabsProps: headlessTabsProps\n } = useTabs({\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation,\n dir,\n activationMode\n });\n return /* @__PURE__ */ jsx(SizeContext.Provider, { size, children: /* @__PURE__ */ jsx(\n TabsProvider,\n {\n scope: __scopeTabs,\n baseId,\n value,\n onChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n size,\n registerTrigger,\n triggersCount,\n unregisterTrigger,\n children: /* @__PURE__ */ jsx(\n TabsFrame,\n {\n direction,\n ...headlessTabsProps,\n ...tabsProps,\n ref: forwardedRef\n }\n )\n }\n ) });\n }\n);\nconst Tabs2 = withStaticProperties(TabsComponent, {\n Frame: TabsFrame,\n List: TabsList,\n Tab: TabsTab,\n Content: TabsContent\n});\nexport {\n Tabs2 as Tabs,\n TabsContent,\n TabsContentFrame,\n TabsFrame,\n TabsList,\n TabsListFrame,\n TabsTab,\n TabsTabFrame\n};\n//# sourceMappingURL=Tabs.js.map\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,eAAe;AACrB,MAAM,YAAY,OAAO,MAAM;CAC7B,aAAa;CACb,SAAS;AACX,CAAC;AACD,MAAM,gBAAgB,OAAO,OAAO;CAClC,aAAa;CACb,SAAS;CACT,MAAM;AACR,CAAC;AACD,MAAM,eAAe,OAAO,MAAM;CAChC,aAAa;CACb,SA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GACA,UAAU;GACV;GACA,KAAK;GACL;GACA;GACA;GACA;GACA;GACA,UAA0B,oBACxB,WACA;IACE;IACA,GAAG;IACH,GAAG;IACH,KAAK;GACP,CACF;EACF,CACF;CAAE,CAAC;AACL,CACF;AACA,MAAM,QAAQ,qBAAqB,eAAe;CAChD,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Tabs.js","names":[],"sources":["esm/Tabs.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { Group, useGroupItem } from \"@tamagui/group\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { RovingFocusGroup } from \"@tamagui/roving-focus\";\nimport { useTab, useTabContent, useTabs, useTabsList } from \"@tamagui/tabs-headless\";\nimport { useEvent } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { TabsProvider, useTabsContext } from \"./StyledContext\";\nimport { jsx } from \"react/jsx-runtime\";\nconst TABS_CONTEXT = \"TabsContext\";\nconst TabsFrame = styled(View, {\n displayName: \"Tabs\"\n});\nconst TabsListFrame = styled(Group, {\n displayName: \"TabsList\",\n role: \"tablist\"\n});\nconst TabsTabFrame = styled(View, {\n displayName: \"TabsTrigger\",\n role: \"tab\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst TabsContentFrame = styled(View, {\n displayName: \"TabsContent\"\n});\nconst TabsListDisabledContext = React.createContext(false);\nconst TabsList = createStyledHOC(\n TabsListFrame,\n function TabsList2(props, forwardedRef) {\n const { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;\n const context = useTabsContext(__scopeTabs);\n const { listProps: headlessListProps } = useTabsList({\n orientation: context.orientation,\n disabled\n });\n return /* @__PURE__ */ jsx(TabsListDisabledContext.Provider, { value: disabled, children: /* @__PURE__ */ jsx(\n RovingFocusGroup,\n {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n asChild: true,\n children: /* @__PURE__ */ jsx(\n TabsListFrame,\n {\n ...headlessListProps,\n orientation: context.orientation,\n ref: forwardedRef,\n ...listProps,\n children\n }\n )\n }\n ) });\n }\n);\nconst TabsTab = createStyledHOC(\n TabsTabFrame,\n function TabsTab2(props, forwardedRef) {\n const {\n __scopeTabs,\n value,\n disabled: disabledProp,\n onInteraction,\n activeStyle,\n activeTheme,\n onLayout,\n onMouseEnter,\n onMouseLeave,\n onPress,\n onKeyDown,\n onFocus,\n onBlur,\n ...triggerProps\n } = props;\n const context = useTabsContext(__scopeTabs);\n const listDisabled = React.useContext(TabsListDisabledContext);\n const disabled = (disabledProp ?? listDisabled) === true;\n const groupItemProps = useGroupItem({ disabled });\n const { isSelected, tabProps } = useTab({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n disabled,\n activationMode: context.activationMode,\n onChange: context.onChange\n });\n const {\n onPress: activateOnPress,\n onKeyDown: activateOnKeyDown,\n onFocus: activateOnFocus,\n ...tabA11yProps\n } = tabProps;\n const [layout, setLayout] = React.useState(null);\n const triggerRef = React.useRef(null);\n const emitInteraction = useEvent(\n (type, layout2) => {\n onInteraction?.(type, layout2);\n }\n );\n React.useEffect(() => {\n context.registerTrigger();\n return () => context.unregisterTrigger();\n }, []);\n React.useEffect(() => {\n if (!triggerRef.current || !isWeb) return;\n const element = triggerRef.current;\n function updateTriggerSize() {\n const next = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop\n };\n setLayout(\n (previous) => previous && previous.width === next.width && previous.height === next.height && previous.x === next.x && previous.y === next.y ? previous : next\n );\n }\n updateTriggerSize();\n const observer = new ResizeObserver(updateTriggerSize);\n observer.observe(element);\n const offsetParent = element.offsetParent;\n if (offsetParent) {\n observer.observe(offsetParent);\n }\n return () => observer.disconnect();\n }, [context.triggersCount]);\n React.useEffect(() => {\n if (isSelected && layout) {\n emitInteraction(\"select\", layout);\n }\n }, [emitInteraction, isSelected, layout]);\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n __scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,\n asChild: true,\n tabIndex: disabled ? -1 : 0,\n active: isSelected,\n children: /* @__PURE__ */ jsx(\n TabsTabFrame,\n {\n onLayout: isWeb ? onLayout : composeEventHandlers(onLayout, (event) => {\n setLayout(event.nativeEvent.layout);\n }),\n onMouseEnter: composeEventHandlers(onMouseEnter, () => {\n if (layout) {\n emitInteraction(\"hover\", layout);\n }\n }),\n onMouseLeave: composeEventHandlers(onMouseLeave, () => {\n emitInteraction(\"hover\", null);\n }),\n ...tabA11yProps,\n theme: isSelected ? activeTheme ?? null : null,\n ...groupItemProps,\n ...triggerProps,\n style: [triggerProps.style, isSelected && activeStyle],\n ref: composeRefs(forwardedRef, triggerRef),\n onPress: composeEventHandlers(onPress ?? void 0, activateOnPress),\n ...isWeb && {\n onKeyDown: composeEventHandlers(onKeyDown, activateOnKeyDown),\n // emit the focus interaction before activating, matching the order\n // the indicator animations were built against\n onFocus: composeEventHandlers(\n onFocus,\n composeEventHandlers(() => {\n if (layout) {\n emitInteraction(\"focus\", layout);\n }\n }, activateOnFocus)\n ),\n onBlur: composeEventHandlers(onBlur, () => {\n emitInteraction(\"focus\", null);\n })\n }\n }\n )\n }\n );\n }\n);\nconst TabsContent = createStyledHOC(\n TabsContentFrame,\n function TabsContent2(props, forwardedRef) {\n const { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n const context = useTabsContext(__scopeTabs);\n const { shouldMount, contentProps: headlessContentProps } = useTabContent({\n baseId: context.baseId,\n value,\n selectedValue: context.value,\n orientation: context.orientation,\n forceMount\n });\n if (!shouldMount) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n TabsContentFrame,\n {\n ...headlessContentProps,\n ...contentProps,\n ref: forwardedRef,\n children\n },\n value\n );\n }\n);\nconst TabsComponent = createStyledHOC(\n TabsFrame,\n function Tabs(props, forwardedRef) {\n const {\n __scopeTabs,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n dir,\n activationMode = \"automatic\",\n ...tabsProps\n } = props;\n const {\n value,\n setValue,\n baseId,\n direction,\n triggersCount,\n registerTrigger,\n unregisterTrigger,\n tabsProps: headlessTabsProps\n } = useTabs({\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation,\n dir,\n activationMode\n });\n return /* @__PURE__ */ jsx(\n TabsProvider,\n {\n scope: __scopeTabs,\n baseId,\n value,\n onChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n registerTrigger,\n triggersCount,\n unregisterTrigger,\n children: /* @__PURE__ */ jsx(\n TabsFrame,\n {\n direction,\n ...headlessTabsProps,\n ...tabsProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nconst Tabs2 = withStaticProperties(TabsComponent, {\n Frame: TabsFrame,\n List: TabsList,\n Tab: TabsTab,\n Content: TabsContent\n});\nexport {\n Tabs2 as Tabs,\n TabsContent,\n TabsContentFrame,\n TabsFrame,\n TabsList,\n TabsListFrame,\n TabsTab,\n TabsTabFrame\n};\n//# sourceMappingURL=Tabs.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAM,eAAe;AACrB,MAAM,YAAY,OAAO,MAAM,EAC7B,aAAa,OACf,CAAC;AACD,MAAM,gBAAgB,OAAO,OAAO;CAClC,aAAa;CACb,MAAM;AACR,CAAC;AACD,MAAM,eAAe,OAAO,MAAM;CAChC,aAAa;CACb,MAAM;CACN,UAAU,EACR,UAAU,EACR,MAAM,EACJ,eAAe,OACjB,EACF,EACF;AACF,CAAC;AACD,MAAM,mBAAmB,OAAO,MAAM,EACpC,aAAa,cACf,CAAC;AACD,MAAM,0BAA0B,MAAM,cAAc,KAAK;AACzD,MAAM,WAAW,gBACf,eACA,SAAS,UAAU,OAAO,cAAc;CACtC,MAAM,EAAE,aAAa,OAAO,MAAM,WAAW,OAAO,U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A2B;KACzB,IAAI,QAAQ;MACV,gBAAgB,SAAS,MAAM;KACjC;IACF,GAAG,eAAe,CACpB;IACA,QAAQ,qBAAqB,cAAc;KACzC,gBAAgB,SAAS,IAAI;IAC/B,CAAC;GACH;EACF,CACF;CACF,CACF;AACF,CACF;AACA,MAAM,cAAc,gBAClB,kBACA,SAAS,aAAa,OAAO,cAAc;CACzC,MAAM,EAAE,aAAa,OAAO,YAAY,UAAU,GAAG,iBAAiB;CACtE,MAAM,UAAU,eAAe,WAAW;CAC1C,MAAM,EAAE,aAAa,cAAc,yBAAyB,cAAc;EACxE,QAAQ,QAAQ;EAChB;EACA,eAAe,QAAQ;EACvB,aAAa,QAAQ;EACrB;CACF,CAAC;CACD,IAAI,CAAC,aAAa;EAChB,OAAO;CACT;CACA,OAAuB,oBACrB,kBACA;EACE,GAAG;EACH,GAAG;EACH,KAAK;EACL;CACF,GACA,KACF;AACF,CACF;AACA,MAAM,gBAAgB,gBACpB,WACA,SAAS,KAAK,OAAO,cAAc;CACjC,MAAM,EACJ,aACA,OAAO,WACP,eACA,cACA,cAAc,cACd,KACA,iBAAiB,aACjB,GAAG,cACD;CACJ,MAAM,EACJ,OACA,UACA,QACA,WACA,eACA,iBACA,mBACA,WAAW,sBACT,QAAQ;EACV,OAAO;EACP;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAuB,oBACrB,cACA;EACE,OAAO;EACP;EACA;EACA,UAAU;EACV;EACA,KAAK;EACL;EACA;EACA;EACA;EACA,UAA0B,oBACxB,WACA;GACE;GACA,GAAG;GACH,GAAG;GACH,KAAK;EACP,CACF;CACF,CACF;AACF,CACF;AACA,MAAM,QAAQ,qBAAqB,eAAe;CAChD,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;AACX,CAAC"}
@@ -5,32 +5,23 @@ import { View, createStyledHOC, styled } from "@tamagui/core";
5
5
  import { Group, useGroupItem } from "@tamagui/group";
6
6
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
7
7
  import { RovingFocusGroup } from "@tamagui/roving-focus";
8
- import { SizeContext } from "@tamagui/size";
9
8
  import { useTab, useTabContent, useTabs, useTabsList } from "@tamagui/tabs-headless";
10
9
  import { useEvent } from "@tamagui/web";
11
10
  import * as React from "react";
12
11
  import { TabsProvider, useTabsContext } from "./StyledContext.native.js";
13
12
 
14
13
  var TABS_CONTEXT = "TabsContext";
15
- var TabsFrame = styled(View, {
16
- displayName: "Tabs",
17
- context: SizeContext
18
- });
14
+ var TabsFrame = styled(View, { displayName: "Tabs" });
19
15
  var TabsListFrame = styled(Group, {
20
16
  displayName: "TabsList",
21
- context: SizeContext,
22
17
  role: "tablist"
23
18
  });
24
19
  var TabsTabFrame = styled(View, {
25
20
  displayName: "TabsTrigger",
26
- context: SizeContext,
27
21
  role: "tab",
28
22
  variants: { disabled: { true: { pointerEvents: "none" } } }
29
23
  });
30
- var TabsContentFrame = styled(View, {
31
- displayName: "TabsContent",
32
- context: SizeContext
33
- });
24
+ var TabsContentFrame = styled(View, { displayName: "TabsContent" });
34
25
  var TabsListDisabledContext = /* @__PURE__ */ React.createContext(false);
35
26
  var TabsList = createStyledHOC(TabsListFrame, function TabsList2(props, forwardedRef) {
36
27
  var { __scopeTabs, loop = true, disabled = false, children, ...listProps } = props;
@@ -136,7 +127,6 @@ var TabsTab = createStyledHOC(TabsTabFrame, function TabsTab2(props, forwardedRe
136
127
  }),
137
128
  ...tabA11yProps,
138
129
  theme: isSelected ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
139
- size: context.size,
140
130
  ...groupItemProps,
141
131
  ...triggerProps,
142
132
  style: [triggerProps.style, isSelected && activeStyle],
@@ -177,7 +167,7 @@ var TabsContent = createStyledHOC(TabsContentFrame, function TabsContent2(props,
177
167
  }, value);
178
168
  });
179
169
  var TabsComponent = createStyledHOC(TabsFrame, function Tabs(props, forwardedRef) {
180
- var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size = true, ...tabsProps } = props;
170
+ var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
181
171
  var { value, setValue, baseId, direction, triggersCount, registerTrigger, unregisterTrigger, tabsProps: headlessTabsProps } = useTabs({
182
172
  value: valueProp,
183
173
  onValueChange,
@@ -186,26 +176,22 @@ var TabsComponent = createStyledHOC(TabsFrame, function Tabs(props, forwardedRef
186
176
  dir,
187
177
  activationMode
188
178
  });
189
- return /* @__PURE__ */ jsx(SizeContext.Provider, {
190
- size,
191
- children: /* @__PURE__ */ jsx(TabsProvider, {
192
- scope: __scopeTabs,
193
- baseId,
194
- value,
195
- onChange: setValue,
196
- orientation,
197
- dir: direction,
198
- activationMode,
199
- size,
200
- registerTrigger,
201
- triggersCount,
202
- unregisterTrigger,
203
- children: /* @__PURE__ */ jsx(TabsFrame, {
204
- direction,
205
- ...headlessTabsProps,
206
- ...tabsProps,
207
- ref: forwardedRef
208
- })
179
+ return /* @__PURE__ */ jsx(TabsProvider, {
180
+ scope: __scopeTabs,
181
+ baseId,
182
+ value,
183
+ onChange: setValue,
184
+ orientation,
185
+ dir: direction,
186
+ activationMode,
187
+ registerTrigger,
188
+ triggersCount,
189
+ unregisterTrigger,
190
+ children: /* @__PURE__ */ jsx(TabsFrame, {
191
+ direction,
192
+ ...headlessTabsProps,
193
+ ...tabsProps,
194
+ ref: forwardedRef
209
195
  })
210
196
  });
211
197
  });