@tamagui/helpers-tamagui 1.143.0 → 2.0.0-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.
@@ -18,4 +18,5 @@ module.exports = __toCommonJS(index_exports);
18
18
  __reExport(index_exports, require("@tamagui/helpers"), module.exports);
19
19
  __reExport(index_exports, require("./prevent.cjs"), module.exports);
20
20
  __reExport(index_exports, require("./useCurrentColor.cjs"), module.exports);
21
- __reExport(index_exports, require("./useGetThemedIcon.cjs"), module.exports);
21
+ __reExport(index_exports, require("./useGetThemedIcon.cjs"), module.exports);
22
+ __reExport(index_exports, require("./useGetIcon.cjs"), module.exports);
package/dist/cjs/index.js CHANGED
@@ -15,4 +15,5 @@ __reExport(index_exports, require("@tamagui/helpers"), module.exports);
15
15
  __reExport(index_exports, require("./prevent"), module.exports);
16
16
  __reExport(index_exports, require("./useCurrentColor"), module.exports);
17
17
  __reExport(index_exports, require("./useGetThemedIcon"), module.exports);
18
+ __reExport(index_exports, require("./useGetIcon"), module.exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,6BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,8BAFd;AAGA,0BAAc,+BAHd;",
4
+ "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,6BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,8BAFd;AAGA,0BAAc,+BAHd;AAIA,0BAAc,yBAJd;",
5
5
  "names": []
6
6
  }
@@ -21,4 +21,5 @@ __reExport(index_exports, require("@tamagui/helpers"), module.exports);
21
21
  __reExport(index_exports, require("./prevent.native.js"), module.exports);
22
22
  __reExport(index_exports, require("./useCurrentColor.native.js"), module.exports);
23
23
  __reExport(index_exports, require("./useGetThemedIcon.native.js"), module.exports);
24
+ __reExport(index_exports, require("./useGetIcon.native.js"), module.exports);
24
25
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,mBADd,GAAAH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,yBAAAH,MAAA,CAAAC,OAFd;AAGAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,iCAAAH,MAHd,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,mBADd,GAAAH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,yBAAAH,MAAA,CAAAC,OAFd;AAGAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,iCAAAH,MAHd,CAAAC,OAAA;AAIAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,+BAJd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -2,4 +2,5 @@ export * from "@tamagui/helpers";
2
2
  export * from "./prevent";
3
3
  export * from "./useCurrentColor";
4
4
  export * from "./useGetThemedIcon";
5
+ export * from "./useGetIcon";
5
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
5
  "names": []
6
6
  }
@@ -2,4 +2,5 @@ export * from "@tamagui/helpers";
2
2
  export * from "./prevent.mjs";
3
3
  export * from "./useCurrentColor.mjs";
4
4
  export * from "./useGetThemedIcon.mjs";
5
+ export * from "./useGetIcon.mjs";
5
6
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -2,4 +2,5 @@ export * from "@tamagui/helpers";
2
2
  export * from "./prevent.native.js";
3
3
  export * from "./useCurrentColor.native.js";
4
4
  export * from "./useGetThemedIcon.native.js";
5
+ export * from "./useGetIcon.native.js";
5
6
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-tamagui",
3
- "version": "1.143.0",
3
+ "version": "2.0.0-001",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "source": "src/index.ts",
@@ -36,11 +36,11 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@tamagui/helpers": "1.143.0",
40
- "@tamagui/web": "1.143.0"
39
+ "@tamagui/helpers": "2.0.0-001",
40
+ "@tamagui/web": "2.0.0-001"
41
41
  },
42
42
  "devDependencies": {
43
- "@tamagui/build": "1.143.0",
43
+ "@tamagui/build": "2.0.0-001",
44
44
  "react": "*",
45
45
  "react-native": "0.81.5",
46
46
  "vitest": "^4.0.4"
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from '@tamagui/helpers'
2
2
  export * from './prevent'
3
3
  export * from './useCurrentColor'
4
4
  export * from './useGetThemedIcon'
5
+ export * from './useGetIcon'
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+
3
+ export const useGetIcon = () => {
4
+ return (el: any, props: any) => {
5
+ if (!el) return el
6
+ if (React.isValidElement(el)) {
7
+ return React.cloneElement(el, {
8
+ ...props,
9
+ // @ts-expect-error
10
+ ...el.props,
11
+ })
12
+ }
13
+ return React.createElement(el, props)
14
+ }
15
+ }
package/types/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from '@tamagui/helpers';
2
2
  export * from './prevent';
3
3
  export * from './useCurrentColor';
4
4
  export * from './useGetThemedIcon';
5
+ export * from './useGetIcon';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,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,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useGetIcon: () => (el: any, props: any) => any;
2
+ //# sourceMappingURL=useGetIcon.d.ts.map