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/test.native.js
CHANGED
|
@@ -1399,29 +1399,6 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1399
1399
|
}
|
|
1400
1400
|
});
|
|
1401
1401
|
|
|
1402
|
-
// ../web/dist/cjs/helpers/createProxy.native.js
|
|
1403
|
-
var require_createProxy_native = __commonJS({
|
|
1404
|
-
"../web/dist/cjs/helpers/createProxy.native.js"(exports, module2) {
|
|
1405
|
-
"use strict";
|
|
1406
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1407
|
-
for (var name in all)
|
|
1408
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1409
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1410
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1411
|
-
for (let key of __getOwnPropNames2(from))
|
|
1412
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1413
|
-
return to;
|
|
1414
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createProxy_exports = {};
|
|
1415
|
-
__export2(createProxy_exports, {
|
|
1416
|
-
createProxy: () => createProxy
|
|
1417
|
-
});
|
|
1418
|
-
module2.exports = __toCommonJS2(createProxy_exports);
|
|
1419
|
-
function createProxy(target, handler) {
|
|
1420
|
-
return new Proxy(target || {}, handler);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
});
|
|
1424
|
-
|
|
1425
1402
|
// ../web/dist/cjs/helpers/matchMedia.native.js
|
|
1426
1403
|
var require_matchMedia_native = __commonJS({
|
|
1427
1404
|
"../web/dist/cjs/helpers/matchMedia.native.js"(exports, module2) {
|
|
@@ -1510,117 +1487,6 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1510
1487
|
}
|
|
1511
1488
|
});
|
|
1512
1489
|
|
|
1513
|
-
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
1514
|
-
var require_objectIdentityKey_native = __commonJS({
|
|
1515
|
-
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
1516
|
-
"use strict";
|
|
1517
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1518
|
-
for (var name in all)
|
|
1519
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1520
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1521
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1522
|
-
for (let key of __getOwnPropNames2(from))
|
|
1523
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1524
|
-
return to;
|
|
1525
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
1526
|
-
__export2(objectIdentityKey_exports, {
|
|
1527
|
-
objectIdentityKey: () => objectIdentityKey
|
|
1528
|
-
});
|
|
1529
|
-
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
1530
|
-
function objectIdentityKey(obj) {
|
|
1531
|
-
let k = "";
|
|
1532
|
-
for (let key in obj) {
|
|
1533
|
-
k += key;
|
|
1534
|
-
let arg = obj[key], type = typeof arg;
|
|
1535
|
-
if (!arg || type !== "object" && type !== "function")
|
|
1536
|
-
k += type + arg;
|
|
1537
|
-
else if (cache.has(arg))
|
|
1538
|
-
k += cache.get(arg);
|
|
1539
|
-
else {
|
|
1540
|
-
let v = Math.random();
|
|
1541
|
-
cache.set(arg, v), k += v;
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
return k;
|
|
1545
|
-
}
|
|
1546
|
-
var cache = /* @__PURE__ */ new WeakMap();
|
|
1547
|
-
}
|
|
1548
|
-
});
|
|
1549
|
-
|
|
1550
|
-
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
1551
|
-
var require_createStyledContext_native = __commonJS({
|
|
1552
|
-
"../web/dist/cjs/helpers/createStyledContext.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), createStyledContext_exports = {};
|
|
1563
|
-
__export2(createStyledContext_exports, {
|
|
1564
|
-
createStyledContext: () => createStyledContext2
|
|
1565
|
-
});
|
|
1566
|
-
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1567
|
-
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1568
|
-
function createStyledContext2(defaultValues) {
|
|
1569
|
-
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1570
|
-
children,
|
|
1571
|
-
scope,
|
|
1572
|
-
...values
|
|
1573
|
-
}) => {
|
|
1574
|
-
let next = (0, import_react2.useMemo)(() => ({
|
|
1575
|
-
// this ! is a workaround for ts error
|
|
1576
|
-
...defaultValues,
|
|
1577
|
-
...values
|
|
1578
|
-
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1579
|
-
if (scope) {
|
|
1580
|
-
let ScopedContext = scopedContexts.get(scope);
|
|
1581
|
-
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1582
|
-
}
|
|
1583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
1584
|
-
}, useStyledContext = (scope) => {
|
|
1585
|
-
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1586
|
-
return (0, import_react2.useContext)(context);
|
|
1587
|
-
};
|
|
1588
|
-
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
|
|
1593
|
-
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1594
|
-
var require_ComponentContext_native = __commonJS({
|
|
1595
|
-
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
1596
|
-
"use strict";
|
|
1597
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1598
|
-
for (var name in all)
|
|
1599
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1600
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
1601
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
1602
|
-
for (let key of __getOwnPropNames2(from))
|
|
1603
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1604
|
-
return to;
|
|
1605
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1606
|
-
__export2(ComponentContext_exports, {
|
|
1607
|
-
ComponentContext: () => ComponentContext2
|
|
1608
|
-
});
|
|
1609
|
-
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1610
|
-
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1611
|
-
disableSSR: void 0,
|
|
1612
|
-
inText: !1,
|
|
1613
|
-
language: null,
|
|
1614
|
-
animationDriver: null,
|
|
1615
|
-
groups: {
|
|
1616
|
-
emit: null,
|
|
1617
|
-
subscribe: null,
|
|
1618
|
-
state: {}
|
|
1619
|
-
}
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
});
|
|
1623
|
-
|
|
1624
1490
|
// ../web/dist/cjs/hooks/useDisableSSR.native.js
|
|
1625
1491
|
var require_useDisableSSR_native = __commonJS({
|
|
1626
1492
|
"../web/dist/cjs/hooks/useDisableSSR.native.js"(exports, module2) {
|
|
@@ -1635,17 +1501,12 @@ var require_useDisableSSR_native = __commonJS({
|
|
|
1635
1501
|
return to;
|
|
1636
1502
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useDisableSSR_exports = {};
|
|
1637
1503
|
__export2(useDisableSSR_exports, {
|
|
1638
|
-
getDisableSSR: () => getDisableSSR
|
|
1639
|
-
useDisableSSR: () => useDisableSSR
|
|
1504
|
+
getDisableSSR: () => getDisableSSR
|
|
1640
1505
|
});
|
|
1641
1506
|
module2.exports = __toCommonJS2(useDisableSSR_exports);
|
|
1642
|
-
var
|
|
1643
|
-
function useDisableSSR() {
|
|
1644
|
-
let componentContext = (0, import_react2.useContext)(import_ComponentContext.ComponentContext);
|
|
1645
|
-
return getDisableSSR(componentContext);
|
|
1646
|
-
}
|
|
1507
|
+
var import_config = require_config_native();
|
|
1647
1508
|
function getDisableSSR(componentContext) {
|
|
1648
|
-
return componentContext.disableSSR ?? (0, import_config.getConfig)().disableSSR;
|
|
1509
|
+
return (componentContext == null ? void 0 : componentContext.disableSSR) ?? (0, import_config.getConfig)().disableSSR;
|
|
1649
1510
|
}
|
|
1650
1511
|
}
|
|
1651
1512
|
});
|
|
@@ -1681,7 +1542,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1681
1542
|
useMedia: () => useMedia3
|
|
1682
1543
|
});
|
|
1683
1544
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
1684
|
-
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(),
|
|
1545
|
+
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 = {}, mediaQueryConfig3 = {}, getMedia3 = () => mediaState3, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => {
|
|
1685
1546
|
if (mediaKeys.has(key))
|
|
1686
1547
|
return !0;
|
|
1687
1548
|
if (key[0] === "$") {
|
|
@@ -1738,7 +1599,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1738
1599
|
return listeners.add(subscriber), () => listeners.delete(subscriber);
|
|
1739
1600
|
}
|
|
1740
1601
|
function useMedia3(uid, componentContext) {
|
|
1741
|
-
let internal = (0, import_react2.useRef)(), initialState = ((
|
|
1602
|
+
let internal = (0, import_react2.useRef)(), initialState = ((0, import_useDisableSSR.getDisableSSR)(componentContext) || !import_constants4.isWeb ? mediaState3 : initState) || {}, state = (0, import_react2.useSyncExternalStore)(
|
|
1742
1603
|
subscribe,
|
|
1743
1604
|
() => {
|
|
1744
1605
|
if (!internal.current)
|
|
@@ -1936,6 +1797,117 @@ var require_constants_native2 = __commonJS({
|
|
|
1936
1797
|
}
|
|
1937
1798
|
});
|
|
1938
1799
|
|
|
1800
|
+
// ../web/dist/cjs/helpers/objectIdentityKey.native.js
|
|
1801
|
+
var require_objectIdentityKey_native = __commonJS({
|
|
1802
|
+
"../web/dist/cjs/helpers/objectIdentityKey.native.js"(exports, module2) {
|
|
1803
|
+
"use strict";
|
|
1804
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1805
|
+
for (var name in all)
|
|
1806
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1807
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1808
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1809
|
+
for (let key of __getOwnPropNames2(from))
|
|
1810
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1811
|
+
return to;
|
|
1812
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), objectIdentityKey_exports = {};
|
|
1813
|
+
__export2(objectIdentityKey_exports, {
|
|
1814
|
+
objectIdentityKey: () => objectIdentityKey
|
|
1815
|
+
});
|
|
1816
|
+
module2.exports = __toCommonJS2(objectIdentityKey_exports);
|
|
1817
|
+
function objectIdentityKey(obj) {
|
|
1818
|
+
let k = "";
|
|
1819
|
+
for (let key in obj) {
|
|
1820
|
+
k += key;
|
|
1821
|
+
let arg = obj[key], type = typeof arg;
|
|
1822
|
+
if (!arg || type !== "object" && type !== "function")
|
|
1823
|
+
k += type + arg;
|
|
1824
|
+
else if (cache.has(arg))
|
|
1825
|
+
k += cache.get(arg);
|
|
1826
|
+
else {
|
|
1827
|
+
let v = Math.random();
|
|
1828
|
+
cache.set(arg, v), k += v;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
return k;
|
|
1832
|
+
}
|
|
1833
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
|
|
1837
|
+
// ../web/dist/cjs/helpers/createStyledContext.native.js
|
|
1838
|
+
var require_createStyledContext_native = __commonJS({
|
|
1839
|
+
"../web/dist/cjs/helpers/createStyledContext.native.js"(exports, module2) {
|
|
1840
|
+
"use strict";
|
|
1841
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1842
|
+
for (var name in all)
|
|
1843
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1844
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1845
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1846
|
+
for (let key of __getOwnPropNames2(from))
|
|
1847
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1848
|
+
return to;
|
|
1849
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createStyledContext_exports = {};
|
|
1850
|
+
__export2(createStyledContext_exports, {
|
|
1851
|
+
createStyledContext: () => createStyledContext2
|
|
1852
|
+
});
|
|
1853
|
+
module2.exports = __toCommonJS2(createStyledContext_exports);
|
|
1854
|
+
var import_react2 = require("react"), import_objectIdentityKey = require_objectIdentityKey_native(), import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1855
|
+
function createStyledContext2(defaultValues) {
|
|
1856
|
+
let OGContext = (0, import_react2.createContext)(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), Provider = ({
|
|
1857
|
+
children,
|
|
1858
|
+
scope,
|
|
1859
|
+
...values
|
|
1860
|
+
}) => {
|
|
1861
|
+
let next = (0, import_react2.useMemo)(() => ({
|
|
1862
|
+
// this ! is a workaround for ts error
|
|
1863
|
+
...defaultValues,
|
|
1864
|
+
...values
|
|
1865
|
+
}), [(0, import_objectIdentityKey.objectIdentityKey)(values)]), Provider2 = OGProvider2;
|
|
1866
|
+
if (scope) {
|
|
1867
|
+
let ScopedContext = scopedContexts.get(scope);
|
|
1868
|
+
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1869
|
+
}
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
1871
|
+
}, useStyledContext = (scope) => {
|
|
1872
|
+
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1873
|
+
return (0, import_react2.useContext)(context);
|
|
1874
|
+
};
|
|
1875
|
+
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
});
|
|
1879
|
+
|
|
1880
|
+
// ../web/dist/cjs/contexts/ComponentContext.native.js
|
|
1881
|
+
var require_ComponentContext_native = __commonJS({
|
|
1882
|
+
"../web/dist/cjs/contexts/ComponentContext.native.js"(exports, module2) {
|
|
1883
|
+
"use strict";
|
|
1884
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
1885
|
+
for (var name in all)
|
|
1886
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
1887
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
1888
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
1889
|
+
for (let key of __getOwnPropNames2(from))
|
|
1890
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1891
|
+
return to;
|
|
1892
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ComponentContext_exports = {};
|
|
1893
|
+
__export2(ComponentContext_exports, {
|
|
1894
|
+
ComponentContext: () => ComponentContext2
|
|
1895
|
+
});
|
|
1896
|
+
module2.exports = __toCommonJS2(ComponentContext_exports);
|
|
1897
|
+
var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
|
|
1898
|
+
disableSSR: void 0,
|
|
1899
|
+
inText: !1,
|
|
1900
|
+
language: null,
|
|
1901
|
+
animationDriver: null,
|
|
1902
|
+
groups: {
|
|
1903
|
+
emit: null,
|
|
1904
|
+
subscribe: null,
|
|
1905
|
+
state: {}
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
});
|
|
1910
|
+
|
|
1939
1911
|
// ../web/dist/cjs/defaultComponentState.native.js
|
|
1940
1912
|
var require_defaultComponentState_native = __commonJS({
|
|
1941
1913
|
"../web/dist/cjs/defaultComponentState.native.js"(exports, module2) {
|
|
@@ -2713,10 +2685,10 @@ var require_normalizeColor_native = __commonJS({
|
|
|
2713
2685
|
rgba: () => import_normalize_css_color2.rgba
|
|
2714
2686
|
});
|
|
2715
2687
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
2716
|
-
var
|
|
2688
|
+
var import_normalize_css_color = require_index_native11(), import_normalize_css_color2 = require_index_native11(), normalizeColor = (color, opacity) => {
|
|
2717
2689
|
if (!color)
|
|
2718
2690
|
return;
|
|
2719
|
-
if (color[0] === "$" || color
|
|
2691
|
+
if (color[0] === "$" || color.startsWith("var("))
|
|
2720
2692
|
return color;
|
|
2721
2693
|
let colorProcessed = (0, import_normalize_css_color.normalizeCSSColor)(color);
|
|
2722
2694
|
if (colorProcessed != null) {
|
|
@@ -2831,7 +2803,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
2831
2803
|
function fixStyles(style) {
|
|
2832
2804
|
"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));
|
|
2833
2805
|
for (let key in borderDefaults)
|
|
2834
|
-
key in style &&
|
|
2806
|
+
key in style && (style[borderDefaults[key]] ||= "solid");
|
|
2835
2807
|
}
|
|
2836
2808
|
var nativeStyle = import_constants4.isWeb ? null : "borderStyle", borderDefaults = {
|
|
2837
2809
|
borderWidth: "borderStyle",
|
|
@@ -3005,7 +2977,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3005
2977
|
getVariantExtras: () => getVariantExtras
|
|
3006
2978
|
});
|
|
3007
2979
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
3008
|
-
var import_createVariable = require_createVariable_native()
|
|
2980
|
+
var import_createVariable = require_createVariable_native();
|
|
3009
2981
|
function getVariantExtras(styleState) {
|
|
3010
2982
|
let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3011
2983
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
@@ -3020,7 +2992,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3020
2992
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
3021
2993
|
// TODO do this in splitstlye
|
|
3022
2994
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
3023
|
-
props:
|
|
2995
|
+
props: new Proxy(curProps, {
|
|
3024
2996
|
// handles shorthands
|
|
3025
2997
|
get(target, key) {
|
|
3026
2998
|
let shorthand = conf.inverseShorthands[key];
|
|
@@ -3095,7 +3067,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3095
3067
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3096
3068
|
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) => {
|
|
3097
3069
|
var _a;
|
|
3098
|
-
if (!import_constants4.isAndroid && key === "elevationAndroid")
|
|
3070
|
+
if (lastFontFamilyToken = null, !import_constants4.isAndroid && key === "elevationAndroid")
|
|
3099
3071
|
return;
|
|
3100
3072
|
if (value === "unset") {
|
|
3101
3073
|
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
@@ -3120,7 +3092,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3120
3092
|
let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
|
|
3121
3093
|
[key, value]
|
|
3122
3094
|
];
|
|
3123
|
-
return key === "fontFamily" && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3095
|
+
return key === "fontFamily" && lastFontFamilyToken && fontFamilyCache.set(result, lastFontFamilyToken), result;
|
|
3124
3096
|
}
|
|
3125
3097
|
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
3126
3098
|
let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
@@ -3347,7 +3319,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3347
3319
|
};
|
|
3348
3320
|
for (let keyOg in props) {
|
|
3349
3321
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
3350
|
-
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
|
|
3322
|
+
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3351
3323
|
continue;
|
|
3352
3324
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3353
3325
|
if (styleState.curProps[keyInit] = valInit, !import_constants4.isAndroid && keyInit === "elevationAndroid")
|
|
@@ -3761,9 +3733,8 @@ var require_proxyThemeVariables_native = __commonJS({
|
|
|
3761
3733
|
proxyThemeVariables: () => proxyThemeVariables
|
|
3762
3734
|
});
|
|
3763
3735
|
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
3764
|
-
var import_createProxy = require_createProxy_native();
|
|
3765
3736
|
function proxyThemeVariables(obj) {
|
|
3766
|
-
return
|
|
3737
|
+
return new Proxy(obj || {}, {
|
|
3767
3738
|
has(target, key) {
|
|
3768
3739
|
return Reflect.has(target, removeStarting$(key));
|
|
3769
3740
|
},
|
|
@@ -3818,7 +3789,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3818
3789
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3819
3790
|
var import_constants4 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
|
|
3820
3791
|
function getHasThemeUpdatingProps(props) {
|
|
3821
|
-
return props.name || props.componentName || props.inverse || props.reset;
|
|
3792
|
+
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
3822
3793
|
}
|
|
3823
3794
|
var uid = 0, ThemeManager = class {
|
|
3824
3795
|
constructor(props = {}, parentManager) {
|
|
@@ -3888,7 +3859,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3888
3859
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3889
3860
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3890
3861
|
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
3891
|
-
|
|
3862
|
+
props.debug && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }));
|
|
3892
3863
|
for (let i = max2; i >= min2; i--) {
|
|
3893
3864
|
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3894
3865
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
@@ -3898,16 +3869,18 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3898
3869
|
lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
|
|
3899
3870
|
}
|
|
3900
3871
|
if (componentName && !props.reset) {
|
|
3901
|
-
let componentPotentials = [];
|
|
3902
|
-
if (nextName) {
|
|
3903
|
-
let beforeSeparator =
|
|
3872
|
+
let baseLen = base.length, componentPotentials = [];
|
|
3873
|
+
if (nextName && baseLen > 1) {
|
|
3874
|
+
let beforeSeparator = base[0];
|
|
3904
3875
|
componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
|
|
3905
3876
|
}
|
|
3906
3877
|
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3878
|
+
if (i > baseLen) {
|
|
3879
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3880
|
+
if (prefixLessOne) {
|
|
3881
|
+
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
3882
|
+
componentPotentials.unshift(lessSpecific);
|
|
3883
|
+
}
|
|
3911
3884
|
}
|
|
3912
3885
|
let moreSpecific = `${prefix}_${nextName}_${componentName}`;
|
|
3913
3886
|
componentPotentials.unshift(moreSpecific);
|
|
@@ -3916,6 +3889,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3916
3889
|
}
|
|
3917
3890
|
let found = potentials.find((t) => t in themes);
|
|
3918
3891
|
if (typeof props.debug == "string" && console.info(" getState ", {
|
|
3892
|
+
props,
|
|
3919
3893
|
found,
|
|
3920
3894
|
potentials,
|
|
3921
3895
|
baseManager,
|
|
@@ -3947,28 +3921,6 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3947
3921
|
}
|
|
3948
3922
|
});
|
|
3949
3923
|
|
|
3950
|
-
// ../web/dist/cjs/hooks/getThemeUnwrapped.native.js
|
|
3951
|
-
var require_getThemeUnwrapped_native = __commonJS({
|
|
3952
|
-
"../web/dist/cjs/hooks/getThemeUnwrapped.native.js"(exports, module2) {
|
|
3953
|
-
"use strict";
|
|
3954
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3955
|
-
for (var name in all)
|
|
3956
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3957
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3958
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3959
|
-
for (let key of __getOwnPropNames2(from))
|
|
3960
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3961
|
-
return to;
|
|
3962
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getThemeUnwrapped_exports = {};
|
|
3963
|
-
__export2(getThemeUnwrapped_exports, {
|
|
3964
|
-
GetThemeUnwrapped: () => GetThemeUnwrapped,
|
|
3965
|
-
getThemeUnwrapped: () => getThemeUnwrapped
|
|
3966
|
-
});
|
|
3967
|
-
module2.exports = __toCommonJS2(getThemeUnwrapped_exports);
|
|
3968
|
-
var getThemeUnwrapped = (theme) => (theme == null ? void 0 : theme[GetThemeUnwrapped]) || theme, GetThemeUnwrapped = Symbol();
|
|
3969
|
-
}
|
|
3970
|
-
});
|
|
3971
|
-
|
|
3972
3924
|
// ../web/dist/cjs/hooks/useTheme.native.js
|
|
3973
3925
|
var require_useTheme_native = __commonJS({
|
|
3974
3926
|
"../web/dist/cjs/hooks/useTheme.native.js"(exports, module2) {
|
|
@@ -3990,7 +3942,7 @@ var require_useTheme_native = __commonJS({
|
|
|
3990
3942
|
useThemeWithState: () => useThemeWithState
|
|
3991
3943
|
});
|
|
3992
3944
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
3993
|
-
var import_constants4 = require_index_native(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(),
|
|
3945
|
+
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;
|
|
3994
3946
|
function getDefaultThemeProxied() {
|
|
3995
3947
|
if (cached)
|
|
3996
3948
|
return cached;
|
|
@@ -4021,7 +3973,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4021
3973
|
function track(key) {
|
|
4022
3974
|
keys && !keys.includes(key) && keys.push(key);
|
|
4023
3975
|
}
|
|
4024
|
-
return
|
|
3976
|
+
return new Proxy(theme, {
|
|
4025
3977
|
has(_, key) {
|
|
4026
3978
|
if (Reflect.has(theme, key))
|
|
4027
3979
|
return !0;
|
|
@@ -4029,8 +3981,6 @@ var require_useTheme_native = __commonJS({
|
|
|
4029
3981
|
return key[0] === "$" && (key = key.slice(1)), themeManager == null ? void 0 : themeManager.allKeys.has(key);
|
|
4030
3982
|
},
|
|
4031
3983
|
get(_, key) {
|
|
4032
|
-
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
4033
|
-
return theme;
|
|
4034
3984
|
if (
|
|
4035
3985
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
4036
3986
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
@@ -4169,7 +4119,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4169
4119
|
}
|
|
4170
4120
|
let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
4171
4121
|
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
4172
|
-
let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed ? !1 : null, response = {
|
|
4122
|
+
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 = {
|
|
4173
4123
|
themeManager: themeManager2,
|
|
4174
4124
|
isNewTheme: isNewTheme2,
|
|
4175
4125
|
mounted: mounted2,
|
|
@@ -4233,40 +4183,40 @@ var require_Theme_native = __commonJS({
|
|
|
4233
4183
|
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Theme_exports = {};
|
|
4234
4184
|
__export2(Theme_exports, {
|
|
4235
4185
|
Theme: () => Theme2,
|
|
4236
|
-
|
|
4186
|
+
getThemedChildren: () => getThemedChildren
|
|
4237
4187
|
});
|
|
4238
4188
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
4239
|
-
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) {
|
|
4189
|
+
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) {
|
|
4240
4190
|
if (props.disable)
|
|
4241
|
-
return
|
|
4242
|
-
let isRoot = !!props._isRoot,
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
return children2;
|
|
4253
|
-
}, [props.children, disableDirectChildTheme]);
|
|
4254
|
-
return useThemedChildren(themeState, children, props, isRoot);
|
|
4191
|
+
return children;
|
|
4192
|
+
let isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), finalChildren = props["disable-child-theme"] ? import_react2.Children.map(
|
|
4193
|
+
children,
|
|
4194
|
+
(child) => (0, import_react2.cloneElement)(child, { "data-disable-theme": !0 })
|
|
4195
|
+
) : children;
|
|
4196
|
+
if (ref)
|
|
4197
|
+
try {
|
|
4198
|
+
import_react2.default.Children.only(finalChildren), finalChildren = (0, import_react2.cloneElement)(finalChildren, { ref });
|
|
4199
|
+
} catch {
|
|
4200
|
+
}
|
|
4201
|
+
return getThemedChildren(themeState, finalChildren, props, isRoot);
|
|
4255
4202
|
});
|
|
4256
4203
|
Theme2.displayName = "Theme";
|
|
4257
4204
|
Theme2.avoidForwardRef = !0;
|
|
4258
|
-
function
|
|
4259
|
-
let { themeManager, isNewTheme } = themeState
|
|
4260
|
-
if (
|
|
4205
|
+
function getThemedChildren(themeState, children, props, isRoot = !1) {
|
|
4206
|
+
let { themeManager, isNewTheme } = themeState;
|
|
4207
|
+
if (!themeManager)
|
|
4208
|
+
throw "\u274C";
|
|
4209
|
+
let { shallow, forceClassName } = props, hasEverThemed = (0, import_react2.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
|
|
4210
|
+
if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
|
|
4261
4211
|
return children;
|
|
4262
4212
|
let next = children;
|
|
4263
|
-
shallow &&
|
|
4213
|
+
shallow && (next = import_react2.Children.toArray(children).map((child) => (0, import_react2.isValidElement)(child) ? (0, import_react2.cloneElement)(
|
|
4264
4214
|
child,
|
|
4265
4215
|
void 0,
|
|
4266
4216
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Theme2, { name: themeManager.state.parentName, children: child.props.children })
|
|
4267
4217
|
) : child));
|
|
4268
|
-
let elementsWithContext =
|
|
4269
|
-
return forceClassName === !1 ? elementsWithContext : import_constants4.isWeb
|
|
4218
|
+
let elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, { value: themeManager, children: next });
|
|
4219
|
+
return forceClassName === !1 ? elementsWithContext : import_constants4.isWeb ? wrapThemeElements({
|
|
4270
4220
|
children: elementsWithContext,
|
|
4271
4221
|
themeState,
|
|
4272
4222
|
forceClassName,
|
|
@@ -4282,18 +4232,18 @@ var require_Theme_native = __commonJS({
|
|
|
4282
4232
|
var _a;
|
|
4283
4233
|
if (isRoot && forceClassName === !1)
|
|
4284
4234
|
return children;
|
|
4285
|
-
let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName;
|
|
4286
|
-
if (!themeState.isNewTheme && !requiresExtraWrapper)
|
|
4287
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "_dsp_contents is_Theme", children });
|
|
4288
|
-
let { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
|
|
4235
|
+
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 });
|
|
4289
4236
|
if (requiresExtraWrapper) {
|
|
4290
4237
|
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" : "";
|
|
4291
4238
|
themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${inverse ? inverseClassName : ""} _dsp_contents`, children: themedChildren });
|
|
4292
4239
|
}
|
|
4293
4240
|
return themedChildren;
|
|
4294
4241
|
}
|
|
4242
|
+
var emptyObj = {};
|
|
4295
4243
|
function getThemeClassNameAndStyle(themeState, isRoot = !1) {
|
|
4296
4244
|
var _a, _b;
|
|
4245
|
+
if (!themeState.isNewTheme)
|
|
4246
|
+
return { className: "", style: emptyObj };
|
|
4297
4247
|
let themeColor = (_a = themeState.state) != null && _a.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
|
|
4298
4248
|
color: themeColor
|
|
4299
4249
|
} : void 0, className = ((_b = themeState.state) == null ? void 0 : _b.className) || "";
|
|
@@ -4319,7 +4269,10 @@ var require_themeable_native = __commonJS({
|
|
|
4319
4269
|
themeable: () => themeable3
|
|
4320
4270
|
});
|
|
4321
4271
|
module2.exports = __toCommonJS2(themeable_exports);
|
|
4322
|
-
var import_react2 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime6 =
|
|
4272
|
+
var import_react2 = require("react"), import_Theme = require_Theme_native(), import_jsx_runtime6 = (
|
|
4273
|
+
// @ts-expect-error its ok
|
|
4274
|
+
require("react/jsx-runtime")
|
|
4275
|
+
);
|
|
4323
4276
|
function themeable3(Component, staticConfig) {
|
|
4324
4277
|
let withTheme = (0, import_react2.forwardRef)(function(props, ref) {
|
|
4325
4278
|
let { themeInverse, theme, componentName, themeReset, ...rest } = props, element = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { ref, ...rest, "data-disable-theme": !0 });
|
|
@@ -4546,7 +4499,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4546
4499
|
isEntering && enterVariant ? props[enterVariant] = !0 : isExiting2 && exitVariant && (props[exitVariant] = !enterExitVariant);
|
|
4547
4500
|
}
|
|
4548
4501
|
}
|
|
4549
|
-
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,
|
|
4502
|
+
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;
|
|
4550
4503
|
props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4551
4504
|
let themeStateProps = {
|
|
4552
4505
|
name: props.theme,
|
|
@@ -4793,7 +4746,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4793
4746
|
subscribe: groupState.subscribe
|
|
4794
4747
|
};
|
|
4795
4748
|
}, [groupName]);
|
|
4796
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), content =
|
|
4749
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), staticConfig.context) {
|
|
4797
4750
|
let contextProps = staticConfig.context.props;
|
|
4798
4751
|
for (let key in contextProps)
|
|
4799
4752
|
(key in style || key in viewProps) && (overriddenContextProps ||= {}, overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
@@ -5097,11 +5050,10 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5097
5050
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeToParents_exports = {};
|
|
5098
5051
|
__export2(proxyThemeToParents_exports, {
|
|
5099
5052
|
proxyThemeToParents: () => proxyThemeToParents,
|
|
5100
|
-
proxyThemesToParents: () => proxyThemesToParents
|
|
5101
|
-
themesRaw: () => themesRaw
|
|
5053
|
+
proxyThemesToParents: () => proxyThemesToParents
|
|
5102
5054
|
});
|
|
5103
5055
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
5104
|
-
var import_config = require_config_native(),
|
|
5056
|
+
var import_config = require_config_native(), themesRaw = {};
|
|
5105
5057
|
function proxyThemesToParents(dedupedThemes) {
|
|
5106
5058
|
for (let { names, theme } of dedupedThemes)
|
|
5107
5059
|
for (let name of names)
|
|
@@ -5118,9 +5070,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5118
5070
|
let cur = [], parents = themeName.split("_").slice(0, -1).map((part) => (cur.push(part), cur.join("_"))), numParents = parents.length;
|
|
5119
5071
|
return new Proxy(theme, {
|
|
5120
5072
|
get(target, key) {
|
|
5121
|
-
if (key
|
|
5122
|
-
return theme;
|
|
5123
|
-
if (key == null || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5073
|
+
if (!key || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
5124
5074
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
5125
5075
|
key == "undefined" || Reflect.has(target, key))
|
|
5126
5076
|
return Reflect.get(target, key);
|
|
@@ -5129,7 +5079,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
5129
5079
|
if (parent && Reflect.has(parent, key))
|
|
5130
5080
|
return Reflect.get(parent, key);
|
|
5131
5081
|
}
|
|
5132
|
-
return (0, import_config.getTokenObject)(key)
|
|
5082
|
+
return (0, import_config.getTokenObject)(key);
|
|
5133
5083
|
}
|
|
5134
5084
|
});
|
|
5135
5085
|
}
|
|
@@ -5180,14 +5130,14 @@ var require_themes_native = __commonJS({
|
|
|
5180
5130
|
module2.exports = __toCommonJS2(themes_exports);
|
|
5181
5131
|
var import_createVariable = require_createVariable_native();
|
|
5182
5132
|
function ensureThemeVariable(theme, key) {
|
|
5183
|
-
let val = theme[key]
|
|
5184
|
-
(0, import_createVariable.isVariable)(val) ? val.name !==
|
|
5133
|
+
let val = theme[key];
|
|
5134
|
+
(0, import_createVariable.isVariable)(val) ? val.name !== key && (theme[key] = (0, import_createVariable.createVariable)({
|
|
5185
5135
|
key: val.name,
|
|
5186
|
-
name:
|
|
5136
|
+
name: key,
|
|
5187
5137
|
val: val.val
|
|
5188
5138
|
})) : theme[key] = (0, import_createVariable.createVariable)({
|
|
5189
|
-
key
|
|
5190
|
-
name:
|
|
5139
|
+
key,
|
|
5140
|
+
name: key,
|
|
5191
5141
|
val
|
|
5192
5142
|
});
|
|
5193
5143
|
}
|
|
@@ -5528,31 +5478,18 @@ var require_mergeVariants_native = __commonJS({
|
|
|
5528
5478
|
mergeVariants: () => mergeVariants
|
|
5529
5479
|
});
|
|
5530
5480
|
module2.exports = __toCommonJS2(mergeVariants_exports);
|
|
5531
|
-
var mergeVariants = (parentVariants, ourVariants) => {
|
|
5481
|
+
var mergeVariants = (parentVariants, ourVariants, level = 0) => {
|
|
5532
5482
|
let variants = {};
|
|
5533
5483
|
for (let key in ourVariants) {
|
|
5534
5484
|
let parentVariant = parentVariants == null ? void 0 : parentVariants[key], ourVariant = ourVariants[key];
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
variants[key] = parentVariant[key];
|
|
5541
|
-
continue;
|
|
5542
|
-
}
|
|
5543
|
-
variants[key] = {};
|
|
5544
|
-
for (let subKey in ourVariant) {
|
|
5545
|
-
let val = ourVariant[subKey], parentVal = parentVariant == null ? void 0 : parentVariant[subKey];
|
|
5546
|
-
typeof val == "function" || !parentVal || typeof parentVal == "function" ? variants[key][subKey] = val : variants[key][subKey] = {
|
|
5547
|
-
// keep order
|
|
5548
|
-
...parentVal,
|
|
5549
|
-
...val
|
|
5550
|
-
};
|
|
5551
|
-
}
|
|
5552
|
-
parentVariant && (variants[key] = {
|
|
5485
|
+
!parentVariant || typeof ourVariant == "function" ? variants[key] = ourVariant : parentVariant && !ourVariant ? variants[key] = parentVariant[key] : level === 0 ? variants[key] = mergeVariants(
|
|
5486
|
+
parentVariant,
|
|
5487
|
+
ourVariant,
|
|
5488
|
+
level + 1
|
|
5489
|
+
) : variants[key] = {
|
|
5553
5490
|
...parentVariant,
|
|
5554
|
-
...
|
|
5555
|
-
}
|
|
5491
|
+
...ourVariant
|
|
5492
|
+
};
|
|
5556
5493
|
}
|
|
5557
5494
|
return {
|
|
5558
5495
|
...parentVariants,
|
|
@@ -7625,22 +7562,23 @@ var require_index_native15 = __commonJS({
|
|
|
7625
7562
|
return viewProps;
|
|
7626
7563
|
},
|
|
7627
7564
|
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
7628
|
-
if (events)
|
|
7629
|
-
if (events
|
|
7565
|
+
if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput) {
|
|
7566
|
+
if (events) {
|
|
7630
7567
|
let { onPressIn, onPressOut, onPress } = events, inputEvents = {
|
|
7631
7568
|
onPressIn,
|
|
7632
7569
|
onPressOut: onPressOut || onPress
|
|
7633
7570
|
};
|
|
7634
7571
|
onPressOut && onPress && (inputEvents.onPressOut = (0, import_web.composeEventHandlers)(onPress, onPressOut)), Object.assign(viewProps, inputEvents);
|
|
7635
|
-
} else {
|
|
7636
|
-
viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7637
|
-
let pressability = (0, import_Pressability.usePressability)(events);
|
|
7638
|
-
if (events.onPress)
|
|
7639
|
-
for (let key in pressability) {
|
|
7640
|
-
let og = viewProps[key], val = pressability[key];
|
|
7641
|
-
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7642
|
-
}
|
|
7643
7572
|
}
|
|
7573
|
+
} else {
|
|
7574
|
+
events && viewProps.hitSlop && (events.hitSlop = viewProps.hitSlop);
|
|
7575
|
+
let pressability = (0, import_Pressability.usePressability)(events);
|
|
7576
|
+
if (events && events.onPress)
|
|
7577
|
+
for (let key in pressability) {
|
|
7578
|
+
let og = viewProps[key], val = pressability[key];
|
|
7579
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7580
|
+
}
|
|
7581
|
+
}
|
|
7644
7582
|
},
|
|
7645
7583
|
useChildren(elementType, children, viewProps, events, staticConfig) {
|
|
7646
7584
|
}
|
|
@@ -11542,7 +11480,7 @@ var require_getFontSize_native = __commonJS({
|
|
|
11542
11480
|
}, getFontSizeToken = (inSize, opts) => {
|
|
11543
11481
|
if (typeof inSize == "number")
|
|
11544
11482
|
return null;
|
|
11545
|
-
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);
|
|
11483
|
+
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);
|
|
11546
11484
|
foundIndex === -1 && size2.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size2.replace(".5", "")));
|
|
11547
11485
|
let tokenIndex = Math.min(
|
|
11548
11486
|
Math.max(0, foundIndex + relativeSize),
|
|
@@ -11818,7 +11756,9 @@ var require_Button_native = __commonJS({
|
|
|
11818
11756
|
ellipse,
|
|
11819
11757
|
maxFontSizeMultiplier,
|
|
11820
11758
|
...restProps
|
|
11821
|
-
} = 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
|
|
11759
|
+
} = 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, {
|
|
11760
|
+
font: (fontFamily == null ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
11761
|
+
})) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
11822
11762
|
size: iconSize,
|
|
11823
11763
|
color
|
|
11824
11764
|
}), [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon), spaceSize = space ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace, contents = noTextWrap ? [propsIn.children] : (0, import_text2.wrapChildrenInText)(
|
|
@@ -13158,7 +13098,7 @@ var require_Group_native = __commonJS({
|
|
|
13158
13098
|
borderRadius,
|
|
13159
13099
|
forceUseItem,
|
|
13160
13100
|
...restProps
|
|
13161
|
-
} =
|
|
13101
|
+
} = activeProps, vertical = orientation === "vertical", [itemChildrenCount, setItemChildrenCount] = (0, import_use_controllable_state.useControllableState)({
|
|
13162
13102
|
defaultProp: forceUseItem ? 1 : 0
|
|
13163
13103
|
}), 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) => {
|
|
13164
13104
|
if (!(0, import_react2.isValidElement)(child))
|
|
@@ -15059,7 +14999,7 @@ var require_Popover_native = __commonJS({
|
|
|
15059
14999
|
context,
|
|
15060
15000
|
children: props.children
|
|
15061
15001
|
}
|
|
15062
|
-
)), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, { zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core13.Theme, { name: themeName, children: [
|
|
15002
|
+
)), /* @__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: [
|
|
15063
15003
|
!!context.open && !context.breakpointActive && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
15064
15004
|
import_stacks3.YStack,
|
|
15065
15005
|
{
|
|
@@ -16407,10 +16347,12 @@ var require_Select_native = __commonJS({
|
|
|
16407
16347
|
{
|
|
16408
16348
|
...!props.unstyled && {
|
|
16409
16349
|
size: itemParentContext.size,
|
|
16410
|
-
ellipse: !0
|
|
16350
|
+
ellipse: !0,
|
|
16351
|
+
// we don't want events from the portalled `SelectValue` children to bubble
|
|
16352
|
+
// through the item they came from
|
|
16353
|
+
pointerEvents: "none"
|
|
16411
16354
|
},
|
|
16412
16355
|
ref: composedRefs,
|
|
16413
|
-
pointerEvents: "none",
|
|
16414
16356
|
...props,
|
|
16415
16357
|
children: unwrapSelectItem(selectValueChildren)
|
|
16416
16358
|
}
|
|
@@ -17538,107 +17480,112 @@ var require_createSwitch_native = __commonJS({
|
|
|
17538
17480
|
ref: forwardedRef
|
|
17539
17481
|
}
|
|
17540
17482
|
);
|
|
17541
|
-
}), SwitchComponent = Frame.styleable(
|
|
17542
|
-
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
17554
|
-
|
|
17555
|
-
|
|
17556
|
-
|
|
17557
|
-
|
|
17558
|
-
|
|
17559
|
-
|
|
17560
|
-
|
|
17561
|
-
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
|
|
17566
|
-
|
|
17567
|
-
|
|
17568
|
-
|
|
17569
|
-
|
|
17570
|
-
|
|
17571
|
-
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17576
|
-
);
|
|
17577
|
-
import_constants4.isWeb || React2.useEffect(() => {
|
|
17578
|
-
if (props.id)
|
|
17579
|
-
return (0, import_focusable2.registerFocusable)(props.id, {
|
|
17580
|
-
focus: () => {
|
|
17581
|
-
setChecked((x) => !x);
|
|
17483
|
+
}), SwitchComponent = Frame.styleable(
|
|
17484
|
+
function(propsIn, forwardedRef) {
|
|
17485
|
+
let styledContext = React2.useContext(import_SwitchContext.SwitchContext), props = (0, import_core13.useProps)(propsIn, {
|
|
17486
|
+
noNormalize: !0,
|
|
17487
|
+
noExpand: !0,
|
|
17488
|
+
resolveValues: "none",
|
|
17489
|
+
forComponent: Frame
|
|
17490
|
+
}), {
|
|
17491
|
+
labeledBy: ariaLabelledby,
|
|
17492
|
+
name,
|
|
17493
|
+
checked: checkedProp,
|
|
17494
|
+
defaultChecked,
|
|
17495
|
+
required,
|
|
17496
|
+
disabled,
|
|
17497
|
+
value = "on",
|
|
17498
|
+
onCheckedChange,
|
|
17499
|
+
size: size2 = styledContext.size ?? "$true",
|
|
17500
|
+
unstyled = styledContext.unstyled ?? !1,
|
|
17501
|
+
native: nativeProp,
|
|
17502
|
+
nativeProps,
|
|
17503
|
+
children,
|
|
17504
|
+
...switchProps
|
|
17505
|
+
} = 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)({
|
|
17506
|
+
prop: checkedProp,
|
|
17507
|
+
defaultProp: defaultChecked || !1,
|
|
17508
|
+
onChange: onCheckedChange,
|
|
17509
|
+
transition: !0
|
|
17510
|
+
});
|
|
17511
|
+
if (shouldRenderMobileNative)
|
|
17512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17513
|
+
import_react_native4.Switch,
|
|
17514
|
+
{
|
|
17515
|
+
value: checkedProp,
|
|
17516
|
+
onValueChange: onCheckedChange,
|
|
17517
|
+
...nativeProps
|
|
17582
17518
|
}
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
{
|
|
17590
|
-
tag: isInsideButton ? "span" : "button",
|
|
17591
|
-
unstyled,
|
|
17592
|
-
size: size2,
|
|
17593
|
-
checked,
|
|
17594
|
-
disabled,
|
|
17595
|
-
frameWidth,
|
|
17596
|
-
themeShallow: !0,
|
|
17597
|
-
...!disableActiveTheme && {
|
|
17598
|
-
theme: checked ? "active" : null,
|
|
17599
|
-
themeShallow: !0
|
|
17600
|
-
},
|
|
17601
|
-
role: "switch",
|
|
17602
|
-
"aria-checked": checked,
|
|
17603
|
-
"aria-labelledby": labelledBy,
|
|
17604
|
-
"aria-required": required,
|
|
17605
|
-
"data-state": getState(checked),
|
|
17606
|
-
"data-disabled": disabled ? "" : void 0,
|
|
17607
|
-
tabIndex: disabled ? void 0 : 0,
|
|
17608
|
-
value,
|
|
17609
|
-
...switchProps,
|
|
17610
|
-
ref: composedRefs,
|
|
17611
|
-
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
17612
|
-
setChecked((prevChecked) => !prevChecked), import_constants4.isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
17613
|
-
}),
|
|
17614
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17615
|
-
import_stacks3.YStack,
|
|
17616
|
-
{
|
|
17617
|
-
alignSelf: "stretch",
|
|
17618
|
-
flex: 1,
|
|
17619
|
-
onLayout: (e) => {
|
|
17620
|
-
setFrameWidth(e.nativeEvent.layout.width);
|
|
17621
|
-
},
|
|
17622
|
-
children: typeof children == "function" ? children(checked) : children
|
|
17519
|
+
);
|
|
17520
|
+
import_constants4.isWeb || React2.useEffect(() => {
|
|
17521
|
+
if (props.id)
|
|
17522
|
+
return (0, import_focusable2.registerFocusable)(props.id, {
|
|
17523
|
+
focus: () => {
|
|
17524
|
+
setChecked((x) => !x);
|
|
17623
17525
|
}
|
|
17624
|
-
)
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17526
|
+
});
|
|
17527
|
+
}, [props.id, setChecked]);
|
|
17528
|
+
let isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
|
|
17529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
17530
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17531
|
+
Frame,
|
|
17532
|
+
{
|
|
17533
|
+
tag: isInsideButton ? "span" : "button",
|
|
17534
|
+
unstyled,
|
|
17535
|
+
size: size2,
|
|
17536
|
+
checked,
|
|
17537
|
+
disabled,
|
|
17538
|
+
frameWidth,
|
|
17539
|
+
themeShallow: !0,
|
|
17540
|
+
...!disableActiveTheme && {
|
|
17541
|
+
theme: checked ? "active" : null,
|
|
17542
|
+
themeShallow: !0
|
|
17543
|
+
},
|
|
17544
|
+
role: "switch",
|
|
17545
|
+
"aria-checked": checked,
|
|
17546
|
+
"aria-labelledby": labelledBy,
|
|
17547
|
+
"aria-required": required,
|
|
17548
|
+
"data-state": getState(checked),
|
|
17549
|
+
"data-disabled": disabled ? "" : void 0,
|
|
17550
|
+
tabIndex: disabled ? void 0 : 0,
|
|
17551
|
+
value,
|
|
17552
|
+
...switchProps,
|
|
17553
|
+
ref: composedRefs,
|
|
17554
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
17555
|
+
setChecked((prevChecked) => !prevChecked), import_constants4.isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
17556
|
+
}),
|
|
17557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17558
|
+
import_stacks3.YStack,
|
|
17559
|
+
{
|
|
17560
|
+
alignSelf: "stretch",
|
|
17561
|
+
flex: 1,
|
|
17562
|
+
onLayout: (e) => {
|
|
17563
|
+
setFrameWidth(e.nativeEvent.layout.width);
|
|
17564
|
+
},
|
|
17565
|
+
children: typeof children == "function" ? children(checked) : children
|
|
17566
|
+
}
|
|
17567
|
+
)
|
|
17568
|
+
}
|
|
17569
|
+
) }),
|
|
17570
|
+
import_constants4.isWeb && isFormControl && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17571
|
+
BubbleInput,
|
|
17572
|
+
{
|
|
17573
|
+
control: button,
|
|
17574
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
17575
|
+
name,
|
|
17576
|
+
value,
|
|
17577
|
+
checked,
|
|
17578
|
+
required,
|
|
17579
|
+
disabled,
|
|
17580
|
+
style: { transform: "translateX(-100%)" }
|
|
17581
|
+
}
|
|
17582
|
+
)
|
|
17583
|
+
] });
|
|
17584
|
+
},
|
|
17585
|
+
{
|
|
17586
|
+
disableTheme: !0
|
|
17587
|
+
}
|
|
17588
|
+
), BubbleInput = (props) => {
|
|
17642
17589
|
let { control, checked, bubbles = !0, ...inputProps } = props, ref = React2.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
17643
17590
|
return React2.useEffect(() => {
|
|
17644
17591
|
let input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|