@tamagui/helpers-tamagui 1.13.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/getSpace.js +1 -34
- package/dist/cjs/getSpace.js.map +2 -2
- package/dist/cjs/index.js +1 -22
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/prevent.js +1 -28
- package/dist/cjs/prevent.js.map +2 -2
- package/dist/cjs/useCurrentColor.js +1 -32
- package/dist/cjs/useCurrentColor.js.map +2 -2
- package/dist/cjs/useGetThemedIcon.js +1 -44
- package/dist/cjs/useGetThemedIcon.js.map +2 -2
- package/dist/esm/getSpace.js +1 -10
- package/dist/esm/getSpace.js.map +2 -2
- package/dist/esm/getSpace.mjs +1 -10
- package/dist/esm/getSpace.mjs.map +2 -2
- package/dist/esm/index.js +1 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -5
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/prevent.js +1 -4
- package/dist/esm/prevent.js.map +2 -2
- package/dist/esm/prevent.mjs +1 -4
- package/dist/esm/prevent.mjs.map +2 -2
- package/dist/esm/useCurrentColor.js +1 -11
- package/dist/esm/useCurrentColor.js.map +2 -2
- package/dist/esm/useCurrentColor.mjs +1 -11
- package/dist/esm/useCurrentColor.mjs.map +2 -2
- package/dist/esm/useGetThemedIcon.js +1 -20
- package/dist/esm/useGetThemedIcon.js.map +2 -2
- package/dist/esm/useGetThemedIcon.mjs +1 -20
- package/dist/esm/useGetThemedIcon.mjs.map +2 -2
- package/package.json +4 -4
package/dist/cjs/getSpace.js
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var getSpace_exports = {};
|
|
20
|
-
__export(getSpace_exports, {
|
|
21
|
-
getSpace: () => getSpace
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(getSpace_exports);
|
|
24
|
-
var import_core = require("@tamagui/core");
|
|
25
|
-
const getSpace = (token, sizeUpOrDownBy = 0) => {
|
|
26
|
-
const spaces = (0, import_core.getTokens)().space;
|
|
27
|
-
const spaceNames = Object.keys(spaces);
|
|
28
|
-
const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || "$true")) + sizeUpOrDownBy)];
|
|
29
|
-
return spaces[key] || spaces["$true"];
|
|
30
|
-
};
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
getSpace
|
|
34
|
-
});
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var S=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},i=(s,e,t,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!k.call(s,n)&&n!==t&&a(s,n,{get:()=>e[n],enumerable:!(c=p(e,n))||c.enumerable});return s};var m=s=>i(a({},"__esModule",{value:!0}),s);var T={};S(T,{getSpace:()=>u});module.exports=m(T);var o=require("@tamagui/core");const u=(s,e=0)=>{const t=(0,o.getTokens)().space,c=Object.keys(t),n=c[Math.max(0,c.indexOf(String(s||"$true"))+e)];return t[n]||t.$true};0&&(module.exports={getSpace});
|
|
35
2
|
//# sourceMappingURL=getSpace.js.map
|
package/dist/cjs/getSpace.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/getSpace.tsx"],
|
|
4
4
|
"sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space\n const spaceNames = Object.keys(spaces)\n const key =\n spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$true')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$true']) as SpaceTokens\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuC,yBAEhC,MAAMF,EAAW,CAACG,EAAiCC,EAAiB,IAAM,CAC/E,MAAMC,KAAS,aAAU,EAAE,MACrBC,EAAa,OAAO,KAAKD,CAAM,EAC/BE,EACJD,EAAW,KAAK,IAAI,EAAGA,EAAW,QAAQ,OAAOH,GAAS,OAAO,CAAC,EAAIC,CAAc,CAAC,EACvF,OAAQC,EAAOE,CAAG,GAAKF,EAAO,KAChC",
|
|
6
|
+
"names": ["getSpace_exports", "__export", "getSpace", "__toCommonJS", "import_core", "token", "sizeUpOrDownBy", "spaces", "spaceNames", "key"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(src_exports);
|
|
18
|
-
__reExport(src_exports, require("@tamagui/helpers"), module.exports);
|
|
19
|
-
__reExport(src_exports, require("./prevent"), module.exports);
|
|
20
|
-
__reExport(src_exports, require("./getSpace"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("./useCurrentColor"), module.exports);
|
|
22
|
-
__reExport(src_exports, require("./useGetThemedIcon"), module.exports);
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("@tamagui/helpers"),module.exports);r(o,require("./prevent"),module.exports);r(o,require("./getSpace"),module.exports);r(o,require("./useCurrentColor"),module.exports);r(o,require("./useGetThemedIcon"),module.exports);
|
|
23
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,4BAAd,gBACAE,EAAAF,EAAc,qBADd,gBAEAE,EAAAF,EAAc,sBAFd,gBAGAE,EAAAF,EAAc,6BAHd,gBAIAE,EAAAF,EAAc,8BAJd",
|
|
6
|
+
"names": ["src_exports", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
package/dist/cjs/prevent.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var prevent_exports = {};
|
|
20
|
-
__export(prevent_exports, {
|
|
21
|
-
prevent: () => prevent
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(prevent_exports);
|
|
24
|
-
const prevent = (e) => [e.preventDefault(), e.stopPropagation()];
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
prevent
|
|
28
|
-
});
|
|
1
|
+
"use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var p in e)n(t,p,{get:e[p],enumerable:!0})},f=(t,e,p,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of s(e))!v.call(t,o)&&o!==p&&n(t,o,{get:()=>e[o],enumerable:!(r=a(e,o))||r.enumerable});return t};var g=t=>f(n({},"__esModule",{value:!0}),t);var l={};c(l,{prevent:()=>i});module.exports=g(l);const i=t=>[t.preventDefault(),t.stopPropagation()];0&&(module.exports={prevent});
|
|
29
2
|
//# sourceMappingURL=prevent.js.map
|
package/dist/cjs/prevent.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/prevent.tsx"],
|
|
4
4
|
"sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAWE,GAAM,CAACA,EAAE,eAAe,EAAGA,EAAE,gBAAgB,CAAC",
|
|
6
|
+
"names": ["prevent_exports", "__export", "prevent", "__toCommonJS", "e"]
|
|
7
7
|
}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useCurrentColor_exports = {};
|
|
20
|
-
__export(useCurrentColor_exports, {
|
|
21
|
-
useCurrentColor: () => useCurrentColor
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useCurrentColor_exports);
|
|
24
|
-
var import_core = require("@tamagui/core");
|
|
25
|
-
const useCurrentColor = (colorProp) => {
|
|
26
|
-
const theme = (0, import_core.useTheme)();
|
|
27
|
-
return (0, import_core.variableToString)(theme[colorProp] || colorProp || theme.color);
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
useCurrentColor
|
|
32
|
-
});
|
|
1
|
+
"use strict";var l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var m=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},C=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!s.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(a=i(e,r))||a.enumerable});return o};var T=o=>C(l({},"__esModule",{value:!0}),o);var u={};m(u,{useCurrentColor:()=>b});module.exports=T(u);var n=require("@tamagui/core");const b=o=>{const e=(0,n.useTheme)();return(0,n.variableToString)(e[o]||o||e.color)};0&&(module.exports={useCurrentColor});
|
|
33
2
|
//# sourceMappingURL=useCurrentColor.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useCurrentColor.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n UnionableString,\n Variable,\n useTheme,\n variableToString,\n} from '@tamagui/core'\nimport type { TextStyle } from 'react-native'\n\nexport const useCurrentColor = (colorProp: ColorProp) => {\n const theme = useTheme()\n return variableToString(theme[colorProp as any] || colorProp || theme.color)\n}\n\nexport type ColorProp =\n | UnionableString\n | Variable\n | ColorTokens\n | TextStyle['color']\n | undefined\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAMO,yBAGA,MAAMF,EAAmBG,GAAyB,CACvD,MAAMC,KAAQ,YAAS,EACvB,SAAO,oBAAiBA,EAAMD,CAAgB,GAAKA,GAAaC,EAAM,KAAK,CAC7E",
|
|
6
|
+
"names": ["useCurrentColor_exports", "__export", "useCurrentColor", "__toCommonJS", "import_core", "colorProp", "theme"]
|
|
7
7
|
}
|
|
@@ -1,45 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useGetThemedIcon_exports = {};
|
|
20
|
-
__export(useGetThemedIcon_exports, {
|
|
21
|
-
useGetThemedIcon: () => useGetThemedIcon
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useGetThemedIcon_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_useCurrentColor = require("./useCurrentColor");
|
|
26
|
-
const useGetThemedIcon = (props) => {
|
|
27
|
-
const color = (0, import_useCurrentColor.useCurrentColor)(props.color);
|
|
28
|
-
return (el) => {
|
|
29
|
-
if (!el)
|
|
30
|
-
return el;
|
|
31
|
-
if ((0, import_react.isValidElement)(el)) {
|
|
32
|
-
return (0, import_react.cloneElement)(el, {
|
|
33
|
-
...props,
|
|
34
|
-
// @ts-expect-error
|
|
35
|
-
...el.props
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return (0, import_react.createElement)(el, props);
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
useGetThemedIcon
|
|
44
|
-
});
|
|
1
|
+
"use strict";var m=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var o in e)m(r,o,{get:e[o],enumerable:!0})},C=(r,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of l(e))!s.call(r,n)&&n!==o&&m(r,n,{get:()=>e[n],enumerable:!(c=i(e,n))||c.enumerable});return r};var a=r=>C(m({},"__esModule",{value:!0}),r);var E={};f(E,{useGetThemedIcon:()=>p});module.exports=a(E);var t=require("react"),u=require("./useCurrentColor");const p=r=>{const e=(0,u.useCurrentColor)(r.color);return o=>o&&((0,t.isValidElement)(o)?(0,t.cloneElement)(o,{...r,...o.props}):(0,t.createElement)(o,r))};0&&(module.exports={useGetThemedIcon});
|
|
45
2
|
//# sourceMappingURL=useGetThemedIcon.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGetThemedIcon.tsx"],
|
|
4
4
|
"sourcesContent": ["import { cloneElement, createElement, isValidElement } from 'react'\n\nimport { ColorProp, useCurrentColor } from './useCurrentColor'\n\nexport const useGetThemedIcon = (props: { color: ColorProp; size: number }) => {\n const color = useCurrentColor(props.color)\n return (el: any) => {\n if (!el) return el\n if (isValidElement(el)) {\n return cloneElement(el, {\n ...props,\n // @ts-expect-error\n ...el.props,\n })\n }\n return createElement(el, props)\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4D,iBAE5DC,EAA2C,6BAEpC,MAAMH,EAAoBI,GAA8C,CAC7E,MAAMC,KAAQ,mBAAgBD,EAAM,KAAK,EACzC,OAAQE,GACDA,OACD,kBAAeA,CAAE,KACZ,gBAAaA,EAAI,CACtB,GAAGF,EAEH,GAAGE,EAAG,KACR,CAAC,KAEI,iBAAcA,EAAIF,CAAK,EAElC",
|
|
6
|
+
"names": ["useGetThemedIcon_exports", "__export", "useGetThemedIcon", "__toCommonJS", "import_react", "import_useCurrentColor", "props", "color", "el"]
|
|
7
7
|
}
|
package/dist/esm/getSpace.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const getSpace = (token, sizeUpOrDownBy = 0) => {
|
|
3
|
-
const spaces = getTokens().space;
|
|
4
|
-
const spaceNames = Object.keys(spaces);
|
|
5
|
-
const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || "$true")) + sizeUpOrDownBy)];
|
|
6
|
-
return spaces[key] || spaces["$true"];
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
getSpace
|
|
10
|
-
};
|
|
1
|
+
import{getTokens as a}from"@tamagui/core";const r=(t,n=0)=>{const e=a().space,s=Object.keys(e),c=s[Math.max(0,s.indexOf(String(t||"$true"))+n)];return e[c]||e.$true};export{r as getSpace};
|
|
11
2
|
//# sourceMappingURL=getSpace.js.map
|
package/dist/esm/getSpace.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/getSpace.tsx"],
|
|
4
4
|
"sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space\n const spaceNames = Object.keys(spaces)\n const key =\n spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$true')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$true']) as SpaceTokens\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAsB,aAAAA,MAAiB,gBAEhC,MAAMC,EAAW,CAACC,EAAiCC,EAAiB,IAAM,CAC/E,MAAMC,EAASJ,EAAU,EAAE,MACrBK,EAAa,OAAO,KAAKD,CAAM,EAC/BE,EACJD,EAAW,KAAK,IAAI,EAAGA,EAAW,QAAQ,OAAOH,GAAS,OAAO,CAAC,EAAIC,CAAc,CAAC,EACvF,OAAQC,EAAOE,CAAG,GAAKF,EAAO,KAChC",
|
|
6
|
+
"names": ["getTokens", "getSpace", "token", "sizeUpOrDownBy", "spaces", "spaceNames", "key"]
|
|
7
7
|
}
|
package/dist/esm/getSpace.mjs
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const getSpace = (token, sizeUpOrDownBy = 0) => {
|
|
3
|
-
const spaces = getTokens().space;
|
|
4
|
-
const spaceNames = Object.keys(spaces);
|
|
5
|
-
const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || "$true")) + sizeUpOrDownBy)];
|
|
6
|
-
return spaces[key] || spaces["$true"];
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
getSpace
|
|
10
|
-
};
|
|
1
|
+
import{getTokens as a}from"@tamagui/core";const r=(t,n=0)=>{const e=a().space,s=Object.keys(e),c=s[Math.max(0,s.indexOf(String(t||"$true"))+n)];return e[c]||e.$true};export{r as getSpace};
|
|
11
2
|
//# sourceMappingURL=getSpace.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/getSpace.tsx"],
|
|
4
4
|
"sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space\n const spaceNames = Object.keys(spaces)\n const key =\n spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$true')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$true']) as SpaceTokens\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAsB,aAAAA,MAAiB,gBAEhC,MAAMC,EAAW,CAACC,EAAiCC,EAAiB,IAAM,CAC/E,MAAMC,EAASJ,EAAU,EAAE,MACrBK,EAAa,OAAO,KAAKD,CAAM,EAC/BE,EACJD,EAAW,KAAK,IAAI,EAAGA,EAAW,QAAQ,OAAOH,GAAS,OAAO,CAAC,EAAIC,CAAc,CAAC,EACvF,OAAQC,EAAOE,CAAG,GAAKF,EAAO,KAChC",
|
|
6
|
+
"names": ["getTokens", "getSpace", "token", "sizeUpOrDownBy", "spaces", "spaceNames", "key"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./prevent";
|
|
3
|
-
export * from "./getSpace";
|
|
4
|
-
export * from "./useCurrentColor";
|
|
5
|
-
export * from "./useGetThemedIcon";
|
|
1
|
+
export*from"@tamagui/helpers";export*from"./prevent";export*from"./getSpace";export*from"./useCurrentColor";export*from"./useGetThemedIcon";
|
|
6
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,WAAc,mBACd,WAAc,YACd,WAAc,aACd,WAAc,oBACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./prevent";
|
|
3
|
-
export * from "./getSpace";
|
|
4
|
-
export * from "./useCurrentColor";
|
|
5
|
-
export * from "./useGetThemedIcon";
|
|
1
|
+
export*from"@tamagui/helpers";export*from"./prevent";export*from"./getSpace";export*from"./useCurrentColor";export*from"./useGetThemedIcon";
|
|
6
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
5
|
+
"mappings": "AAAA,WAAc,mBACd,WAAc,YACd,WAAc,aACd,WAAc,oBACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/prevent.js
CHANGED
package/dist/esm/prevent.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/prevent.tsx"],
|
|
4
4
|
"sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
|
|
5
|
-
"mappings": "AAAO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAWC,GAAM,CAACA,EAAE,eAAe,EAAGA,EAAE,gBAAgB,CAAC",
|
|
6
|
+
"names": ["prevent", "e"]
|
|
7
7
|
}
|
package/dist/esm/prevent.mjs
CHANGED
package/dist/esm/prevent.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/prevent.tsx"],
|
|
4
4
|
"sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
|
|
5
|
-
"mappings": "AAAO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAWC,GAAM,CAACA,EAAE,eAAe,EAAGA,EAAE,gBAAgB,CAAC",
|
|
6
|
+
"names": ["prevent", "e"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTheme,
|
|
3
|
-
variableToString
|
|
4
|
-
} from "@tamagui/core";
|
|
5
|
-
const useCurrentColor = (colorProp) => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
return variableToString(theme[colorProp] || colorProp || theme.color);
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
useCurrentColor
|
|
11
|
-
};
|
|
1
|
+
import{useTheme as r,variableToString as t}from"@tamagui/core";const p=e=>{const o=r();return t(o[e]||e||o.color)};export{p as useCurrentColor};
|
|
12
2
|
//# sourceMappingURL=useCurrentColor.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useCurrentColor.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n UnionableString,\n Variable,\n useTheme,\n variableToString,\n} from '@tamagui/core'\nimport type { TextStyle } from 'react-native'\n\nexport const useCurrentColor = (colorProp: ColorProp) => {\n const theme = useTheme()\n return variableToString(theme[colorProp as any] || colorProp || theme.color)\n}\n\nexport type ColorProp =\n | UnionableString\n | Variable\n | ColorTokens\n | TextStyle['color']\n | undefined\n"],
|
|
5
|
-
"mappings": "AAAA
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAIE,YAAAA,EACA,oBAAAC,MACK,gBAGA,MAAMC,EAAmBC,GAAyB,CACvD,MAAMC,EAAQJ,EAAS,EACvB,OAAOC,EAAiBG,EAAMD,CAAgB,GAAKA,GAAaC,EAAM,KAAK,CAC7E",
|
|
6
|
+
"names": ["useTheme", "variableToString", "useCurrentColor", "colorProp", "theme"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTheme,
|
|
3
|
-
variableToString
|
|
4
|
-
} from "@tamagui/core";
|
|
5
|
-
const useCurrentColor = (colorProp) => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
return variableToString(theme[colorProp] || colorProp || theme.color);
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
useCurrentColor
|
|
11
|
-
};
|
|
1
|
+
import{useTheme as r,variableToString as t}from"@tamagui/core";const p=e=>{const o=r();return t(o[e]||e||o.color)};export{p as useCurrentColor};
|
|
12
2
|
//# sourceMappingURL=useCurrentColor.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useCurrentColor.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n UnionableString,\n Variable,\n useTheme,\n variableToString,\n} from '@tamagui/core'\nimport type { TextStyle } from 'react-native'\n\nexport const useCurrentColor = (colorProp: ColorProp) => {\n const theme = useTheme()\n return variableToString(theme[colorProp as any] || colorProp || theme.color)\n}\n\nexport type ColorProp =\n | UnionableString\n | Variable\n | ColorTokens\n | TextStyle['color']\n | undefined\n"],
|
|
5
|
-
"mappings": "AAAA
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAIE,YAAAA,EACA,oBAAAC,MACK,gBAGA,MAAMC,EAAmBC,GAAyB,CACvD,MAAMC,EAAQJ,EAAS,EACvB,OAAOC,EAAiBG,EAAMD,CAAgB,GAAKA,GAAaC,EAAM,KAAK,CAC7E",
|
|
6
|
+
"names": ["useTheme", "variableToString", "useCurrentColor", "colorProp", "theme"]
|
|
7
7
|
}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useCurrentColor } from "./useCurrentColor";
|
|
3
|
-
const useGetThemedIcon = (props) => {
|
|
4
|
-
const color = useCurrentColor(props.color);
|
|
5
|
-
return (el) => {
|
|
6
|
-
if (!el)
|
|
7
|
-
return el;
|
|
8
|
-
if (isValidElement(el)) {
|
|
9
|
-
return cloneElement(el, {
|
|
10
|
-
...props,
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
...el.props
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
return createElement(el, props);
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
useGetThemedIcon
|
|
20
|
-
};
|
|
1
|
+
import{cloneElement as e,createElement as t,isValidElement as n}from"react";import{useCurrentColor as m}from"./useCurrentColor";const s=o=>{const c=m(o.color);return r=>r&&(n(r)?e(r,{...o,...r.props}):t(r,o))};export{s as useGetThemedIcon};
|
|
21
2
|
//# sourceMappingURL=useGetThemedIcon.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGetThemedIcon.tsx"],
|
|
4
4
|
"sourcesContent": ["import { cloneElement, createElement, isValidElement } from 'react'\n\nimport { ColorProp, useCurrentColor } from './useCurrentColor'\n\nexport const useGetThemedIcon = (props: { color: ColorProp; size: number }) => {\n const color = useCurrentColor(props.color)\n return (el: any) => {\n if (!el) return el\n if (isValidElement(el)) {\n return cloneElement(el, {\n ...props,\n // @ts-expect-error\n ...el.props,\n })\n }\n return createElement(el, props)\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,gBAAAA,EAAc,iBAAAC,EAAe,kBAAAC,MAAsB,QAE5D,OAAoB,mBAAAC,MAAuB,oBAEpC,MAAMC,EAAoBC,GAA8C,CAC7E,MAAMC,EAAQH,EAAgBE,EAAM,KAAK,EACzC,OAAQE,GACDA,IACDL,EAAeK,CAAE,EACZP,EAAaO,EAAI,CACtB,GAAGF,EAEH,GAAGE,EAAG,KACR,CAAC,EAEIN,EAAcM,EAAIF,CAAK,EAElC",
|
|
6
|
+
"names": ["cloneElement", "createElement", "isValidElement", "useCurrentColor", "useGetThemedIcon", "props", "color", "el"]
|
|
7
7
|
}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useCurrentColor } from "./useCurrentColor";
|
|
3
|
-
const useGetThemedIcon = (props) => {
|
|
4
|
-
const color = useCurrentColor(props.color);
|
|
5
|
-
return (el) => {
|
|
6
|
-
if (!el)
|
|
7
|
-
return el;
|
|
8
|
-
if (isValidElement(el)) {
|
|
9
|
-
return cloneElement(el, {
|
|
10
|
-
...props,
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
...el.props
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
return createElement(el, props);
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
useGetThemedIcon
|
|
20
|
-
};
|
|
1
|
+
import{cloneElement as e,createElement as t,isValidElement as n}from"react";import{useCurrentColor as m}from"./useCurrentColor";const s=o=>{const c=m(o.color);return r=>r&&(n(r)?e(r,{...o,...r.props}):t(r,o))};export{s as useGetThemedIcon};
|
|
21
2
|
//# sourceMappingURL=useGetThemedIcon.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGetThemedIcon.tsx"],
|
|
4
4
|
"sourcesContent": ["import { cloneElement, createElement, isValidElement } from 'react'\n\nimport { ColorProp, useCurrentColor } from './useCurrentColor'\n\nexport const useGetThemedIcon = (props: { color: ColorProp; size: number }) => {\n const color = useCurrentColor(props.color)\n return (el: any) => {\n if (!el) return el\n if (isValidElement(el)) {\n return cloneElement(el, {\n ...props,\n // @ts-expect-error\n ...el.props,\n })\n }\n return createElement(el, props)\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,gBAAAA,EAAc,iBAAAC,EAAe,kBAAAC,MAAsB,QAE5D,OAAoB,mBAAAC,MAAuB,oBAEpC,MAAMC,EAAoBC,GAA8C,CAC7E,MAAMC,EAAQH,EAAgBE,EAAM,KAAK,EACzC,OAAQE,GACDA,IACDL,EAAeK,CAAE,EACZP,EAAaO,EAAI,CACtB,GAAGF,EAEH,GAAGE,EAAG,KACR,CAAC,EAEIN,EAAcM,EAAIF,CAAK,EAElC",
|
|
6
|
+
"names": ["cloneElement", "createElement", "isValidElement", "useCurrentColor", "useGetThemedIcon", "props", "color", "el"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers-tamagui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"clean:build": "tamagui-build clean:build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/core": "1.
|
|
23
|
-
"@tamagui/helpers": "1.
|
|
22
|
+
"@tamagui/core": "1.14.0",
|
|
23
|
+
"@tamagui/helpers": "1.14.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "1.
|
|
26
|
+
"@tamagui/build": "1.14.0",
|
|
27
27
|
"react": "^18.2.0",
|
|
28
28
|
"react-native": "^0.71.4",
|
|
29
29
|
"vitest": "^0.26.3"
|