tamagui 1.125.35 → 1.126.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/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/inputHelpers.native.js.map +1 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/lib/linear-gradient.native.js.map +1 -1
- package/dist/cjs/linear-gradient.native.js.map +1 -1
- package/dist/cjs/react-native-web/Dimensions.native.js.map +1 -1
- package/dist/cjs/setup.native.js.map +1 -1
- package/dist/cjs/viewTypes.native.js.map +1 -1
- package/dist/cjs/views/Anchor.native.js.map +1 -1
- package/dist/cjs/views/EnsureFlexed.native.js.map +1 -1
- package/dist/cjs/views/Fieldset.native.js.map +1 -1
- package/dist/cjs/views/Input.native.js.map +1 -1
- package/dist/cjs/views/Spinner.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.server.native.js.map +1 -1
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/TextArea.native.js.map +1 -1
- package/dist/cjs/views/VisuallyHidden.native.js.map +1 -1
- package/dist/esm/lib/linear-gradient.native.js.map +1 -1
- package/dist/jsx/createTamagui.native.js.map +1 -1
- package/dist/jsx/helpers/inputHelpers.native.js.map +1 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/lib/linear-gradient.native.js.map +1 -1
- package/dist/jsx/linear-gradient.native.js.map +1 -1
- package/dist/jsx/react-native-web/Dimensions.native.js.map +1 -1
- package/dist/jsx/setup.native.js.map +1 -1
- package/dist/jsx/views/Anchor.native.js.map +1 -1
- package/dist/jsx/views/EnsureFlexed.native.js.map +1 -1
- package/dist/jsx/views/Fieldset.native.js.map +1 -1
- package/dist/jsx/views/Input.native.js.map +1 -1
- package/dist/jsx/views/Spinner.native.js.map +1 -1
- package/dist/jsx/views/TamaguiProvider.native.js.map +1 -1
- package/dist/jsx/views/TamaguiProvider.server.native.js.map +1 -1
- package/dist/jsx/views/Text.native.js.map +1 -1
- package/dist/jsx/views/TextArea.native.js.map +1 -1
- package/dist/jsx/views/VisuallyHidden.native.js.map +1 -1
- package/dist/native.js +317 -185
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +317 -185
- package/dist/test.native.js.map +3 -3
- package/package.json +55 -55
package/dist/test.native.js
CHANGED
|
@@ -8136,7 +8136,16 @@ var require_createComponent_native = __commonJS({
|
|
|
8136
8136
|
});
|
|
8137
8137
|
return;
|
|
8138
8138
|
}
|
|
8139
|
+
var tm;
|
|
8139
8140
|
if (state.unmounted) {
|
|
8141
|
+
var _config_animations2, _animationDriver_supportsCSSVars;
|
|
8142
|
+
if ((_animationDriver_supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars) !== null && _animationDriver_supportsCSSVars !== void 0 ? _animationDriver_supportsCSSVars : !(config == null || (_config_animations2 = config.animations) === null || _config_animations2 === void 0) && _config_animations2.supportsCSSVars) return tm = setTimeout(function() {
|
|
8143
|
+
setStateShallow({
|
|
8144
|
+
unmounted: !1
|
|
8145
|
+
});
|
|
8146
|
+
}), function() {
|
|
8147
|
+
return clearTimeout(tm);
|
|
8148
|
+
};
|
|
8140
8149
|
setStateShallow({
|
|
8141
8150
|
unmounted: !1
|
|
8142
8151
|
});
|
|
@@ -19073,7 +19082,8 @@ var require_Dialog_native = __commonJS({
|
|
|
19073
19082
|
// @ts-ignore
|
|
19074
19083
|
ref: composedRefs,
|
|
19075
19084
|
onDismiss: function() {
|
|
19076
|
-
|
|
19085
|
+
var _context_onOpenChange;
|
|
19086
|
+
return context == null || (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, !1);
|
|
19077
19087
|
},
|
|
19078
19088
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_focus_scope.FocusScope, {
|
|
19079
19089
|
loop: !0,
|
|
@@ -25097,7 +25107,8 @@ var require_Popover_native = __commonJS({
|
|
|
25097
25107
|
ref: forwardedRef,
|
|
25098
25108
|
componentName: "PopoverClose",
|
|
25099
25109
|
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, function() {
|
|
25100
|
-
|
|
25110
|
+
var _context_onOpenChange;
|
|
25111
|
+
return context == null || (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, !1, "press");
|
|
25101
25112
|
})
|
|
25102
25113
|
});
|
|
25103
25114
|
}), PopoverArrow = import_popper.PopperArrow.styleable(function(props, forwardedRef) {
|
|
@@ -29230,7 +29241,7 @@ var require_index_native68 = __commonJS({
|
|
|
29230
29241
|
var require_Tabs_native = __commonJS({
|
|
29231
29242
|
"../tabs/dist/cjs/Tabs.native.js"(exports2, module2) {
|
|
29232
29243
|
"use strict";
|
|
29233
|
-
var
|
|
29244
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
29234
29245
|
for (var name in all) __defProp2(target, name, {
|
|
29235
29246
|
get: all[name],
|
|
29236
29247
|
enumerable: !0
|
|
@@ -29258,53 +29269,26 @@ var require_Tabs_native = __commonJS({
|
|
|
29258
29269
|
}
|
|
29259
29270
|
}
|
|
29260
29271
|
return to;
|
|
29261
|
-
}, __toESM2 = function(mod, isNodeMode, target) {
|
|
29262
|
-
return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
29263
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
29264
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29265
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29266
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29267
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
29268
|
-
value: mod,
|
|
29269
|
-
enumerable: !0
|
|
29270
|
-
}) : target,
|
|
29271
|
-
mod
|
|
29272
|
-
);
|
|
29273
29272
|
}, __toCommonJS2 = function(mod) {
|
|
29274
29273
|
return __copyProps2(__defProp2({}, "__esModule", {
|
|
29275
29274
|
value: !0
|
|
29276
29275
|
}), mod);
|
|
29277
29276
|
}, Tabs_exports = {};
|
|
29278
29277
|
__export2(Tabs_exports, {
|
|
29279
|
-
|
|
29280
|
-
return
|
|
29278
|
+
DefaultTabsContentFrame: function() {
|
|
29279
|
+
return DefaultTabsContentFrame;
|
|
29281
29280
|
},
|
|
29282
|
-
|
|
29283
|
-
return
|
|
29281
|
+
DefaultTabsFrame: function() {
|
|
29282
|
+
return DefaultTabsFrame;
|
|
29283
|
+
},
|
|
29284
|
+
DefaultTabsTabFrame: function() {
|
|
29285
|
+
return DefaultTabsTabFrame;
|
|
29284
29286
|
}
|
|
29285
29287
|
});
|
|
29286
29288
|
module2.exports = __toCommonJS2(Tabs_exports);
|
|
29287
|
-
var
|
|
29288
|
-
|
|
29289
|
-
|
|
29290
|
-
__scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,
|
|
29291
|
-
orientation: context.orientation,
|
|
29292
|
-
dir: context.dir,
|
|
29293
|
-
loop,
|
|
29294
|
-
asChild: !0,
|
|
29295
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_group.Group, {
|
|
29296
|
-
role: "tablist",
|
|
29297
|
-
componentName: TAB_LIST_NAME,
|
|
29298
|
-
"aria-orientation": context.orientation,
|
|
29299
|
-
ref: forwardedRef,
|
|
29300
|
-
orientation: context.orientation,
|
|
29301
|
-
...listProps,
|
|
29302
|
-
children
|
|
29303
|
-
})
|
|
29304
|
-
});
|
|
29305
|
-
});
|
|
29306
|
-
TabsList.displayName = TAB_LIST_NAME;
|
|
29307
|
-
var TRIGGER_NAME = "TabsTrigger", TabsTriggerFrame = (0, import_web.styled)(import_stacks3.ThemeableStack, {
|
|
29289
|
+
var import_core12 = require_index_native18(), import_stacks3 = require_index_native22(), import_get_button_sized2 = require_index_native21(), TABS_NAME = "Tabs", DefaultTabsFrame = (0, import_core12.styled)(import_stacks3.SizableStack, {
|
|
29290
|
+
name: TABS_NAME
|
|
29291
|
+
}), TRIGGER_NAME = "TabsTrigger", DefaultTabsTabFrame = (0, import_core12.styled)(import_stacks3.ThemeableStack, {
|
|
29308
29292
|
name: TRIGGER_NAME,
|
|
29309
29293
|
tag: "button",
|
|
29310
29294
|
variants: {
|
|
@@ -29351,160 +29335,291 @@ var require_Tabs_native = __commonJS({
|
|
|
29351
29335
|
defaultVariants: {
|
|
29352
29336
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
29353
29337
|
}
|
|
29354
|
-
}),
|
|
29355
|
-
|
|
29356
|
-
|
|
29338
|
+
}), CONTENT_NAME = "TabsContent", DefaultTabsContentFrame = (0, import_core12.styled)(import_stacks3.ThemeableStack, {
|
|
29339
|
+
name: CONTENT_NAME
|
|
29340
|
+
});
|
|
29341
|
+
}
|
|
29342
|
+
});
|
|
29343
|
+
|
|
29344
|
+
// ../tabs/dist/cjs/StyledContext.native.js
|
|
29345
|
+
var require_StyledContext_native2 = __commonJS({
|
|
29346
|
+
"../tabs/dist/cjs/StyledContext.native.js"(exports2, module2) {
|
|
29347
|
+
"use strict";
|
|
29348
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
29349
|
+
for (var name in all) __defProp2(target, name, {
|
|
29350
|
+
get: all[name],
|
|
29351
|
+
enumerable: !0
|
|
29357
29352
|
});
|
|
29358
|
-
|
|
29359
|
-
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
|
|
29363
|
-
|
|
29364
|
-
|
|
29365
|
-
|
|
29366
|
-
|
|
29367
|
-
|
|
29368
|
-
|
|
29369
|
-
|
|
29370
|
-
|
|
29371
|
-
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
29376
|
-
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
value
|
|
29384
|
-
|
|
29385
|
-
|
|
29386
|
-
|
|
29387
|
-
|
|
29388
|
-
|
|
29389
|
-
|
|
29353
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
29354
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
29355
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
29356
|
+
for (var _loop = function() {
|
|
29357
|
+
var key = _step.value;
|
|
29358
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
29359
|
+
get: function() {
|
|
29360
|
+
return from[key];
|
|
29361
|
+
},
|
|
29362
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
29363
|
+
});
|
|
29364
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
29365
|
+
} catch (err) {
|
|
29366
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
29367
|
+
} finally {
|
|
29368
|
+
try {
|
|
29369
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
29370
|
+
} finally {
|
|
29371
|
+
if (_didIteratorError)
|
|
29372
|
+
throw _iteratorError;
|
|
29373
|
+
}
|
|
29374
|
+
}
|
|
29375
|
+
return to;
|
|
29376
|
+
}, __toCommonJS2 = function(mod) {
|
|
29377
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
29378
|
+
value: !0
|
|
29379
|
+
}), mod);
|
|
29380
|
+
}, StyledContext_exports = {};
|
|
29381
|
+
__export2(StyledContext_exports, {
|
|
29382
|
+
TabsProvider: function() {
|
|
29383
|
+
return TabsProvider;
|
|
29384
|
+
},
|
|
29385
|
+
useTabsContext: function() {
|
|
29386
|
+
return useTabsContext;
|
|
29387
|
+
}
|
|
29388
|
+
});
|
|
29389
|
+
module2.exports = __toCommonJS2(StyledContext_exports);
|
|
29390
|
+
var import_core12 = require_index_native18(), { Provider: TabsProvider, useStyledContext: useTabsContext } = (0, import_core12.createStyledContext)();
|
|
29391
|
+
}
|
|
29392
|
+
});
|
|
29393
|
+
|
|
29394
|
+
// ../tabs/dist/cjs/createTabs.native.js
|
|
29395
|
+
var require_createTabs_native = __commonJS({
|
|
29396
|
+
"../tabs/dist/cjs/createTabs.native.js"(exports2, module2) {
|
|
29397
|
+
"use strict";
|
|
29398
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
29399
|
+
for (var name in all) __defProp2(target, name, {
|
|
29400
|
+
get: all[name],
|
|
29401
|
+
enumerable: !0
|
|
29402
|
+
});
|
|
29403
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
29404
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
29405
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
29406
|
+
for (var _loop = function() {
|
|
29407
|
+
var key = _step.value;
|
|
29408
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
29409
|
+
get: function() {
|
|
29410
|
+
return from[key];
|
|
29411
|
+
},
|
|
29412
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
29413
|
+
});
|
|
29414
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
29415
|
+
} catch (err) {
|
|
29416
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
29417
|
+
} finally {
|
|
29418
|
+
try {
|
|
29419
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
29420
|
+
} finally {
|
|
29421
|
+
if (_didIteratorError)
|
|
29422
|
+
throw _iteratorError;
|
|
29423
|
+
}
|
|
29424
|
+
}
|
|
29425
|
+
return to;
|
|
29426
|
+
}, __toESM2 = function(mod, isNodeMode, target) {
|
|
29427
|
+
return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
29428
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29429
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29430
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29431
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29432
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
29433
|
+
value: mod,
|
|
29434
|
+
enumerable: !0
|
|
29435
|
+
}) : target,
|
|
29436
|
+
mod
|
|
29437
|
+
);
|
|
29438
|
+
}, __toCommonJS2 = function(mod) {
|
|
29439
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
29440
|
+
value: !0
|
|
29441
|
+
}), mod);
|
|
29442
|
+
}, createTabs_exports = {};
|
|
29443
|
+
__export2(createTabs_exports, {
|
|
29444
|
+
createTabs: function() {
|
|
29445
|
+
return createTabs;
|
|
29446
|
+
}
|
|
29447
|
+
});
|
|
29448
|
+
module2.exports = __toCommonJS2(createTabs_exports);
|
|
29449
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_group = require_index_native52(), import_helpers = require_index_native7(), import_roving_focus = require_index_native61(), import_use_controllable_state = require_index_native10(), import_use_direction = require_index_native25(), import_web = require_index_native14(), React4 = __toESM2(require("react")), import_Tabs = require_Tabs_native(), import_StyledContext = require_StyledContext_native2();
|
|
29450
|
+
function createTabs(createProps) {
|
|
29451
|
+
var { ContentFrame = import_Tabs.DefaultTabsContentFrame, TabFrame = import_Tabs.DefaultTabsTabFrame, TabsFrame = import_Tabs.DefaultTabsFrame } = createProps, TABS_CONTEXT = "TabsContext", TAB_LIST_NAME = "TabsList", TabsList = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
29452
|
+
var { __scopeTabs, loop = !0, children, ...listProps } = props, context = (0, import_StyledContext.useTabsContext)(__scopeTabs);
|
|
29453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_roving_focus.RovingFocusGroup, {
|
|
29390
29454
|
__scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,
|
|
29455
|
+
orientation: context.orientation,
|
|
29456
|
+
dir: context.dir,
|
|
29457
|
+
loop,
|
|
29391
29458
|
asChild: !0,
|
|
29392
|
-
|
|
29393
|
-
|
|
29394
|
-
|
|
29395
|
-
|
|
29396
|
-
|
|
29397
|
-
|
|
29398
|
-
|
|
29399
|
-
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29421
|
-
|
|
29422
|
-
|
|
29423
|
-
|
|
29424
|
-
|
|
29425
|
-
|
|
29426
|
-
|
|
29427
|
-
|
|
29428
|
-
|
|
29429
|
-
|
|
29430
|
-
|
|
29459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_group.Group, {
|
|
29460
|
+
role: "tablist",
|
|
29461
|
+
componentName: TAB_LIST_NAME,
|
|
29462
|
+
"aria-orientation": context.orientation,
|
|
29463
|
+
ref: forwardedRef,
|
|
29464
|
+
orientation: context.orientation,
|
|
29465
|
+
...listProps,
|
|
29466
|
+
children
|
|
29467
|
+
})
|
|
29468
|
+
});
|
|
29469
|
+
});
|
|
29470
|
+
TabsList.displayName = TAB_LIST_NAME;
|
|
29471
|
+
var TRIGGER_NAME = "TabsTrigger", TabsTrigger = TabFrame.styleable(function(props, forwardedRef) {
|
|
29472
|
+
var { __scopeTabs, value, disabled = !1, onInteraction, disableActiveTheme, ...triggerProps } = props, context = (0, import_StyledContext.useTabsContext)(__scopeTabs), triggerId = makeTriggerId(context.baseId, value), contentId = makeContentId(context.baseId, value), isSelected = value === context.value, [layout, setLayout] = React4.useState(null), triggerRef = React4.useRef(null), groupItemProps = (0, import_group.useGroupItem)({
|
|
29473
|
+
disabled: !!disabled
|
|
29474
|
+
});
|
|
29475
|
+
React4.useEffect(function() {
|
|
29476
|
+
return context.registerTrigger(), function() {
|
|
29477
|
+
return context.unregisterTrigger();
|
|
29478
|
+
};
|
|
29479
|
+
}, []), React4.useEffect(function() {
|
|
29480
|
+
if (!triggerRef.current || !import_constants4.isWeb) return;
|
|
29481
|
+
function getTriggerSize() {
|
|
29482
|
+
triggerRef.current && setLayout({
|
|
29483
|
+
width: triggerRef.current.offsetWidth,
|
|
29484
|
+
height: triggerRef.current.offsetHeight,
|
|
29485
|
+
x: triggerRef.current.offsetLeft,
|
|
29486
|
+
y: triggerRef.current.offsetTop
|
|
29487
|
+
});
|
|
29488
|
+
}
|
|
29489
|
+
getTriggerSize();
|
|
29490
|
+
var observer = new ResizeObserver(getTriggerSize);
|
|
29491
|
+
return observer.observe(triggerRef.current), function() {
|
|
29492
|
+
triggerRef.current && observer.unobserve(triggerRef.current);
|
|
29493
|
+
};
|
|
29494
|
+
}, [
|
|
29495
|
+
context.triggersCount
|
|
29496
|
+
]), React4.useEffect(function() {
|
|
29497
|
+
isSelected && layout && (onInteraction == null || onInteraction("select", layout));
|
|
29498
|
+
}, [
|
|
29499
|
+
isSelected,
|
|
29500
|
+
value,
|
|
29501
|
+
layout
|
|
29502
|
+
]);
|
|
29503
|
+
var _props_onPress;
|
|
29504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_web.Theme, {
|
|
29505
|
+
name: isSelected && !disableActiveTheme ? "active" : null,
|
|
29506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_roving_focus.RovingFocusGroup.Item, {
|
|
29507
|
+
__scopeRovingFocusGroup: __scopeTabs || TABS_CONTEXT,
|
|
29508
|
+
asChild: !0,
|
|
29509
|
+
focusable: !disabled,
|
|
29510
|
+
active: isSelected,
|
|
29511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabFrame, {
|
|
29512
|
+
onLayout: function(event) {
|
|
29513
|
+
import_constants4.isWeb || setLayout(event.nativeEvent.layout);
|
|
29514
|
+
},
|
|
29515
|
+
onHoverIn: (0, import_helpers.composeEventHandlers)(props.onHoverIn, function() {
|
|
29516
|
+
layout && (onInteraction == null || onInteraction("hover", layout));
|
|
29431
29517
|
}),
|
|
29432
|
-
|
|
29433
|
-
|
|
29434
|
-
var isAutomaticActivation = context.activationMode !== "manual";
|
|
29435
|
-
!isSelected && !disabled && isAutomaticActivation && context.onChange(value);
|
|
29518
|
+
onHoverOut: (0, import_helpers.composeEventHandlers)(props.onHoverOut, function() {
|
|
29519
|
+
onInteraction == null || onInteraction("hover", null);
|
|
29436
29520
|
}),
|
|
29437
|
-
|
|
29438
|
-
|
|
29439
|
-
|
|
29440
|
-
|
|
29521
|
+
role: "tab",
|
|
29522
|
+
"aria-selected": isSelected,
|
|
29523
|
+
"aria-controls": contentId,
|
|
29524
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
29525
|
+
"data-disabled": disabled ? "" : void 0,
|
|
29526
|
+
disabled,
|
|
29527
|
+
id: triggerId,
|
|
29528
|
+
...!props.unstyled && {
|
|
29529
|
+
size: context.size
|
|
29530
|
+
},
|
|
29531
|
+
...isSelected && {
|
|
29532
|
+
forceStyle: "focus"
|
|
29533
|
+
},
|
|
29534
|
+
...groupItemProps,
|
|
29535
|
+
...triggerProps,
|
|
29536
|
+
ref: (0, import_compose_refs.composeRefs)(forwardedRef, triggerRef),
|
|
29537
|
+
onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function(event) {
|
|
29538
|
+
var webChecks = !import_constants4.isWeb || event.button === 0 && event.ctrlKey === !1;
|
|
29539
|
+
!disabled && !isSelected && webChecks ? context.onChange(value) : event.preventDefault();
|
|
29540
|
+
}),
|
|
29541
|
+
...import_constants4.isWeb && {
|
|
29542
|
+
type: "button",
|
|
29543
|
+
onKeyDown: (0, import_helpers.composeEventHandlers)(props.onKeyDown, function(event) {
|
|
29544
|
+
[
|
|
29545
|
+
" ",
|
|
29546
|
+
"Enter"
|
|
29547
|
+
].includes(event.key) && (context.onChange(value), event.preventDefault());
|
|
29548
|
+
}),
|
|
29549
|
+
onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, function(event) {
|
|
29550
|
+
layout && (onInteraction == null || onInteraction("focus", layout));
|
|
29551
|
+
var isAutomaticActivation = context.activationMode !== "manual";
|
|
29552
|
+
!isSelected && !disabled && isAutomaticActivation && context.onChange(value);
|
|
29553
|
+
}),
|
|
29554
|
+
onBlur: (0, import_helpers.composeEventHandlers)(props.onFocus, function() {
|
|
29555
|
+
onInteraction == null || onInteraction("focus", null);
|
|
29556
|
+
})
|
|
29557
|
+
}
|
|
29558
|
+
})
|
|
29441
29559
|
})
|
|
29442
|
-
})
|
|
29560
|
+
});
|
|
29443
29561
|
});
|
|
29444
|
-
|
|
29445
|
-
|
|
29446
|
-
|
|
29447
|
-
|
|
29448
|
-
|
|
29449
|
-
|
|
29450
|
-
|
|
29451
|
-
|
|
29452
|
-
|
|
29453
|
-
|
|
29454
|
-
|
|
29455
|
-
|
|
29456
|
-
|
|
29457
|
-
|
|
29458
|
-
|
|
29459
|
-
|
|
29460
|
-
|
|
29461
|
-
|
|
29462
|
-
|
|
29463
|
-
|
|
29464
|
-
|
|
29465
|
-
|
|
29466
|
-
|
|
29467
|
-
|
|
29468
|
-
|
|
29469
|
-
|
|
29470
|
-
|
|
29471
|
-
|
|
29472
|
-
|
|
29562
|
+
TabsTrigger.displayName = TRIGGER_NAME;
|
|
29563
|
+
var TabsContent = ContentFrame.styleable(function(props, forwardedRef) {
|
|
29564
|
+
var { __scopeTabs, value, forceMount, children, ...contentProps } = props, context = (0, import_StyledContext.useTabsContext)(__scopeTabs), isSelected = value === context.value, show = forceMount || isSelected, triggerId = makeTriggerId(context.baseId, value), contentId = makeContentId(context.baseId, value);
|
|
29565
|
+
return show ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ContentFrame, {
|
|
29566
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
29567
|
+
"data-orientation": context.orientation,
|
|
29568
|
+
role: "tabpanel",
|
|
29569
|
+
"aria-labelledby": triggerId,
|
|
29570
|
+
// @ts-ignore
|
|
29571
|
+
hidden: !show,
|
|
29572
|
+
id: contentId,
|
|
29573
|
+
tabIndex: 0,
|
|
29574
|
+
...contentProps,
|
|
29575
|
+
ref: forwardedRef,
|
|
29576
|
+
children
|
|
29577
|
+
}, value) : null;
|
|
29578
|
+
}), TabsComponent = TabsFrame.styleable(function(props, forwardedRef) {
|
|
29579
|
+
var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size: size4 = "$true", ...tabsProps } = props, direction = (0, import_use_direction.useDirection)(dir), [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
29580
|
+
prop: valueProp,
|
|
29581
|
+
onChange: onValueChange,
|
|
29582
|
+
defaultProp: defaultValue ?? ""
|
|
29583
|
+
}), [triggersCount, setTriggersCount] = React4.useState(0), registerTrigger = (0, import_web.useEvent)(function() {
|
|
29584
|
+
return setTriggersCount(function(v) {
|
|
29585
|
+
return v + 1;
|
|
29586
|
+
});
|
|
29587
|
+
}), unregisterTrigger = (0, import_web.useEvent)(function() {
|
|
29588
|
+
return setTriggersCount(function(v) {
|
|
29589
|
+
return v - 1;
|
|
29590
|
+
});
|
|
29473
29591
|
});
|
|
29474
|
-
|
|
29475
|
-
|
|
29476
|
-
|
|
29592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_StyledContext.TabsProvider, {
|
|
29593
|
+
scope: __scopeTabs,
|
|
29594
|
+
baseId: React4.useId(),
|
|
29595
|
+
value,
|
|
29596
|
+
onChange: setValue,
|
|
29597
|
+
orientation,
|
|
29598
|
+
dir: direction,
|
|
29599
|
+
activationMode,
|
|
29600
|
+
size: size4,
|
|
29601
|
+
registerTrigger,
|
|
29602
|
+
triggersCount,
|
|
29603
|
+
unregisterTrigger,
|
|
29604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsFrame, {
|
|
29605
|
+
direction,
|
|
29606
|
+
// dir={direction}
|
|
29607
|
+
"data-orientation": orientation,
|
|
29608
|
+
...tabsProps,
|
|
29609
|
+
ref: forwardedRef
|
|
29610
|
+
})
|
|
29477
29611
|
});
|
|
29478
29612
|
});
|
|
29479
|
-
return
|
|
29480
|
-
|
|
29481
|
-
|
|
29482
|
-
|
|
29483
|
-
|
|
29484
|
-
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
size: size4,
|
|
29488
|
-
registerTrigger,
|
|
29489
|
-
triggersCount,
|
|
29490
|
-
unregisterTrigger,
|
|
29491
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsFrame, {
|
|
29492
|
-
direction,
|
|
29493
|
-
// dir={direction}
|
|
29494
|
-
"data-orientation": orientation,
|
|
29495
|
-
...tabsProps,
|
|
29496
|
-
ref: forwardedRef
|
|
29497
|
-
})
|
|
29613
|
+
return (0, import_helpers.withStaticProperties)(TabsComponent, {
|
|
29614
|
+
List: TabsList,
|
|
29615
|
+
/**
|
|
29616
|
+
* @deprecated Use Tabs.Tab instead
|
|
29617
|
+
*/
|
|
29618
|
+
Trigger: TabsTrigger,
|
|
29619
|
+
Tab: TabsTrigger,
|
|
29620
|
+
Content: TabsContent
|
|
29498
29621
|
});
|
|
29499
|
-
}
|
|
29500
|
-
List: TabsList,
|
|
29501
|
-
/**
|
|
29502
|
-
* @deprecated Use Tabs.Tab instead
|
|
29503
|
-
*/
|
|
29504
|
-
Trigger: TabsTrigger,
|
|
29505
|
-
Tab: TabsTrigger,
|
|
29506
|
-
Content: TabsContent
|
|
29507
|
-
});
|
|
29622
|
+
}
|
|
29508
29623
|
function makeTriggerId(baseId, value) {
|
|
29509
29624
|
return `${baseId}-trigger-${value}`;
|
|
29510
29625
|
}
|
|
@@ -29518,7 +29633,12 @@ var require_Tabs_native = __commonJS({
|
|
|
29518
29633
|
var require_index_native69 = __commonJS({
|
|
29519
29634
|
"../tabs/dist/cjs/index.native.js"(exports2, module2) {
|
|
29520
29635
|
"use strict";
|
|
29521
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty,
|
|
29636
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
29637
|
+
for (var name in all) __defProp2(target, name, {
|
|
29638
|
+
get: all[name],
|
|
29639
|
+
enumerable: !0
|
|
29640
|
+
});
|
|
29641
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
29522
29642
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
29523
29643
|
if (from && typeof from == "object" || typeof from == "function") try {
|
|
29524
29644
|
for (var _loop = function() {
|
|
@@ -29548,8 +29668,20 @@ var require_index_native69 = __commonJS({
|
|
|
29548
29668
|
value: !0
|
|
29549
29669
|
}), mod);
|
|
29550
29670
|
}, index_exports2 = {};
|
|
29671
|
+
__export2(index_exports2, {
|
|
29672
|
+
Tabs: function() {
|
|
29673
|
+
return Tabs;
|
|
29674
|
+
}
|
|
29675
|
+
});
|
|
29551
29676
|
module2.exports = __toCommonJS2(index_exports2);
|
|
29552
|
-
|
|
29677
|
+
var import_createTabs = require_createTabs_native(), import_Tabs = require_Tabs_native();
|
|
29678
|
+
__reExport2(index_exports2, require_createTabs_native(), module2.exports);
|
|
29679
|
+
__reExport2(index_exports2, require_StyledContext_native2(), module2.exports);
|
|
29680
|
+
var Tabs = (0, import_createTabs.createTabs)({
|
|
29681
|
+
ContentFrame: import_Tabs.DefaultTabsContentFrame,
|
|
29682
|
+
TabFrame: import_Tabs.DefaultTabsTabFrame,
|
|
29683
|
+
TabsFrame: import_Tabs.DefaultTabsFrame
|
|
29684
|
+
});
|
|
29553
29685
|
}
|
|
29554
29686
|
});
|
|
29555
29687
|
|