@tamagui/helpers-tamagui 1.74.3 → 1.74.5

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.
@@ -0,0 +1,5 @@
1
+ export * from "@tamagui/helpers";
2
+ export * from "./prevent";
3
+ export * from "./useCurrentColor";
4
+ export * from "./useGetThemedIcon";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
+ "names": []
6
+ }
@@ -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,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/prevent.tsx"],
4
+ "mappings": "AAAO,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,EAAE,gBAAgB,CAAC;",
5
+ "names": []
6
+ }
@@ -0,0 +1,12 @@
1
+ import {
2
+ getVariable,
3
+ useTheme
4
+ } from "@tamagui/web";
5
+ const useCurrentColor = (colorProp) => {
6
+ const theme = useTheme();
7
+ return getVariable(colorProp || theme[colorProp] || theme.color);
8
+ };
9
+ export {
10
+ useCurrentColor
11
+ };
12
+ //# sourceMappingURL=useCurrentColor.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/useCurrentColor.tsx"],
4
+ "mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,QAAQ,SAAS;AAEvB,SADY,YAAY,aAAa,MAAM,SAAgB,KAAK,MAAM,KAAK;AAE7E;",
5
+ "names": []
6
+ }
@@ -0,0 +1,15 @@
1
+ import { cloneElement, createElement, isValidElement } from "react";
2
+ import { useCurrentColor } from "./useCurrentColor";
3
+ const useGetThemedIcon = (props) => {
4
+ const color = useCurrentColor(props.color);
5
+ return (el) => el && (isValidElement(el) ? cloneElement(el, {
6
+ ...props,
7
+ color,
8
+ // @ts-expect-error
9
+ ...el.props
10
+ }) : createElement(el, props));
11
+ };
12
+ export {
13
+ useGetThemedIcon
14
+ };
15
+ //# sourceMappingURL=useGetThemedIcon.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/useGetThemedIcon.tsx"],
4
+ "mappings": "AAAA,SAAS,cAAc,eAAe,sBAAsB;AAE5D,SAAoB,uBAAuB;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,QAAQ,gBAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OACD,OACD,eAAe,EAAE,IACZ,aAAa,IAAI;AAAA,IACtB,GAAG;AAAA,IACH;AAAA;AAAA,IAEA,GAAG,GAAG;AAAA,EACR,CAAC,IAEI,cAAc,IAAI,KAAK;AAElC;",
5
+ "names": []
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-tamagui",
3
- "version": "1.74.3",
3
+ "version": "1.74.5",
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/helpers": "1.74.3",
23
- "@tamagui/web": "1.74.3"
22
+ "@tamagui/helpers": "1.74.5",
23
+ "@tamagui/web": "1.74.5"
24
24
  },
25
25
  "devDependencies": {
26
- "@tamagui/build": "1.74.3",
26
+ "@tamagui/build": "1.74.5",
27
27
  "react": "^18.2.0",
28
28
  "react-native": "^0.72.1",
29
29
  "vitest": "^0.34.3"