@tamagui/helpers-tamagui 1.0.14 → 1.0.15

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.
@@ -24,9 +24,7 @@ module.exports = __toCommonJS(useCurrentColor_exports);
24
24
  var import_core = require("@tamagui/core");
25
25
  const useCurrentColor = (colorProp) => {
26
26
  const theme = (0, import_core.useTheme)();
27
- return (0, import_core.variableToString)(
28
- theme[colorProp] || (0, import_core.getTokens)(true).color[colorProp] || colorProp || theme.color
29
- );
27
+ return (0, import_core.variableToString)(theme[colorProp] || colorProp || theme.color);
30
28
  };
31
29
  // Annotate the CommonJS export names for ESM import in node:
32
30
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useCurrentColor.tsx"],
4
- "sourcesContent": ["import {\n ColorTokens,\n ThemeValueFallback,\n getTokens,\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(\n theme[colorProp as any] ||\n getTokens(true).color[colorProp as any] ||\n colorProp ||\n theme.color\n )\n}\n\nexport type ColorProp = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMO;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,YAAQ,sBAAS;AACvB,aAAO;AAAA,IACL,MAAM,kBACJ,uBAAU,IAAI,EAAE,MAAM,cACtB,aACA,MAAM;AAAA,EACV;AACF;",
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;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,10 @@
1
1
  import {
2
- getTokens,
3
2
  useTheme,
4
3
  variableToString
5
4
  } from "@tamagui/core";
6
5
  const useCurrentColor = (colorProp) => {
7
6
  const theme = useTheme();
8
- return variableToString(
9
- theme[colorProp] || getTokens(true).color[colorProp] || colorProp || theme.color
10
- );
7
+ return variableToString(theme[colorProp] || colorProp || theme.color);
11
8
  };
12
9
  export {
13
10
  useCurrentColor
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useCurrentColor.tsx"],
4
- "sourcesContent": ["import {\n ColorTokens,\n ThemeValueFallback,\n getTokens,\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(\n theme[colorProp as any] ||\n getTokens(true).color[colorProp as any] ||\n colorProp ||\n theme.color\n )\n}\n\nexport type ColorProp = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined\n"],
5
- "mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,MAAM,kBAAkB,CAAC,cAAyB;AACvD,QAAM,QAAQ,SAAS;AACvB,SAAO;AAAA,IACL,MAAM,cACJ,UAAU,IAAI,EAAE,MAAM,cACtB,aACA,MAAM;AAAA,EACV;AACF;",
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
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-tamagui",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
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.0.14",
23
- "@tamagui/helpers": "^1.0.14"
22
+ "@tamagui/core": "^1.0.15",
23
+ "@tamagui/helpers": "^1.0.15"
24
24
  },
25
25
  "devDependencies": {
26
- "@tamagui/build": "^1.0.14",
26
+ "@tamagui/build": "^1.0.15",
27
27
  "react": "^18.2.0",
28
28
  "react-native": "*",
29
29
  "vitest": "^0.26.3"
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  ColorTokens,
3
3
  ThemeValueFallback,
4
- getTokens,
5
4
  useTheme,
6
5
  variableToString,
7
6
  } from '@tamagui/core'
@@ -9,12 +8,7 @@ import type { TextStyle } from 'react-native'
9
8
 
10
9
  export const useCurrentColor = (colorProp: ColorProp) => {
11
10
  const theme = useTheme()
12
- return variableToString(
13
- theme[colorProp as any] ||
14
- getTokens(true).color[colorProp as any] ||
15
- colorProp ||
16
- theme.color
17
- )
11
+ return variableToString(theme[colorProp as any] || colorProp || theme.color)
18
12
  }
19
13
 
20
14
  export type ColorProp = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined