@tamagui/adapt 1.108.0 → 1.108.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/Adapt.js CHANGED
@@ -1,7 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
7
  for (var name in all)
7
8
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -11,7 +12,14 @@ var __export = (target, all) => {
11
12
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
13
  return to;
13
14
  };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
23
  var Adapt_exports = {};
16
24
  __export(Adapt_exports, {
17
25
  Adapt: () => Adapt,
@@ -20,22 +28,22 @@ __export(Adapt_exports, {
20
28
  useAdaptParent: () => useAdaptParent
21
29
  });
22
30
  module.exports = __toCommonJS(Adapt_exports);
23
- var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime");
24
- const AdaptParentContext = (0, import_react.createContext)(null), AdaptContents = (props) => {
25
- const context = (0, import_react.useContext)(AdaptParentContext);
31
+ var import_react = __toESM(require("react")), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_jsx_runtime = require("react/jsx-runtime");
32
+ const AdaptParentContext = import_react.default.createContext(null), AdaptContents = (props) => {
33
+ const context = import_react.default.useContext(AdaptParentContext);
26
34
  if (!context?.Contents)
27
35
  throw new Error(
28
36
  process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt."
29
37
  );
30
- return (0, import_react.createElement)(context.Contents, props);
38
+ return import_react.default.createElement(context.Contents, props);
31
39
  };
32
40
  AdaptContents.shouldForwardSpace = !0;
33
41
  const useAdaptParent = ({
34
42
  Contents
35
43
  }) => {
36
- const [when, setWhen] = (0, import_react.useState)(null);
44
+ const [when, setWhen] = import_react.default.useState(null);
37
45
  return {
38
- AdaptProvider: (0, import_react.useMemo)(() => {
46
+ AdaptProvider: import_react.default.useMemo(() => {
39
47
  const context = {
40
48
  Contents,
41
49
  setWhen
@@ -49,7 +57,7 @@ const useAdaptParent = ({
49
57
  };
50
58
  }, Adapt = (0, import_helpers.withStaticProperties)(
51
59
  function({ platform, when, children }) {
52
- const context = (0, import_react.useContext)(AdaptParentContext), media = (0, import_core.useMedia)();
60
+ const context = import_react.default.useContext(AdaptParentContext), media = (0, import_core.useMedia)();
53
61
  let enabled = !1;
54
62
  return typeof when == "function" ? enabled = when({ media }) : (enabled = !platform, platform === "touch" && (enabled = import_constants.isTouchable), platform === "native" && (enabled = !import_constants.isWeb), platform === "web" && (enabled = import_constants.isWeb), platform === "ios" && (enabled = import_constants.isIos), platform === "android" && (enabled = import_constants.isAndroid), when && !media[when] && (enabled = !1)), (0, import_constants.useIsomorphicLayoutEffect)(() => {
55
63
  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UAAU,aAAAA,QAAM,WAAW,kBAAkB,GAC7C,YAAQ,sBAAS;AAEvB,QAAI,UAAU;AAuBd,WArBI,OAAO,QAAS,aAClB,UAAU,KAAK,EAAE,MAAM,CAAC,KAExB,UAAU,CAAC,UAEP,aAAa,YAAS,UAAU,+BAChC,aAAa,aAAU,UAAU,CAAC,yBAClC,aAAa,UAAO,UAAU,yBAC9B,aAAa,UAAO,UAAU,yBAC9B,aAAa,cAAW,UAAU,6BAElC,QAAQ,CAAC,MAAM,IAAI,MACrB,UAAU,UAId,4CAA0B,MAAM;AAC9B,MAAK,WACL,SAAS,QAAS,QAAQ,OAAgB;AAAA,IAC5C,GAAG,CAAC,MAAM,SAAS,OAAO,CAAC,GAEtB,UAID,OAAO,YAAa,aACf,SAAS,EAAE,SAAS,MAAM,CAAC,IAG7B,WAPE;AAAA,EAQX;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AACF;",
5
+ "names": ["React"]
6
6
  }
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -12,7 +13,14 @@ var __export = (target, all) => {
12
13
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
14
  return to;
14
15
  };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
+ mod
23
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
24
  var Adapt_exports = {};
17
25
  __export(Adapt_exports, {
18
26
  Adapt: () => Adapt,
@@ -21,7 +29,7 @@ __export(Adapt_exports, {
21
29
  useAdaptParent: () => useAdaptParent
22
30
  });
23
31
  module.exports = __toCommonJS(Adapt_exports);
24
- var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_react = require("react");
32
+ var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers");
25
33
  function _array_like_to_array(arr, len) {
26
34
  (len == null || len > arr.length) && (len = arr.length);
27
35
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
@@ -63,15 +71,15 @@ function _unsupported_iterable_to_array(o, minLen) {
63
71
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
64
72
  }
65
73
  }
66
- var AdaptParentContext = /* @__PURE__ */ (0, import_react.createContext)(null), AdaptContents = function(props) {
67
- var context = (0, import_react.useContext)(AdaptParentContext);
74
+ var AdaptParentContext = /* @__PURE__ */ import_react.default.createContext(null), AdaptContents = function(props) {
75
+ var context = import_react.default.useContext(AdaptParentContext);
68
76
  if (!(context != null && context.Contents))
69
77
  throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
70
- return /* @__PURE__ */ (0, import_react.createElement)(context.Contents, props);
78
+ return /* @__PURE__ */ import_react.default.createElement(context.Contents, props);
71
79
  };
72
80
  AdaptContents.shouldForwardSpace = !0;
73
81
  var useAdaptParent = function(param) {
74
- var Contents = param.Contents, _useState = _sliced_to_array((0, import_react.useState)(null), 2), when = _useState[0], setWhen = _useState[1], AdaptProvider = (0, import_react.useMemo)(function() {
82
+ var Contents = param.Contents, _React_useState = _sliced_to_array(import_react.default.useState(null), 2), when = _React_useState[0], setWhen = _React_useState[1], AdaptProvider = import_react.default.useMemo(function() {
75
83
  var AdaptProviderView = function(props) {
76
84
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptParentContext.Provider, {
77
85
  value: context,
@@ -90,7 +98,7 @@ var useAdaptParent = function(param) {
90
98
  when
91
99
  };
92
100
  }, Adapt = (0, import_helpers.withStaticProperties)(function(param) {
93
- var platform = param.platform, when = param.when, children = param.children, context = (0, import_react.useContext)(AdaptParentContext), media = (0, import_core.useMedia)(), enabled = !1;
101
+ var platform = param.platform, when = param.when, children = param.children, context = import_react.default.useContext(AdaptParentContext), media = (0, import_core.useMedia)(), enabled = !1;
94
102
  return typeof when == "function" ? enabled = when({
95
103
  media
96
104
  }) : (enabled = !platform, platform === "touch" && (enabled = import_constants.isTouchable), platform === "native" && (enabled = !import_constants.isWeb), platform === "web" && (enabled = import_constants.isWeb), platform === "ios" && (enabled = import_constants.isIos), platform === "android" && (enabled = import_constants.isAndroid), when && !media[when] && (enabled = !1)), (0, import_constants.useIsomorphicLayoutEffect)(function() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/ui/adapt/src/Adapt.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAMO,+BAEP,cAAyB,0BACzB,iBAAqC,6BACrC,eAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBrE,IAAMA,qBAAqBC,gDAA0C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d;IAAMX;IAASyB;GAAQ,GAEtBA,UAID,OAAON,YAAa,aACfA,SAAS;IAAEM;IAASF;EAAM,CAAA,IAG5BJ,WAPE;AAQX,GACA;EACEjB,UAAUJ;AACZ,CAAA;",
5
- "names": ["AdaptParentContext", "createContext", "AdaptContents", "props", "context", "useContext", "Contents", "Error", "process", "env", "NODE_ENV", "createElement", "shouldForwardSpace", "useAdaptParent", "useState", "when", "setWhen", "AdaptProvider", "useMemo", "AdaptProviderView", "_jsx", "Provider", "value", "children", "Adapt", "withStaticProperties", "platform", "media", "useMedia", "enabled", "isTouchable", "isWeb", "isIos", "isAndroid", "useIsomorphicLayoutEffect"]
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,mBAMO,+BAEP,cAAyB,0BACzB,iBAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoB9B,IAAMA,qBAAqBC,6BAAAA,QAAMC,cAA0C,IAAA,GAGrEC,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,UAAUJ,aAAAA,QAAMK,WAAWN,kBAAAA;AACjC,MAAI,EAACK,WAAAA,QAAAA,QAASE;AACZ,UAAM,IAAIC,MACRC,QAAQC,IAAIC,aAAa,eACpB,8CACA,0GAAA;AAGT,SAAOV,6BAAAA,QAAMW,cAAcP,QAAQE,UAAUH,KAAAA;AAC/C;AAEAD,cAAcU,qBAAqB;AAE5B,IAAMC,iBAAiB,SAAA,OAAA;MAC5BP,WAAAA,MAAAA,UAEwBN,kBAAAA,iBAAAA,aAAAA,QAAMc,SAAe,IAAA,GAAA,CAAA,GAAtCC,OAAiBf,gBAAAA,CAAAA,GAAXgB,UAAWhB,gBAAAA,CAAAA,GAElBiB,gBAAgBjB,aAAAA,QAAMkB,QAAQ,WAAA;QAMzBC,oBAAT,SAA2BhB,OAAyB;AAClD,aACE,uCAAAiB,KAACrB,mBAAmBsB,UAAQ;QAACC,OAAOlB;kBACjCD,MAAMoB;;IAGb,GAXMnB,UAA+B;MACnCE;MACAU;IACF;AAUA,WAAOG;EACT,GAAG;IAACb;GAAS;AAEb,SAAO;IACLW;IACAF;EACF;AACF,GAEaS,YAAQC,qCACnB,SAAe,OAAwC;MAAtCC,WAAF,MAAEA,UAAUX,OAAZ,MAAYA,MAAMQ,WAAlB,MAAkBA,UACzBnB,UAAUJ,aAAAA,QAAMK,WAAWN,kBAAAA,GAC3B4B,YAAQC,sBAAAA,GAEVC,UAAU;AAuBd,SArBI,OAAOd,QAAS,aAClBc,UAAUd,KAAK;IAAEY;EAAM,CAAA,KAEvBE,UAAU,CAACH,UAEPA,aAAa,YAASG,UAAUC,+BAChCJ,aAAa,aAAUG,UAAU,CAACE,yBAClCL,aAAa,UAAOG,UAAUE,yBAC9BL,aAAa,UAAOG,UAAUG,yBAC9BN,aAAa,cAAWG,UAAUI,6BAElClB,QAAQ,CAACY,MAAMZ,IAAAA,MACjBc,UAAU,UAIdK,4CAA0B,WAAA;AACxB,IAAKL,YACLzB,WAAAA,QAAAA,QAASY,QAASD,QAAQc,OAAAA;EAC5B,GAAG;IAACd;IAAMX;IAASyB;GAAQ,GAEtBA,UAID,OAAON,YAAa,aACfA,SAAS;IAAEM;IAASF;EAAM,CAAA,IAG5BJ,WAPE;AAQX,GACA;EACEjB,UAAUJ;AACZ,CAAA;",
5
+ "names": ["AdaptParentContext", "React", "createContext", "AdaptContents", "props", "context", "useContext", "Contents", "Error", "process", "env", "NODE_ENV", "createElement", "shouldForwardSpace", "useAdaptParent", "useState", "when", "setWhen", "AdaptProvider", "useMemo", "AdaptProviderView", "_jsx", "Provider", "value", "children", "Adapt", "withStaticProperties", "platform", "media", "useMedia", "enabled", "isTouchable", "isWeb", "isIos", "isAndroid", "useIsomorphicLayoutEffect"]
6
6
  }
package/dist/esm/Adapt.js CHANGED
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import {
2
3
  isAndroid,
3
4
  isIos,
@@ -7,23 +8,22 @@ import {
7
8
  } from "@tamagui/constants";
8
9
  import { useMedia } from "@tamagui/core";
9
10
  import { withStaticProperties } from "@tamagui/helpers";
10
- import { createContext, createElement, useContext, useMemo, useState } from "react";
11
11
  import { jsx } from "react/jsx-runtime";
12
- const AdaptParentContext = createContext(null), AdaptContents = (props) => {
13
- const context = useContext(AdaptParentContext);
12
+ const AdaptParentContext = React.createContext(null), AdaptContents = (props) => {
13
+ const context = React.useContext(AdaptParentContext);
14
14
  if (!context?.Contents)
15
15
  throw new Error(
16
16
  process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt."
17
17
  );
18
- return createElement(context.Contents, props);
18
+ return React.createElement(context.Contents, props);
19
19
  };
20
20
  AdaptContents.shouldForwardSpace = !0;
21
21
  const useAdaptParent = ({
22
22
  Contents
23
23
  }) => {
24
- const [when, setWhen] = useState(null);
24
+ const [when, setWhen] = React.useState(null);
25
25
  return {
26
- AdaptProvider: useMemo(() => {
26
+ AdaptProvider: React.useMemo(() => {
27
27
  const context = {
28
28
  Contents,
29
29
  setWhen
@@ -37,7 +37,7 @@ const useAdaptParent = ({
37
37
  };
38
38
  }, Adapt = withStaticProperties(
39
39
  function({ platform, when, children }) {
40
- const context = useContext(AdaptParentContext), media = useMedia();
40
+ const context = React.useContext(AdaptParentContext), media = useMedia();
41
41
  let enabled = !1;
42
42
  return typeof when == "function" ? enabled = when({ media }) : (enabled = !platform, platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), platform === "ios" && (enabled = isIos), platform === "android" && (enabled = isAndroid), when && !media[when] && (enabled = !1)), useIsomorphicLayoutEffect(() => {
43
43
  enabled && context?.setWhen(when || enabled);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Adapt.tsx"],
4
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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CAAC,QAClC,aAAa,UAAO,UAAU,QAC9B,aAAa,UAAO,UAAU,QAC9B,aAAa,cAAW,UAAU,YAElC,QAAQ,CAAC,MAAM,IAAI,MACrB,UAAU,MAId,0BAA0B,MAAM;AAC9B,MAAK,WACL,SAAS,QAAS,QAAQ,OAAgB;AAAA,IAC5C,GAAG,CAAC,MAAM,SAAS,OAAO,CAAC,GAEtB,UAID,OAAO,YAAa,aACf,SAAS,EAAE,SAAS,MAAM,CAAC,IAG7B,WAPE;AAAA,EAQX;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,21 +1,21 @@
1
+ import React from "react";
1
2
  import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
2
3
  import { useMedia } from "@tamagui/core";
3
4
  import { withStaticProperties } from "@tamagui/helpers";
4
- import { createContext, createElement, useContext, useMemo, useState } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
- const AdaptParentContext = createContext(null),
6
+ const AdaptParentContext = React.createContext(null),
7
7
  AdaptContents = props => {
8
- const context = useContext(AdaptParentContext);
8
+ const context = React.useContext(AdaptParentContext);
9
9
  if (!context?.Contents) throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
10
- return createElement(context.Contents, props);
10
+ return React.createElement(context.Contents, props);
11
11
  };
12
12
  AdaptContents.shouldForwardSpace = !0;
13
13
  const useAdaptParent = ({
14
14
  Contents
15
15
  }) => {
16
- const [when, setWhen] = useState(null);
16
+ const [when, setWhen] = React.useState(null);
17
17
  return {
18
- AdaptProvider: useMemo(() => {
18
+ AdaptProvider: React.useMemo(() => {
19
19
  const context = {
20
20
  Contents,
21
21
  setWhen
@@ -36,7 +36,7 @@ const useAdaptParent = ({
36
36
  when,
37
37
  children
38
38
  }) {
39
- const context = useContext(AdaptParentContext),
39
+ const context = React.useContext(AdaptParentContext),
40
40
  media = useMedia();
41
41
  let enabled = !1;
42
42
  return typeof when == "function" ? enabled = when({
@@ -1 +1 @@
1
- {"version":3,"names":["isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","useMedia","withStaticProperties","createContext","createElement","useContext","useMemo","useState","jsx","AdaptParentContext","AdaptContents","props","context","Contents","Error","process","env","NODE_ENV","shouldForwardSpace","useAdaptParent","when","setWhen","AdaptProvider","AdaptProviderView","Provider","value","children","Adapt","platform","media","enabled"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,SAAA,EACAC,KAAA,EACAC,WAAA,EACAC,KAAA,EACAC,yBAAA,QACK;AAEP,SAASC,QAAA,QAAgB;AACzB,SAASC,oBAAA,QAA4B;AACrC,SAASC,aAAA,EAAeC,aAAA,EAAeC,UAAA,EAAYC,OAAA,EAASC,QAAA,QAAgB;AAoDpE,SAAAC,GAAA;AAhCD,MAAMC,kBAAA,GAAqBN,aAAA,CAA0C,IAAI;EAGnEO,aAAA,GAAiBC,KAAA,IAAe;IAC3C,MAAMC,OAAA,GAAUP,UAAA,CAAWI,kBAAkB;IAC7C,IAAI,CAACG,OAAA,EAASC,QAAA,EACZ,MAAM,IAAIC,KAAA,CACRC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,eACrB,8CACA,0GACN;IAEF,OAAOb,aAAA,CAAcQ,OAAA,CAAQC,QAAA,EAAUF,KAAK;EAC9C;AAEAD,aAAA,CAAcQ,kBAAA,GAAqB;AAE5B,MAAMC,cAAA,GAAiBA,CAAC;IAC7BN;EACF,MAEM;IACJ,MAAM,CAACO,IAAA,EAAMC,OAAO,IAAId,QAAA,CAAe,IAAI;IAmB3C,OAAO;MACLe,aAAA,EAlBoBhB,OAAA,CAAQ,MAAM;QAClC,MAAMM,OAAA,GAA+B;UACnCC,QAAA;UACAQ;QACF;QAEA,SAASE,kBAAkBZ,KAAA,EAA2B;UACpD,OACE,eAAAH,GAAA,CAACC,kBAAA,CAAmBe,QAAA,EAAnB;YAA4BC,KAAA,EAAOb,OAAA;YACjCc,QAAA,EAAAf,KAAA,CAAMe;UAAA,CACT;QAEJ;QAEA,OAAOH,iBAAA;MACT,GAAG,CAACV,QAAQ,CAAC;MAIXO;IACF;EACF;EAEaO,KAAA,GAAQzB,oBAAA,CACnB,UAAe;IAAE0B,QAAA;IAAUR,IAAA;IAAMM;EAAS,GAAe;IACvD,MAAMd,OAAA,GAAUP,UAAA,CAAWI,kBAAkB;MACvCoB,KAAA,GAAQ5B,QAAA,CAAS;IAEvB,IAAI6B,OAAA,GAAU;IAuBd,OArBI,OAAOV,IAAA,IAAS,aAClBU,OAAA,GAAUV,IAAA,CAAK;MAAES;IAAM,CAAC,KAExBC,OAAA,GAAU,CAACF,QAAA,EAEPA,QAAA,KAAa,YAASE,OAAA,GAAUhC,WAAA,GAChC8B,QAAA,KAAa,aAAUE,OAAA,GAAU,CAAC/B,KAAA,GAClC6B,QAAA,KAAa,UAAOE,OAAA,GAAU/B,KAAA,GAC9B6B,QAAA,KAAa,UAAOE,OAAA,GAAUjC,KAAA,GAC9B+B,QAAA,KAAa,cAAWE,OAAA,GAAUlC,SAAA,GAElCwB,IAAA,IAAQ,CAACS,KAAA,CAAMT,IAAI,MACrBU,OAAA,GAAU,MAId9B,yBAAA,CAA0B,MAAM;MACzB8B,OAAA,IACLlB,OAAA,EAASS,OAAA,CAASD,IAAA,IAAQU,OAAgB;IAC5C,GAAG,CAACV,IAAA,EAAMR,OAAA,EAASkB,OAAO,CAAC,GAEtBA,OAAA,GAID,OAAOJ,QAAA,IAAa,aACfA,QAAA,CAAS;MAAEI,OAAA;MAASD;IAAM,CAAC,IAG7BH,QAAA,GAPE;EAQX,GACA;IACEb,QAAA,EAAUH;EACZ,CACF","ignoreList":[]}
1
+ {"version":3,"names":["React","isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","useMedia","withStaticProperties","jsx","AdaptParentContext","createContext","AdaptContents","props","context","useContext","Contents","Error","process","env","NODE_ENV","createElement","shouldForwardSpace","useAdaptParent","when","setWhen","useState","AdaptProvider","useMemo","AdaptProviderView","Provider","value","children","Adapt","platform","media","enabled"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SACEC,SAAA,EACAC,KAAA,EACAC,WAAA,EACAC,KAAA,EACAC,yBAAA,QACK;AAEP,SAASC,QAAA,QAAgB;AACzB,SAASC,oBAAA,QAA4B;AAkD7B,SAAAC,GAAA;AA9BD,MAAMC,kBAAA,GAAqBT,KAAA,CAAMU,aAAA,CAA0C,IAAI;EAGzEC,aAAA,GAAiBC,KAAA,IAAe;IAC3C,MAAMC,OAAA,GAAUb,KAAA,CAAMc,UAAA,CAAWL,kBAAkB;IACnD,IAAI,CAACI,OAAA,EAASE,QAAA,EACZ,MAAM,IAAIC,KAAA,CACRC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,eACrB,8CACA,0GACN;IAEF,OAAOnB,KAAA,CAAMoB,aAAA,CAAcP,OAAA,CAAQE,QAAA,EAAUH,KAAK;EACpD;AAEAD,aAAA,CAAcU,kBAAA,GAAqB;AAE5B,MAAMC,cAAA,GAAiBA,CAAC;IAC7BP;EACF,MAAqD;IACnD,MAAM,CAACQ,IAAA,EAAMC,OAAO,IAAIxB,KAAA,CAAMyB,QAAA,CAAe,IAAI;IAmBjD,OAAO;MACLC,aAAA,EAlBoB1B,KAAA,CAAM2B,OAAA,CAAQ,MAAM;QACxC,MAAMd,OAAA,GAA+B;UACnCE,QAAA;UACAS;QACF;QAEA,SAASI,kBAAkBhB,KAAA,EAA2B;UACpD,OACE,eAAAJ,GAAA,CAACC,kBAAA,CAAmBoB,QAAA,EAAnB;YAA4BC,KAAA,EAAOjB,OAAA;YACjCkB,QAAA,EAAAnB,KAAA,CAAMmB;UAAA,CACT;QAEJ;QAEA,OAAOH,iBAAA;MACT,GAAG,CAACb,QAAQ,CAAC;MAIXQ;IACF;EACF;EAEaS,KAAA,GAAQzB,oBAAA,CACnB,UAAe;IAAE0B,QAAA;IAAUV,IAAA;IAAMQ;EAAS,GAAe;IACvD,MAAMlB,OAAA,GAAUb,KAAA,CAAMc,UAAA,CAAWL,kBAAkB;MAC7CyB,KAAA,GAAQ5B,QAAA,CAAS;IAEvB,IAAI6B,OAAA,GAAU;IAuBd,OArBI,OAAOZ,IAAA,IAAS,aAClBY,OAAA,GAAUZ,IAAA,CAAK;MAAEW;IAAM,CAAC,KAExBC,OAAA,GAAU,CAACF,QAAA,EAEPA,QAAA,KAAa,YAASE,OAAA,GAAUhC,WAAA,GAChC8B,QAAA,KAAa,aAAUE,OAAA,GAAU,CAAC/B,KAAA,GAClC6B,QAAA,KAAa,UAAOE,OAAA,GAAU/B,KAAA,GAC9B6B,QAAA,KAAa,UAAOE,OAAA,GAAUjC,KAAA,GAC9B+B,QAAA,KAAa,cAAWE,OAAA,GAAUlC,SAAA,GAElCsB,IAAA,IAAQ,CAACW,KAAA,CAAMX,IAAI,MACrBY,OAAA,GAAU,MAId9B,yBAAA,CAA0B,MAAM;MACzB8B,OAAA,IACLtB,OAAA,EAASW,OAAA,CAASD,IAAA,IAAQY,OAAgB;IAC5C,GAAG,CAACZ,IAAA,EAAMV,OAAA,EAASsB,OAAO,CAAC,GAEtBA,OAAA,GAID,OAAOJ,QAAA,IAAa,aACfA,QAAA,CAAS;MAAEI,OAAA;MAASD;IAAM,CAAC,IAG7BH,QAAA,GAPE;EAQX,GACA;IACEhB,QAAA,EAAUJ;EACZ,CACF","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
2
3
  import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
3
4
  import { useMedia } from "@tamagui/core";
4
5
  import { withStaticProperties } from "@tamagui/helpers";
5
- import { createContext, createElement, useContext, useMemo, useState } from "react";
6
6
  function _array_like_to_array(arr, len) {
7
7
  (len == null || len > arr.length) && (len = arr.length);
8
8
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
@@ -44,15 +44,15 @@ function _unsupported_iterable_to_array(o, minLen) {
44
44
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
45
45
  }
46
46
  }
47
- var AdaptParentContext = /* @__PURE__ */ createContext(null), AdaptContents = function(props) {
48
- var context = useContext(AdaptParentContext);
47
+ var AdaptParentContext = /* @__PURE__ */ React.createContext(null), AdaptContents = function(props) {
48
+ var context = React.useContext(AdaptParentContext);
49
49
  if (!(context != null && context.Contents))
50
50
  throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
51
- return /* @__PURE__ */ createElement(context.Contents, props);
51
+ return /* @__PURE__ */ React.createElement(context.Contents, props);
52
52
  };
53
53
  AdaptContents.shouldForwardSpace = !0;
54
54
  var useAdaptParent = function(param) {
55
- var Contents = param.Contents, _useState = _sliced_to_array(useState(null), 2), when = _useState[0], setWhen = _useState[1], AdaptProvider = useMemo(function() {
55
+ var Contents = param.Contents, _React_useState = _sliced_to_array(React.useState(null), 2), when = _React_useState[0], setWhen = _React_useState[1], AdaptProvider = React.useMemo(function() {
56
56
  var AdaptProviderView = function(props) {
57
57
  return /* @__PURE__ */ _jsx(AdaptParentContext.Provider, {
58
58
  value: context,
@@ -71,7 +71,7 @@ var useAdaptParent = function(param) {
71
71
  when
72
72
  };
73
73
  }, Adapt = withStaticProperties(function(param) {
74
- var platform = param.platform, when = param.when, children = param.children, context = useContext(AdaptParentContext), media = useMedia(), enabled = !1;
74
+ var platform = param.platform, when = param.when, children = param.children, context = React.useContext(AdaptParentContext), media = useMedia(), enabled = !1;
75
75
  return typeof when == "function" ? enabled = when({
76
76
  media
77
77
  }) : (enabled = !platform, platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), platform === "ios" && (enabled = isIos), platform === "android" && (enabled = isAndroid), when && !media[when] && (enabled = !1)), useIsomorphicLayoutEffect(function() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/ui/adapt/src/Adapt.tsx"],
4
- "mappings": ";AAAA,SACEA,WACAC,OACAC,aACAC,OACAC,iCACK;AAEP,SAASC,gBAAgB;AACzB,SAASC,4BAA4B;AACrC,SAASC,eAAeC,eAAeC,YAAYC,SAASC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBrE,IAAMC,qBAAqBL,8BAA0C,IAAA,GAG/DM,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,UAAUN,WAAWG,kBAAAA;AAC3B,MAAI,EAACG,WAAAA,QAAAA,QAASC;AACZ,UAAM,IAAIC,MACRC,QAAQC,IAAIC,aAAa,eACpB,8CACA,0GAAA;AAGT,SAAOZ,8BAAcO,QAAQC,UAAUF,KAAAA;AACzC;AAEAD,cAAcQ,qBAAqB;AAE5B,IAAMC,iBAAiB,SAAA,OAAA;MAC5BN,WAAAA,MAAAA,UAIwBL,YAAAA,iBAAAA,SAAe,IAAA,GAAA,CAAA,GAAhCY,OAAiBZ,UAAAA,CAAAA,GAAXa,UAAWb,UAAAA,CAAAA,GAElBc,gBAAgBf,QAAQ,WAAA;QAMnBgB,oBAAT,SAA2BZ,OAAyB;AAClD,aACE,qBAACF,mBAAmBe,UAAQ;QAACC,OAAOb;kBACjCD,MAAMe;;IAGb,GAXMd,UAA+B;MACnCC;MACAQ;IACF;AAUA,WAAOE;EACT,GAAG;IAACV;GAAS;AAEb,SAAO;IACLS;IACAF;EACF;AACF,GAEaO,QAAQxB,qBACnB,SAAe,OAAwC;MAAtCyB,WAAF,MAAEA,UAAUR,OAAZ,MAAYA,MAAMM,WAAlB,MAAkBA,UACzBd,UAAUN,WAAWG,kBAAAA,GACrBoB,QAAQ3B,SAAAA,GAEV4B,UAAU;AAuBd,SArBI,OAAOV,QAAS,aAClBU,UAAUV,KAAK;IAAES;EAAM,CAAA,KAEvBC,UAAU,CAACF,UAEPA,aAAa,YAASE,UAAU/B,cAChC6B,aAAa,aAAUE,UAAU,CAAC9B,QAClC4B,aAAa,UAAOE,UAAU9B,QAC9B4B,aAAa,UAAOE,UAAUhC,QAC9B8B,aAAa,cAAWE,UAAUjC,YAElCuB,QAAQ,CAACS,MAAMT,IAAAA,MACjBU,UAAU,MAId7B,0BAA0B,WAAA;AACxB,IAAK6B,YACLlB,WAAAA,QAAAA,QAASS,QAASD,QAAQU,OAAAA;EAC5B,GAAG;IAACV;IAAMR;IAASkB;GAAQ,GAEtBA,UAID,OAAOJ,YAAa,aACfA,SAAS;IAAEI;IAASD;EAAM,CAAA,IAG5BH,WAPE;AAQX,GACA;EACEb,UAAUH;AACZ,CAAA;",
5
- "names": ["isAndroid", "isIos", "isTouchable", "isWeb", "useIsomorphicLayoutEffect", "useMedia", "withStaticProperties", "createContext", "createElement", "useContext", "useMemo", "useState", "AdaptParentContext", "AdaptContents", "props", "context", "Contents", "Error", "process", "env", "NODE_ENV", "shouldForwardSpace", "useAdaptParent", "when", "setWhen", "AdaptProvider", "AdaptProviderView", "Provider", "value", "children", "Adapt", "platform", "media", "enabled"]
4
+ "mappings": ";AAAA,OAAOA,WAAW;AAClB,SACEC,WACAC,OACAC,aACAC,OACAC,iCACK;AAEP,SAASC,gBAAgB;AACzB,SAASC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoB9B,IAAMC,qBAAqBR,sBAAMS,cAA0C,IAAA,GAGrEC,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,UAAUZ,MAAMa,WAAWL,kBAAAA;AACjC,MAAI,EAACI,WAAAA,QAAAA,QAASE;AACZ,UAAM,IAAIC,MACRC,QAAQC,IAAIC,aAAa,eACpB,8CACA,0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Z,CAAA;",
5
+ "names": ["React", "isAndroid", "isIos", "isTouchable", "isWeb", "useIsomorphicLayoutEffect", "useMedia", "withStaticProperties", "AdaptParentContext", "createContext", "AdaptContents", "props", "context", "useContext", "Contents", "Error", "process", "env", "NODE_ENV", "createElement", "shouldForwardSpace", "useAdaptParent", "useState", "when", "setWhen", "AdaptProvider", "useMemo", "AdaptProviderView", "Provider", "value", "children", "Adapt", "platform", "media", "enabled"]
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/adapt",
3
- "version": "1.108.0",
3
+ "version": "1.108.1",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -27,12 +27,12 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@tamagui/constants": "1.108.0",
31
- "@tamagui/core": "1.108.0",
32
- "@tamagui/helpers": "1.108.0"
30
+ "@tamagui/constants": "1.108.1",
31
+ "@tamagui/core": "1.108.1",
32
+ "@tamagui/helpers": "1.108.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@tamagui/build": "1.108.0"
35
+ "@tamagui/build": "1.108.1"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
package/src/Adapt.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import {
2
3
  isAndroid,
3
4
  isIos,
@@ -8,7 +9,6 @@ import {
8
9
  import type { MediaQueryKey, UseMediaState } from '@tamagui/core'
9
10
  import { useMedia } from '@tamagui/core'
10
11
  import { withStaticProperties } from '@tamagui/helpers'
11
- import { createContext, createElement, useContext, useMemo, useState } from 'react'
12
12
 
13
13
  type MediaQueryKeyString = MediaQueryKey extends string ? MediaQueryKey : never
14
14
 
@@ -16,8 +16,8 @@ export type AdaptProps = {
16
16
  when?: MediaQueryKeyString | ((state: { media: UseMediaState }) => boolean)
17
17
  platform?: 'native' | 'web' | 'touch' | 'ios' | 'android'
18
18
  children?:
19
- | React.ReactNode
20
- | ((state: { enabled: boolean; media: UseMediaState }) => React.ReactNode)
19
+ | JSX.Element
20
+ | ((state: { enabled: boolean; media: UseMediaState }) => JSX.Element)
21
21
  }
22
22
 
23
23
  type When = MediaQueryKeyString | boolean | null
@@ -28,11 +28,11 @@ type AdaptParentContextI = {
28
28
  setWhen: (when: When) => any
29
29
  }
30
30
 
31
- export const AdaptParentContext = createContext<AdaptParentContextI | null>(null)
31
+ export const AdaptParentContext = React.createContext<AdaptParentContextI | null>(null)
32
32
 
33
33
  // forward props
34
34
  export const AdaptContents = (props: any) => {
35
- const context = useContext(AdaptParentContext)
35
+ const context = React.useContext(AdaptParentContext)
36
36
  if (!context?.Contents) {
37
37
  throw new Error(
38
38
  process.env.NODE_ENV === 'production'
@@ -40,19 +40,17 @@ export const AdaptContents = (props: any) => {
40
40
  : `You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.`
41
41
  )
42
42
  }
43
- return createElement(context.Contents, props)
43
+ return React.createElement(context.Contents, props)
44
44
  }
45
45
 
46
46
  AdaptContents.shouldForwardSpace = true
47
47
 
48
48
  export const useAdaptParent = ({
49
49
  Contents,
50
- }: {
51
- Contents: AdaptParentContextI['Contents']
52
- }) => {
53
- const [when, setWhen] = useState<When>(null)
50
+ }: { Contents: AdaptParentContextI['Contents'] }) => {
51
+ const [when, setWhen] = React.useState<When>(null)
54
52
 
55
- const AdaptProvider = useMemo(() => {
53
+ const AdaptProvider = React.useMemo(() => {
56
54
  const context: AdaptParentContextI = {
57
55
  Contents,
58
56
  setWhen,
@@ -77,7 +75,7 @@ export const useAdaptParent = ({
77
75
 
78
76
  export const Adapt = withStaticProperties(
79
77
  function Adapt({ platform, when, children }: AdaptProps) {
80
- const context = useContext(AdaptParentContext)
78
+ const context = React.useContext(AdaptParentContext)
81
79
  const media = useMedia()
82
80
 
83
81
  let enabled = false
package/types/Adapt.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { MediaQueryKey, UseMediaState } from '@tamagui/core';
2
3
  type MediaQueryKeyString = MediaQueryKey extends string ? MediaQueryKey : never;
3
4
  export type AdaptProps = {
@@ -5,10 +6,10 @@ export type AdaptProps = {
5
6
  media: UseMediaState;
6
7
  }) => boolean);
7
8
  platform?: 'native' | 'web' | 'touch' | 'ios' | 'android';
8
- children?: React.ReactNode | ((state: {
9
+ children?: JSX.Element | ((state: {
9
10
  enabled: boolean;
10
11
  media: UseMediaState;
11
- }) => React.ReactNode);
12
+ }) => JSX.Element);
12
13
  };
13
14
  type When = MediaQueryKeyString | boolean | null;
14
15
  type Component = (props: any) => any;
@@ -16,9 +17,9 @@ type AdaptParentContextI = {
16
17
  Contents: Component;
17
18
  setWhen: (when: When) => any;
18
19
  };
19
- export declare const AdaptParentContext: import("react").Context<AdaptParentContextI | null>;
20
+ export declare const AdaptParentContext: React.Context<AdaptParentContextI | null>;
20
21
  export declare const AdaptContents: {
21
- (props: any): import("react").FunctionComponentElement<any>;
22
+ (props: any): React.FunctionComponentElement<any>;
22
23
  shouldForwardSpace: boolean;
23
24
  };
24
25
  export declare const useAdaptParent: ({ Contents, }: {
@@ -29,9 +30,9 @@ export declare const useAdaptParent: ({ Contents, }: {
29
30
  }) => import("react/jsx-runtime").JSX.Element;
30
31
  when: When;
31
32
  };
32
- export declare const Adapt: (({ platform, when, children }: AdaptProps) => import("react").ReactNode) & {
33
+ export declare const Adapt: (({ platform, when, children }: AdaptProps) => JSX.Element | null | undefined) & {
33
34
  Contents: {
34
- (props: any): import("react").FunctionComponentElement<any>;
35
+ (props: any): React.FunctionComponentElement<any>;
35
36
  shouldForwardSpace: boolean;
36
37
  };
37
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Adapt.d.ts","sourceRoot":"","sources":["../src/Adapt.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAKjE,KAAK,mBAAmB,GAAG,aAAa,SAAS,MAAM,GAAG,a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