@tamagui/helpers-tamagui 1.0.1-beta.113 → 1.0.1-beta.114

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/README.md ADDED
@@ -0,0 +1 @@
1
+ This is a superset of @tamagui/helpers with extra utilities used by `tamagui`
@@ -0,0 +1,35 @@
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 || "$4")) + sizeUpOrDownBy)];
29
+ return spaces[key] || spaces["$4"];
30
+ };
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ getSpace
34
+ });
35
+ //# sourceMappingURL=getSpace.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getSpace.tsx"],
4
+ "sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space as any as SpaceTokens\n const spaceNames = Object.keys(spaces)\n const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$4')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$4']) as SpaceTokens\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,2BAAU,EAAE;AAC3B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MAAM,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,IAAI,CAAC,IAAI,cAAc;AAC7F,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
6
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -15,6 +15,9 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var src_exports = {};
17
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);
18
21
  __reExport(src_exports, require("./useCurrentColor"), module.exports);
19
22
  __reExport(src_exports, require("./useGetThemedIcon"), module.exports);
20
23
  __reExport(src_exports, require("./types"), module.exports);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,8BAAd;AACA,wBAAc,+BADd;AAEA,wBAAc,oBAFd;",
4
+ "sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,6BAAd;AACA,wBAAc,sBADd;AAEA,wBAAc,uBAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,+BAJd;AAKA,wBAAc,oBALd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,29 @@
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
+ });
29
+ //# sourceMappingURL=prevent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/prevent.tsx"],
4
+ "sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,EAAE,gBAAgB,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import { getTokens } from "@tamagui/core";
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 || "$4")) + sizeUpOrDownBy)];
6
+ return spaces[key] || spaces["$4"];
7
+ };
8
+ export {
9
+ getSpace
10
+ };
11
+ //# sourceMappingURL=getSpace.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getSpace.tsx"],
4
+ "sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space as any as SpaceTokens\n const spaceNames = Object.keys(spaces)\n const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$4')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$4']) as SpaceTokens\n}\n"],
5
+ "mappings": "AAAA;AAEO,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,UAAU,EAAE;AAC3B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MAAM,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,IAAI,CAAC,IAAI,cAAc;AAC7F,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ export * from "@tamagui/helpers";
2
+ export * from "./prevent";
3
+ export * from "./getSpace";
1
4
  export * from "./useCurrentColor";
2
5
  export * from "./useGetThemedIcon";
3
6
  export * from "./types";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
- "mappings": "AAAA;AACA;AACA;",
4
+ "sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
+ "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,5 @@
1
+ const prevent = (e) => [e.preventDefault(), e.stopPropagation()];
2
+ export {
3
+ prevent
4
+ };
5
+ //# sourceMappingURL=prevent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/prevent.tsx"],
4
+ "sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
5
+ "mappings": "AAAO,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,EAAE,gBAAgB,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import { getTokens } from "@tamagui/core";
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 || "$4")) + sizeUpOrDownBy)];
6
+ return spaces[key] || spaces["$4"];
7
+ };
8
+ export {
9
+ getSpace
10
+ };
11
+ //# sourceMappingURL=getSpace.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getSpace.tsx"],
4
+ "sourcesContent": ["import { SpaceTokens, getTokens } from '@tamagui/core'\n\nexport const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {\n const spaces = getTokens().space as any as SpaceTokens\n const spaceNames = Object.keys(spaces)\n const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$4')) + sizeUpOrDownBy)]\n return (spaces[key] || spaces['$4']) as SpaceTokens\n}\n"],
5
+ "mappings": "AAAA;AAEO,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,UAAU,EAAE;AAC3B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MAAM,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,IAAI,CAAC,IAAI,cAAc;AAC7F,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
6
+ "names": []
7
+ }
package/dist/jsx/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ export * from "@tamagui/helpers";
2
+ export * from "./prevent";
3
+ export * from "./getSpace";
1
4
  export * from "./useCurrentColor";
2
5
  export * from "./useGetThemedIcon";
3
6
  export * from "./types";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
- "mappings": "AAAA;AACA;AACA;",
4
+ "sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\nexport * from './types'\n"],
5
+ "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,5 @@
1
+ const prevent = (e) => [e.preventDefault(), e.stopPropagation()];
2
+ export {
3
+ prevent
4
+ };
5
+ //# sourceMappingURL=prevent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/prevent.tsx"],
4
+ "sourcesContent": ["export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]\n"],
5
+ "mappings": "AAAO,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,EAAE,gBAAgB,CAAC;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-tamagui",
3
- "version": "1.0.1-beta.113",
3
+ "version": "1.0.1-beta.114",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs",
@@ -18,14 +18,14 @@
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "dependencies": {
21
- "@tamagui/core": "^1.0.1-beta.113"
21
+ "@tamagui/core": "^1.0.1-beta.114",
22
+ "@tamagui/helpers": "^1.0.1-beta.114"
22
23
  },
23
24
  "devDependencies": {
24
- "@tamagui/build": "^1.0.1-beta.113",
25
- "@tamagui/vite-plugin-internal": "^1.0.1-beta.113",
25
+ "@tamagui/build": "^1.0.1-beta.114",
26
26
  "react": "*",
27
27
  "react-native": "*",
28
- "vitest": "^0.17.1"
28
+ "vitest": "^0.18.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "*",
@@ -0,0 +1,8 @@
1
+ import { SpaceTokens, getTokens } from '@tamagui/core'
2
+
3
+ export const getSpace = (token?: SpaceTokens | undefined, sizeUpOrDownBy = 0) => {
4
+ const spaces = getTokens().space as any as SpaceTokens
5
+ const spaceNames = Object.keys(spaces)
6
+ const key = spaceNames[Math.max(0, spaceNames.indexOf(String(token || '$4')) + sizeUpOrDownBy)]
7
+ return (spaces[key] || spaces['$4']) as SpaceTokens
8
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export * from '@tamagui/helpers'
2
+ export * from './prevent'
3
+ export * from './getSpace'
1
4
  export * from './useCurrentColor'
2
5
  export * from './useGetThemedIcon'
3
6
  export * from './types'
@@ -0,0 +1 @@
1
+ export const prevent = (e) => [e.preventDefault(), e.stopPropagation()]
@@ -0,0 +1,3 @@
1
+ import { SpaceTokens } from '@tamagui/core';
2
+ export declare const getSpace: (token?: SpaceTokens | undefined, sizeUpOrDownBy?: number) => SpaceTokens;
3
+ //# sourceMappingURL=getSpace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSpace.d.ts","sourceRoot":"","sources":["../src/getSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,QAAQ,WAAY,WAAW,GAAG,SAAS,yCAKvD,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export * from '@tamagui/helpers';
2
+ export * from './prevent';
3
+ export * from './getSpace';
1
4
  export * from './useCurrentColor';
2
5
  export * from './useGetThemedIcon';
3
6
  export * from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const prevent: (e: any) => any[];
2
+ //# sourceMappingURL=prevent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prevent.d.ts","sourceRoot":"","sources":["../src/prevent.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,mBAAmD,CAAA"}