@tamagui/web 1.2.11 → 1.2.13

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 (34) hide show
  1. package/dist/cjs/config.js +8 -2
  2. package/dist/cjs/config.js.map +2 -2
  3. package/dist/cjs/helpers/normalizeShadow.js +47 -0
  4. package/dist/cjs/helpers/normalizeShadow.js.map +7 -0
  5. package/dist/cjs/helpers/normalizeShadow.native.js +55 -0
  6. package/dist/cjs/helpers/normalizeShadow.native.js.map +7 -0
  7. package/dist/cjs/helpers/normalizeStylePropKeys.js +29 -0
  8. package/dist/cjs/helpers/normalizeStylePropKeys.js.map +7 -0
  9. package/dist/cjs/helpers/normalizeStylePropKeys.native.js +40 -0
  10. package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +7 -0
  11. package/dist/esm/config.js +8 -2
  12. package/dist/esm/config.js.map +2 -2
  13. package/dist/esm/config.mjs +8 -2
  14. package/dist/esm/config.mjs.map +2 -2
  15. package/dist/esm/helpers/normalizeShadow.js +23 -0
  16. package/dist/esm/helpers/normalizeShadow.js.map +7 -0
  17. package/dist/esm/helpers/normalizeShadow.mjs +23 -0
  18. package/dist/esm/helpers/normalizeShadow.mjs.map +7 -0
  19. package/dist/esm/helpers/normalizeShadow.native.js +31 -0
  20. package/dist/esm/helpers/normalizeShadow.native.js.map +7 -0
  21. package/dist/esm/helpers/normalizeShadow.native.mjs +31 -0
  22. package/dist/esm/helpers/normalizeShadow.native.mjs.map +7 -0
  23. package/dist/esm/helpers/normalizeStylePropKeys.js +5 -0
  24. package/dist/esm/helpers/normalizeStylePropKeys.js.map +7 -0
  25. package/dist/esm/helpers/normalizeStylePropKeys.mjs +5 -0
  26. package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +7 -0
  27. package/dist/esm/helpers/normalizeStylePropKeys.native.js +16 -0
  28. package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +7 -0
  29. package/dist/esm/helpers/normalizeStylePropKeys.native.mjs +16 -0
  30. package/dist/esm/helpers/normalizeStylePropKeys.native.mjs.map +7 -0
  31. package/package.json +9 -9
  32. package/src/config.ts +16 -13
  33. package/types/config.d.ts +1 -1
  34. package/types/config.d.ts.map +1 -1
@@ -55,7 +55,13 @@ let cached;
55
55
  const getTokens = ({
56
56
  prefixed
57
57
  } = {}) => {
58
- return cached ?? (cached = {
58
+ if (!conf)
59
+ throw new Error(`never called createTamagui`);
60
+ if (prefixed === false)
61
+ return conf.tokens;
62
+ if (prefixed === true)
63
+ return conf.tokensParsed;
64
+ return cached ?? (cached = Object.freeze({
59
65
  size: {
60
66
  ...conf.tokens["size"],
61
67
  ...conf.tokensParsed["size"]
@@ -76,7 +82,7 @@ const getTokens = ({
76
82
  ...conf.tokens["color"],
77
83
  ...conf.tokensParsed["color"]
78
84
  }
79
- });
85
+ }));
80
86
  };
81
87
  const useTokens = () => getTokens();
82
88
  const getThemes = () => conf.themes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/config.ts"],
4
- "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, TokensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * @deprecated prefixed true and false are merged together, no longer need this property\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n return (cached ??= {\n size: {\n ...conf!.tokens['size'],\n ...conf!.tokensParsed['size'],\n },\n space: {\n ...conf!.tokens['space'],\n ...conf!.tokensParsed['space'],\n },\n radius: {\n ...conf!.tokens['radius'],\n ...conf!.tokensParsed['radius'],\n },\n zIndex: {\n ...conf!.tokens['zIndex'],\n ...conf!.tokensParsed['zIndex'],\n },\n color: {\n ...conf!.tokens['color'],\n ...conf!.tokensParsed['color'],\n },\n } as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;A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EACpD,MAFA,mBAEI;AAER;",
4
+ "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, TokensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * Force either with $ or without $ prefix\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n if (!conf) throw new Error(`never called createTamagui`)\n if (prefixed === false) return conf.tokens\n if (prefixed === true) return conf.tokensParsed\n return (cached ??= Object.freeze({\n size: {\n ...conf.tokens['size'],\n ...conf.tokensParsed['size'],\n },\n space: {\n ...conf.tokens['space'],\n ...conf.tokensParsed['space'],\n },\n radius: {\n ...conf.tokens['radius'],\n ...conf.tokensParsed['radius'],\n },\n zIndex: {\n ...conf.tokens['zIndex'],\n ...conf.tokensParsed['zIndex'],\n },\n color: {\n ...conf.tokens['color'],\n ...conf.tokensParsed['color'],\n },\n }) as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\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B;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,KAAK,OAAO,QAAQ;AAAA,MACvB,GAAG,KAAK,aAAa,QAAQ;AAAA,IAC/B;AAAA,IACA,OAAO;AAAA,MACL,GAAG,KAAK,OAAO,OAAO;AAAA,MACtB,GAAG,KAAK,aAAa,OAAO;AAAA,IAC9B;AAAA,EACF,CAAC;AACH;AAKO,MAAM,YAAY,MAAM,UAAU;AAElC,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAI;AAAA,EACT,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,eAAe,CAAC,KAAa,UAAe;AACvD,SAAO,OAAO,KAAK,KAAK;AAC1B;AAGO,MAAM,UAAU,CAAC,SAAiB;AAtFzC;AAuFE,QAAMA,QAAO,UAAU;AACvB,SACEA,MAAK,YAAY,IAAI,OACrB,YAAO,QAAQA,MAAK,WAAW,EAAE;AAAA,IAC/B,CAAC,CAAC,CAAC,MAAG;AA3FZ,UAAAC,KAAA;AA2Fe,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
6
6
  "names": ["conf", "_a"]
7
7
  }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var normalizeShadow_exports = {};
20
+ __export(normalizeShadow_exports, {
21
+ normalizeShadow: () => normalizeShadow
22
+ });
23
+ module.exports = __toCommonJS(normalizeShadow_exports);
24
+ var import_expandStyles = require("./expandStyles");
25
+ var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.js");
26
+ function normalizeShadow({
27
+ shadowColor,
28
+ shadowOffset,
29
+ shadowOpacity = 1,
30
+ shadowRadius
31
+ }) {
32
+ const { height, width } = shadowOffset || import_expandStyles.defaultOffset;
33
+ return {
34
+ shadowOffset: {
35
+ width: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width || 0),
36
+ height: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height || 0)
37
+ },
38
+ shadowRadius: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
39
+ shadowColor,
40
+ shadowOpacity
41
+ };
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ normalizeShadow
46
+ });
47
+ //# sourceMappingURL=normalizeShadow.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.ts"],
4
+ "sourcesContent": ["import { defaultOffset } from './expandStyles'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity = 1,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor,\n shadowOpacity,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA8B;AAC9B,wCAA2C;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,WAAO,8DAA2B,SAAS,CAAC;AAAA,MAC5C,YAAQ,8DAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,kBAAc,8DAA2B,gBAAgB,CAAC;AAAA,IAC1D;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var normalizeShadow_native_exports = {};
20
+ __export(normalizeShadow_native_exports, {
21
+ normalizeShadow: () => normalizeShadow
22
+ });
23
+ module.exports = __toCommonJS(normalizeShadow_native_exports);
24
+ var import_normalize_css_color = require("@tamagui/normalize-css-color");
25
+ var import_expandStyles = require("./expandStyles");
26
+ var import_normalizeColor = require("./normalizeColor");
27
+ var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.js");
28
+ function normalizeShadow({
29
+ shadowColor,
30
+ shadowOffset,
31
+ shadowOpacity,
32
+ shadowRadius
33
+ }) {
34
+ const { height, width } = shadowOffset || import_expandStyles.defaultOffset;
35
+ const colorStr = String(shadowColor || "black");
36
+ const val = (0, import_normalize_css_color.normalizeCSSColor)(colorStr);
37
+ if (!val) {
38
+ throw new Error(`invalid shadow color ${colorStr}`);
39
+ }
40
+ const { r, g, b, a } = (0, import_normalizeColor.rgba)(val);
41
+ return {
42
+ shadowOffset: {
43
+ width: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width || 0),
44
+ height: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height || 0)
45
+ },
46
+ shadowRadius: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
47
+ shadowColor: `rgb(${r},${g},${b})`,
48
+ shadowOpacity: shadowOpacity ?? a
49
+ };
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ normalizeShadow
54
+ });
55
+ //# sourceMappingURL=normalizeShadow.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.native.ts"],
4
+ "sourcesContent": ["import { normalizeCSSColor } from '@tamagui/normalize-css-color'\n\nimport { defaultOffset } from './expandStyles'\nimport { rgba } from './normalizeColor'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n const colorStr = String(shadowColor || 'black')\n // on native fix bug - shadows behave better if turned into non-alpha rgb() + shadowOpacity\n const val = normalizeCSSColor(colorStr)\n if (!val) {\n throw new Error(`invalid shadow color ${colorStr}`)\n }\n const { r, g, b, a } = rgba(val)\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor: `rgb(${r},${g},${b})`,\n shadowOpacity: shadowOpacity ?? a,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAkC;AAElC,0BAA8B;AAC9B,4BAAqB;AACrB,wCAA2C;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,QAAM,WAAW,OAAO,eAAe,OAAO;AAE9C,QAAM,UAAM,8CAAkB,QAAQ;AACtC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,wBAAwB,UAAU;AAAA,EACpD;AACA,QAAM,EAAE,GAAG,GAAG,GAAG,EAAE,QAAI,4BAAK,GAAG;AAC/B,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,WAAO,8DAA2B,SAAS,CAAC;AAAA,MAC5C,YAAQ,8DAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,kBAAc,8DAA2B,gBAAgB,CAAC;AAAA,IAC1D,aAAa,OAAO,KAAK,KAAK;AAAA,IAC9B,eAAe,iBAAiB;AAAA,EAClC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var normalizeStylePropKeys_exports = {};
20
+ __export(normalizeStylePropKeys_exports, {
21
+ normalizeStylePropKeys: () => normalizeStylePropKeys
22
+ });
23
+ module.exports = __toCommonJS(normalizeStylePropKeys_exports);
24
+ const normalizeStylePropKeys = {};
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ normalizeStylePropKeys
28
+ });
29
+ //# sourceMappingURL=normalizeStylePropKeys.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.ts"],
4
+ "sourcesContent": ["// none for web, all for native\n\nexport const normalizeStylePropKeys = {}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,yBAAyB,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var normalizeStylePropKeys_native_exports = {};
20
+ __export(normalizeStylePropKeys_native_exports, {
21
+ normalizeStylePropKeys: () => normalizeStylePropKeys
22
+ });
23
+ module.exports = __toCommonJS(normalizeStylePropKeys_native_exports);
24
+ const normalizeStylePropKeys = {
25
+ backgroundColor: true,
26
+ borderColor: true,
27
+ borderTopColor: true,
28
+ borderRightColor: true,
29
+ borderBottomColor: true,
30
+ borderLeftColor: true,
31
+ color: true,
32
+ shadowColor: true,
33
+ textDecorationColor: true,
34
+ textShadowColor: true
35
+ };
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ normalizeStylePropKeys
39
+ });
40
+ //# sourceMappingURL=normalizeStylePropKeys.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.native.ts"],
4
+ "sourcesContent": ["export const normalizeStylePropKeys = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AACnB;",
6
+ "names": []
7
+ }
@@ -23,7 +23,13 @@ let cached;
23
23
  const getTokens = ({
24
24
  prefixed
25
25
  } = {}) => {
26
- return cached ??= {
26
+ if (!conf)
27
+ throw new Error(`never called createTamagui`);
28
+ if (prefixed === false)
29
+ return conf.tokens;
30
+ if (prefixed === true)
31
+ return conf.tokensParsed;
32
+ return cached ??= Object.freeze({
27
33
  size: {
28
34
  ...conf.tokens["size"],
29
35
  ...conf.tokensParsed["size"]
@@ -44,7 +50,7 @@ const getTokens = ({
44
50
  ...conf.tokens["color"],
45
51
  ...conf.tokensParsed["color"]
46
52
  }
47
- };
53
+ });
48
54
  };
49
55
  const useTokens = () => getTokens();
50
56
  const getThemes = () => conf.themes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/config.ts"],
4
- "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, TokensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * @deprecated prefixed true and false are merged together, no longer need this property\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n return (cached ??= {\n size: {\n ...conf!.tokens['size'],\n ...conf!.tokensParsed['size'],\n },\n space: {\n ...conf!.tokens['space'],\n ...conf!.tokensParsed['space'],\n },\n radius: {\n ...conf!.tokens['radius'],\n ...conf!.tokensParsed['radius'],\n },\n zIndex: {\n ...conf!.tokens['zIndex'],\n ...conf!.tokensParsed['zIndex'],\n },\n color: {\n ...conf!.tokens['color'],\n ...conf!.tokensParsed['color'],\n },\n } as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
5
- "mappings": "AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAI;AACG,MAAM,YAAY,CAAC;AAAA,EACxB;AACF,IAKI,CAAC,MAAoB;AACvB,SAAQ,WAAW;AAAA,IACjB,MAAM;AAAA,MACJ,GAAG,KAAM,OAAO,MAAM;AAAA,MACtB,GAAG,KAAM,aAAa,MAAM;AAAA,IAC9B;AAAA,IACA,OAAO;AAAA,MACL,GAAG,KAAM,OAAO,OAAO;AAAA,MACvB,GAAG,KAAM,aAAa,OAAO;AAAA,IAC/B;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,KAAM,OAAO,QAAQ;AAAA,MACxB,GAAG,KAAM,aAAa,QAAQ;AAAA,IAChC;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,KAAM,OAAO,QAAQ;AAAA,MACxB,GAAG,KAAM,aAAa,QAAQ;AAAA,IAChC;AAAA,IACA,OAAO;AAAA,MACL,GAAG,KAAM,OAAO,OAAO;AAAA,MACvB,GAAG,KAAM,aAAa,OAAO;AAAA,IAC/B;AAAA,EACF;AACF;AAKO,MAAM,YAAY,MAAM,UAAU;AAElC,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAI;AAAA,EACT,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,eAAe,CAAC,KAAa,UAAe;AACvD,SAAO,OAAO,KAAK,KAAK;AAC1B;AAGO,MAAM,UAAU,CAAC,SAAiB;AAnFzC;AAoFE,QAAMA,QAAO,UAAU;AACvB,SACEA,MAAK,YAAY,IAAI,OACrB,YAAO,QAAQA,MAAK,WAAW,EAAE;AAAA,IAC/B,CAAC,CAAC,CAAC,MAAG;AAxFZ,UAAAC,KAAA;AAwFe,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
4
+ "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, TokensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * Force either with $ or without $ prefix\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n if (!conf) throw new Error(`never called createTamagui`)\n if (prefixed === false) return conf.tokens\n if (prefixed === true) return conf.tokensParsed\n return (cached ??= Object.freeze({\n size: {\n ...conf.tokens['size'],\n ...conf.tokensParsed['size'],\n },\n space: {\n ...conf.tokens['space'],\n ...conf.tokensParsed['space'],\n },\n radius: {\n ...conf.tokens['radius'],\n ...conf.tokensParsed['radius'],\n },\n zIndex: {\n ...conf.tokens['zIndex'],\n ...conf.tokensParsed['zIndex'],\n },\n color: {\n ...conf.tokens['color'],\n ...conf.tokensParsed['color'],\n },\n }) as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
5
+ "mappings": "AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;AAAA,EACF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AAC,CAAC,MAAG;AA3FZ,UAAAC,KAAA;AA2Fe,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
6
6
  "names": ["conf", "_a"]
7
7
  }
@@ -23,7 +23,13 @@ let cached;
23
23
  const getTokens = ({
24
24
  prefixed
25
25
  } = {}) => {
26
- return cached ??= {
26
+ if (!conf)
27
+ throw new Error(`never called createTamagui`);
28
+ if (prefixed === false)
29
+ return conf.tokens;
30
+ if (prefixed === true)
31
+ return conf.tokensParsed;
32
+ return cached ??= Object.freeze({
27
33
  size: {
28
34
  ...conf.tokens["size"],
29
35
  ...conf.tokensParsed["size"]
@@ -44,7 +50,7 @@ const getTokens = ({
44
50
  ...conf.tokens["color"],
45
51
  ...conf.tokensParsed["color"]
46
52
  }
47
- };
53
+ });
48
54
  };
49
55
  const useTokens = () => getTokens();
50
56
  const getThemes = () => conf.themes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/config.ts"],
4
- "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, TokensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * @deprecated prefixed true and false are merged together, no longer need this property\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n return (cached ??= {\n size: {\n ...conf!.tokens['size'],\n ...conf!.tokensParsed['size'],\n },\n space: {\n ...conf!.tokens['space'],\n ...conf!.tokensParsed['space'],\n },\n radius: {\n ...conf!.tokens['radius'],\n ...conf!.tokensParsed['radius'],\n },\n zIndex: {\n ...conf!.tokens['zIndex'],\n ...conf!.tokensParsed['zIndex'],\n },\n color: {\n ...conf!.tokens['color'],\n ...conf!.tokensParsed['color'],\n },\n } as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
5
- "mappings": "AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAI;AACG,MAAM,YAAY,CAAC;AAAA,EAC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okensMerged } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nlet cached: TokensMerged\nexport const getTokens = ({\n prefixed,\n}: {\n /**\n * Force either with $ or without $ prefix\n */\n prefixed?: boolean\n} = {}): TokensMerged => {\n if (!conf) throw new Error(`never called createTamagui`)\n if (prefixed === false) return conf.tokens\n if (prefixed === true) return conf.tokensParsed\n return (cached ??= Object.freeze({\n size: {\n ...conf.tokens['size'],\n ...conf.tokensParsed['size'],\n },\n space: {\n ...conf.tokens['space'],\n ...conf.tokensParsed['space'],\n },\n radius: {\n ...conf.tokens['radius'],\n ...conf.tokensParsed['radius'],\n },\n zIndex: {\n ...conf.tokens['zIndex'],\n ...conf.tokensParsed['zIndex'],\n },\n color: {\n ...conf.tokens['color'],\n ...conf.tokensParsed['color'],\n },\n }) as any)\n}\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family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KAAK,aAAa,OAAO;AAAA,IAC9B;AAAA,EACF,CAAC;AACH;AAKO,MAAM,YAAY,MAAM,UAAU;AAElC,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAI;AAAA,EACT,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,eAAe,CAAC,KAAa,UAAe;AACvD,SAAO,OAAO,KAAK,KAAK;AAC1B;AAGO,MAAM,UAAU,CAAC,SAAiB;AAtFzC;AAuFE,QAAMA,QAAO,UAAU;AACvB,SACEA,MAAK,YAAY,IAAI,OACrB,YAAO,QAAQA,MAAK,WAAW,EAAE;AAAA,IAC/B,CAAC,CAAC,CAAC,MAAG;AA3FZ,UAAAC,KAAA;AA2Fe,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
6
6
  "names": ["conf", "_a"]
7
7
  }
@@ -0,0 +1,23 @@
1
+ import { defaultOffset } from "./expandStyles";
2
+ import { normalizeValueWithProperty } from "./normalizeValueWithProperty.js";
3
+ function normalizeShadow({
4
+ shadowColor,
5
+ shadowOffset,
6
+ shadowOpacity = 1,
7
+ shadowRadius
8
+ }) {
9
+ const { height, width } = shadowOffset || defaultOffset;
10
+ return {
11
+ shadowOffset: {
12
+ width: normalizeValueWithProperty(width || 0),
13
+ height: normalizeValueWithProperty(height || 0)
14
+ },
15
+ shadowRadius: normalizeValueWithProperty(shadowRadius || 0),
16
+ shadowColor,
17
+ shadowOpacity
18
+ };
19
+ }
20
+ export {
21
+ normalizeShadow
22
+ };
23
+ //# sourceMappingURL=normalizeShadow.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.ts"],
4
+ "sourcesContent": ["import { defaultOffset } from './expandStyles'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity = 1,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor,\n shadowOpacity,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,OAAO,2BAA2B,SAAS,CAAC;AAAA,MAC5C,QAAQ,2BAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,cAAc,2BAA2B,gBAAgB,CAAC;AAAA,IAC1D;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ import { defaultOffset } from "./expandStyles";
2
+ import { normalizeValueWithProperty } from "./normalizeValueWithProperty.js";
3
+ function normalizeShadow({
4
+ shadowColor,
5
+ shadowOffset,
6
+ shadowOpacity = 1,
7
+ shadowRadius
8
+ }) {
9
+ const { height, width } = shadowOffset || defaultOffset;
10
+ return {
11
+ shadowOffset: {
12
+ width: normalizeValueWithProperty(width || 0),
13
+ height: normalizeValueWithProperty(height || 0)
14
+ },
15
+ shadowRadius: normalizeValueWithProperty(shadowRadius || 0),
16
+ shadowColor,
17
+ shadowOpacity
18
+ };
19
+ }
20
+ export {
21
+ normalizeShadow
22
+ };
23
+ //# sourceMappingURL=normalizeShadow.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.ts"],
4
+ "sourcesContent": ["import { defaultOffset } from './expandStyles'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity = 1,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor,\n shadowOpacity,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,OAAO,2BAA2B,SAAS,CAAC;AAAA,MAC5C,QAAQ,2BAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,cAAc,2BAA2B,gBAAgB,CAAC;AAAA,IAC1D;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import { normalizeCSSColor } from "@tamagui/normalize-css-color";
2
+ import { defaultOffset } from "./expandStyles";
3
+ import { rgba } from "./normalizeColor";
4
+ import { normalizeValueWithProperty } from "./normalizeValueWithProperty.js";
5
+ function normalizeShadow({
6
+ shadowColor,
7
+ shadowOffset,
8
+ shadowOpacity,
9
+ shadowRadius
10
+ }) {
11
+ const { height, width } = shadowOffset || defaultOffset;
12
+ const colorStr = String(shadowColor || "black");
13
+ const val = normalizeCSSColor(colorStr);
14
+ if (!val) {
15
+ throw new Error(`invalid shadow color ${colorStr}`);
16
+ }
17
+ const { r, g, b, a } = rgba(val);
18
+ return {
19
+ shadowOffset: {
20
+ width: normalizeValueWithProperty(width || 0),
21
+ height: normalizeValueWithProperty(height || 0)
22
+ },
23
+ shadowRadius: normalizeValueWithProperty(shadowRadius || 0),
24
+ shadowColor: `rgb(${r},${g},${b})`,
25
+ shadowOpacity: shadowOpacity ?? a
26
+ };
27
+ }
28
+ export {
29
+ normalizeShadow
30
+ };
31
+ //# sourceMappingURL=normalizeShadow.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.native.ts"],
4
+ "sourcesContent": ["import { normalizeCSSColor } from '@tamagui/normalize-css-color'\n\nimport { defaultOffset } from './expandStyles'\nimport { rgba } from './normalizeColor'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n const colorStr = String(shadowColor || 'black')\n // on native fix bug - shadows behave better if turned into non-alpha rgb() + shadowOpacity\n const val = normalizeCSSColor(colorStr)\n if (!val) {\n throw new Error(`invalid shadow color ${colorStr}`)\n }\n const { r, g, b, a } = rgba(val)\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor: `rgb(${r},${g},${b})`,\n shadowOpacity: shadowOpacity ?? a,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB;AAElC,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,QAAM,WAAW,OAAO,eAAe,OAAO;AAE9C,QAAM,MAAM,kBAAkB,QAAQ;AACtC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,wBAAwB,UAAU;AAAA,EACpD;AACA,QAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,KAAK,GAAG;AAC/B,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,OAAO,2BAA2B,SAAS,CAAC;AAAA,MAC5C,QAAQ,2BAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,cAAc,2BAA2B,gBAAgB,CAAC;AAAA,IAC1D,aAAa,OAAO,KAAK,KAAK;AAAA,IAC9B,eAAe,iBAAiB;AAAA,EAClC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import { normalizeCSSColor } from "@tamagui/normalize-css-color";
2
+ import { defaultOffset } from "./expandStyles";
3
+ import { rgba } from "./normalizeColor";
4
+ import { normalizeValueWithProperty } from "./normalizeValueWithProperty.js";
5
+ function normalizeShadow({
6
+ shadowColor,
7
+ shadowOffset,
8
+ shadowOpacity,
9
+ shadowRadius
10
+ }) {
11
+ const { height, width } = shadowOffset || defaultOffset;
12
+ const colorStr = String(shadowColor || "black");
13
+ const val = normalizeCSSColor(colorStr);
14
+ if (!val) {
15
+ throw new Error(`invalid shadow color ${colorStr}`);
16
+ }
17
+ const { r, g, b, a } = rgba(val);
18
+ return {
19
+ shadowOffset: {
20
+ width: normalizeValueWithProperty(width || 0),
21
+ height: normalizeValueWithProperty(height || 0)
22
+ },
23
+ shadowRadius: normalizeValueWithProperty(shadowRadius || 0),
24
+ shadowColor: `rgb(${r},${g},${b})`,
25
+ shadowOpacity: shadowOpacity ?? a
26
+ };
27
+ }
28
+ export {
29
+ normalizeShadow
30
+ };
31
+ //# sourceMappingURL=normalizeShadow.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeShadow.native.ts"],
4
+ "sourcesContent": ["import { normalizeCSSColor } from '@tamagui/normalize-css-color'\n\nimport { defaultOffset } from './expandStyles'\nimport { rgba } from './normalizeColor'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\n\nexport function normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n const colorStr = String(shadowColor || 'black')\n // on native fix bug - shadows behave better if turned into non-alpha rgb() + shadowOpacity\n const val = normalizeCSSColor(colorStr)\n if (!val) {\n throw new Error(`invalid shadow color ${colorStr}`)\n }\n const { r, g, b, a } = rgba(val)\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n shadowColor: `rgb(${r},${g},${b})`,\n shadowOpacity: shadowOpacity ?? a,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB;AAElC,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAEpC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,QAAQ,MAAM,IAAI,gBAAgB;AAC1C,QAAM,WAAW,OAAO,eAAe,OAAO;AAE9C,QAAM,MAAM,kBAAkB,QAAQ;AACtC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,wBAAwB,UAAU;AAAA,EACpD;AACA,QAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,KAAK,GAAG;AAC/B,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,OAAO,2BAA2B,SAAS,CAAC;AAAA,MAC5C,QAAQ,2BAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,cAAc,2BAA2B,gBAAgB,CAAC;AAAA,IAC1D,aAAa,OAAO,KAAK,KAAK;AAAA,IAC9B,eAAe,iBAAiB;AAAA,EAClC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ const normalizeStylePropKeys = {};
2
+ export {
3
+ normalizeStylePropKeys
4
+ };
5
+ //# sourceMappingURL=normalizeStylePropKeys.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.ts"],
4
+ "sourcesContent": ["// none for web, all for native\n\nexport const normalizeStylePropKeys = {}\n"],
5
+ "mappings": "AAEO,MAAM,yBAAyB,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ const normalizeStylePropKeys = {};
2
+ export {
3
+ normalizeStylePropKeys
4
+ };
5
+ //# sourceMappingURL=normalizeStylePropKeys.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.ts"],
4
+ "sourcesContent": ["// none for web, all for native\n\nexport const normalizeStylePropKeys = {}\n"],
5
+ "mappings": "AAEO,MAAM,yBAAyB,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ const normalizeStylePropKeys = {
2
+ backgroundColor: true,
3
+ borderColor: true,
4
+ borderTopColor: true,
5
+ borderRightColor: true,
6
+ borderBottomColor: true,
7
+ borderLeftColor: true,
8
+ color: true,
9
+ shadowColor: true,
10
+ textDecorationColor: true,
11
+ textShadowColor: true
12
+ };
13
+ export {
14
+ normalizeStylePropKeys
15
+ };
16
+ //# sourceMappingURL=normalizeStylePropKeys.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.native.ts"],
4
+ "sourcesContent": ["export const normalizeStylePropKeys = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n"],
5
+ "mappings": "AAAO,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AACnB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ const normalizeStylePropKeys = {
2
+ backgroundColor: true,
3
+ borderColor: true,
4
+ borderTopColor: true,
5
+ borderRightColor: true,
6
+ borderBottomColor: true,
7
+ borderLeftColor: true,
8
+ color: true,
9
+ shadowColor: true,
10
+ textDecorationColor: true,
11
+ textShadowColor: true
12
+ };
13
+ export {
14
+ normalizeStylePropKeys
15
+ };
16
+ //# sourceMappingURL=normalizeStylePropKeys.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/normalizeStylePropKeys.native.ts"],
4
+ "sourcesContent": ["export const normalizeStylePropKeys = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n"],
5
+ "mappings": "AAAO,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AACnB;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -27,20 +27,20 @@
27
27
  "reset.css"
28
28
  ],
29
29
  "dependencies": {
30
- "@tamagui/compose-refs": "^1.2.11",
31
- "@tamagui/constants": "^1.2.11",
32
- "@tamagui/helpers": "^1.2.11",
33
- "@tamagui/normalize-css-color": "^1.2.11",
34
- "@tamagui/use-did-finish-ssr": "^1.2.11",
35
- "@tamagui/use-event": "^1.2.11",
36
- "@tamagui/use-force-update": "^1.2.11"
30
+ "@tamagui/compose-refs": "^1.2.13",
31
+ "@tamagui/constants": "^1.2.13",
32
+ "@tamagui/helpers": "^1.2.13",
33
+ "@tamagui/normalize-css-color": "^1.2.13",
34
+ "@tamagui/use-did-finish-ssr": "^1.2.13",
35
+ "@tamagui/use-event": "^1.2.13",
36
+ "@tamagui/use-force-update": "^1.2.13"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "*",
40
40
  "react-dom": "*"
41
41
  },
42
42
  "devDependencies": {
43
- "@tamagui/build": "^1.2.11",
43
+ "@tamagui/build": "^1.2.13",
44
44
  "@testing-library/react": "^13.4.0",
45
45
  "csstype": "^3.0.10",
46
46
  "react": "^18.2.0",
package/src/config.ts CHANGED
@@ -31,32 +31,35 @@ export const getTokens = ({
31
31
  prefixed,
32
32
  }: {
33
33
  /**
34
- * @deprecated prefixed true and false are merged together, no longer need this property
34
+ * Force either with $ or without $ prefix
35
35
  */
36
36
  prefixed?: boolean
37
37
  } = {}): TokensMerged => {
38
- return (cached ??= {
38
+ if (!conf) throw new Error(`never called createTamagui`)
39
+ if (prefixed === false) return conf.tokens
40
+ if (prefixed === true) return conf.tokensParsed
41
+ return (cached ??= Object.freeze({
39
42
  size: {
40
- ...conf!.tokens['size'],
41
- ...conf!.tokensParsed['size'],
43
+ ...conf.tokens['size'],
44
+ ...conf.tokensParsed['size'],
42
45
  },
43
46
  space: {
44
- ...conf!.tokens['space'],
45
- ...conf!.tokensParsed['space'],
47
+ ...conf.tokens['space'],
48
+ ...conf.tokensParsed['space'],
46
49
  },
47
50
  radius: {
48
- ...conf!.tokens['radius'],
49
- ...conf!.tokensParsed['radius'],
51
+ ...conf.tokens['radius'],
52
+ ...conf.tokensParsed['radius'],
50
53
  },
51
54
  zIndex: {
52
- ...conf!.tokens['zIndex'],
53
- ...conf!.tokensParsed['zIndex'],
55
+ ...conf.tokens['zIndex'],
56
+ ...conf.tokensParsed['zIndex'],
54
57
  },
55
58
  color: {
56
- ...conf!.tokens['color'],
57
- ...conf!.tokensParsed['color'],
59
+ ...conf.tokens['color'],
60
+ ...conf.tokensParsed['color'],
58
61
  },
59
- } as any)
62
+ }) as any)
60
63
  }
61
64
 
62
65
  /**
package/types/config.d.ts CHANGED
@@ -16,7 +16,7 @@ export declare const getConfig: () => TamaguiInternalConfig<import("./types").Cr
16
16
  }, import("./types").GenericFonts>;
17
17
  export declare const getTokens: ({ prefixed, }?: {
18
18
  /**
19
- * @deprecated prefixed true and false are merged together, no longer need this property
19
+ * Force either with $ or without $ prefix
20
20
  */
21
21
  prefixed?: boolean | undefined;
22
22
  }) => TokensMerged;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI7E,eAAO,MAAM,SAAS,SAAU,qBAAqB,SAGpD,CAAA;AAED,eAAO,MAAM,aAAa,SAAU,MAAM,QAAQ,GAAG,cAAc,GAAG,SAMrE,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;kCASrB,CAAA;AAGD,eAAO,MAAM,SAAS;IAGpB;;OAEG;;MAEI,YAuBR,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,oBAAoB,CAAA;AAE1C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAAqB,CAAA;AAE3C,eAAO,MAAM,eAAe,qBAA4B,CAAA;AAExD,eAAO,MAAM,gBAAgB,OAAQ,cAAc,SAMlD,CAAA;AAED,eAAO,MAAM,YAAY,QAAS,MAAM,SAAS,GAAG,SAEnD,CAAA;AAGD,eAAO,MAAM,OAAO,SAAU,MAAM,mDAQnC,CAAA"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,E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