tamagui 1.82.0 → 1.82.2
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/views/Input.js.map +1 -1
- package/dist/cjs/views/Input.native.js.map +1 -1
- package/dist/esm/views/Input.js.map +1 -1
- package/dist/esm/views/Input.native.js.map +1 -1
- package/dist/jsx/views/Input.js.map +1 -1
- package/dist/jsx/views/Input.native.js.map +1 -1
- package/dist/native.js +319 -379
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +314 -367
- package/dist/test.native.js.map +3 -3
- package/package.json +52 -52
- package/src/views/Input.tsx +2 -0
- package/types/views/Input.d.ts +1 -0
- package/types/views/Input.d.ts.map +1 -1
package/dist/native.js
CHANGED
|
@@ -1429,36 +1429,6 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1429
1429
|
}
|
|
1430
1430
|
});
|
|
1431
1431
|
|
|
1432
|
-
// ../web/dist/cjs/helpers/createProxy.native.js
|
|
1433
|
-
var require_createProxy_native = __commonJS({
|
|
1434
|
-
"../web/dist/cjs/helpers/createProxy.native.js"(exports, module2) {
|
|
1435
|
-
"use strict";
|
|
1436
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1437
|
-
for (var name in all)
|
|
1438
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1439
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1440
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1441
|
-
for (let key of __getOwnPropNames2(from))
|
|
1442
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1443
|
-
return to;
|
|
1444
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createProxy_exports = {};
|
|
1445
|
-
__export2(createProxy_exports, {
|
|
1446
|
-
createProxy: () => createProxy
|
|
1447
|
-
});
|
|
1448
|
-
module2.exports = __toCommonJS2(createProxy_exports);
|
|
1449
|
-
function createProxy(target, handler) {
|
|
1450
|
-
return process.env.NODE_ENV === "development" && (typeof target != "object" || !target) && console.warn(
|
|
1451
|
-
"Invalid object given for proxy:",
|
|
1452
|
-
target,
|
|
1453
|
-
`
|
|
1454
|
-
|
|
1455
|
-
This can be due to a missing theme or configuration given to Tamagui.`,
|
|
1456
|
-
new Error().stack
|
|
1457
|
-
), new Proxy(target || {}, handler);
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
});
|
|
1461
|
-
|
|
1462
1432
|
// ../web/dist/cjs/helpers/matchMedia.native.js
|
|
1463
1433
|
var require_matchMedia_native = __commonJS({
|
|
1464
1434
|
"../web/dist/cjs/helpers/matchMedia.native.js"(exports, module2) {
|
|
@@ -1547,117 +1517,6 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1547
1517
|
}
|
|
1548
1518
|
});
|
|
1549
1519
|
|
|
1550
|
-
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
1551
|
-
var require_objectIdentityKey_native = __commonJS({
|
|
1552
|
-
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
1553
|
-
"use strict";
|
|
1554
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1555
|
-
for (var name in all)
|
|
1556
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1557
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1558
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1559
|
-
for (let key of __getOwnPropNames2(from))
|
|
1560
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1561
|
-
return to;
|
|
1562
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
1563
|
-
__export2(objectIdentityKey_exports, {
|
|
1564
|
-
objectIdentityKey: () => objectIdentityKey
|
|
1565
|
-
});
|
|
1566
|
-
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
1567
|
-
function objectIdentityKey(obj) {
|
|
1568
|
-
let k = "";
|
|
1569
|
-
for (let key in obj) {
|
|
1570
|
-
k += key;
|
|
1571
|
-
let arg = obj[key], type = typeof arg;
|
|
1572
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1573
|
-
k += type + arg;
|
|
1574
|
-
else if (cache.has(arg))
|
|
1575
|
-
k += cache.get(arg);
|
|
1576
|
-
else {
|
|
1577
|
-
let v = Math.random();
|
|
1578
|
-
cache.set(arg, v), k += v;
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
return k;
|
|
1582
|
-
}
|
|
1583
|
-
var cache = /* @__PURE__ */ new WeakMap();
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
|
|
1587
|
-
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
1588
|
-
var require_createStyledContext_native = __commonJS({
|
|
1589
|
-
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
|
|
1590
|
-
"use strict";
|
|
1591
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1592
|
-
for (var name in all)
|
|
1593
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1594
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1595
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1596
|
-
for (let key of __getOwnPropNames2(from))
|
|
1597
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1598
|
-
return to;
|
|
1599
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1600
|
-
__export2(createStyledContext_exports, {
|
|
1601
|
-
createStyledContext: () => createStyledContext2
|
|
1602
|
-
});
|
|
1603
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1604
|
-
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1605
|
-
function createStyledContext2(defaultValues) {
|
|
1606
|
-
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1607
|
-
children,
|
|
1608
|
-
scope,
|
|
1609
|
-
...values
|
|
1610
|
-
}) => {
|
|
1611
|
-
let next = (0, import_react2.useMemo)(() => ({
|
|
1612
|
-
// this ! is a workaround for ts error
|
|
1613
|
-
...defaultValues,
|
|
1614
|
-
...values
|
|
1615
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1616
|
-
if (scope) {
|
|
1617
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
1618
|
-
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1619
|
-
}
|
|
1620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
1621
|
-
}, useStyledContext = (scope) => {
|
|
1622
|
-
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1623
|
-
return (0, import_react2.useContext)(context);
|
|
1624
|
-
};
|
|
1625
|
-
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
});
|
|
1629
|
-
|
|
1630
|
-
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1631
|
-
var require_ComponentContext_native = __commonJS({
|
|
1632
|
-
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
1633
|
-
"use strict";
|
|
1634
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1635
|
-
for (var name in all)
|
|
1636
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1637
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1638
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1639
|
-
for (let key of __getOwnPropNames2(from))
|
|
1640
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1641
|
-
return to;
|
|
1642
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1643
|
-
__export2(ComponentContext_exports, {
|
|
1644
|
-
ComponentContext: () => ComponentContext2
|
|
1645
|
-
});
|
|
1646
|
-
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1647
|
-
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1648
|
-
disableSSR: void 0,
|
|
1649
|
-
inText: !1,
|
|
1650
|
-
language: null,
|
|
1651
|
-
animationDriver: null,
|
|
1652
|
-
groups: {
|
|
1653
|
-
emit: null,
|
|
1654
|
-
subscribe: null,
|
|
1655
|
-
state: {}
|
|
1656
|
-
}
|
|
1657
|
-
});
|
|
1658
|
-
}
|
|
1659
|
-
});
|
|
1660
|
-
|
|
1661
1520
|
// ../web/dist/cjs/hooks/useDisableSSR.native.js
|
|
1662
1521
|
var require_useDisableSSR_native = __commonJS({
|
|
1663
1522
|
"../web/dist/cjs/hooks/useDisableSSR.native.js"(exports, module2) {
|
|
@@ -1672,17 +1531,12 @@ var require_useDisableSSR_native = __commonJS({
|
|
|
1672
1531
|
return to;
|
|
1673
1532
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useDisableSSR_exports = {};
|
|
1674
1533
|
__export2(useDisableSSR_exports, {
|
|
1675
|
-
getDisableSSR: () => getDisableSSR
|
|
1676
|
-
useDisableSSR: () => useDisableSSR
|
|
1534
|
+
getDisableSSR: () => getDisableSSR
|
|
1677
1535
|
});
|
|
1678
1536
|
module2.exports = __toCommonJS2(useDisableSSR_exports);
|
|
1679
|
-
var
|
|
1680
|
-
function useDisableSSR() {
|
|
1681
|
-
let componentContext = (0, import_react2.useContext)(import_ComponentContext.ComponentContext);
|
|
1682
|
-
return getDisableSSR(componentContext);
|
|
1683
|
-
}
|
|
1537
|
+
var import_config = require_config_native();
|
|
1684
1538
|
function getDisableSSR(componentContext) {
|
|
1685
|
-
return componentContext.disableSSR ?? (0, import_config.getConfig)().disableSSR;
|
|
1539
|
+
return (componentContext == null ? void 0 : componentContext.disableSSR) ?? (0, import_config.getConfig)().disableSSR;
|
|
1686
1540
|
}
|
|
1687
1541
|
}
|
|
1688
1542
|
});
|
|
@@ -1718,9 +1572,9 @@ var require_useMedia_native = __commonJS({
|
|
|
1718
1572
|
useMedia: () => useMedia3
|
|
1719
1573
|
});
|
|
1720
1574
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
1721
|
-
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(),
|
|
1575
|
+
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState3 = (
|
|
1722
1576
|
// development only safeguard
|
|
1723
|
-
process.env.NODE_ENV === "development" ?
|
|
1577
|
+
process.env.NODE_ENV === "development" ? new Proxy(
|
|
1724
1578
|
{},
|
|
1725
1579
|
{
|
|
1726
1580
|
get(target, key) {
|
|
@@ -1792,7 +1646,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1792
1646
|
return listeners.add(subscriber), () => listeners.delete(subscriber);
|
|
1793
1647
|
}
|
|
1794
1648
|
function useMedia3(uid, componentContext) {
|
|
1795
|
-
let internal = (0, import_react2.useRef)(), initialState = ((
|
|
1649
|
+
let internal = (0, import_react2.useRef)(), initialState = ((0, import_useDisableSSR.getDisableSSR)(componentContext) || !import_constants4.isWeb ? mediaState3 : initState) || {}, state = (0, import_react2.useSyncExternalStore)(
|
|
1796
1650
|
subscribe,
|
|
1797
1651
|
() => {
|
|
1798
1652
|
if (!internal.current)
|
|
@@ -1990,6 +1844,117 @@ var require_constants_native2 = __commonJS({
|
|
|
1990
1844
|
}
|
|
1991
1845
|
});
|
|
1992
1846
|
|
|
1847
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
1848
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
1849
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
1850
|
+
"use strict";
|
|
1851
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1852
|
+
for (var name in all)
|
|
1853
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1854
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1855
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1856
|
+
for (let key of __getOwnPropNames2(from))
|
|
1857
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1858
|
+
return to;
|
|
1859
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
1860
|
+
__export2(objectIdentityKey_exports, {
|
|
1861
|
+
objectIdentityKey: () => objectIdentityKey
|
|
1862
|
+
});
|
|
1863
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
1864
|
+
function objectIdentityKey(obj) {
|
|
1865
|
+
let k = "";
|
|
1866
|
+
for (let key in obj) {
|
|
1867
|
+
k += key;
|
|
1868
|
+
let arg = obj[key], type = typeof arg;
|
|
1869
|
+
if (!arg || type !== "object" && type !== "function")
|
|
1870
|
+
k += type + arg;
|
|
1871
|
+
else if (cache.has(arg))
|
|
1872
|
+
k += cache.get(arg);
|
|
1873
|
+
else {
|
|
1874
|
+
let v = Math.random();
|
|
1875
|
+
cache.set(arg, v), k += v;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
return k;
|
|
1879
|
+
}
|
|
1880
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1883
|
+
|
|
1884
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
1885
|
+
var require_createStyledContext_native = __commonJS({
|
|
1886
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
|
|
1887
|
+
"use strict";
|
|
1888
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1889
|
+
for (var name in all)
|
|
1890
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1891
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1892
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1893
|
+
for (let key of __getOwnPropNames2(from))
|
|
1894
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1895
|
+
return to;
|
|
1896
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1897
|
+
__export2(createStyledContext_exports, {
|
|
1898
|
+
createStyledContext: () => createStyledContext2
|
|
1899
|
+
});
|
|
1900
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1901
|
+
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1902
|
+
function createStyledContext2(defaultValues) {
|
|
1903
|
+
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1904
|
+
children,
|
|
1905
|
+
scope,
|
|
1906
|
+
...values
|
|
1907
|
+
}) => {
|
|
1908
|
+
let next = (0, import_react2.useMemo)(() => ({
|
|
1909
|
+
// this ! is a workaround for ts error
|
|
1910
|
+
...defaultValues,
|
|
1911
|
+
...values
|
|
1912
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1913
|
+
if (scope) {
|
|
1914
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
1915
|
+
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1916
|
+
}
|
|
1917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
1918
|
+
}, useStyledContext = (scope) => {
|
|
1919
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1920
|
+
return (0, import_react2.useContext)(context);
|
|
1921
|
+
};
|
|
1922
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
});
|
|
1926
|
+
|
|
1927
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1928
|
+
var require_ComponentContext_native = __commonJS({
|
|
1929
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
1930
|
+
"use strict";
|
|
1931
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1932
|
+
for (var name in all)
|
|
1933
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1934
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1935
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1936
|
+
for (let key of __getOwnPropNames2(from))
|
|
1937
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1938
|
+
return to;
|
|
1939
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1940
|
+
__export2(ComponentContext_exports, {
|
|
1941
|
+
ComponentContext: () => ComponentContext2
|
|
1942
|
+
});
|
|
1943
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1944
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1945
|
+
disableSSR: void 0,
|
|
1946
|
+
inText: !1,
|
|
1947
|
+
language: null,
|
|
1948
|
+
animationDriver: null,
|
|
1949
|
+
groups: {
|
|
1950
|
+
emit: null,
|
|
1951
|
+
subscribe: null,
|
|
1952
|
+
state: {}
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1993
1958
|
// ../web/dist/cjs/defaultComponentState.native.js
|
|
1994
1959
|
var require_defaultComponentState_native = __commonJS({
|
|
1995
1960
|
"../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
|
|
@@ -2768,10 +2733,10 @@ var require_normalizeColor_native = __commonJS({
|
|
|
2768
2733
|
rgba: () => import_normalize_css_color2.rgba
|
|
2769
2734
|
});
|
|
2770
2735
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
2771
|
-
var
|
|
2736
|
+
var import_normalize_css_color = require_index_native11(), import_normalize_css_color2 = require_index_native11(), normalizeColor = (color, opacity) => {
|
|
2772
2737
|
if (!color)
|
|
2773
2738
|
return;
|
|
2774
|
-
if (color[0] === "$" || color
|
|
2739
|
+
if (color[0] === "$" || color.startsWith("var("))
|
|
2775
2740
|
return color;
|
|
2776
2741
|
let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
|
|
2777
2742
|
if (colorProcessed != null) {
|
|
@@ -2897,7 +2862,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
2897
2862
|
function fixStyles(style) {
|
|
2898
2863
|
"elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
|
|
2899
2864
|
for (let key in borderDefaults)
|
|
2900
|
-
key in style &&
|
|
2865
|
+
key in style && (style[borderDefaults[key]] ||= "solid");
|
|
2901
2866
|
}
|
|
2902
2867
|
var nativeStyle = import_constants4.isWeb ? null : "borderStyle", borderDefaults = {
|
|
2903
2868
|
borderWidth: "borderStyle",
|
|
@@ -3072,7 +3037,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3072
3037
|
getVariantExtras: () => getVariantExtras
|
|
3073
3038
|
});
|
|
3074
3039
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
3075
|
-
var import_createVariable = require_createVariable_native()
|
|
3040
|
+
var import_createVariable = require_createVariable_native();
|
|
3076
3041
|
function getVariantExtras(styleState) {
|
|
3077
3042
|
let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3078
3043
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
@@ -3087,7 +3052,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3087
3052
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
3088
3053
|
// TODO do this in splitstlye
|
|
3089
3054
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
3090
|
-
props:
|
|
3055
|
+
props: new Proxy(curProps, {
|
|
3091
3056
|
// handles shorthands
|
|
3092
3057
|
get(target, key) {
|
|
3093
3058
|
let shorthand = conf.inverseShorthands[key];
|
|
@@ -3162,7 +3127,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3162
3127
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3163
3128
|
var import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
3164
3129
|
var _a;
|
|
3165
|
-
if (!import_constants4.isAndroid && key === "elevationAndroid")
|
|
3130
|
+
if (lastFontFamilyToken = null, !import_constants4.isAndroid && key === "elevationAndroid")
|
|
3166
3131
|
return;
|
|
3167
3132
|
if (value === "unset") {
|
|
3168
3133
|
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
@@ -3191,7 +3156,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3191
3156
|
let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
|
|
3192
3157
|
[key, value]
|
|
3193
3158
|
];
|
|
3194
|
-
return key === "fontFamily" && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3159
|
+
return key === "fontFamily" && lastFontFamilyToken && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3195
3160
|
}
|
|
3196
3161
|
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3197
3162
|
let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
@@ -3444,7 +3409,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3444
3409
|
}), console.groupEnd());
|
|
3445
3410
|
for (let keyOg in props) {
|
|
3446
3411
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
3447
|
-
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
|
|
3412
|
+
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3448
3413
|
continue;
|
|
3449
3414
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3450
3415
|
if (styleState.curProps[keyInit] = valInit, !import_constants4.isAndroid && keyInit === "elevationAndroid")
|
|
@@ -3935,9 +3900,8 @@ var require_proxyThemeVariables_native = __commonJS({
|
|
|
3935
3900
|
proxyThemeVariables: () => proxyThemeVariables
|
|
3936
3901
|
});
|
|
3937
3902
|
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
3938
|
-
var import_createProxy = require_createProxy_native();
|
|
3939
3903
|
function proxyThemeVariables(obj) {
|
|
3940
|
-
return
|
|
3904
|
+
return new Proxy(obj || {}, {
|
|
3941
3905
|
has(target, key) {
|
|
3942
3906
|
return Reflect.has(target, removeStarting$(key));
|
|
3943
3907
|
},
|
|
@@ -3992,7 +3956,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3992
3956
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3993
3957
|
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
3994
3958
|
function getHasThemeUpdatingProps(props) {
|
|
3995
|
-
return props.name || props.componentName || props.inverse || props.reset;
|
|
3959
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
3996
3960
|
}
|
|
3997
3961
|
var uid = 0, ThemeManager = class {
|
|
3998
3962
|
constructor(props = {}, parentManager) {
|
|
@@ -4062,7 +4026,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4062
4026
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
4063
4027
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
4064
4028
|
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
4065
|
-
process.env.NODE_ENV !== "production" &&
|
|
4029
|
+
process.env.NODE_ENV !== "production" && props.debug && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }));
|
|
4066
4030
|
for (let i = max2; i >= min2; i--) {
|
|
4067
4031
|
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
4068
4032
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
@@ -4072,16 +4036,18 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4072
4036
|
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
4073
4037
|
}
|
|
4074
4038
|
if (componentName && !props.reset) {
|
|
4075
|
-
let componentPotentials = [];
|
|
4076
|
-
if (nextName) {
|
|
4077
|
-
let beforeSeparator =
|
|
4039
|
+
let baseLen = base.length, componentPotentials = [];
|
|
4040
|
+
if (nextName && baseLen > 1) {
|
|
4041
|
+
let beforeSeparator = base[0];
|
|
4078
4042
|
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
4079
4043
|
}
|
|
4080
4044
|
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4045
|
+
if (i > baseLen) {
|
|
4046
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
4047
|
+
if (prefixLessOne) {
|
|
4048
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
4049
|
+
componentPotentials.unshift(lessSpecific);
|
|
4050
|
+
}
|
|
4085
4051
|
}
|
|
4086
4052
|
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
4087
4053
|
componentPotentials.unshift(moreSpecific);
|
|
@@ -4090,6 +4056,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4090
4056
|
}
|
|
4091
4057
|
let found = potentials.find((t) => t in themes);
|
|
4092
4058
|
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" getState ", {
|
|
4059
|
+
props,
|
|
4093
4060
|
found,
|
|
4094
4061
|
potentials,
|
|
4095
4062
|
baseManager,
|
|
@@ -4121,28 +4088,6 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4121
4088
|
}
|
|
4122
4089
|
});
|
|
4123
4090
|
|
|
4124
|
-
// ../web/dist/cjs/hooks/getThemeUnwrapped.native.js
|
|
4125
|
-
var require_getThemeUnwrapped_native = __commonJS({
|
|
4126
|
-
"../web/dist/cjs/hooks/getThemeUnwrapped.native.js"(exports, module2) {
|
|
4127
|
-
"use strict";
|
|
4128
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4129
|
-
for (var name in all)
|
|
4130
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4131
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
4132
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
4133
|
-
for (let key of __getOwnPropNames2(from))
|
|
4134
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4135
|
-
return to;
|
|
4136
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getThemeUnwrapped_exports = {};
|
|
4137
|
-
__export2(getThemeUnwrapped_exports, {
|
|
4138
|
-
GetThemeUnwrapped: () => GetThemeUnwrapped,
|
|
4139
|
-
getThemeUnwrapped: () => getThemeUnwrapped
|
|
4140
|
-
});
|
|
4141
|
-
module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
|
|
4142
|
-
var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
|
|
4143
|
-
}
|
|
4144
|
-
});
|
|
4145
|
-
|
|
4146
4091
|
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
4147
4092
|
var require_useTheme_native = __commonJS({
|
|
4148
4093
|
"../web/dist/cjs/hooks/useTheme.native.js"(exports, module2) {
|
|
@@ -4164,7 +4109,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4164
4109
|
useThemeWithState: () => useThemeWithState
|
|
4165
4110
|
});
|
|
4166
4111
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4167
|
-
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(),
|
|
4112
|
+
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
4168
4113
|
function getDefaultThemeProxied() {
|
|
4169
4114
|
if (cached)
|
|
4170
4115
|
return cached;
|
|
@@ -4205,7 +4150,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4205
4150
|
function track(key) {
|
|
4206
4151
|
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
4207
4152
|
}
|
|
4208
|
-
return
|
|
4153
|
+
return new Proxy(theme, {
|
|
4209
4154
|
has(_, key) {
|
|
4210
4155
|
if (Reflect.has(theme, key))
|
|
4211
4156
|
return !0;
|
|
@@ -4213,8 +4158,6 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4213
4158
|
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
4214
4159
|
},
|
|
4215
4160
|
get(_, key) {
|
|
4216
|
-
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
4217
|
-
return theme;
|
|
4218
4161
|
if (
|
|
4219
4162
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
4220
4163
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
@@ -4362,7 +4305,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4362
4305
|
}
|
|
4363
4306
|
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4364
4307
|
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4365
|
-
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed ? !1 : null, response = {
|
|
4308
|
+
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed != null ? !1 : null, response = {
|
|
4366
4309
|
themeManager: themeManager2,
|
|
4367
4310
|
isNewTheme: isNewTheme2,
|
|
4368
4311
|
mounted: mounted2,
|
|
@@ -4441,40 +4384,40 @@ var require_Theme_native = __commonJS({
|
|
|
4441
4384
|
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Theme_exports = {};
|
|
4442
4385
|
__export2(Theme_exports, {
|
|
4443
4386
|
Theme: () => Theme2,
|
|
4444
|
-
|
|
4387
|
+
getThemedChildren: () => getThemedChildren
|
|
4445
4388
|
});
|
|
4446
4389
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
4447
|
-
var import_constants4 = require_index_native(), import_react2 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime6 = require("react/jsx-runtime"), Theme2 = (0, import_react2.forwardRef)(function(props, ref) {
|
|
4390
|
+
var import_constants4 = require_index_native(), import_react2 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime6 = require("react/jsx-runtime"), Theme2 = (0, import_react2.forwardRef)(function({ children, ...props }, ref) {
|
|
4448
4391
|
if (props.disable)
|
|
4449
|
-
return
|
|
4450
|
-
let isRoot = !!props._isRoot,
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
return process.env.NODE_ENV === "development" && props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
|
|
4461
|
-
}, [props.children, disableDirectChildTheme]);
|
|
4462
|
-
return useThemedChildren(themeState, children, props, isRoot);
|
|
4392
|
+
return children;
|
|
4393
|
+
let isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), finalChildren = props["disable-child-theme"] ? import_react2.Children.map(
|
|
4394
|
+
children,
|
|
4395
|
+
(child) => (0, import_react2.cloneElement)(child, { "data-disable-theme": !0 })
|
|
4396
|
+
) : children;
|
|
4397
|
+
if (ref)
|
|
4398
|
+
try {
|
|
4399
|
+
import_react2.default.Children.only(finalChildren), finalChildren = (0, import_react2.cloneElement)(finalChildren, { ref });
|
|
4400
|
+
} catch {
|
|
4401
|
+
}
|
|
4402
|
+
return process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: finalChildren })), getThemedChildren(themeState, finalChildren, props, isRoot);
|
|
4463
4403
|
});
|
|
4464
4404
|
Theme2.displayName = "Theme";
|
|
4465
4405
|
Theme2.avoidForwardRef = !0;
|
|
4466
|
-
function
|
|
4467
|
-
let { themeManager, isNewTheme } = themeState
|
|
4468
|
-
if (
|
|
4406
|
+
function getThemedChildren(themeState, children, props, isRoot = !1) {
|
|
4407
|
+
let { themeManager, isNewTheme } = themeState;
|
|
4408
|
+
if (!themeManager)
|
|
4409
|
+
throw "\u274C";
|
|
4410
|
+
let { shallow, forceClassName } = props, hasEverThemed = (0, import_react2.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
|
|
4411
|
+
if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
|
|
4469
4412
|
return children;
|
|
4470
4413
|
let next = children;
|
|
4471
|
-
shallow &&
|
|
4414
|
+
shallow && (next = import_react2.Children.toArray(children).map((child) => (0, import_react2.isValidElement)(child) ? (0, import_react2.cloneElement)(
|
|
4472
4415
|
child,
|
|
4473
4416
|
void 0,
|
|
4474
4417
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Theme2, { name: themeManager.state.parentName, children: child.props.children })
|
|
4475
4418
|
) : child));
|
|
4476
|
-
let elementsWithContext =
|
|
4477
|
-
return forceClassName === !1 ? elementsWithContext : import_constants4.isWeb
|
|
4419
|
+
let elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, { value: themeManager, children: next });
|
|
4420
|
+
return forceClassName === !1 ? elementsWithContext : import_constants4.isWeb ? wrapThemeElements({
|
|
4478
4421
|
children: elementsWithContext,
|
|
4479
4422
|
themeState,
|
|
4480
4423
|
forceClassName,
|
|
@@ -4490,18 +4433,18 @@ var require_Theme_native = __commonJS({
|
|
|
4490
4433
|
var _a;
|
|
4491
4434
|
if (isRoot && forceClassName === !1)
|
|
4492
4435
|
return children;
|
|
4493
|
-
let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName;
|
|
4494
|
-
if (!themeState.isNewTheme && !requiresExtraWrapper)
|
|
4495
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "_dsp_contents is_Theme", children });
|
|
4496
|
-
let { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
|
|
4436
|
+
let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
|
|
4497
4437
|
if (requiresExtraWrapper) {
|
|
4498
4438
|
let name = ((_a = themeState.state) == null ? void 0 : _a.name) || "", inverseClassName = name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "";
|
|
4499
4439
|
themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${inverse ? inverseClassName : ""} _dsp_contents`, children: themedChildren });
|
|
4500
4440
|
}
|
|
4501
4441
|
return themedChildren;
|
|
4502
4442
|
}
|
|
4443
|
+
var emptyObj = {};
|
|
4503
4444
|
function getThemeClassNameAndStyle(themeState, isRoot = !1) {
|
|
4504
4445
|
var _a, _b;
|
|
4446
|
+
if (!themeState.isNewTheme)
|
|
4447
|
+
return { className: "", style: emptyObj };
|
|
4505
4448
|
let themeColor = (_a = themeState.state) != null && _a.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
|
|
4506
4449
|
color: themeColor
|
|
4507
4450
|
} : void 0, className = ((_b = themeState.state) == null ? void 0 : _b.className) || "";
|
|
@@ -4527,7 +4470,10 @@ var require_themeable_native = __commonJS({
|
|
|
4527
4470
|
themeable: () => themeable3
|
|
4528
4471
|
});
|
|
4529
4472
|
module2.exports = __toCommonJS2(themeable_exports);
|
|
4530
|
-
var import_react2 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime6 =
|
|
4473
|
+
var import_react2 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime6 = (
|
|
4474
|
+
// @ts-expect-error its ok
|
|
4475
|
+
require("react/jsx-runtime")
|
|
4476
|
+
);
|
|
4531
4477
|
function themeable3(Component, staticConfig) {
|
|
4532
4478
|
let withTheme = (0, import_react2.forwardRef)(function(props, ref) {
|
|
4533
4479
|
let { themeInverse, theme, componentName, themeReset, ...rest } = props, element = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { ref, ...rest, "data-disable-theme": !0 });
|
|
@@ -4805,7 +4751,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4805
4751
|
isEntering && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4806
4752
|
}
|
|
4807
4753
|
}
|
|
4808
|
-
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo,
|
|
4754
|
+
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableTheme = isHOC;
|
|
4809
4755
|
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4810
4756
|
let themeStateProps = {
|
|
4811
4757
|
name: props.theme,
|
|
@@ -5098,7 +5044,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5098
5044
|
subscribe: groupState.subscribe
|
|
5099
5045
|
};
|
|
5100
5046
|
}, [groupName]);
|
|
5101
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content =
|
|
5047
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
5102
5048
|
let contextProps = staticConfig.context.props;
|
|
5103
5049
|
for (let key in contextProps)
|
|
5104
5050
|
(key in style || key in viewProps) && (overriddenContextProps ||= {}, overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
@@ -5438,11 +5384,10 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5438
5384
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeToParents_exports = {};
|
|
5439
5385
|
__export2(proxyThemeToParents_exports, {
|
|
5440
5386
|
proxyThemeToParents: () => proxyThemeToParents,
|
|
5441
|
-
proxyThemesToParents: () => proxyThemesToParents
|
|
5442
|
-
themesRaw: () => themesRaw
|
|
5387
|
+
proxyThemesToParents: () => proxyThemesToParents
|
|
5443
5388
|
});
|
|
5444
5389
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
5445
|
-
var import_config = require_config_native(),
|
|
5390
|
+
var import_config = require_config_native(), themesRaw = {};
|
|
5446
5391
|
function proxyThemesToParents(dedupedThemes) {
|
|
5447
5392
|
for (let { names, theme } of dedupedThemes)
|
|
5448
5393
|
for (let name of names)
|
|
@@ -5459,9 +5404,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5459
5404
|
let cur = [], parents = themeName.split("_").slice(0, -1).map((part) => (cur.push(part), cur.join("_"))), numParents = parents.length;
|
|
5460
5405
|
return new Proxy(theme, {
|
|
5461
5406
|
get(target, key) {
|
|
5462
|
-
if (key
|
|
5463
|
-
return theme;
|
|
5464
|
-
if (key == null || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5407
|
+
if (!key || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5465
5408
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
5466
5409
|
key == "undefined" || Reflect.has(target, key))
|
|
5467
5410
|
return Reflect.get(target, key);
|
|
@@ -5470,7 +5413,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5470
5413
|
if (parent && Reflect.has(parent, key))
|
|
5471
5414
|
return Reflect.get(parent, key);
|
|
5472
5415
|
}
|
|
5473
|
-
return (0, import_config.getTokenObject)(key)
|
|
5416
|
+
return (0, import_config.getTokenObject)(key);
|
|
5474
5417
|
}
|
|
5475
5418
|
});
|
|
5476
5419
|
}
|
|
@@ -5521,14 +5464,14 @@ var require_themes_native = __commonJS({
|
|
|
5521
5464
|
module2.exports = __toCommonJS2(themes_exports);
|
|
5522
5465
|
var import_createVariable = require_createVariable_native();
|
|
5523
5466
|
function ensureThemeVariable(theme, key) {
|
|
5524
|
-
let val = theme[key]
|
|
5525
|
-
(0, import_createVariable.isVariable)(val) ? val.name !==
|
|
5467
|
+
let val = theme[key];
|
|
5468
|
+
(0, import_createVariable.isVariable)(val) ? val.name !== key && (theme[key] = (0, import_createVariable.createVariable)({
|
|
5526
5469
|
key: val.name,
|
|
5527
|
-
name:
|
|
5470
|
+
name: key,
|
|
5528
5471
|
val: val.val
|
|
5529
5472
|
})) : theme[key] = (0, import_createVariable.createVariable)({
|
|
5530
|
-
key
|
|
5531
|
-
name:
|
|
5473
|
+
key,
|
|
5474
|
+
name: key,
|
|
5532
5475
|
val
|
|
5533
5476
|
});
|
|
5534
5477
|
}
|
|
@@ -5878,31 +5821,18 @@ var require_mergeVariants_native = __commonJS({
|
|
|
5878
5821
|
mergeVariants: () => mergeVariants
|
|
5879
5822
|
});
|
|
5880
5823
|
module2.exports = __toCommonJS2(mergeVariants_exports);
|
|
5881
|
-
var mergeVariants = (parentVariants, ourVariants) => {
|
|
5824
|
+
var mergeVariants = (parentVariants, ourVariants, level = 0) => {
|
|
5882
5825
|
let variants = {};
|
|
5883
5826
|
for (let key in ourVariants) {
|
|
5884
5827
|
let parentVariant = parentVariants == null ? void 0 : parentVariants[key], ourVariant = ourVariants[key];
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
variants[key] = parentVariant[key];
|
|
5891
|
-
continue;
|
|
5892
|
-
}
|
|
5893
|
-
variants[key] = {};
|
|
5894
|
-
for (let subKey in ourVariant) {
|
|
5895
|
-
let val = ourVariant[subKey], parentVal = parentVariant == null ? void 0 : parentVariant[subKey];
|
|
5896
|
-
typeof val == "function" || !parentVal || typeof parentVal == "function" ? variants[key][subKey] = val : variants[key][subKey] = {
|
|
5897
|
-
// keep order
|
|
5898
|
-
...parentVal,
|
|
5899
|
-
...val
|
|
5900
|
-
};
|
|
5901
|
-
}
|
|
5902
|
-
parentVariant && (variants[key] = {
|
|
5828
|
+
!parentVariant || typeof ourVariant == "function" ? variants[key] = ourVariant : parentVariant && !ourVariant ? variants[key] = parentVariant[key] : level === 0 ? variants[key] = mergeVariants(
|
|
5829
|
+
parentVariant,
|
|
5830
|
+
ourVariant,
|
|
5831
|
+
level + 1
|
|
5832
|
+
) : variants[key] = {
|
|
5903
5833
|
...parentVariant,
|
|
5904
|
-
...
|
|
5905
|
-
}
|
|
5834
|
+
...ourVariant
|
|
5835
|
+
};
|
|
5906
5836
|
}
|
|
5907
5837
|
return {
|
|
5908
5838
|
...parentVariants,
|
|
@@ -7985,26 +7915,27 @@ var require_index_native15 = __commonJS({
|
|
|
7985
7915
|
return viewProps;
|
|
7986
7916
|
},
|
|
7987
7917
|
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
7988
|
-
if (events)
|
|
7989
|
-
if (events
|
|
7918
|
+
if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput) {
|
|
7919
|
+
if (events) {
|
|
7990
7920
|
let { onPressIn, onPressOut, onPress } = events, inputEvents = {
|
|
7991
7921
|
onPressIn,
|
|
7992
7922
|
onPressOut: onPressOut || onPress
|
|
7993
7923
|
};
|
|
7994
7924
|
onPressOut && onPress && (inputEvents.onPressOut = (0, import_web.composeEventHandlers)(onPress, onPressOut)), Object.assign(viewProps, inputEvents);
|
|
7995
|
-
} else {
|
|
7996
|
-
viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7997
|
-
let pressability = (0, import_Pressability.usePressability)(events);
|
|
7998
|
-
if (process.env.NODE_ENV === "development" && viewProps.debug && console.info(
|
|
7999
|
-
`Checking for press ${!!events.onPress} then applying pressability props: ${Object.keys(
|
|
8000
|
-
pressability || {}
|
|
8001
|
-
)}`
|
|
8002
|
-
), events.onPress)
|
|
8003
|
-
for (let key in pressability) {
|
|
8004
|
-
let og = viewProps[key], val = pressability[key];
|
|
8005
|
-
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
8006
|
-
}
|
|
8007
7925
|
}
|
|
7926
|
+
} else {
|
|
7927
|
+
events && viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7928
|
+
let pressability = (0, import_Pressability.usePressability)(events);
|
|
7929
|
+
if (events && (process.env.NODE_ENV === "development" && viewProps.debug && console.info(
|
|
7930
|
+
`Checking for press ${!!events.onPress} then applying pressability props: ${Object.keys(
|
|
7931
|
+
pressability || {}
|
|
7932
|
+
)}`
|
|
7933
|
+
), events.onPress))
|
|
7934
|
+
for (let key in pressability) {
|
|
7935
|
+
let og = viewProps[key], val = pressability[key];
|
|
7936
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7937
|
+
}
|
|
7938
|
+
}
|
|
8008
7939
|
},
|
|
8009
7940
|
useChildren(elementType, children, viewProps, events, staticConfig) {
|
|
8010
7941
|
if (process.env.NODE_ENV !== "test") {
|
|
@@ -11995,7 +11926,7 @@ var require_getFontSize_native = __commonJS({
|
|
|
11995
11926
|
}, getFontSizeToken = (inSize, opts) => {
|
|
11996
11927
|
if (typeof inSize == "number")
|
|
11997
11928
|
return null;
|
|
11998
|
-
let relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = (0, import_core13.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size2 = inSize || ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size2);
|
|
11929
|
+
let relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = (0, import_core13.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size2 = (inSize === "$true" ? "$4" : inSize) || ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size2);
|
|
11999
11930
|
foundIndex === -1 && size2.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size2.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size2, opts, "in size tokens", sizeTokens);
|
|
12000
11931
|
let tokenIndex = Math.min(
|
|
12001
11932
|
Math.max(0, foundIndex + relativeSize),
|
|
@@ -12271,7 +12202,9 @@ var require_Button_native = __commonJS({
|
|
|
12271
12202
|
ellipse,
|
|
12272
12203
|
maxFontSizeMultiplier,
|
|
12273
12204
|
...restProps
|
|
12274
|
-
} = propsActive, size2 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2
|
|
12205
|
+
} = propsActive, size2 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2, {
|
|
12206
|
+
font: (fontFamily == null ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
12207
|
+
})) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
12275
12208
|
size: iconSize,
|
|
12276
12209
|
color
|
|
12277
12210
|
}), [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon), spaceSize = space ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace, contents = noTextWrap ? [propsIn.children] : (0, import_text2.wrapChildrenInText)(
|
|
@@ -13698,7 +13631,7 @@ var require_Group_native = __commonJS({
|
|
|
13698
13631
|
borderRadius,
|
|
13699
13632
|
forceUseItem,
|
|
13700
13633
|
...restProps
|
|
13701
|
-
} =
|
|
13634
|
+
} = activeProps, vertical = orientation === "vertical", [itemChildrenCount, setItemChildrenCount] = (0, import_use_controllable_state.useControllableState)({
|
|
13702
13635
|
defaultProp: forceUseItem ? 1 : 0
|
|
13703
13636
|
}), isUsingItems = itemChildrenCount > 0, radius = borderRadius ?? (size2 ? (0, import_core13.getVariableValue)((0, import_core13.getTokens)().radius[size2]) - 1 : void 0), disablePassBorderRadius = disablePassBorderRadiusProp ?? radius === void 0, childrenArray = import_react2.Children.toArray(childrenProp), children = isUsingItems ? import_react2.Children.toArray(childrenProp).filter(import_react2.isValidElement) : childrenArray.map((child, i) => {
|
|
13704
13637
|
if (!(0, import_react2.isValidElement)(child))
|
|
@@ -15599,7 +15532,7 @@ var require_Popover_native = __commonJS({
|
|
|
15599
15532
|
context,
|
|
15600
15533
|
children: props.children
|
|
15601
15534
|
}
|
|
15602
|
-
)), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, { zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core13.Theme, { name: themeName, children: [
|
|
15535
|
+
)), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, { zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core13.Theme, { forceClassName: !0, name: themeName, children: [
|
|
15603
15536
|
!!context.open && !context.breakpointActive && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
15604
15537
|
import_stacks3.YStack,
|
|
15605
15538
|
{
|
|
@@ -16947,10 +16880,12 @@ var require_Select_native = __commonJS({
|
|
|
16947
16880
|
{
|
|
16948
16881
|
...!props.unstyled && {
|
|
16949
16882
|
size: itemParentContext.size,
|
|
16950
|
-
ellipse: !0
|
|
16883
|
+
ellipse: !0,
|
|
16884
|
+
// we don't want events from the portalled `SelectValue` children to bubble
|
|
16885
|
+
// through the item they came from
|
|
16886
|
+
pointerEvents: "none"
|
|
16951
16887
|
},
|
|
16952
16888
|
ref: composedRefs,
|
|
16953
|
-
pointerEvents: "none",
|
|
16954
16889
|
...props,
|
|
16955
16890
|
children: unwrapSelectItem(selectValueChildren)
|
|
16956
16891
|
}
|
|
@@ -18082,107 +18017,112 @@ var require_createSwitch_native = __commonJS({
|
|
|
18082
18017
|
ref: forwardedRef
|
|
18083
18018
|
}
|
|
18084
18019
|
);
|
|
18085
|
-
}), SwitchComponent = Frame.styleable(
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
|
|
18096
|
-
|
|
18097
|
-
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
|
|
18101
|
-
|
|
18102
|
-
|
|
18103
|
-
|
|
18104
|
-
|
|
18105
|
-
|
|
18106
|
-
|
|
18107
|
-
|
|
18108
|
-
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
);
|
|
18121
|
-
import_constants4.isWeb || React2.useEffect(() => {
|
|
18122
|
-
if (props.id)
|
|
18123
|
-
return (0, import_focusable2.registerFocusable)(props.id, {
|
|
18124
|
-
focus: () => {
|
|
18125
|
-
setChecked((x) => !x);
|
|
18020
|
+
}), SwitchComponent = Frame.styleable(
|
|
18021
|
+
function(propsIn, forwardedRef) {
|
|
18022
|
+
let styledContext = React2.useContext(import_SwitchContext.SwitchContext), props = (0, import_core13.useProps)(propsIn, {
|
|
18023
|
+
noNormalize: !0,
|
|
18024
|
+
noExpand: !0,
|
|
18025
|
+
resolveValues: "none",
|
|
18026
|
+
forComponent: Frame
|
|
18027
|
+
}), {
|
|
18028
|
+
labeledBy: ariaLabelledby,
|
|
18029
|
+
name,
|
|
18030
|
+
checked: checkedProp,
|
|
18031
|
+
defaultChecked,
|
|
18032
|
+
required,
|
|
18033
|
+
disabled,
|
|
18034
|
+
value = "on",
|
|
18035
|
+
onCheckedChange,
|
|
18036
|
+
size: size2 = styledContext.size ?? "$true",
|
|
18037
|
+
unstyled = styledContext.unstyled ?? !1,
|
|
18038
|
+
native: nativeProp,
|
|
18039
|
+
nativeProps,
|
|
18040
|
+
children,
|
|
18041
|
+
...switchProps
|
|
18042
|
+
} = props, native = Array.isArray(nativeProp) ? nativeProp : [nativeProp], shouldRenderMobileNative = !import_constants4.isWeb && nativeProp === !0 || !import_constants4.isWeb && native.includes("mobile") || native.includes("android") && import_react_native4.Platform.OS === "android" || native.includes("ios") && import_react_native4.Platform.OS === "ios", [button, setButton] = React2.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, setButton), labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId, hasConsumerStoppedPropagationRef = React2.useRef(!1), isFormControl = import_constants4.isWeb ? button ? !!button.closest("form") : !0 : !1, [frameWidth, setFrameWidth] = React2.useState(0), [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
18043
|
+
prop: checkedProp,
|
|
18044
|
+
defaultProp: defaultChecked || !1,
|
|
18045
|
+
onChange: onCheckedChange,
|
|
18046
|
+
transition: !0
|
|
18047
|
+
});
|
|
18048
|
+
if (shouldRenderMobileNative)
|
|
18049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18050
|
+
import_react_native4.Switch,
|
|
18051
|
+
{
|
|
18052
|
+
value: checkedProp,
|
|
18053
|
+
onValueChange: onCheckedChange,
|
|
18054
|
+
...nativeProps
|
|
18126
18055
|
}
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
{
|
|
18134
|
-
tag: isInsideButton ? "span" : "button",
|
|
18135
|
-
unstyled,
|
|
18136
|
-
size: size2,
|
|
18137
|
-
checked,
|
|
18138
|
-
disabled,
|
|
18139
|
-
frameWidth,
|
|
18140
|
-
themeShallow: !0,
|
|
18141
|
-
...!disableActiveTheme && {
|
|
18142
|
-
theme: checked ? "active" : null,
|
|
18143
|
-
themeShallow: !0
|
|
18144
|
-
},
|
|
18145
|
-
role: "switch",
|
|
18146
|
-
"aria-checked": checked,
|
|
18147
|
-
"aria-labelledby": labelledBy,
|
|
18148
|
-
"aria-required": required,
|
|
18149
|
-
"data-state": getState(checked),
|
|
18150
|
-
"data-disabled": disabled ? "" : void 0,
|
|
18151
|
-
tabIndex: disabled ? void 0 : 0,
|
|
18152
|
-
value,
|
|
18153
|
-
...switchProps,
|
|
18154
|
-
ref: composedRefs,
|
|
18155
|
-
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
18156
|
-
setChecked((prevChecked) => !prevChecked), import_constants4.isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
18157
|
-
}),
|
|
18158
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18159
|
-
import_stacks3.YStack,
|
|
18160
|
-
{
|
|
18161
|
-
alignSelf: "stretch",
|
|
18162
|
-
flex: 1,
|
|
18163
|
-
onLayout: (e) => {
|
|
18164
|
-
setFrameWidth(e.nativeEvent.layout.width);
|
|
18165
|
-
},
|
|
18166
|
-
children: typeof children == "function" ? children(checked) : children
|
|
18056
|
+
);
|
|
18057
|
+
import_constants4.isWeb || React2.useEffect(() => {
|
|
18058
|
+
if (props.id)
|
|
18059
|
+
return (0, import_focusable2.registerFocusable)(props.id, {
|
|
18060
|
+
focus: () => {
|
|
18061
|
+
setChecked((x) => !x);
|
|
18167
18062
|
}
|
|
18168
|
-
)
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18174
|
-
|
|
18175
|
-
|
|
18176
|
-
|
|
18177
|
-
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
|
|
18185
|
-
|
|
18063
|
+
});
|
|
18064
|
+
}, [props.id, setChecked]);
|
|
18065
|
+
let isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
|
|
18066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
18067
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18068
|
+
Frame,
|
|
18069
|
+
{
|
|
18070
|
+
tag: isInsideButton ? "span" : "button",
|
|
18071
|
+
unstyled,
|
|
18072
|
+
size: size2,
|
|
18073
|
+
checked,
|
|
18074
|
+
disabled,
|
|
18075
|
+
frameWidth,
|
|
18076
|
+
themeShallow: !0,
|
|
18077
|
+
...!disableActiveTheme && {
|
|
18078
|
+
theme: checked ? "active" : null,
|
|
18079
|
+
themeShallow: !0
|
|
18080
|
+
},
|
|
18081
|
+
role: "switch",
|
|
18082
|
+
"aria-checked": checked,
|
|
18083
|
+
"aria-labelledby": labelledBy,
|
|
18084
|
+
"aria-required": required,
|
|
18085
|
+
"data-state": getState(checked),
|
|
18086
|
+
"data-disabled": disabled ? "" : void 0,
|
|
18087
|
+
tabIndex: disabled ? void 0 : 0,
|
|
18088
|
+
value,
|
|
18089
|
+
...switchProps,
|
|
18090
|
+
ref: composedRefs,
|
|
18091
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
18092
|
+
setChecked((prevChecked) => !prevChecked), import_constants4.isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
18093
|
+
}),
|
|
18094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18095
|
+
import_stacks3.YStack,
|
|
18096
|
+
{
|
|
18097
|
+
alignSelf: "stretch",
|
|
18098
|
+
flex: 1,
|
|
18099
|
+
onLayout: (e) => {
|
|
18100
|
+
setFrameWidth(e.nativeEvent.layout.width);
|
|
18101
|
+
},
|
|
18102
|
+
children: typeof children == "function" ? children(checked) : children
|
|
18103
|
+
}
|
|
18104
|
+
)
|
|
18105
|
+
}
|
|
18106
|
+
) }),
|
|
18107
|
+
import_constants4.isWeb && isFormControl && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18108
|
+
BubbleInput,
|
|
18109
|
+
{
|
|
18110
|
+
control: button,
|
|
18111
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
18112
|
+
name,
|
|
18113
|
+
value,
|
|
18114
|
+
checked,
|
|
18115
|
+
required,
|
|
18116
|
+
disabled,
|
|
18117
|
+
style: { transform: "translateX(-100%)" }
|
|
18118
|
+
}
|
|
18119
|
+
)
|
|
18120
|
+
] });
|
|
18121
|
+
},
|
|
18122
|
+
{
|
|
18123
|
+
disableTheme: !0
|
|
18124
|
+
}
|
|
18125
|
+
), BubbleInput = (props) => {
|
|
18186
18126
|
let { control, checked, bubbles = !0, ...inputProps } = props, ref = React2.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
18187
18127
|
return React2.useEffect(() => {
|
|
18188
18128
|
let input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|