@tamagui/core 1.0.0-alpha.55 → 1.0.0-alpha.59

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.
Files changed (42) hide show
  1. package/dist/cjs/constants/platform.js +1 -1
  2. package/dist/cjs/constants/platform.js.map +2 -2
  3. package/dist/cjs/createComponent.js +28 -27
  4. package/dist/cjs/createComponent.js.map +2 -2
  5. package/dist/cjs/helpers/createPropMapper.js +32 -34
  6. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  7. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  8. package/dist/cjs/tamagui-base.css +8 -0
  9. package/dist/cjs/tamagui-base.css.map +7 -0
  10. package/dist/cjs/{getThemeParentClassName.js → views/AbsoluteFullscreen.js} +15 -11
  11. package/dist/cjs/views/AbsoluteFullscreen.js.map +7 -0
  12. package/dist/cjs/views/AbsoluteFullscreen.native.js +1 -0
  13. package/dist/cjs/views/AbsoluteFullscreen.native.js.map +7 -0
  14. package/dist/esm/constants/platform.js +1 -1
  15. package/dist/esm/constants/platform.js.map +2 -2
  16. package/dist/esm/createComponent.js +28 -27
  17. package/dist/esm/createComponent.js.map +2 -2
  18. package/dist/esm/helpers/createPropMapper.js +32 -20
  19. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  20. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  21. package/dist/esm/tamagui-base.css +8 -0
  22. package/dist/esm/tamagui-base.css.map +7 -0
  23. package/dist/esm/views/AbsoluteFullscreen.js +14 -0
  24. package/dist/esm/views/AbsoluteFullscreen.js.map +7 -0
  25. package/dist/esm/views/AbsoluteFullscreen.native.js +1 -0
  26. package/dist/esm/views/AbsoluteFullscreen.native.js.map +7 -0
  27. package/dist/jsx/constants/platform.js +1 -1
  28. package/dist/jsx/createComponent.js +27 -28
  29. package/dist/jsx/helpers/createPropMapper.js +32 -20
  30. package/dist/jsx/tamagui-base.css +7 -0
  31. package/dist/jsx/views/AbsoluteFullscreen.js +13 -0
  32. package/dist/jsx/views/AbsoluteFullscreen.native.js +0 -0
  33. package/package.json +9 -6
  34. package/types/constants/platform.d.ts.map +1 -1
  35. package/types/createComponent.d.ts +3 -0
  36. package/types/createComponent.d.ts.map +1 -1
  37. package/types/helpers/createPropMapper.d.ts.map +1 -1
  38. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  39. package/dist/cjs/getThemeParentClassName.js.map +0 -7
  40. package/dist/esm/getThemeParentClassName.js +0 -11
  41. package/dist/esm/getThemeParentClassName.js.map +0 -7
  42. package/dist/jsx/getThemeParentClassName.js +0 -10
@@ -22,9 +22,12 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
22
22
  const variant = variantsParsed == null ? void 0 : variantsParsed[key];
23
23
  if (variant && typeof value !== "undefined") {
24
24
  const val = value === true ? variant["$true"] || variant["true"] : (_b = (_a = variant[value]) != null ? _a : variant["..."]) != null ? _b : value;
25
- const res = typeof val === "function" ? val(value, { tokens: conf.tokensParsed, theme, props }) : isObj(val) ? { ...val } : val;
25
+ let res = val;
26
+ if (typeof res === "function") {
27
+ res = res(value, { tokens: conf.tokensParsed, theme, props });
28
+ }
26
29
  if (isObj(res)) {
27
- resolveTokens(res, conf, theme, fontFamily);
30
+ res = resolveTokens(res, conf, theme, fontFamily);
28
31
  }
29
32
  return res;
30
33
  }
@@ -48,10 +51,12 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
48
51
  }
49
52
  };
50
53
  }, "createPropMapper");
51
- const resolveTokens = /* @__PURE__ */ __name((res, conf, theme, fontFamily) => {
52
- for (const rKey in res) {
54
+ const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily) => {
55
+ var _a;
56
+ let res = {};
57
+ for (const rKey in input) {
53
58
  const fKey = conf.shorthands[rKey] || rKey;
54
- const val = res[rKey];
59
+ const val = input[rKey];
55
60
  if (val instanceof Variable) {
56
61
  res[fKey] = val.variable;
57
62
  } else if (typeof val === "string") {
@@ -59,37 +64,40 @@ const resolveTokens = /* @__PURE__ */ __name((res, conf, theme, fontFamily) => {
59
64
  res[fKey] = fVal;
60
65
  } else {
61
66
  if (isObj(val)) {
62
- resolveTokens(val, conf, theme, fontFamily);
67
+ res[fKey] = resolveTokens(val, conf, theme, fontFamily);
68
+ } else {
69
+ res[fKey] = input[fKey];
70
+ }
71
+ }
72
+ if (process.env.NODE_ENV === "development") {
73
+ if (((_a = res[fKey]) == null ? void 0 : _a[0]) === "$") {
74
+ console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey]);
63
75
  }
64
76
  }
65
77
  }
78
+ return res;
66
79
  }, "resolveTokens");
67
80
  const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed }, theme, fontFamily = "$body") => {
68
- var _a, _b, _c, _d, _e, _f, _g;
69
- if (themeParsed[value]) {
70
- if (isWeb && themeParsed[value].variable) {
71
- return themeParsed[value].variable;
72
- } else {
73
- if (value && value[0] === "$") {
74
- return ((_a = theme[`${value.slice(1)}`]) == null ? void 0 : _a.val) || ((_b = themeParsed[value]) == null ? void 0 : _b.val);
75
- }
76
- }
81
+ var _a, _b, _c, _d, _e;
82
+ const tokenVal = themeParsed[value];
83
+ if (tokenVal) {
84
+ return isWeb && tokenVal.variable ? tokenVal.variable : tokenVal.val;
77
85
  }
78
86
  let valOrVar;
79
87
  if (key === "fontFamily") {
80
- valOrVar = ((_c = tokensParsed.font[value]) == null ? void 0 : _c.family) || value;
88
+ valOrVar = ((_a = tokensParsed.font[value]) == null ? void 0 : _a.family) || value;
81
89
  }
82
90
  if (key === "fontSize") {
83
- valOrVar = ((_d = tokensParsed.font[fontFamily]) == null ? void 0 : _d.size[value]) || value;
91
+ valOrVar = ((_b = tokensParsed.font[fontFamily]) == null ? void 0 : _b.size[value]) || value;
84
92
  }
85
93
  if (key === "lineHeight") {
86
- valOrVar = ((_e = tokensParsed.font[fontFamily]) == null ? void 0 : _e.lineHeight[value]) || value;
94
+ valOrVar = ((_c = tokensParsed.font[fontFamily]) == null ? void 0 : _c.lineHeight[value]) || value;
87
95
  }
88
96
  if (key === "letterSpacing") {
89
- valOrVar = ((_f = tokensParsed.font[fontFamily]) == null ? void 0 : _f.letterSpacing[value]) || value;
97
+ valOrVar = ((_d = tokensParsed.font[fontFamily]) == null ? void 0 : _d.letterSpacing[value]) || value;
90
98
  }
91
99
  if (key === "fontWeight") {
92
- valOrVar = ((_g = tokensParsed.font[fontFamily]) == null ? void 0 : _g.weight[value]) || value;
100
+ valOrVar = ((_e = tokensParsed.font[fontFamily]) == null ? void 0 : _e.weight[value]) || value;
93
101
  }
94
102
  if (typeof valOrVar !== "undefined") {
95
103
  if (valOrVar instanceof Variable) {
@@ -115,6 +123,10 @@ const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed
115
123
  if (spaceVar) {
116
124
  return spaceVar.variable;
117
125
  }
126
+ if (value && value[0] === "$") {
127
+ console.warn("Missing token in theme", value, "in", theme);
128
+ return null;
129
+ }
118
130
  return value;
119
131
  }, "getToken");
120
132
  const tokenCategories = {
@@ -0,0 +1,7 @@
1
+ .tamagui-absolute-fill {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ }
@@ -0,0 +1,13 @@
1
+ import { styled } from "../styled";
2
+ import { Stack } from "./Stack";
3
+ const AbsoluteFullscreen = styled(Stack, {
4
+ position: "absolute",
5
+ top: 0,
6
+ left: 0,
7
+ right: 0,
8
+ bottom: 0
9
+ });
10
+ globalThis["TamaguiAbsoluteFullscreen"] = AbsoluteFullscreen;
11
+ export {
12
+ AbsoluteFullscreen
13
+ };
File without changes
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.0.0-alpha.55",
3
+ "version": "1.0.0-alpha.59",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
7
7
  "typings": "types",
8
+ "sideEffects": [
9
+ "*.css"
10
+ ],
8
11
  "scripts": {
9
12
  "build": "tamagui-build",
10
13
  "watch": "tamagui-build --watch"
@@ -14,10 +17,10 @@
14
17
  "dist"
15
18
  ],
16
19
  "dependencies": {
17
- "@tamagui/helpers": "^1.0.0-alpha.48",
20
+ "@tamagui/helpers": "^1.0.0-alpha.58",
18
21
  "@tamagui/ow": "^0.28.1",
19
- "@tamagui/use-debounce": "^1.0.0-alpha.44",
20
- "@tamagui/use-force-update": "^1.0.0-alpha.44",
22
+ "@tamagui/use-debounce": "^1.0.0-alpha.58",
23
+ "@tamagui/use-force-update": "^1.0.0-alpha.58",
21
24
  "react": "*",
22
25
  "react-dom": "*"
23
26
  },
@@ -25,7 +28,7 @@
25
28
  "react-native-web": "*"
26
29
  },
27
30
  "devDependencies": {
28
- "@tamagui/build": "^1.0.0-alpha.44",
31
+ "@tamagui/build": "^1.0.0-alpha.58",
29
32
  "@types/react": "^17.0.35",
30
33
  "csstype": "^3.0.10",
31
34
  "esbuild": "^0.13.12",
@@ -35,5 +38,5 @@
35
38
  "publishConfig": {
36
39
  "access": "public"
37
40
  },
38
- "gitHead": "d9c8dbec240f5e16eb7c52b96ea8bed948e6e299"
41
+ "gitHead": "fc9f0f06708907f2f8d3968f56d9fc67df3345d5"
39
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,KAAK,SAAuE,CAAA;AACzF,eAAO,MAAM,KAAK,SAAyC,CAAA;AAC3D,eAAO,MAAM,yBAAyB,kBAAsC,CAAA;AAC5E,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,gBAAgB,SAA4D,CAAA;AACzF,eAAO,MAAM,aAAa,SAA6B,CAAA;AACvD,eAAO,MAAM,QAAQ,SAKA,CAAA"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,KAAK,SAEgD,CAAA;AAElE,eAAO,MAAM,KAAK,SAAyC,CAAA;AAC3D,eAAO,MAAM,yBAAyB,kBAAsC,CAAA;AAC5E,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,gBAAgB,SAA4D,CAAA;AACzF,eAAO,MAAM,aAAa,SAA6B,CAAA;AACvD,eAAO,MAAM,QAAQ,SAKA,CAAA"}
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+ import './tamagui-base.css';
1
3
  import { ViewStyle } from 'react-native';
2
4
  import { StaticComponent, StaticConfig, StaticConfigParsed } from './types';
3
5
  export declare const mouseUps: Set<Function>;
@@ -13,5 +15,6 @@ export declare function spacedChildren({ isZStack, children, space, flexDirectio
13
15
  space?: any;
14
16
  flexDirection?: ViewStyle['flexDirection'];
15
17
  }): any;
18
+ export declare const AbsoluteFill: (props: any) => JSX.Element;
16
19
  export {};
17
20
  //# sourceMappingURL=createComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAA;AAYhE,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAS3C,aAAK,YAAY,GAAG,EAAE,CAAA;AAuBtB,wBAAgB,eAAe,CAAC,kBAAkB,SAAS,MAAM,GAAG,YAAY,EAC9E,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,sEAscrD;AAOD,eAAO,MAAM,MAAM;;;iCAyBjB,CAAA;AAEF,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,aAAa,GACd,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,GAAG,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;CAC3C,OAwCA"}
1
+ {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAe3B,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAA;AAYhE,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAS3C,aAAK,YAAY,GAAG,EAAE,CAAA;AAuBtB,wBAAgB,eAAe,CAAC,kBAAkB,SAAS,MAAM,GAAG,YAAY,EAC9E,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,sEAqdrD;AAOD,eAAO,MAAM,MAAM;;;iCAyBjB,CAAA;AAEF,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,aAAa,GACd,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,GAAG,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;CAC3C,OA0CA;AAED,eAAO,MAAM,YAAY,UAAW,GAAG,gBAKpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAyB,MAAM,UAAU,CAAA;AAG9D,eAAO,MAAM,gBAAgB,MAAO,YAAY,WAKjC,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QA2DxD,CAAA"}
1
+ {"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAyB,MAAM,UAAU,CAAA;AAG9D,eAAO,MAAM,gBAAgB,MAAO,YAAY,WAKjC,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAsDxD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1D,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAI3D,eAAO,MAAM,cAAc;;iBAEX,kBAAkB,SACzB,WAAW;;;;;;;;CAuInB,CAAA"}
1
+ {"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1D,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAI3D,eAAO,MAAM,cAAc;;iBAEX,kBAAkB,SACzB,WAAW;;;;;;;;CAsInB,CAAA"}
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getThemeParentClassName.ts"],
4
- "sourcesContent": ["import { PREFIX } from './constants/constants'\n\nexport function getThemeParentClassName(themeName?: string | null) {\n return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ''}`\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAuB;AAEhB,iCAAiC,WAA2B;AACjE,SAAO,gBAAgB,YAAY,GAAG,0BAAS,cAAc;AAAA;AAD/C;",
6
- "names": []
7
- }
@@ -1,11 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { PREFIX } from "./constants/constants";
4
- function getThemeParentClassName(themeName) {
5
- return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ""}`;
6
- }
7
- __name(getThemeParentClassName, "getThemeParentClassName");
8
- export {
9
- getThemeParentClassName
10
- };
11
- //# sourceMappingURL=getThemeParentClassName.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getThemeParentClassName.ts"],
4
- "sourcesContent": ["import { PREFIX } from './constants/constants'\n\nexport function getThemeParentClassName(themeName?: string | null) {\n return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ''}`\n}\n"],
5
- "mappings": ";;AAAA;AAEO,iCAAiC,WAA2B;AACjE,SAAO,gBAAgB,YAAY,GAAG,SAAS,cAAc;AAAA;AAD/C;",
6
- "names": []
7
- }
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { PREFIX } from "./constants/constants";
4
- function getThemeParentClassName(themeName) {
5
- return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ""}`;
6
- }
7
- __name(getThemeParentClassName, "getThemeParentClassName");
8
- export {
9
- getThemeParentClassName
10
- };