@tamagui/helpers-tamagui 1.1.8 → 1.1.9

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.
@@ -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(true).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;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,aAAS,uBAAU,IAAI,EAAE;AAC/B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MACJ,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,OAAO,CAAC,IAAI,cAAc;AACtF,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,aAAS,uBAAU,IAAI,EAAE;AAC/B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MACJ,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,OAAO,CAAC,IAAI,cAAc,CAAC;AACvF,SAAQ,OAAO,GAAG,KAAK,OAAO,OAAO;AACvC;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useCurrentColor.tsx"],
4
4
  "sourcesContent": ["import {\n ColorTokens,\n ThemeValueFallback,\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 = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKO;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,YAAQ,sBAAS;AACvB,aAAO,8BAAiB,MAAM,cAAqB,aAAa,MAAM,KAAK;AAC7E;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKO;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,YAAQ,sBAAS;AACvB,aAAO,8BAAiB,MAAM,SAAgB,KAAK,aAAa,MAAM,KAAK;AAC7E;",
6
6
  "names": []
7
7
  }
@@ -31,6 +31,7 @@ const useGetThemedIcon = (props) => {
31
31
  if ((0, import_react.isValidElement)(el)) {
32
32
  return (0, import_react.cloneElement)(el, {
33
33
  ...props,
34
+ // @ts-expect-error
34
35
  ...el.props
35
36
  });
36
37
  }
@@ -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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA4D;AAE5D,6BAA2C;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,YAAQ,wCAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OAAY;AAClB,QAAI,CAAC;AAAI,aAAO;AAChB,YAAI,6BAAe,EAAE,GAAG;AACtB,iBAAO,2BAAa,IAAI;AAAA,QACtB,GAAG;AAAA,QAEH,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AACA,eAAO,4BAAc,IAAI,KAAK;AAAA,EAChC;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA4D;AAE5D,6BAA2C;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,YAAQ,wCAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OAAY;AAClB,QAAI,CAAC;AAAI,aAAO;AAChB,YAAI,6BAAe,EAAE,GAAG;AACtB,iBAAO,2BAAa,IAAI;AAAA,QACtB,GAAG;AAAA;AAAA,QAEH,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AACA,eAAO,4BAAc,IAAI,KAAK;AAAA,EAChC;AACF;",
6
6
  "names": []
7
7
  }
@@ -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(true).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,SAAsB,iBAAiB;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,UAAU,IAAI,EAAE;AAC/B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MACJ,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,OAAO,CAAC,IAAI,cAAc;AACtF,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
5
+ "mappings": "AAAA,SAAsB,iBAAiB;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,UAAU,IAAI,EAAE;AAC/B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MACJ,WAAW,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,OAAO,CAAC,IAAI,cAAc,CAAC;AACvF,SAAQ,OAAO,GAAG,KAAK,OAAO,OAAO;AACvC;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useCurrentColor.tsx"],
4
4
  "sourcesContent": ["import {\n ColorTokens,\n ThemeValueFallback,\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 = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined\n"],
5
- "mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,QAAQ,SAAS;AACvB,SAAO,iBAAiB,MAAM,cAAqB,aAAa,MAAM,KAAK;AAC7E;",
5
+ "mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,QAAQ,SAAS;AACvB,SAAO,iBAAiB,MAAM,SAAgB,KAAK,aAAa,MAAM,KAAK;AAC7E;",
6
6
  "names": []
7
7
  }
@@ -8,6 +8,7 @@ const useGetThemedIcon = (props) => {
8
8
  if (isValidElement(el)) {
9
9
  return cloneElement(el, {
10
10
  ...props,
11
+ // @ts-expect-error
11
12
  ...el.props
12
13
  });
13
14
  }
@@ -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,SAAS,cAAc,eAAe,sBAAsB;AAE5D,SAAoB,uBAAuB;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,QAAQ,gBAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OAAY;AAClB,QAAI,CAAC;AAAI,aAAO;AAChB,QAAI,eAAe,EAAE,GAAG;AACtB,aAAO,aAAa,IAAI;AAAA,QACtB,GAAG;AAAA,QAEH,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AACA,WAAO,cAAc,IAAI,KAAK;AAAA,EAChC;AACF;",
5
+ "mappings": "AAAA,SAAS,cAAc,eAAe,sBAAsB;AAE5D,SAAoB,uBAAuB;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,QAAQ,gBAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OAAY;AAClB,QAAI,CAAC;AAAI,aAAO;AAChB,QAAI,eAAe,EAAE,GAAG;AACtB,aAAO,aAAa,IAAI;AAAA,QACtB,GAAG;AAAA;AAAA,QAEH,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AACA,WAAO,cAAc,IAAI,KAAK;AAAA,EAChC;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-tamagui",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
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.1.8",
23
- "@tamagui/helpers": "^1.1.8"
22
+ "@tamagui/core": "^1.1.9",
23
+ "@tamagui/helpers": "^1.1.9"
24
24
  },
25
25
  "devDependencies": {
26
- "@tamagui/build": "^1.1.8",
26
+ "@tamagui/build": "^1.1.9",
27
27
  "react": "^18.2.0",
28
28
  "react-native": "*",
29
29
  "vitest": "^0.26.3"
@@ -1,11 +0,0 @@
1
- import { getTokens } from "@tamagui/core";
2
- const getSpace = (token, sizeUpOrDownBy = 0) => {
3
- const spaces = getTokens(true).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
@@ -1,7 +0,0 @@
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(true).space\n const spaceNames = Object.keys(spaces)\n const key =\n spaceNames[\n Math.max(0, spaceNames.indexOf(String(token || '$4')) + sizeUpOrDownBy)\n ]\n return (spaces[key] || spaces['$4']) as SpaceTokens\n}\n"],
5
- "mappings": "AAAA,SAAsB,iBAAiB;AAEhC,MAAM,WAAW,CAAC,OAAiC,iBAAiB,MAAM;AAC/E,QAAM,SAAS,UAAU,IAAI,EAAE;AAC/B,QAAM,aAAa,OAAO,KAAK,MAAM;AACrC,QAAM,MACJ,WACE,KAAK,IAAI,GAAG,WAAW,QAAQ,OAAO,SAAS,IAAI,CAAC,IAAI,cAAc;AAE1E,SAAQ,OAAO,QAAQ,OAAO;AAChC;",
6
- "names": []
7
- }
package/dist/jsx/index.js DELETED
@@ -1,6 +0,0 @@
1
- export * from "@tamagui/helpers";
2
- export * from "./prevent";
3
- export * from "./getSpace";
4
- export * from "./useCurrentColor";
5
- export * from "./useGetThemedIcon";
6
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from '@tamagui/helpers'\nexport * from './prevent'\nexport * from './getSpace'\nexport * from './useCurrentColor'\nexport * from './useGetThemedIcon'\n"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
1
- const prevent = (e) => [e.preventDefault(), e.stopPropagation()];
2
- export {
3
- prevent
4
- };
5
- //# sourceMappingURL=prevent.js.map
@@ -1,7 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
- };
12
- //# sourceMappingURL=useCurrentColor.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useCurrentColor.tsx"],
4
- "sourcesContent": ["import {\n ColorTokens,\n ThemeValueFallback,\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 = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined\n"],
5
- "mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,QAAQ,SAAS;AACvB,SAAO,iBAAiB,MAAM,cAAqB,aAAa,MAAM,KAAK;AAC7E;",
6
- "names": []
7
- }
@@ -1,20 +0,0 @@
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) => {
6
- if (!el)
7
- return el;
8
- if (isValidElement(el)) {
9
- return cloneElement(el, {
10
- ...props,
11
- ...el.props
12
- });
13
- }
14
- return createElement(el, props);
15
- };
16
- };
17
- export {
18
- useGetThemedIcon
19
- };
20
- //# sourceMappingURL=useGetThemedIcon.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useGetThemedIcon.tsx"],
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,SAAS,cAAc,eAAe,sBAAsB;AAE5D,SAAoB,uBAAuB;AAEpC,MAAM,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,QAAQ,gBAAgB,MAAM,KAAK;AACzC,SAAO,CAAC,OAAY;AAClB,QAAI,CAAC;AAAI,aAAO;AAChB,QAAI,eAAe,EAAE,GAAG;AACtB,aAAO,aAAa,IAAI;AAAA,QACtB,GAAG;AAAA,QAEH,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AACA,WAAO,cAAc,IAAI,KAAK;AAAA,EAChC;AACF;",
6
- "names": []
7
- }