@tamagui/web 1.121.12 → 1.122.0

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 (160) hide show
  1. package/dist/cjs/createComponent.cjs +9 -10
  2. package/dist/cjs/createComponent.js +7 -16
  3. package/dist/cjs/createComponent.js.map +1 -1
  4. package/dist/cjs/createComponent.native.js +9 -13
  5. package/dist/cjs/createComponent.native.js.map +2 -2
  6. package/dist/cjs/helpers/ThemeManager.js.map +1 -1
  7. package/dist/cjs/helpers/ThemeManager.native.js.map +1 -1
  8. package/dist/cjs/helpers/ThemeManagerContext.cjs +2 -2
  9. package/dist/cjs/helpers/ThemeManagerContext.js +2 -2
  10. package/dist/cjs/helpers/ThemeManagerContext.js.map +1 -1
  11. package/dist/cjs/helpers/ThemeManagerContext.native.js +3 -3
  12. package/dist/cjs/helpers/ThemeManagerContext.native.js.map +2 -2
  13. package/dist/cjs/helpers/expandStyle.cjs +3 -3
  14. package/dist/cjs/helpers/expandStyle.js +2 -2
  15. package/dist/cjs/helpers/expandStyle.js.map +1 -1
  16. package/dist/cjs/helpers/expandStyle.native.js +1 -1
  17. package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
  18. package/dist/cjs/helpers/expandStyles.js.map +1 -1
  19. package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
  20. package/dist/cjs/helpers/getSplitStyles.cjs +64 -93
  21. package/dist/cjs/helpers/getSplitStyles.js +60 -86
  22. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  23. package/dist/cjs/helpers/getSplitStyles.native.js +344 -372
  24. package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
  25. package/dist/cjs/helpers/getThemeCSSRules.cjs +1 -1
  26. package/dist/cjs/helpers/getThemeCSSRules.js +1 -1
  27. package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
  28. package/dist/cjs/helpers/insertStyleRule.cjs +6 -6
  29. package/dist/cjs/helpers/insertStyleRule.js +6 -11
  30. package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
  31. package/dist/cjs/helpers/insertStyleRule.native.js +17 -16
  32. package/dist/cjs/helpers/insertStyleRule.native.js.map +2 -2
  33. package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
  34. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  35. package/dist/cjs/helpers/propMapper.cjs +21 -15
  36. package/dist/cjs/helpers/propMapper.js +26 -20
  37. package/dist/cjs/helpers/propMapper.js.map +2 -2
  38. package/dist/cjs/helpers/propMapper.native.js +27 -21
  39. package/dist/cjs/helpers/propMapper.native.js.map +2 -2
  40. package/dist/cjs/hooks/useTheme.cjs +148 -169
  41. package/dist/cjs/hooks/useTheme.js +64 -69
  42. package/dist/cjs/hooks/useTheme.js.map +2 -2
  43. package/dist/cjs/hooks/useTheme.native.js +60 -72
  44. package/dist/cjs/hooks/useTheme.native.js.map +2 -2
  45. package/dist/cjs/hooks/useThemeName.cjs +4 -5
  46. package/dist/cjs/hooks/useThemeName.js +2 -2
  47. package/dist/cjs/hooks/useThemeName.js.map +1 -1
  48. package/dist/cjs/hooks/useThemeName.native.js +2 -2
  49. package/dist/cjs/hooks/useThemeName.native.js.map +2 -2
  50. package/dist/cjs/views/Theme.cjs +3 -4
  51. package/dist/cjs/views/Theme.js +2 -3
  52. package/dist/cjs/views/Theme.js.map +1 -1
  53. package/dist/cjs/views/Theme.native.js +3 -4
  54. package/dist/cjs/views/Theme.native.js.map +2 -2
  55. package/dist/esm/createComponent.js +7 -16
  56. package/dist/esm/createComponent.js.map +1 -1
  57. package/dist/esm/createComponent.mjs +9 -10
  58. package/dist/esm/createComponent.mjs.map +1 -1
  59. package/dist/esm/createComponent.native.js +8 -11
  60. package/dist/esm/createComponent.native.js.map +2 -2
  61. package/dist/esm/helpers/ThemeManager.js.map +1 -1
  62. package/dist/esm/helpers/ThemeManager.mjs.map +1 -1
  63. package/dist/esm/helpers/ThemeManager.native.js.map +1 -1
  64. package/dist/esm/helpers/ThemeManagerContext.js +2 -2
  65. package/dist/esm/helpers/ThemeManagerContext.js.map +1 -1
  66. package/dist/esm/helpers/ThemeManagerContext.mjs +2 -2
  67. package/dist/esm/helpers/ThemeManagerContext.mjs.map +1 -1
  68. package/dist/esm/helpers/ThemeManagerContext.native.js +2 -2
  69. package/dist/esm/helpers/ThemeManagerContext.native.js.map +2 -2
  70. package/dist/esm/helpers/expandStyle.js +2 -2
  71. package/dist/esm/helpers/expandStyle.js.map +1 -1
  72. package/dist/esm/helpers/expandStyle.mjs +2 -2
  73. package/dist/esm/helpers/expandStyle.mjs.map +1 -1
  74. package/dist/esm/helpers/expandStyle.native.js +1 -1
  75. package/dist/esm/helpers/expandStyle.native.js.map +1 -1
  76. package/dist/esm/helpers/expandStyles.js.map +1 -1
  77. package/dist/esm/helpers/expandStyles.mjs.map +1 -1
  78. package/dist/esm/helpers/expandStyles.native.js.map +1 -1
  79. package/dist/esm/helpers/getSplitStyles.js +61 -92
  80. package/dist/esm/helpers/getSplitStyles.js.map +1 -1
  81. package/dist/esm/helpers/getSplitStyles.mjs +65 -94
  82. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  83. package/dist/esm/helpers/getSplitStyles.native.js +347 -375
  84. package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
  85. package/dist/esm/helpers/getThemeCSSRules.js +1 -1
  86. package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
  87. package/dist/esm/helpers/getThemeCSSRules.mjs +1 -1
  88. package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
  89. package/dist/esm/helpers/insertStyleRule.js +6 -11
  90. package/dist/esm/helpers/insertStyleRule.js.map +1 -1
  91. package/dist/esm/helpers/insertStyleRule.mjs +6 -6
  92. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  93. package/dist/esm/helpers/insertStyleRule.native.js +17 -16
  94. package/dist/esm/helpers/insertStyleRule.native.js.map +2 -2
  95. package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
  96. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  97. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  98. package/dist/esm/helpers/propMapper.js +26 -20
  99. package/dist/esm/helpers/propMapper.js.map +2 -2
  100. package/dist/esm/helpers/propMapper.mjs +22 -15
  101. package/dist/esm/helpers/propMapper.mjs.map +1 -1
  102. package/dist/esm/helpers/propMapper.native.js +28 -21
  103. package/dist/esm/helpers/propMapper.native.js.map +2 -2
  104. package/dist/esm/hooks/useTheme.js +70 -60
  105. package/dist/esm/hooks/useTheme.js.map +2 -2
  106. package/dist/esm/hooks/useTheme.mjs +145 -154
  107. package/dist/esm/hooks/useTheme.mjs.map +1 -1
  108. package/dist/esm/hooks/useTheme.native.js +59 -62
  109. package/dist/esm/hooks/useTheme.native.js.map +2 -2
  110. package/dist/esm/hooks/useThemeName.js +3 -4
  111. package/dist/esm/hooks/useThemeName.js.map +1 -1
  112. package/dist/esm/hooks/useThemeName.mjs +3 -4
  113. package/dist/esm/hooks/useThemeName.mjs.map +1 -1
  114. package/dist/esm/hooks/useThemeName.native.js +3 -4
  115. package/dist/esm/hooks/useThemeName.native.js.map +2 -2
  116. package/dist/esm/types.mjs.map +1 -1
  117. package/dist/esm/views/Theme.js +3 -4
  118. package/dist/esm/views/Theme.js.map +1 -1
  119. package/dist/esm/views/Theme.mjs +4 -5
  120. package/dist/esm/views/Theme.mjs.map +1 -1
  121. package/dist/esm/views/Theme.native.js +4 -5
  122. package/dist/esm/views/Theme.native.js.map +2 -2
  123. package/package.json +11 -11
  124. package/src/createComponent.tsx +7 -15
  125. package/src/helpers/ThemeManager.tsx +1 -0
  126. package/src/helpers/ThemeManagerContext.tsx +2 -1
  127. package/src/helpers/expandStyle.ts +3 -3
  128. package/src/helpers/expandStyles.ts +0 -1
  129. package/src/helpers/getSplitStyles.tsx +111 -127
  130. package/src/helpers/getThemeCSSRules.ts +7 -6
  131. package/src/helpers/insertStyleRule.tsx +9 -16
  132. package/src/helpers/normalizeValueWithProperty.ts +0 -2
  133. package/src/helpers/propMapper.ts +28 -36
  134. package/src/hooks/useTheme.tsx +143 -113
  135. package/src/hooks/useThemeName.tsx +3 -5
  136. package/src/setupHooks.ts +1 -7
  137. package/src/types.tsx +15 -15
  138. package/src/views/Theme.tsx +5 -5
  139. package/types/createComponent.d.ts.map +1 -1
  140. package/types/helpers/ThemeManager.d.ts.map +1 -1
  141. package/types/helpers/ThemeManagerContext.d.ts +2 -1
  142. package/types/helpers/ThemeManagerContext.d.ts.map +1 -1
  143. package/types/helpers/expandStyle.d.ts.map +1 -1
  144. package/types/helpers/expandStyles.d.ts.map +1 -1
  145. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  146. package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
  147. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  148. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  149. package/types/helpers/propMapper.d.ts +0 -1
  150. package/types/helpers/propMapper.d.ts.map +1 -1
  151. package/types/hooks/useConfiguration.d.ts +30 -50
  152. package/types/hooks/useConfiguration.d.ts.map +1 -1
  153. package/types/hooks/useTheme.d.ts +3 -3
  154. package/types/hooks/useTheme.d.ts.map +1 -1
  155. package/types/hooks/useThemeName.d.ts.map +1 -1
  156. package/types/setupHooks.d.ts +1 -1
  157. package/types/setupHooks.d.ts.map +1 -1
  158. package/types/types.d.ts +23 -13
  159. package/types/types.d.ts.map +1 -1
  160. package/types/views/Theme.d.ts.map +1 -1
@@ -30,387 +30,372 @@ __export(getSplitStyles_exports, {
30
30
  });
31
31
  module.exports = __toCommonJS(getSplitStyles_exports);
32
32
  var import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_react = __toESM(require("react")), import_config = require("../config"), import_accessibilityDirectMap = require("../constants/accessibilityDirectMap"), import_constants2 = require("../constants/constants"), import_isDevTools = require("../constants/isDevTools"), import_useMedia = require("../hooks/useMedia"), import_createMediaStyle = require("./createMediaStyle"), import_expandStyles = require("./expandStyles"), import_getGroupPropParts = require("./getGroupPropParts"), import_getStylesAtomic = require("./getStylesAtomic"), import_insertStyleRule = require("./insertStyleRule"), import_isActivePlatform = require("./isActivePlatform"), import_isActiveTheme = require("./isActiveTheme"), import_log = require("./log"), import_normalizeValueWithProperty = require("./normalizeValueWithProperty"), import_propMapper = require("./propMapper"), import_pseudoDescriptors = require("./pseudoDescriptors"), import_skipProps = require("./skipProps"), import_sortString = require("./sortString"), import_transformsToString = require("./transformsToString"), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
33
- function isValidStyleKey(key, staticConfig) {
34
- var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
35
- return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
33
+ function isValidStyleKey(key, validStyles, accept) {
34
+ return key in validStyles ? !0 : accept && key in accept;
36
35
  }
37
36
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
38
- conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
39
- var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
40
- classNames,
41
- conf,
42
- props,
43
- styleProps,
44
- componentState,
45
- staticConfig,
46
- style: null,
47
- theme,
48
- usedKeys,
49
- viewProps,
50
- context,
51
- debug
52
- };
53
- process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
54
- props,
55
- staticConfig,
56
- shouldDoClasses,
57
- styleProps,
58
- rulesToInsert,
59
- componentState,
60
- styleState,
61
- theme: {
62
- ...theme
37
+ var _loop = function(keyOg2) {
38
+ var keyInit = keyOg2, valInit = props[keyInit];
39
+ if (keyInit === "children")
40
+ return viewProps[keyInit] = valInit, "continue";
41
+ if (process.env.NODE_ENV === "development" && debug === "profile" && time`before-prop-${keyInit}`, process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle")
42
+ return "continue";
43
+ if (accept) {
44
+ var accepted = accept[keyInit];
45
+ if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object")
46
+ return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
63
47
  }
64
- }), console.groupEnd());
65
- var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
66
- for (var keyOg in props) {
67
- var _loop = function(i2) {
68
- var _parentStaticConfig_variants;
69
- if (expanded) {
70
- var [k, v] = expanded[i2];
71
- key = k, val = v;
48
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
49
+ if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
50
+ if (keyInit === "group" && 0)
51
+ var identifier2, containerType, containerCSS;
52
+ return "continue";
53
+ }
54
+ var valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
55
+ if (0) {
56
+ if (staticConfig.isReactNative && keyInit.startsWith("data-"))
57
+ var _viewProps2, _dataSet;
58
+ if (isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
59
+ var isValidClassName, isMediaOrPseudo;
60
+ if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
61
+ var _styleState3;
72
62
  }
73
- if (val == null || key in usedKeys) return "continue";
74
- if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key in variants, inlineProps != null && inlineProps.has(key) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key))) {
75
- var _props_key;
76
- viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
63
+ }
64
+ if (!isValidStyleKeyInit) {
65
+ if (!import_constants.isAndroid && keyInit === "elevationAndroid")
66
+ return "continue";
67
+ if (keyInit === "userSelect")
68
+ keyInit = "selectable", valInit = valInit !== "none";
69
+ else if (keyInit.startsWith("data-"))
70
+ return "continue";
71
+ }
72
+ if (keyInit === "dataSet") {
73
+ for (var keyInit1 in valInit)
74
+ viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
75
+ return "continue";
76
+ }
77
+ if (0 && !noExpand)
78
+ var didUseKeyInit;
79
+ var isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
80
+ if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
81
+ var parts = keyInit.split("-");
82
+ if (
83
+ // check if its actually a simple group selector to avoid breaking selectors
84
+ parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
85
+ ) {
86
+ var name2 = parts[1];
87
+ context != null && context.groups.subscribe && !(context != null && context.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
77
88
  }
78
- var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
79
- if (shouldPassThrough2)
80
- return passDownProp(viewProps, key, val, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(` - passing down prop ${key}`), (0, import_log.log)({
81
- val,
82
- after: {
83
- ...viewProps[key]
84
- }
85
- }), console.groupEnd()), "continue";
86
- if (isPseudo) {
87
- if (!val) return "continue";
88
- var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClass), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
89
- if (!descriptor)
90
- return "continue";
91
- if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
92
- var _pseudos, _key;
93
- if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static")
94
- return Object.assign(pseudos[key], pseudoStyleObject), "continue";
89
+ }
90
+ var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand;
91
+ if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
92
+ return "continue";
93
+ var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
94
+ isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
95
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(` \u{1F511} ${keyOg2}${keyInit !== keyOg2 ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), (0, import_log.log)({
96
+ isVariant,
97
+ valInit,
98
+ shouldPassProp
99
+ }), import_constants.isClient && (0, import_log.log)({
100
+ variants,
101
+ variant: variants == null ? void 0 : variants[keyInit],
102
+ isVariant,
103
+ isHOCShouldPassThrough,
104
+ parentStaticConfig
105
+ })), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant) || !noSkip && keyInit in import_skipProps.skipProps)
106
+ return "continue";
107
+ (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
108
+ var disablePropMap = isMediaOrPseudo1 || !isStyleLikeKey;
109
+ if ((0, import_propMapper.propMapper)(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
110
+ var _parentStaticConfig_variants;
111
+ if (!isHOC && disablePropMap && !isMediaOrPseudo1) {
112
+ viewProps[key4] = val2;
113
+ return;
114
+ }
115
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, "=>", key4), (0, import_log.log)(val2), console.groupEnd()), val2 != null && !(key4 in usedKeys)) {
116
+ if (key4 === "pointerEvents") {
117
+ viewProps[key4] = val2;
118
+ return;
119
+ }
120
+ if (!isHOC && isValidStyleKey(key4, validStyles, accept) || import_constants.isAndroid && key4 === "elevation") {
121
+ mergeStyle(styleState, key4, val2);
122
+ return;
95
123
  }
96
- if (shouldDoClasses && !isExit) {
97
- var pseudoStyles = (0, import_getStylesAtomic.getStyleAtomic)(pseudoStyleObject, descriptor);
98
- process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key), (0, import_log.log)({
99
- pseudoStyleObject,
100
- pseudoStyles
124
+ if (isPseudo = key4 in import_helpers.validPseudoKeys, isMedia = !isPseudo && (0, import_useMedia.isMediaKey)(key4), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4))) {
125
+ var _props_key;
126
+ viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
127
+ }
128
+ var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
129
+ if (shouldPassThrough2) {
130
+ passDownProp(viewProps, key4, val2, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(` - passing down prop ${key4}`), (0, import_log.log)({
131
+ val: val2,
132
+ after: {
133
+ ...viewProps[key4]
134
+ }
101
135
  }), console.groupEnd());
102
- var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
103
- try {
104
- for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
105
- var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
106
- fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0));
136
+ return;
137
+ }
138
+ if (isPseudo) {
139
+ if (!val2) return;
140
+ var pseudoStyleObject = getSubStyle(styleState, key4, val2, styleProps.noClass);
141
+ if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
142
+ var _pseudos, _key;
143
+ if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key4] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static") {
144
+ Object.assign(pseudos[key4], pseudoStyleObject);
145
+ return;
107
146
  }
108
- } catch (err) {
109
- _didIteratorError2 = !0, _iteratorError2 = err;
110
- } finally {
147
+ }
148
+ var descriptor = import_pseudoDescriptors.pseudoDescriptors[key4], isEnter = key4 === "enterStyle", isExit = key4 === "exitStyle";
149
+ if (!descriptor)
150
+ return;
151
+ if (shouldDoClasses && !isExit) {
152
+ var pseudoStyles = (0, import_getStylesAtomic.getStyleAtomic)(pseudoStyleObject, descriptor);
153
+ process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key4), (0, import_log.log)({
154
+ pseudoStyleObject,
155
+ pseudoStyles
156
+ }), console.groupEnd());
157
+ var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
111
158
  try {
112
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
159
+ for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
160
+ var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
161
+ fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0));
162
+ }
163
+ } catch (err) {
164
+ _didIteratorError2 = !0, _iteratorError2 = err;
113
165
  } finally {
114
- if (_didIteratorError2)
115
- throw _iteratorError2;
166
+ try {
167
+ !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
168
+ } finally {
169
+ if (_didIteratorError2)
170
+ throw _iteratorError2;
171
+ }
116
172
  }
117
173
  }
118
- }
119
- if (!shouldDoClasses || isExit || isEnter) {
120
- var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
121
- isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key, {
122
- isDisabled
123
- }), (0, import_log.log)({
124
- pseudoStyleObject,
125
- isDisabled,
126
- descriptor,
127
- componentState
128
- }), console.groupEnd());
129
- var importance = descriptor.priority;
130
- for (var pkey in pseudoStyleObject) {
131
- var val12 = pseudoStyleObject[pkey];
132
- if (isDisabled)
133
- applyDefaultStyle(pkey, styleState);
134
- else {
135
- var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
136
- if (shouldMerge) {
137
- var _pseudos1, _key1;
138
- pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val12, mergeStyle(styleState, pkey, val12);
174
+ if (!shouldDoClasses || isExit || isEnter) {
175
+ var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
176
+ isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key4, {
177
+ isDisabled
178
+ }), (0, import_log.log)({
179
+ pseudoStyleObject,
180
+ isDisabled,
181
+ descriptor,
182
+ componentState
183
+ }), console.groupEnd());
184
+ var importance = descriptor.priority;
185
+ for (var pkey in pseudoStyleObject) {
186
+ var _$val = pseudoStyleObject[pkey];
187
+ if (isDisabled)
188
+ applyDefaultStyle(pkey, styleState);
189
+ else {
190
+ var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
191
+ if (shouldMerge) {
192
+ if (process.env.IS_STATIC === "is_static") {
193
+ var _pseudos1, _key1;
194
+ pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
195
+ }
196
+ mergeStyle(styleState, pkey, _$val);
197
+ }
198
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
199
+ importance,
200
+ curImportance,
201
+ pkey,
202
+ val: _$val
203
+ });
139
204
  }
140
- process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
141
- importance,
142
- curImportance,
143
- pkey,
144
- val: val12
145
- });
146
205
  }
206
+ if (!isDisabled)
207
+ for (var _$key in val2) {
208
+ var k = shorthands[_$key] || _$key;
209
+ usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
210
+ }
147
211
  }
148
- if (!isDisabled)
149
- for (var key12 in val) {
150
- var k1 = shorthands[key12] || key12;
151
- usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
152
- }
212
+ return;
153
213
  }
154
- return "continue";
155
- }
156
- if (isMedia) {
157
- if (!val) return "continue";
158
- var hasSpace = val.space, mediaKeyShort = key.slice(isMedia == "theme" ? 7 : 1);
159
- if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key))
160
- return "continue";
161
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
162
- key,
163
- val,
164
- props,
165
- shouldDoClasses,
166
- acceptsClassName,
167
- componentState,
168
- mediaState
169
- }), shouldDoClasses) {
170
- var mediaStyle = getSubStyle(styleState, key, val, !1);
171
- if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
172
- var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
173
- importance1 && (space = val.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance1})`));
174
- }
175
- var mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
176
- mediaStylesSeen += 1;
177
- var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
178
- try {
179
- for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
180
- var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
181
- if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
182
- var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
183
- process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
184
- var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
185
- fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
186
- }
214
+ if (isMedia) {
215
+ if (!val2) return;
216
+ var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
217
+ if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key4))
218
+ return;
219
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
220
+ key: key4,
221
+ val: val2,
222
+ props,
223
+ shouldDoClasses,
224
+ acceptsClassName,
225
+ componentState,
226
+ mediaState
227
+ }), shouldDoClasses) {
228
+ var mediaStyle = getSubStyle(styleState, key4, val2, !1);
229
+ if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
230
+ var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
231
+ importance1 && (space = val2.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val2} (importance: ${importance1})`));
187
232
  }
188
- } catch (err) {
189
- _didIteratorError12 = !0, _iteratorError12 = err;
190
- } finally {
233
+ var mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
234
+ mediaStylesSeen += 1;
235
+ var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
191
236
  try {
192
- !_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
237
+ for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
238
+ var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
239
+ if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
240
+ var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
241
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
242
+ var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
243
+ fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
244
+ }
245
+ }
246
+ } catch (err) {
247
+ _didIteratorError12 = !0, _iteratorError12 = err;
193
248
  } finally {
194
- if (_didIteratorError12)
195
- throw _iteratorError12;
249
+ try {
250
+ !_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
251
+ } finally {
252
+ if (_didIteratorError12)
253
+ throw _iteratorError12;
254
+ }
196
255
  }
197
- }
198
- } else {
199
- let mergeMediaStyle2 = function(key5, val3) {
200
- var _styleState4;
201
- (_styleState4 = styleState).style || (_styleState4.style = {});
202
- var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
203
- didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
204
- };
205
- var mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
206
- if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
207
- if (!mediaState[mediaKeyShort])
208
- return process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`), "continue";
209
- process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
210
- }
211
- var mediaStyle1 = getSubStyle(styleState, key, val, !0), importanceBump = 0;
212
- if (isThemeMedia) {
213
- if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort)))
214
- return "continue";
215
- } else if (isGroupMedia) {
216
- var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
217
- if (!groupContext)
218
- return process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`), "continue";
219
- var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
220
- if (groupMediaKey) {
221
- mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
222
- var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
223
- if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
224
- for (var pkey1 in mediaStyle1)
225
- applyDefaultStyle(pkey1, styleState);
226
- return "continue";
256
+ } else {
257
+ let mergeMediaStyle2 = function(key5, val3) {
258
+ var _styleState4;
259
+ (_styleState4 = styleState).style || (_styleState4.style = {});
260
+ var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
261
+ didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
262
+ };
263
+ var mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
264
+ if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
265
+ if (!mediaState[mediaKeyShort]) {
266
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`);
267
+ return;
227
268
  }
228
- importanceBump = 2;
269
+ process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
229
270
  }
230
- if (groupPseudoKey) {
231
- pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
232
- var componentGroupPseudoState = (componentGroupState || // fallback to context initially
233
- context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
234
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
235
- for (var pkey2 in mediaStyle1)
236
- applyDefaultStyle(pkey2, styleState);
237
- return "continue";
271
+ var mediaStyle1 = getSubStyle(styleState, key4, val2, !0), importanceBump = 0;
272
+ if (isThemeMedia) {
273
+ if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort)))
274
+ return;
275
+ } else if (isGroupMedia) {
276
+ var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
277
+ if (!groupContext) {
278
+ process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`);
279
+ return;
280
+ }
281
+ var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
282
+ if (groupMediaKey) {
283
+ mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
284
+ var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
285
+ if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
286
+ for (var pkey1 in mediaStyle1)
287
+ applyDefaultStyle(pkey1, styleState);
288
+ return;
289
+ }
290
+ importanceBump = 2;
291
+ }
292
+ if (groupPseudoKey) {
293
+ pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
294
+ var componentGroupPseudoState = (componentGroupState || // fallback to context initially
295
+ context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
296
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
297
+ for (var pkey2 in mediaStyle1)
298
+ applyDefaultStyle(pkey2, styleState);
299
+ return;
300
+ }
301
+ importanceBump = priority1;
238
302
  }
239
- importanceBump = priority1;
240
303
  }
241
- }
242
- for (var subKey1 in mediaStyle1) {
243
- if (subKey1 === "space") {
244
- space = valInit.space;
245
- continue;
304
+ for (var subKey1 in mediaStyle1) {
305
+ if (subKey1 === "space") {
306
+ space = valInit.space;
307
+ continue;
308
+ }
309
+ if (subKey1[0] === "$") {
310
+ if (!(0, import_isActivePlatform.isActivePlatform)(subKey1) || !(0, import_isActiveTheme.isActiveTheme)(subKey1, themeName)) continue;
311
+ for (var subSubKey in mediaStyle1[subKey1])
312
+ mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
313
+ } else
314
+ mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
246
315
  }
247
- if (subKey1[0] === "$") {
248
- if (!(0, import_isActivePlatform.isActivePlatform)(subKey1) || !(0, import_isActiveTheme.isActiveTheme)(subKey1, themeName)) continue;
249
- for (var subSubKey in mediaStyle1[subKey1])
250
- mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
251
- } else
252
- mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
253
316
  }
317
+ return;
254
318
  }
255
- return "continue";
256
- }
257
- if (key === "pointerEvents")
258
- return viewProps[key] = val, "continue";
259
- if (
260
- // is HOC we can just pass through the styles as props
261
- // this fixes issues where style prop got merged with wrong priority
262
- !isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
263
- )
264
- return mergeStyle(styleState, key, val), "continue";
265
- if (!isVariant) {
266
- if (styleProps.styledContextProps && key in styleProps.styledContextProps)
267
- return "continue";
268
- viewProps[key] = val;
269
- }
270
- }, keyInit = keyOg, valInit = props[keyInit];
271
- if (!(process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle")) {
272
- if (process.env.NODE_ENV === "development" && debug === "profile" && time`prop-${keyInit}`, accept) {
273
- var accepted = accept[keyInit];
274
- if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
275
- viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass);
276
- continue;
319
+ if (!isVariant) {
320
+ if (styleProps.styledContextProps && key4 in styleProps.styledContextProps)
321
+ return;
322
+ viewProps[key4] = val2;
277
323
  }
278
324
  }
279
- if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit !== "className" && !(keyInit in usedKeys)) {
280
- if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
281
- if (keyInit === "group" && 0)
282
- var identifier, containerType, containerCSS;
283
- continue;
284
- }
285
- var valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
286
- if (0) {
287
- if (staticConfig.isReactNative && keyInit.startsWith("data-"))
288
- var _viewProps, _dataSet;
289
- if (isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
290
- var isValidClassName, isMediaOrPseudo;
291
- if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
292
- var _styleState;
293
- }
294
- }
295
- if (!isValidStyleKeyInit) {
296
- if (!import_constants.isAndroid && keyInit === "elevationAndroid")
297
- continue;
298
- if (keyInit === "userSelect")
299
- keyInit = "selectable", valInit = valInit !== "none";
300
- else if (keyInit.startsWith("data-"))
301
- continue;
302
- }
303
- if (keyInit === "dataSet") {
304
- for (var keyInit1 in valInit)
305
- viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
306
- continue;
307
- }
308
- if (0 && !noExpand)
309
- var didUseKeyInit;
310
- var isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
311
- if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
312
- var parts = keyInit.split("-");
313
- if (
314
- // check if its actually a simple group selector to avoid breaking selectors
315
- parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
316
- ) {
317
- var name = parts[1];
318
- context != null && context.groups.subscribe && !(context != null && context.groups.state[name]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
319
- }
320
- }
321
- var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
322
- if (!(isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))) {
323
- var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
324
- isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
325
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), (0, import_log.log)({
326
- isVariant,
327
- valInit,
328
- shouldPassProp
329
- }), import_constants.isClient && (0, import_log.log)({
330
- variants,
331
- variant: variants == null ? void 0 : variants[keyInit],
332
- isVariant,
333
- isHOCShouldPassThrough,
334
- parentStaticConfig
335
- })), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
336
- process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
337
- continue;
338
- }
339
- if (!noSkip && keyInit in import_skipProps.skipProps) {
340
- process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
341
- continue;
342
- }
343
- (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
344
- var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
345
- if (!avoidPropMap) {
346
- if (!expanded) continue;
347
- var next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
348
- next && (styleState.fontFamily = next);
349
- }
350
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
351
- consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
352
- try {
353
- !import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
354
- expanded,
355
- styleProps,
356
- componentState,
357
- isVariant,
358
- variant: variants == null ? void 0 : variants[keyInit],
359
- shouldPassProp,
360
- isHOCShouldPassThrough,
361
- usedKeys: {
362
- ...usedKeys
363
- }
364
- }), globalThis.tamaguiAvoidTracking = !0, (0, import_log.log)("expanded", expanded, `
365
- usedKeys`, {
366
- ...usedKeys
367
- }, `
368
- current`, {
369
- ...styleState.style
370
- }), globalThis.tamaguiAvoidTracking = !1);
371
- } catch {
372
- }
373
- console.groupEnd();
374
- }
375
- for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) _loop(i);
376
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
377
- try {
378
- (0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
379
- ...styleState.style
380
- }), (0, import_log.log)("transforms", {
381
- ...transforms
382
- }), (0, import_log.log)("viewProps", {
383
- ...viewProps
384
- });
385
- } catch {
386
- }
387
- console.groupEnd();
388
- }
389
- }
325
+ }), process.env.NODE_ENV === "development" && debug === "verbose") {
326
+ try {
327
+ (0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
328
+ ...styleState.style
329
+ }), (0, import_log.log)("transforms", {
330
+ ...transforms
331
+ }), (0, import_log.log)("viewProps", {
332
+ ...viewProps
333
+ });
334
+ } catch {
390
335
  }
336
+ console.groupEnd();
391
337
  }
338
+ };
339
+ props.reddish && (debug = "verbose"), conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
340
+ var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
341
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-setup`;
342
+ var styleState = {
343
+ classNames,
344
+ conf,
345
+ props,
346
+ styleProps,
347
+ componentState,
348
+ staticConfig,
349
+ style: null,
350
+ theme,
351
+ usedKeys,
352
+ viewProps,
353
+ context,
354
+ debug
355
+ };
356
+ if (process.env.IS_STATIC === "is_static") {
357
+ var { fallbackProps } = styleProps;
358
+ fallbackProps && (styleState.props = new Proxy(props, {
359
+ get(_, key4, val2) {
360
+ return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
361
+ }
362
+ }));
392
363
  }
364
+ process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
365
+ props,
366
+ staticConfig,
367
+ shouldDoClasses,
368
+ styleProps,
369
+ rulesToInsert,
370
+ componentState,
371
+ styleState,
372
+ theme: {
373
+ ...theme
374
+ }
375
+ }), console.groupEnd());
376
+ var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
377
+ for (var keyOg in props) _loop(keyOg);
393
378
  process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
394
379
  var avoidNormalize = styleProps.noNormalize === !1;
395
380
  if (!avoidNormalize) {
396
381
  if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
397
- var _styleState1;
398
- (_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
382
+ var _styleState;
383
+ (_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
399
384
  var [a] = param, [b] = param1;
400
385
  return (0, import_sortString.sortString)(a, b);
401
386
  }).forEach(function(param) {
402
- var [key5, val3] = param;
403
- mergeTransform(styleState.style, key5, val3, !0);
387
+ var [key4, val2] = param;
388
+ mergeTransform(styleState.style, key4, val2, !0);
404
389
  });
405
390
  }
406
391
  if (parentSplitStyles) {
407
392
  if (0 && shouldDoClasses)
408
- for (var key1 in parentSplitStyles.classNames)
409
- var val1;
393
+ for (var key in parentSplitStyles.classNames)
394
+ var val;
410
395
  if (!shouldDoClasses)
411
- for (var key2 in parentSplitStyles.style) {
412
- var _styleState2;
413
- key2 in classNames || styleState.style && key2 in styleState.style || ((_styleState2 = styleState).style || (_styleState2.style = {}), styleState.style[key2] = parentSplitStyles.style[key2]);
396
+ for (var key1 in parentSplitStyles.style) {
397
+ var _styleState1;
398
+ key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
414
399
  }
415
400
  }
416
401
  }
@@ -423,21 +408,21 @@ current`, {
423
408
  var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
424
409
  try {
425
410
  for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
426
- var atomicStyle, _props_animateOnly, _props_animateOnly1, key3, value, identifier1, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
411
+ var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
427
412
  } catch (err) {
428
413
  } finally {
429
414
  }
430
415
  }
431
416
  if (transforms)
432
417
  for (var namespace in transforms) {
433
- var hash, val2, identifier2;
434
- if (import_constants.isClient && !insertedTransforms[identifier2])
418
+ var hash, val1, identifier1;
419
+ if (import_constants.isClient && !insertedTransforms[identifier1])
435
420
  var rule;
436
421
  }
437
422
  }
438
423
  if (isReactNative) {
439
424
  if (viewProps.tabIndex === 0)
440
- var _viewProps1, _accessible;
425
+ var _viewProps, _accessible;
441
426
  } else if (viewProps.tabIndex == null)
442
427
  var _viewProps_focusable, isFocusable, role;
443
428
  }
@@ -446,14 +431,14 @@ current`, {
446
431
  if (isHOC)
447
432
  viewProps.style = normalizeStyle(styleProp);
448
433
  else
449
- for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i1 = 0; i1 < len; i1++) {
450
- var style = isArray ? styleProp[i1] : styleProp;
434
+ for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
435
+ var style = isArray ? styleProp[i] : styleProp;
451
436
  if (style)
452
437
  if (style.$$css)
453
438
  Object.assign(styleState.classNames, style);
454
439
  else {
455
- var _styleState3;
456
- (_styleState3 = styleState).style || (_styleState3.style = {}), Object.assign(styleState.style, normalizeStyle(style));
440
+ var _styleState2;
441
+ (_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
457
442
  }
458
443
  }
459
444
  var style1 = styleState.style;
@@ -489,7 +474,7 @@ current`, {
489
474
  var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
490
475
  try {
491
476
  for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
492
- var name1;
477
+ var name;
493
478
  } catch (err) {
494
479
  } finally {
495
480
  }
@@ -511,8 +496,8 @@ current`, {
511
496
  rulesToInsert,
512
497
  parentSplitStyles
513
498
  };
514
- for (var key4 in logs)
515
- (0, import_log.log)(key4, logs[key4]);
499
+ for (var key3 in logs)
500
+ (0, import_log.log)(key3, logs[key3]);
516
501
  } catch {
517
502
  }
518
503
  console.groupEnd();
@@ -546,30 +531,17 @@ function mergeStyle(styleState, key, val) {
546
531
  }
547
532
  }
548
533
  var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
549
- var { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
550
- for (var key in styleIn) {
551
- var val = styleIn[key];
552
- key = conf2.shorthands[key] || key;
553
- var expanded = (0, import_propMapper.propMapper)(key, val, styleState);
554
- if (!(!expanded || !staticConfig.isHOC && key in import_skipProps.skipProps && !styleProps.noSkip)) {
555
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
556
- try {
557
- for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
558
- var [skey, sval] = _step.value;
559
- skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
560
- }
561
- } catch (err) {
562
- _didIteratorError = !0, _iteratorError = err;
563
- } finally {
564
- try {
565
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
566
- } finally {
567
- if (_didIteratorError)
568
- throw _iteratorError;
569
- }
570
- }
571
- }
572
- }
534
+ var _loop = function(key1) {
535
+ var val = styleIn[key1];
536
+ key1 = conf2.shorthands[key1] || key1;
537
+ var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
538
+ if (shouldSkip)
539
+ return key = key1, "continue";
540
+ (0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
541
+ skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
542
+ }), key = key1;
543
+ }, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
544
+ for (var key in styleIn) _loop(key);
573
545
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
574
546
  }, useInsertEffectCompat = import_constants.isWeb ? import_react.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {
575
547
  }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {