@tamagui/core 1.0.1-beta.26 → 1.0.1-beta.29

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 (113) hide show
  1. package/dist/cjs/ThemeManager.js +21 -10
  2. package/dist/cjs/ThemeManager.js.map +2 -2
  3. package/dist/cjs/constants/platform.js +6 -6
  4. package/dist/cjs/constants/platform.js.map +2 -2
  5. package/dist/cjs/constants/rnw.js.map +2 -2
  6. package/dist/cjs/createComponent.js +23 -20
  7. package/dist/cjs/createComponent.js.map +2 -2
  8. package/dist/cjs/createTamagui.js +10 -2
  9. package/dist/cjs/createTamagui.js.map +2 -2
  10. package/dist/cjs/helpers/createMediaStyle.js +1 -0
  11. package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
  12. package/dist/cjs/helpers/createPropMapper.js +9 -39
  13. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  14. package/dist/cjs/helpers/generateAtomicStyles.js +453 -0
  15. package/dist/cjs/helpers/generateAtomicStyles.js.map +7 -0
  16. package/dist/cjs/helpers/getSplitStyles.js +67 -65
  17. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  18. package/dist/cjs/helpers/getStylesAtomic.js +31 -40
  19. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  20. package/dist/cjs/helpers/mergeTransform.js +42 -0
  21. package/dist/cjs/helpers/mergeTransform.js.map +7 -0
  22. package/dist/cjs/helpers/prefixStyles.js +192 -0
  23. package/dist/cjs/helpers/prefixStyles.js.map +7 -0
  24. package/dist/cjs/hooks/useIsTouchDevice.js +1 -1
  25. package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
  26. package/dist/cjs/hooks/useTheme.js +8 -7
  27. package/dist/cjs/hooks/useTheme.js.map +2 -2
  28. package/dist/cjs/types.js.map +1 -1
  29. package/dist/cjs/views/Theme.js.map +2 -2
  30. package/dist/cjs/views/ThemeProvider.js +1 -1
  31. package/dist/cjs/views/ThemeProvider.js.map +2 -2
  32. package/dist/cjs/views/ThemeReset.js +1 -0
  33. package/dist/cjs/views/ThemeReset.js.map +2 -2
  34. package/dist/esm/ThemeManager.js +21 -10
  35. package/dist/esm/ThemeManager.js.map +2 -2
  36. package/dist/esm/constants/platform.js +4 -4
  37. package/dist/esm/constants/platform.js.map +2 -2
  38. package/dist/esm/constants/rnw.js.map +2 -2
  39. package/dist/esm/createComponent.js +24 -20
  40. package/dist/esm/createComponent.js.map +2 -2
  41. package/dist/esm/createTamagui.js +8 -1
  42. package/dist/esm/createTamagui.js.map +2 -2
  43. package/dist/esm/helpers/createMediaStyle.js +1 -0
  44. package/dist/esm/helpers/createMediaStyle.js.map +2 -2
  45. package/dist/esm/helpers/createPropMapper.js +9 -40
  46. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  47. package/dist/esm/helpers/generateAtomicStyles.js +425 -0
  48. package/dist/esm/helpers/generateAtomicStyles.js.map +7 -0
  49. package/dist/esm/helpers/getSplitStyles.js +70 -73
  50. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  51. package/dist/esm/helpers/getStylesAtomic.js +26 -39
  52. package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
  53. package/dist/esm/helpers/mergeTransform.js +19 -0
  54. package/dist/esm/helpers/mergeTransform.js.map +7 -0
  55. package/dist/esm/helpers/prefixStyles.js +166 -0
  56. package/dist/esm/helpers/prefixStyles.js.map +7 -0
  57. package/dist/esm/hooks/useIsTouchDevice.js +2 -2
  58. package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
  59. package/dist/esm/hooks/useTheme.js +8 -7
  60. package/dist/esm/hooks/useTheme.js.map +2 -2
  61. package/dist/esm/views/Theme.js.map +2 -2
  62. package/dist/esm/views/ThemeProvider.js +1 -1
  63. package/dist/esm/views/ThemeProvider.js.map +2 -2
  64. package/dist/esm/views/ThemeReset.js +1 -0
  65. package/dist/esm/views/ThemeReset.js.map +2 -2
  66. package/dist/jsx/ThemeManager.js +21 -10
  67. package/dist/jsx/constants/platform.js +4 -4
  68. package/dist/jsx/createComponent.js +24 -20
  69. package/dist/jsx/createTamagui.js +8 -1
  70. package/dist/jsx/helpers/createMediaStyle.js +1 -0
  71. package/dist/jsx/helpers/createPropMapper.js +9 -40
  72. package/dist/jsx/helpers/generateAtomicStyles.js +424 -0
  73. package/dist/jsx/helpers/getSplitStyles.js +70 -73
  74. package/dist/jsx/helpers/getStylesAtomic.js +26 -39
  75. package/dist/jsx/helpers/mergeTransform.js +18 -0
  76. package/dist/jsx/helpers/prefixStyles.js +165 -0
  77. package/dist/jsx/hooks/useIsTouchDevice.js +2 -2
  78. package/dist/jsx/hooks/useTheme.js +8 -7
  79. package/dist/jsx/views/ThemeProvider.js +1 -1
  80. package/dist/jsx/views/ThemeReset.js +1 -1
  81. package/package.json +8 -5
  82. package/reset.css +3 -2
  83. package/types/Tamagui.d.ts +1 -1
  84. package/types/Tamagui.d.ts.map +1 -1
  85. package/types/ThemeManager.d.ts +9 -6
  86. package/types/ThemeManager.d.ts.map +1 -1
  87. package/types/constants/platform.d.ts +2 -2
  88. package/types/constants/platform.d.ts.map +1 -1
  89. package/types/constants/rnw.d.ts +1 -1
  90. package/types/constants/rnw.d.ts.map +1 -1
  91. package/types/createComponent.d.ts.map +1 -1
  92. package/types/createTamagui.d.ts +1 -0
  93. package/types/createTamagui.d.ts.map +1 -1
  94. package/types/helpers/createMediaStyle.d.ts.map +1 -1
  95. package/types/helpers/createPropMapper.d.ts +2 -2
  96. package/types/helpers/createPropMapper.d.ts.map +1 -1
  97. package/types/helpers/generateAtomicStyles.d.ts +22 -0
  98. package/types/helpers/generateAtomicStyles.d.ts.map +1 -0
  99. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  100. package/types/helpers/getStylesAtomic.d.ts +10 -10
  101. package/types/helpers/getStylesAtomic.d.ts.map +1 -1
  102. package/types/helpers/mergeTransform.d.ts +7 -0
  103. package/types/helpers/mergeTransform.d.ts.map +1 -0
  104. package/types/helpers/prefixStyles.d.ts +5 -0
  105. package/types/helpers/prefixStyles.d.ts.map +1 -0
  106. package/types/hooks/useTheme.d.ts +13 -4
  107. package/types/hooks/useTheme.d.ts.map +1 -1
  108. package/types/types.d.ts +3 -4
  109. package/types/types.d.ts.map +1 -1
  110. package/types/views/Theme.d.ts +1 -9
  111. package/types/views/Theme.d.ts.map +1 -1
  112. package/types/views/ThemeProvider.d.ts +1 -0
  113. package/types/views/ThemeProvider.d.ts.map +1 -1
@@ -41,6 +41,7 @@ const createMediaStyle = /* @__PURE__ */ __name(({ identifier, rules }, mediaKey
41
41
  } else {
42
42
  styleRule = `@media ${mediaQuery} { ${precendencePrefix} ${styleInner} }`;
43
43
  }
44
+ styleRule = styleRule.replace(";}", " !important;}");
44
45
  return {
45
46
  styleRule,
46
47
  identifier: nextIdentifier
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/createMediaStyle.ts"],
4
- "sourcesContent": ["import { StyleObject } from '@tamagui/helpers'\n\nimport { mediaObjectToString } from '../hooks/useMedia'\nimport { MediaQueries } from '../types'\n\n// TODO have this be used by extractMediaStyle in tamagui static\n// not synced to static/constants for now\nexport const MEDIA_SEP = '_'\n\nexport const createMediaStyle = (\n { identifier, rules }: StyleObject,\n mediaKey: string,\n mediaQueries: MediaQueries,\n negate?: boolean,\n importance?: number\n) => {\n const mediaKeys = Object.keys(mediaQueries)\n const importance_ = Math.max(\n 0,\n importance == undefined ? mediaKeys.indexOf(mediaKey) : importance || 0\n )\n const precendencePrefix = new Array(importance_ + 1).fill(':root').join('')\n const negKey = negate ? '0' : ''\n const ogPrefix = identifier.slice(0, identifier.indexOf('-') + 1)\n const nextIdentifier = `${identifier.replace(\n ogPrefix,\n `${ogPrefix}${MEDIA_SEP}${mediaKey}${negKey}${MEDIA_SEP}`\n )}`\n const screenStr = negate ? 'not all' : 'screen'\n const mediaSelector = mediaObjectToString(mediaQueries[mediaKey])\n const mediaQuery = `${screenStr} and ${mediaSelector}`\n const styleInner = rules[0].replace(identifier, nextIdentifier)\n // combines media queries if they already exist\n let styleRule = ''\n if (styleInner.includes('@media')) {\n // combine\n styleRule = styleInner.replace('{', ` and ${mediaQuery} {`)\n } else {\n styleRule = `@media ${mediaQuery} { ${precendencePrefix} ${styleInner} }`\n }\n return {\n styleRule,\n identifier: nextIdentifier,\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAAoC;AAK7B,MAAM,YAAY;AAElB,MAAM,mBAAmB,wBAC9B,EAAE,YAAY,SACd,UACA,cACA,QACA,eACG;AACH,QAAM,YAAY,OAAO,KAAK,YAAY;AAC1C,QAAM,cAAc,KAAK,IACvB,GACA,cAAc,SAAY,UAAU,QAAQ,QAAQ,IAAI,cAAc,CACxE;AACA,QAAM,oBAAoB,IAAI,MAAM,cAAc,CAAC,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE;AAC1E,QAAM,SAAS,SAAS,MAAM;AAC9B,QAAM,WAAW,WAAW,MAAM,GAAG,WAAW,QAAQ,GAAG,IAAI,CAAC;AAChE,QAAM,iBAAiB,GAAG,WAAW,QACnC,UACA,GAAG,WAAW,YAAY,WAAW,SAAS,WAChD;AACA,QAAM,YAAY,SAAS,YAAY;AACvC,QAAM,gBAAgB,yCAAoB,aAAa,SAAS;AAChE,QAAM,aAAa,GAAG,iBAAiB;AACvC,QAAM,aAAa,MAAM,GAAG,QAAQ,YAAY,cAAc;AAE9D,MAAI,YAAY;AAChB,MAAI,WAAW,SAAS,QAAQ,GAAG;AAEjC,gBAAY,WAAW,QAAQ,KAAK,QAAQ,cAAc;AAAA,EAC5D,OAAO;AACL,gBAAY,UAAU,gBAAgB,qBAAqB;AAAA,EAC7D;AACA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,EACd;AACF,GAnCgC;",
4
+ "sourcesContent": ["import { StyleObject } from '@tamagui/helpers'\n\nimport { mediaObjectToString } from '../hooks/useMedia'\nimport { MediaQueries } from '../types'\n\n// TODO have this be used by extractMediaStyle in tamagui static\n// not synced to static/constants for now\nexport const MEDIA_SEP = '_'\n\nexport const createMediaStyle = (\n { identifier, rules }: StyleObject,\n mediaKey: string,\n mediaQueries: MediaQueries,\n negate?: boolean,\n importance?: number\n) => {\n const mediaKeys = Object.keys(mediaQueries)\n const importance_ = Math.max(\n 0,\n importance == undefined ? mediaKeys.indexOf(mediaKey) : importance || 0\n )\n const precendencePrefix = new Array(importance_ + 1).fill(':root').join('')\n const negKey = negate ? '0' : ''\n const ogPrefix = identifier.slice(0, identifier.indexOf('-') + 1)\n const nextIdentifier = `${identifier.replace(\n ogPrefix,\n `${ogPrefix}${MEDIA_SEP}${mediaKey}${negKey}${MEDIA_SEP}`\n )}`\n const screenStr = negate ? 'not all' : 'screen'\n const mediaSelector = mediaObjectToString(mediaQueries[mediaKey])\n const mediaQuery = `${screenStr} and ${mediaSelector}`\n const styleInner = rules[0].replace(identifier, nextIdentifier)\n // combines media queries if they already exist\n let styleRule = ''\n if (styleInner.includes('@media')) {\n // combine\n styleRule = styleInner.replace('{', ` and ${mediaQuery} {`)\n } else {\n styleRule = `@media ${mediaQuery} { ${precendencePrefix} ${styleInner} }`\n }\n styleRule = styleRule.replace(';}', ' !important;}')\n return {\n styleRule,\n identifier: nextIdentifier,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAAoC;AAK7B,MAAM,YAAY;AAElB,MAAM,mBAAmB,wBAC9B,EAAE,YAAY,SACd,UACA,cACA,QACA,eACG;AACH,QAAM,YAAY,OAAO,KAAK,YAAY;AAC1C,QAAM,cAAc,KAAK,IACvB,GACA,cAAc,SAAY,UAAU,QAAQ,QAAQ,IAAI,cAAc,CACxE;AACA,QAAM,oBAAoB,IAAI,MAAM,cAAc,CAAC,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE;AAC1E,QAAM,SAAS,SAAS,MAAM;AAC9B,QAAM,WAAW,WAAW,MAAM,GAAG,WAAW,QAAQ,GAAG,IAAI,CAAC;AAChE,QAAM,iBAAiB,GAAG,WAAW,QACnC,UACA,GAAG,WAAW,YAAY,WAAW,SAAS,WAChD;AACA,QAAM,YAAY,SAAS,YAAY;AACvC,QAAM,gBAAgB,yCAAoB,aAAa,SAAS;AAChE,QAAM,aAAa,GAAG,iBAAiB;AACvC,QAAM,aAAa,MAAM,GAAG,QAAQ,YAAY,cAAc;AAE9D,MAAI,YAAY;AAChB,MAAI,WAAW,SAAS,QAAQ,GAAG;AAEjC,gBAAY,WAAW,QAAQ,KAAK,QAAQ,cAAc;AAAA,EAC5D,OAAO;AACL,gBAAY,UAAU,gBAAgB,qBAAqB;AAAA,EAC7D;AACA,cAAY,UAAU,QAAQ,MAAM,eAAe;AACnD,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,EACd;AACF,GApCgC;",
6
6
  "names": []
7
7
  }
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(createPropMapper_exports);
24
24
  var import_conf = require("../conf");
25
25
  var import_platform = require("../constants/platform");
26
26
  var import_createVariable = require("../createVariable");
27
+ var import_generateAtomicStyles = require("./generateAtomicStyles");
27
28
  var import_getVariantExtras = require("./getVariantExtras");
28
29
  var import_isObj = require("./isObj");
29
30
  function getVariantFunction(variant, key, value) {
@@ -53,12 +54,14 @@ __name(getVariantFunction, "getVariantFunction");
53
54
  const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
54
55
  const variants = staticConfig.variants || {};
55
56
  const defaultProps = staticConfig.defaultProps || {};
56
- return (key, value, theme, props, returnVariablesAs = !!props.animation ? "value" : "auto", avoidDefaultProps = false) => {
57
+ const mapper = /* @__PURE__ */ __name((key, value, theme, propsIn, state, avoidDefaultProps = false) => {
57
58
  const conf = (0, import_conf.getConfig)();
58
59
  if (!conf) {
59
60
  console.trace("no conf! err");
60
61
  return;
61
62
  }
63
+ const props = state.fallbackProps || propsIn;
64
+ const returnVariablesAs = state.resolveVariablesAs || !!props.animation ? "value" : "auto";
62
65
  const fontFamily = props.fontFamily || defaultProps.fontFamily || "$body";
63
66
  const variant = variants && variants[key];
64
67
  if (variant && value !== void 0) {
@@ -71,16 +74,15 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
71
74
  if ((0, import_isObj.isObj)(variantValue)) {
72
75
  variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
73
76
  }
74
- return expansions(variantValue);
77
+ return Object.entries((0, import_generateAtomicStyles.expandStyles)(variantValue));
75
78
  }
76
79
  }
77
- let shouldReturn = false;
80
+ let shouldReturn = value !== void 0 && value !== null;
78
81
  if (conf.shorthands[key]) {
79
82
  shouldReturn = true;
80
83
  key = conf.shorthands[key];
81
84
  }
82
85
  if (value) {
83
- shouldReturn = true;
84
86
  if (value[0] === "$") {
85
87
  value = getToken(key, value, conf, theme, fontFamily, returnVariablesAs);
86
88
  } else if ((0, import_createVariable.isVariable)(value)) {
@@ -88,11 +90,10 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
88
90
  }
89
91
  }
90
92
  if (shouldReturn) {
91
- return expansions({
92
- [key]: value
93
- });
93
+ return (0, import_generateAtomicStyles.expandStyle)(key, value) || [[key, value]];
94
94
  }
95
- };
95
+ }, "mapper");
96
+ return mapper;
96
97
  }, "createPropMapper");
97
98
  const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily, resolveAs) => {
98
99
  var _a;
@@ -215,37 +216,6 @@ const tokenCategories = {
215
216
  borderRightColor: true
216
217
  }
217
218
  };
218
- const sidesX = ["Left", "Right"];
219
- const sidesY = ["Top", "Bottom"];
220
- const sidesXY = [...sidesX, ...sidesY];
221
- const expand = {
222
- padding: sidesXY.map((x) => `padding${x}`),
223
- paddingHorizontal: sidesX.map((x) => `padding${x}`),
224
- paddingVertical: sidesY.map((x) => `padding${x}`),
225
- margin: sidesXY.map((x) => `margin${x}`),
226
- marginHorizontal: sidesX.map((x) => `margin${x}`),
227
- marginVertical: sidesY.map((x) => `margin${x}`),
228
- borderWidth: sidesXY.map((x) => `border${x}Width`)
229
- };
230
- function expansions(styleObj) {
231
- for (const key in expand) {
232
- if (key in styleObj) {
233
- for (const expandKey of expand[key]) {
234
- styleObj[expandKey] = styleObj[key];
235
- }
236
- delete styleObj[key];
237
- }
238
- }
239
- if ("flex" in styleObj) {
240
- if (typeof styleObj.flex === "number") {
241
- styleObj.flexGrow = styleObj.flexGrow ?? styleObj.flex;
242
- styleObj.flexShrink = styleObj.flexShrink ?? 1;
243
- delete styleObj.flex;
244
- }
245
- }
246
- return styleObj;
247
- }
248
- __name(expansions, "expansions");
249
219
  // Annotate the CommonJS export names for ESM import in node:
250
220
  0 && (module.exports = {
251
221
  createPropMapper
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/createPropMapper.ts"],
4
- "sourcesContent": ["import { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable, isVariable } from '../createVariable'\nimport { StaticConfig, TamaguiInternalConfig, VariantSpreadFunction } from '../types'\nimport { getVariantExtras } from './getVariantExtras'\nimport { isObj } from './isObj'\n\nexport type ResolveVariableTypes = 'auto' | 'value' | 'variable' | 'both'\n\n// goes through specificity finding best matching variant function\nfunction getVariantFunction(variant: any, key: string, value: any) {\n if (typeof variant === 'function') {\n return variant\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const spreadVariant = variant[`...${cat}`]\n if (spreadVariant) {\n return spreadVariant\n }\n }\n }\n let fn: any\n if (typeof value === 'number') {\n fn = variant[':number']\n } else if (typeof value === 'string') {\n fn = variant[':string']\n } else if (value === true || value === false) {\n fn = variant[':boolean']\n }\n fn = fn || variant[value]\n // fallback to size ultimately - could do token level detection\n return fn || variant['...'] || variant['...size']\n}\n\nexport const createPropMapper = (staticConfig: Partial<StaticConfig>) => {\n const variants = staticConfig.variants || {}\n const defaultProps = staticConfig.defaultProps || {}\n\n return (\n key: string,\n value: any,\n theme: any,\n props: any,\n returnVariablesAs: ResolveVariableTypes = !!props.animation ? 'value' : 'auto',\n avoidDefaultProps = false\n ) => {\n const conf = getConfig()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n const fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n const variant = variants && variants[key]\n\n if (variant && value !== undefined) {\n let variantValue = getVariantFunction(variant, key, value)\n\n if (variantValue) {\n if (typeof variantValue === 'function') {\n const fn = variantValue as VariantSpreadFunction<any>\n variantValue = fn(value, getVariantExtras(props, theme, defaultProps, avoidDefaultProps))\n }\n\n if (isObj(variantValue)) {\n variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs)\n }\n\n return expansions(variantValue)\n }\n }\n\n let shouldReturn = false\n\n // handle shorthands\n if (conf.shorthands[key]) {\n shouldReturn = true\n key = conf.shorthands[key]\n }\n\n if (value) {\n shouldReturn = true\n if (value[0] === '$') {\n value = getToken(key, value, conf, theme, fontFamily, returnVariablesAs)\n } else if (isVariable(value)) {\n value = getVariableValue(value, returnVariablesAs)\n }\n }\n\n if (shouldReturn) {\n return expansions({\n [key]: value,\n })\n }\n }\n}\n\nconst resolveTokens = (\n input: Object,\n conf: TamaguiInternalConfig,\n theme: any,\n fontFamily: any,\n resolveAs?: ResolveVariableTypes\n) => {\n let res = {}\n for (const rKey in input) {\n const fKey = conf.shorthands[rKey] || rKey\n const val = input[rKey]\n if (isVariable(val)) {\n res[fKey] =\n resolveAs === 'variable' ? val : !isWeb || resolveAs === 'value' ? val.val : val.variable\n } else if (typeof val === 'string') {\n const fVal = val[0] === '$' ? getToken(fKey, val, conf, theme, fontFamily, resolveAs) : val\n res[fKey] = fVal\n } else {\n if (isObj(val)) {\n // for things like shadowOffset, hoverStyle which is a sub-object\n res[fKey] = resolveTokens(val, conf, theme, fontFamily, resolveAs)\n } else {\n // nullish values cant be tokens so need no exrta parsing\n res[fKey] = input[fKey]\n }\n }\n if (process.env.NODE_ENV === 'development') {\n if (res[fKey]?.[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey])\n }\n }\n }\n return res\n}\n\nconst fontShorthand = {\n fontSize: 'size',\n fontWeight: 'weight',\n}\n\nconst getToken = (\n key: string,\n value: string,\n { tokensParsed, fontsParsed }: TamaguiInternalConfig,\n theme: any,\n fontFamily: string | undefined = '$body',\n resolveAs?: ResolveVariableTypes\n) => {\n let valOrVar: any\n let hasSet = false\n if (value in theme) {\n valOrVar = theme[value]\n hasSet = true\n } else {\n switch (key) {\n case 'fontFamily':\n valOrVar = fontsParsed[value]?.family || value\n hasSet = true\n break\n case 'fontSize':\n case 'lineHeight':\n case 'letterSpacing':\n case 'fontWeight':\n valOrVar = fontsParsed[fontFamily]?.[fontShorthand[key] || key]?.[value] || value\n hasSet = true\n break\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const res = tokensParsed[cat][value]\n if (res) {\n valOrVar = res\n hasSet = true\n }\n }\n }\n if (!hasSet) {\n const spaceVar = tokensParsed.space[value]\n if (spaceVar) {\n valOrVar = spaceVar\n hasSet = true\n }\n }\n }\n if (hasSet) {\n return getVariableValue(valOrVar, resolveAs)\n }\n if (process.env.NODE_ENV === 'development') {\n if (value && value[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token:`, key, value, fontFamily, theme, fontsParsed)\n return null\n }\n }\n return value\n}\n\nfunction getVariableValue(valOrVar: Variable | any, resolveAs: ResolveVariableTypes = 'auto') {\n if (isVariable(valOrVar)) {\n if (resolveAs === 'variable') {\n return valOrVar\n }\n if (!isWeb || resolveAs === 'value') {\n return valOrVar.val\n }\n return valOrVar.variable\n }\n return valOrVar\n}\n\n// just specificy the least costly, all else go to `space` (most keys - we can exclude)\nconst tokenCategories = {\n radius: {\n borderRadius: true,\n },\n size: {\n width: true,\n height: true,\n minWidth: true,\n minHeight: true,\n maxWidth: true,\n maxHeight: true,\n padding: true,\n paddingLeft: true,\n paddingRight: true,\n paddingTop: true,\n paddingBottom: true,\n paddingVertical: true,\n paddingHorizontal: true,\n },\n color: {\n color: true,\n backgroundColor: true,\n borderColor: true,\n borderBottomColor: true,\n borderTopColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n },\n}\n\n// TODO need to move to own engine for all this... duplicating some functionality temporarily\n\nconst sidesX = ['Left', 'Right']\nconst sidesY = ['Top', 'Bottom']\nconst sidesXY = [...sidesX, ...sidesY]\nconst expand = {\n padding: sidesXY.map((x) => `padding${x}`),\n paddingHorizontal: sidesX.map((x) => `padding${x}`),\n paddingVertical: sidesY.map((x) => `padding${x}`),\n margin: sidesXY.map((x) => `margin${x}`),\n marginHorizontal: sidesX.map((x) => `margin${x}`),\n marginVertical: sidesY.map((x) => `margin${x}`),\n borderWidth: sidesXY.map((x) => `border${x}Width`),\n}\n\nfunction expansions(styleObj: Record<string, any>) {\n for (const key in expand) {\n if (key in styleObj) {\n for (const expandKey of expand[key]) {\n styleObj[expandKey] = styleObj[key]\n }\n delete styleObj[key]\n }\n }\n if ('flex' in styleObj) {\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (typeof styleObj.flex === 'number') {\n styleObj.flexGrow = styleObj.flexGrow ?? styleObj.flex\n styleObj.flexShrink = styleObj.flexShrink ?? 1\n delete styleObj.flex\n }\n }\n return styleObj\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,sBAAsB;AACtB,4BAAqC;AAErC,8BAAiC;AACjC,mBAAsB;AAKtB,4BAA4B,SAAc,KAAa,OAAY;AACjE,MAAI,OAAO,YAAY,YAAY;AACjC,WAAO;AAAA,EACT;AACA,aAAW,OAAO,iBAAiB;AACjC,QAAI,OAAO,gBAAgB,MAAM;AAC/B,YAAM,gBAAgB,QAAQ,MAAM;AACpC,UAAI,eAAe;AACjB,eAAO;AAAA,MACT;AAA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'\nimport { isWeb } from '../constants/platform'\nimport { Variable, isVariable } from '../createVariable'\nimport {\n PropMapper,\n SplitStyleState,\n StaticConfig,\n TamaguiInternalConfig,\n ThemeObject,\n VariantSpreadFunction,\n} from '../types'\nimport { expandStyle, expandStyles } from './generateAtomicStyles'\nimport { getVariantExtras } from './getVariantExtras'\nimport { isObj } from './isObj'\n\nexport type ResolveVariableTypes = 'auto' | 'value' | 'variable' | 'both'\n\n// goes through specificity finding best matching variant function\nfunction getVariantFunction(variant: any, key: string, value: any) {\n if (typeof variant === 'function') {\n return variant\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const spreadVariant = variant[`...${cat}`]\n if (spreadVariant) {\n return spreadVariant\n }\n }\n }\n let fn: any\n if (typeof value === 'number') {\n fn = variant[':number']\n } else if (typeof value === 'string') {\n fn = variant[':string']\n } else if (value === true || value === false) {\n fn = variant[':boolean']\n }\n fn = fn || variant[value]\n // fallback to size ultimately - could do token level detection\n return fn || variant['...'] || variant['...size']\n}\n\nexport const createPropMapper = (staticConfig: Partial<StaticConfig>) => {\n const variants = staticConfig.variants || {}\n const defaultProps = staticConfig.defaultProps || {}\n\n const mapper: PropMapper = (key, value, theme, propsIn, state, avoidDefaultProps = false) => {\n const conf = getConfig()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n\n const props = state.fallbackProps || propsIn\n const returnVariablesAs = state.resolveVariablesAs || !!props.animation ? 'value' : 'auto'\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n const fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n const variant = variants && variants[key]\n\n if (variant && value !== undefined) {\n let variantValue = getVariantFunction(variant, key, value)\n\n if (variantValue) {\n if (typeof variantValue === 'function') {\n const fn = variantValue as VariantSpreadFunction<any>\n variantValue = fn(value, getVariantExtras(props, theme, defaultProps, avoidDefaultProps))\n }\n\n if (isObj(variantValue)) {\n variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs)\n }\n\n return Object.entries(expandStyles(variantValue))\n }\n }\n\n let shouldReturn = value !== undefined && value !== null\n\n // handle shorthands\n if (conf.shorthands[key]) {\n shouldReturn = true\n key = conf.shorthands[key]\n }\n\n if (value) {\n if (value[0] === '$') {\n value = getToken(key, value, conf, theme, fontFamily, returnVariablesAs)\n } else if (isVariable(value)) {\n value = getVariableValue(value, returnVariablesAs)\n }\n }\n\n if (shouldReturn) {\n return expandStyle(key, value) || [[key, value]]\n }\n }\n\n return mapper\n}\n\nconst resolveTokens = (\n input: Object,\n conf: TamaguiInternalConfig,\n theme: any,\n fontFamily: any,\n resolveAs?: ResolveVariableTypes\n) => {\n let res = {}\n for (const rKey in input) {\n const fKey = conf.shorthands[rKey] || rKey\n const val = input[rKey]\n if (isVariable(val)) {\n res[fKey] =\n resolveAs === 'variable' ? val : !isWeb || resolveAs === 'value' ? val.val : val.variable\n } else if (typeof val === 'string') {\n const fVal = val[0] === '$' ? getToken(fKey, val, conf, theme, fontFamily, resolveAs) : val\n res[fKey] = fVal\n } else {\n if (isObj(val)) {\n // for things like shadowOffset, hoverStyle which is a sub-object\n res[fKey] = resolveTokens(val, conf, theme, fontFamily, resolveAs)\n } else {\n // nullish values cant be tokens so need no exrta parsing\n res[fKey] = input[fKey]\n }\n }\n if (process.env.NODE_ENV === 'development') {\n if (res[fKey]?.[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey])\n }\n }\n }\n return res\n}\n\nconst fontShorthand = {\n fontSize: 'size',\n fontWeight: 'weight',\n}\n\nconst getToken = (\n key: string,\n value: string,\n { tokensParsed, fontsParsed }: TamaguiInternalConfig,\n theme: any,\n fontFamily: string | undefined = '$body',\n resolveAs?: ResolveVariableTypes\n) => {\n let valOrVar: any\n let hasSet = false\n if (value in theme) {\n valOrVar = theme[value]\n hasSet = true\n } else {\n switch (key) {\n case 'fontFamily':\n valOrVar = fontsParsed[value]?.family || value\n hasSet = true\n break\n case 'fontSize':\n case 'lineHeight':\n case 'letterSpacing':\n case 'fontWeight':\n valOrVar = fontsParsed[fontFamily]?.[fontShorthand[key] || key]?.[value] || value\n hasSet = true\n break\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const res = tokensParsed[cat][value]\n if (res) {\n valOrVar = res\n hasSet = true\n }\n }\n }\n if (!hasSet) {\n const spaceVar = tokensParsed.space[value]\n if (spaceVar) {\n valOrVar = spaceVar\n hasSet = true\n }\n }\n }\n if (hasSet) {\n return getVariableValue(valOrVar, resolveAs)\n }\n if (process.env.NODE_ENV === 'development') {\n if (value && value[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token:`, key, value, fontFamily, theme, fontsParsed)\n return null\n }\n }\n return value\n}\n\nfunction getVariableValue(valOrVar: Variable | any, resolveAs: ResolveVariableTypes = 'auto') {\n if (isVariable(valOrVar)) {\n if (resolveAs === 'variable') {\n return valOrVar\n }\n if (!isWeb || resolveAs === 'value') {\n return valOrVar.val\n }\n return valOrVar.variable\n }\n return valOrVar\n}\n\n// just specificy the least costly, all else go to `space` (most keys - we can exclude)\nconst tokenCategories = {\n radius: {\n borderRadius: true,\n },\n size: {\n width: true,\n height: true,\n minWidth: true,\n minHeight: true,\n maxWidth: true,\n maxHeight: true,\n padding: true,\n paddingLeft: true,\n paddingRight: true,\n paddingTop: true,\n paddingBottom: true,\n paddingVertical: true,\n paddingHorizontal: true,\n },\n color: {\n color: true,\n backgroundColor: true,\n borderColor: true,\n borderBottomColor: true,\n borderTopColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n },\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,sBAAsB;AACtB,4BAAqC;AASrC,kCAA0C;AAC1C,8BAAiC;AACjC,mBAAsB;AAKtB,4BAA4B,SAAc,KAAa,OAAY;AACjE,MAAI,OAAO,YAAY,YAAY;AACjC,WAAO;AAAA,EACT;AACA,aAAW,OAAO,iBAAiB;AACjC,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AS;AAAA,EAClB;AACA,SAAO;AACT;AAXS;AAcT,MAAM,kBAAkB;AAAA,EACtB,QAAQ;AAAA,IACN,cAAc;AAAA,EAChB;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,IACX,SAAS;AAAA,IACT,aAAa;AAAA,IACb,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,EACrB;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,453 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var generateAtomicStyles_exports = {};
23
+ __export(generateAtomicStyles_exports, {
24
+ expandStyle: () => expandStyle,
25
+ expandStyles: () => expandStyles,
26
+ generateAtomicStyles: () => generateAtomicStyles,
27
+ inline: () => inline
28
+ });
29
+ module.exports = __toCommonJS(generateAtomicStyles_exports);
30
+ var import_helpers = require("@tamagui/helpers");
31
+ var import_hyphenate_style_name = __toESM(require("hyphenate-style-name"));
32
+ var import_normalize_css_color = __toESM(require("normalize-css-color"));
33
+ var import_platform = require("../constants/platform");
34
+ var import_prefixStyles = require("./prefixStyles");
35
+ function expandStyles(style) {
36
+ const res = {};
37
+ for (const key in style) {
38
+ updateReactDOMStyle(res, key, style[key]);
39
+ }
40
+ return res;
41
+ }
42
+ __name(expandStyles, "expandStyles");
43
+ function inline(style) {
44
+ return (0, import_prefixStyles.prefixInlineStyles)(expandStyles(style));
45
+ }
46
+ __name(inline, "inline");
47
+ const STYLE_SHORT_FORM_EXPANSIONS = {
48
+ borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
49
+ borderRadius: [
50
+ "borderTopLeftRadius",
51
+ "borderTopRightRadius",
52
+ "borderBottomRightRadius",
53
+ "borderBottomLeftRadius"
54
+ ],
55
+ borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
56
+ borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
57
+ margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
58
+ marginHorizontal: ["marginRight", "marginLeft"],
59
+ marginVertical: ["marginTop", "marginBottom"],
60
+ overflow: ["overflowX", "overflowY"],
61
+ overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
62
+ padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
63
+ paddingHorizontal: ["paddingRight", "paddingLeft"],
64
+ paddingVertical: ["paddingTop", "paddingBottom"]
65
+ };
66
+ const generateAtomicStyles = /* @__PURE__ */ __name((style) => {
67
+ const res = expandStyles(style);
68
+ if (style.shadowColor != null || style.shadowOffset != null || style.shadowOpacity != null || style.shadowRadius != null) {
69
+ boxShadowReducer(res, style);
70
+ }
71
+ if (style.textShadowColor != null || style.textShadowOffset != null || style.textShadowRadius != null) {
72
+ textShadowReducer(res, style);
73
+ }
74
+ const out = {};
75
+ for (const key in res) {
76
+ const value = res[key];
77
+ if (value != null) {
78
+ const valueString = stringifyValueWithProperty(value, key);
79
+ const cachedResult = cache.get(key, valueString);
80
+ if (cachedResult != null) {
81
+ const { identifier } = cachedResult;
82
+ out[identifier] = cachedResult;
83
+ } else {
84
+ const identifier = createIdentifier("r", key, value);
85
+ const rules = createAtomicRules(identifier, key, value);
86
+ const cachedResult2 = cache.set(key, valueString, {
87
+ property: key,
88
+ value: stringifyValueWithProperty(value, key),
89
+ identifier,
90
+ rules
91
+ });
92
+ out[identifier] = cachedResult2;
93
+ }
94
+ }
95
+ }
96
+ return out;
97
+ }, "generateAtomicStyles");
98
+ function updateReactDOMStyle(style, key, value) {
99
+ value = normalizeValueWithProperty(value, key);
100
+ const out = expandStyle(key, value);
101
+ if (out) {
102
+ Object.assign(style, Object.fromEntries(out));
103
+ } else {
104
+ style[key] = value;
105
+ }
106
+ }
107
+ __name(updateReactDOMStyle, "updateReactDOMStyle");
108
+ function expandStyle(key, value) {
109
+ if (key === "flex") {
110
+ if (value <= -1) {
111
+ return [
112
+ ["flexGrow", 0],
113
+ ["flexShrink", 1],
114
+ ["flexBasis", "auto"]
115
+ ];
116
+ }
117
+ if (value >= 0) {
118
+ return [
119
+ ["flexGrow", value],
120
+ ["flexShrink", 1]
121
+ ];
122
+ }
123
+ return;
124
+ }
125
+ if (import_platform.isWeb) {
126
+ switch (key) {
127
+ case "elevation":
128
+ case "overlayColor":
129
+ case "resizeMode":
130
+ case "tintColor": {
131
+ break;
132
+ }
133
+ case "aspectRatio": {
134
+ return [key, value.toString()];
135
+ }
136
+ case "backgroundClip": {
137
+ if (value === "text") {
138
+ return [
139
+ ["backgroundClip", value],
140
+ ["WebkitBackgroundClip", value]
141
+ ];
142
+ }
143
+ break;
144
+ }
145
+ case "textAlignVertical": {
146
+ return [["verticalAlign", value === "center" ? "middle" : value]];
147
+ }
148
+ case "textDecorationLine": {
149
+ return ["textDecorationLine", value];
150
+ }
151
+ case "transform": {
152
+ if (Array.isArray(value)) {
153
+ return [[key, value.map(mapTransform).join(" ")]];
154
+ }
155
+ break;
156
+ }
157
+ case "writingDirection": {
158
+ return [["direction", value]];
159
+ }
160
+ }
161
+ }
162
+ const longKey = STYLE_SHORT_FORM_EXPANSIONS[key];
163
+ if (longKey) {
164
+ return longKey.map((key2) => {
165
+ return [key2, value];
166
+ });
167
+ } else {
168
+ if (import_platform.isWeb && Array.isArray(value)) {
169
+ return [[key, value.join(",")]];
170
+ }
171
+ }
172
+ }
173
+ __name(expandStyle, "expandStyle");
174
+ function createAtomicRules(identifier, property, value) {
175
+ const rules = [];
176
+ const selector = `.${identifier}`;
177
+ switch (property) {
178
+ case "animationKeyframes": {
179
+ const { animationNames, rules: keyframesRules } = processKeyframesValue(value);
180
+ const block = createDeclarationBlock({ animationName: animationNames.join(",") });
181
+ rules.push(`${selector}${block}`, ...keyframesRules);
182
+ break;
183
+ }
184
+ case "placeholderTextColor": {
185
+ const block = createDeclarationBlock({ color: value, opacity: 1 });
186
+ rules.push(`${selector}::-webkit-input-placeholder${block}`, `${selector}::-moz-placeholder${block}`, `${selector}:-ms-input-placeholder${block}`, `${selector}::placeholder${block}`);
187
+ break;
188
+ }
189
+ case "pointerEvents": {
190
+ let finalValue = value;
191
+ if (value === "auto" || value === "box-only") {
192
+ finalValue = "auto!important";
193
+ if (value === "box-only") {
194
+ const block2 = createDeclarationBlock({ pointerEvents: "none" });
195
+ rules.push(`${selector}>*${block2}`);
196
+ }
197
+ } else if (value === "none" || value === "box-none") {
198
+ finalValue = "none!important";
199
+ if (value === "box-none") {
200
+ const block2 = createDeclarationBlock({ pointerEvents: "auto" });
201
+ rules.push(`${selector}>*${block2}`);
202
+ }
203
+ }
204
+ const block = createDeclarationBlock({ pointerEvents: finalValue });
205
+ rules.push(`${selector}${block}`);
206
+ break;
207
+ }
208
+ case "scrollbarWidth": {
209
+ if (value === "none") {
210
+ rules.push(`${selector}::-webkit-scrollbar{display:none}`);
211
+ }
212
+ const block = createDeclarationBlock({ scrollbarWidth: value });
213
+ rules.push(`${selector}${block}`);
214
+ break;
215
+ }
216
+ default: {
217
+ const block = createDeclarationBlock({ [property]: value });
218
+ rules.push(`${selector}${block}`);
219
+ break;
220
+ }
221
+ }
222
+ return rules;
223
+ }
224
+ __name(createAtomicRules, "createAtomicRules");
225
+ function processKeyframesValue(keyframesValue) {
226
+ if (typeof keyframesValue === "number") {
227
+ throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
228
+ }
229
+ const animationNames = [];
230
+ const rules = [];
231
+ const value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
232
+ for (const keyframes of value) {
233
+ if (typeof keyframes === "string") {
234
+ animationNames.push(keyframes);
235
+ } else {
236
+ const { identifier, rules: keyframesRules } = createKeyframes(keyframes);
237
+ animationNames.push(identifier);
238
+ rules.push(...keyframesRules);
239
+ }
240
+ }
241
+ return { animationNames, rules };
242
+ }
243
+ __name(processKeyframesValue, "processKeyframesValue");
244
+ function createKeyframes(keyframes) {
245
+ const prefixes2 = ["-webkit-", ""];
246
+ const identifier = createIdentifier("r", "animation", keyframes);
247
+ const steps = "{" + Object.keys(keyframes).map((stepName) => {
248
+ const rule = keyframes[stepName];
249
+ const block = createDeclarationBlock(rule);
250
+ return `${stepName}${block}`;
251
+ }).join("") + "}";
252
+ const rules = prefixes2.map((prefix) => {
253
+ return `@${prefix}keyframes ${identifier}${steps}`;
254
+ });
255
+ return { identifier, rules };
256
+ }
257
+ __name(createKeyframes, "createKeyframes");
258
+ function createDeclarationBlock(style) {
259
+ const domStyle = (0, import_prefixStyles.prefixStyles)(expandStyles(style));
260
+ const declarationsString = Object.keys(domStyle).map((property) => {
261
+ const value = domStyle[property];
262
+ const prop = (0, import_hyphenate_style_name.default)(property);
263
+ if (Array.isArray(value)) {
264
+ return value.map((v) => `${prop}:${v}`).join(";");
265
+ } else {
266
+ return `${prop}:${value}`;
267
+ }
268
+ }).sort().join(";");
269
+ return `{${declarationsString};}`;
270
+ }
271
+ __name(createDeclarationBlock, "createDeclarationBlock");
272
+ function createIdentifier(prefix, name, value) {
273
+ const hashedString = (0, import_helpers.simpleHash)(name + stringifyValueWithProperty(value, name));
274
+ return `${prefix}-${hashedString}`;
275
+ }
276
+ __name(createIdentifier, "createIdentifier");
277
+ const cache = {
278
+ get(property, value) {
279
+ if (cache[property] != null && cache[property].hasOwnProperty(value) && cache[property][value] != null) {
280
+ return cache[property][value];
281
+ }
282
+ },
283
+ set(property, value, object) {
284
+ if (cache[property] == null) {
285
+ cache[property] = {};
286
+ }
287
+ return cache[property][value] = object;
288
+ }
289
+ };
290
+ function stringifyValueWithProperty(value, property) {
291
+ const normalizedValue = normalizeValueWithProperty(value, property);
292
+ return typeof normalizedValue !== "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
293
+ }
294
+ __name(stringifyValueWithProperty, "stringifyValueWithProperty");
295
+ const mapTransform = /* @__PURE__ */ __name((transform) => {
296
+ const type = Object.keys(transform)[0];
297
+ const value = transform[type];
298
+ if (type === "matrix" || type === "matrix3d") {
299
+ return `${type}(${value.join(",")})`;
300
+ } else {
301
+ const normalizedValue = normalizeValueWithProperty(value, type);
302
+ return `${type}(${normalizedValue})`;
303
+ }
304
+ }, "mapTransform");
305
+ const colorProps = {
306
+ backgroundColor: true,
307
+ borderColor: true,
308
+ borderTopColor: true,
309
+ borderRightColor: true,
310
+ borderBottomColor: true,
311
+ borderLeftColor: true,
312
+ color: true,
313
+ shadowColor: true,
314
+ textDecorationColor: true,
315
+ textShadowColor: true
316
+ };
317
+ function normalizeValueWithProperty(value, property) {
318
+ if (import_platform.isWeb) {
319
+ if ((property == null || !unitlessNumbers[property]) && typeof value === "number") {
320
+ return `${value}px`;
321
+ }
322
+ }
323
+ if (property && colorProps[property]) {
324
+ return normalizeColor(value);
325
+ }
326
+ return value;
327
+ }
328
+ __name(normalizeValueWithProperty, "normalizeValueWithProperty");
329
+ const normalizeColor = /* @__PURE__ */ __name((color, opacity = 1) => {
330
+ if (color == null || color == void 0) {
331
+ return;
332
+ }
333
+ if (typeof color === "string" && isWebColor(color)) {
334
+ return color;
335
+ }
336
+ const colorInt = processColor(color);
337
+ if (colorInt != null) {
338
+ const r = colorInt >> 16 & 255;
339
+ const g = colorInt >> 8 & 255;
340
+ const b = colorInt & 255;
341
+ const a = (colorInt >> 24 & 255) / 255;
342
+ const alpha = (a * opacity).toFixed(2);
343
+ return `rgba(${r},${g},${b},${alpha})`;
344
+ }
345
+ }, "normalizeColor");
346
+ const isWebColor = /* @__PURE__ */ __name((color) => color === "currentcolor" || color === "currentColor" || color === "inherit" || color.indexOf("var(") === 0, "isWebColor");
347
+ const processColor = /* @__PURE__ */ __name((color) => {
348
+ if (color === void 0 || color === null) {
349
+ return color;
350
+ }
351
+ let intColor = (0, import_normalize_css_color.default)(color);
352
+ if (intColor === void 0 || intColor === null) {
353
+ return void 0;
354
+ }
355
+ return (+intColor << 24 | +intColor >>> 8) >>> 0;
356
+ }, "processColor");
357
+ const unitlessNumbers = {
358
+ animationIterationCount: true,
359
+ aspectRatio: true,
360
+ borderImageOutset: true,
361
+ borderImageSlice: true,
362
+ borderImageWidth: true,
363
+ boxFlex: true,
364
+ boxFlexGroup: true,
365
+ boxOrdinalGroup: true,
366
+ columnCount: true,
367
+ flex: true,
368
+ flexGrow: true,
369
+ flexOrder: true,
370
+ flexPositive: true,
371
+ flexShrink: true,
372
+ flexNegative: true,
373
+ fontWeight: true,
374
+ gridRow: true,
375
+ gridRowEnd: true,
376
+ gridRowGap: true,
377
+ gridRowStart: true,
378
+ gridColumn: true,
379
+ gridColumnEnd: true,
380
+ gridColumnGap: true,
381
+ gridColumnStart: true,
382
+ lineClamp: true,
383
+ opacity: true,
384
+ order: true,
385
+ orphans: true,
386
+ tabSize: true,
387
+ widows: true,
388
+ zIndex: true,
389
+ zoom: true,
390
+ fillOpacity: true,
391
+ floodOpacity: true,
392
+ stopOpacity: true,
393
+ strokeDasharray: true,
394
+ strokeDashoffset: true,
395
+ strokeMiterlimit: true,
396
+ strokeOpacity: true,
397
+ strokeWidth: true,
398
+ scale: true,
399
+ scaleX: true,
400
+ scaleY: true,
401
+ scaleZ: true,
402
+ shadowOpacity: true
403
+ };
404
+ const prefixes = ["ms", "Moz", "O", "Webkit"];
405
+ const prefixKey = /* @__PURE__ */ __name((prefix, key) => {
406
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
407
+ }, "prefixKey");
408
+ Object.keys(unitlessNumbers).forEach((prop) => {
409
+ prefixes.forEach((prefix) => {
410
+ unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
411
+ });
412
+ });
413
+ const resolveShadowValue = /* @__PURE__ */ __name((style) => {
414
+ const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;
415
+ const { height, width } = shadowOffset || defaultOffset;
416
+ const offsetX = normalizeValueWithProperty(width);
417
+ const offsetY = normalizeValueWithProperty(height);
418
+ const blurRadius = normalizeValueWithProperty(shadowRadius || 0);
419
+ const color = normalizeColor(shadowColor || "black", shadowOpacity);
420
+ if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
421
+ return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
422
+ }
423
+ }, "resolveShadowValue");
424
+ function boxShadowReducer(resolvedStyle, style) {
425
+ const { boxShadow } = style;
426
+ const shadow = resolveShadowValue(style);
427
+ if (shadow != null) {
428
+ resolvedStyle.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow;
429
+ }
430
+ }
431
+ __name(boxShadowReducer, "boxShadowReducer");
432
+ const defaultOffset = { height: 0, width: 0 };
433
+ function textShadowReducer(resolvedStyle, style) {
434
+ const { textShadowColor, textShadowOffset, textShadowRadius } = style;
435
+ const { height, width } = textShadowOffset || defaultOffset;
436
+ const radius = textShadowRadius || 0;
437
+ const offsetX = normalizeValueWithProperty(width);
438
+ const offsetY = normalizeValueWithProperty(height);
439
+ const blurRadius = normalizeValueWithProperty(radius);
440
+ const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
441
+ if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
442
+ resolvedStyle.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
443
+ }
444
+ }
445
+ __name(textShadowReducer, "textShadowReducer");
446
+ // Annotate the CommonJS export names for ESM import in node:
447
+ 0 && (module.exports = {
448
+ expandStyle,
449
+ expandStyles,
450
+ generateAtomicStyles,
451
+ inline
452
+ });
453
+ //# sourceMappingURL=generateAtomicStyles.js.map