@tamagui/web 2.7.7 → 3.0.0-beta.643.1
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.
- package/dist/cjs/Tamagui.cjs +45 -53
- package/dist/cjs/Tamagui.native.cjs +124 -0
- package/dist/cjs/Tamagui.native.js +94 -96
- package/dist/cjs/Tamagui.native.js.map +1 -1
- package/dist/cjs/_withNativeStyle.cjs +81 -0
- package/dist/cjs/_withNativeStyle.native.cjs +86 -0
- package/dist/cjs/_withNativeStyle.native.js +88 -0
- package/dist/cjs/_withNativeStyle.native.js.map +1 -0
- package/dist/cjs/_withStableStyle.cjs +59 -54
- package/dist/cjs/_withStableStyle.native.cjs +93 -0
- package/dist/cjs/_withStableStyle.native.js +70 -57
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +120 -133
- package/dist/cjs/config.native.cjs +193 -0
- package/dist/cjs/config.native.js +157 -173
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.cjs +19 -20
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs +37 -0
- package/dist/cjs/constants/accessibilityDirectMap.native.js +19 -19
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +18 -19
- package/dist/cjs/constants/constants.native.cjs +41 -0
- package/dist/cjs/constants/constants.native.js +18 -18
- package/dist/cjs/constants/constants.native.js.map +1 -1
- package/dist/cjs/constants/isDevTools.cjs +21 -24
- package/dist/cjs/constants/isDevTools.native.cjs +34 -0
- package/dist/cjs/constants/isDevTools.native.js +23 -25
- package/dist/cjs/constants/isDevTools.native.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.cjs +32 -25
- package/dist/cjs/contexts/ComponentContext.native.cjs +50 -0
- package/dist/cjs/contexts/ComponentContext.native.js +33 -25
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
- package/dist/cjs/contexts/GroupContext.cjs +15 -18
- package/dist/cjs/contexts/GroupContext.native.cjs +28 -0
- package/dist/cjs/contexts/GroupContext.native.js +16 -18
- package/dist/cjs/contexts/GroupContext.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +967 -1017
- package/dist/cjs/createComponent.native.cjs +1144 -0
- package/dist/cjs/createComponent.native.js +1072 -994
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createFont.cjs +41 -36
- package/dist/cjs/createFont.native.cjs +57 -0
- package/dist/cjs/createFont.native.js +44 -38
- package/dist/cjs/createFont.native.js.map +1 -1
- package/dist/cjs/createShorthands.cjs +16 -19
- package/dist/cjs/createShorthands.native.cjs +29 -0
- package/dist/cjs/createShorthands.native.js +16 -18
- package/dist/cjs/createShorthands.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +55 -0
- package/dist/cjs/createStyledHOC.native.cjs +57 -0
- package/dist/cjs/createStyledHOC.native.js +59 -0
- package/dist/cjs/createStyledHOC.native.js.map +1 -0
- package/dist/cjs/createTamagui.cjs +269 -224
- package/dist/cjs/createTamagui.native.cjs +335 -0
- package/dist/cjs/createTamagui.native.js +302 -272
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +28 -19
- package/dist/cjs/createTokens.native.cjs +47 -0
- package/dist/cjs/createTokens.native.js +33 -19
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +92 -86
- package/dist/cjs/createVariable.native.cjs +145 -0
- package/dist/cjs/createVariable.native.js +106 -100
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/createVariables.cjs +50 -60
- package/dist/cjs/createVariables.native.cjs +71 -0
- package/dist/cjs/createVariables.native.js +54 -64
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/defaultComponentState.cjs +29 -30
- package/dist/cjs/defaultComponentState.native.cjs +48 -0
- package/dist/cjs/defaultComponentState.native.js +29 -29
- package/dist/cjs/defaultComponentState.native.js.map +1 -1
- package/dist/cjs/dom/adapters.cjs +96 -0
- package/dist/cjs/dom/adapters.native.cjs +117 -0
- package/dist/cjs/dom/adapters.native.js +119 -0
- package/dist/cjs/dom/adapters.native.js.map +1 -0
- package/dist/cjs/dom/contract.cjs +17 -0
- package/dist/cjs/dom/contract.native.cjs +19 -0
- package/dist/cjs/dom/contract.native.js +21 -0
- package/dist/cjs/dom/contract.native.js.map +1 -0
- package/dist/cjs/dom/domEventProps.native.cjs +57 -0
- package/dist/cjs/dom/domEventProps.native.js +59 -0
- package/dist/cjs/dom/domEventProps.native.js.map +1 -0
- package/dist/cjs/dom/html.cjs +583 -0
- package/dist/cjs/dom/html.native.cjs +952 -0
- package/dist/cjs/dom/html.native.js +954 -0
- package/dist/cjs/dom/html.native.js.map +1 -0
- package/dist/cjs/dom/htmlRuntime.native.cjs +168 -0
- package/dist/cjs/dom/htmlRuntime.native.js +170 -0
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -0
- package/dist/cjs/dom/index.cjs +29 -0
- package/dist/cjs/dom/index.native.cjs +42 -0
- package/dist/cjs/dom/index.native.js +44 -0
- package/dist/cjs/dom/index.native.js.map +1 -0
- package/dist/cjs/dom/primitives.native.cjs +644 -0
- package/dist/cjs/dom/primitives.native.js +646 -0
- package/dist/cjs/dom/primitives.native.js.map +1 -0
- package/dist/cjs/dom/standalone.cjs +34 -0
- package/dist/cjs/dom/standalone.native.cjs +40 -0
- package/dist/cjs/dom/standalone.native.js +42 -0
- package/dist/cjs/dom/standalone.native.js.map +1 -0
- package/dist/cjs/dom/standaloneHtml.cjs +76 -0
- package/dist/cjs/dom/standaloneHtml.native.cjs +78 -0
- package/dist/cjs/dom/standaloneHtml.native.js +80 -0
- package/dist/cjs/dom/standaloneHtml.native.js.map +1 -0
- package/dist/cjs/dom/styleTypes.cjs +17 -0
- package/dist/cjs/dom/styleTypes.native.cjs +19 -0
- package/dist/cjs/dom/styleTypes.native.js +21 -0
- package/dist/cjs/dom/styleTypes.native.js.map +1 -0
- package/dist/cjs/eventDetails.cjs +39 -0
- package/dist/cjs/eventDetails.native.cjs +41 -0
- package/dist/cjs/eventDetails.native.js +43 -0
- package/dist/cjs/eventDetails.native.js.map +1 -0
- package/dist/cjs/eventHandling.cjs +30 -31
- package/dist/cjs/eventHandling.native.cjs +192 -0
- package/dist/cjs/eventHandling.native.js +159 -188
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/componentDisplayName.cjs +35 -0
- package/dist/cjs/helpers/componentDisplayName.native.cjs +37 -0
- package/dist/cjs/helpers/componentDisplayName.native.js +39 -0
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -0
- package/dist/cjs/helpers/consoleLog.native.cjs +31 -0
- package/dist/cjs/helpers/consoleLog.native.js +17 -17
- package/dist/cjs/helpers/consoleLog.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +147 -150
- package/dist/cjs/helpers/createDesignSystem.native.cjs +196 -0
- package/dist/cjs/helpers/createDesignSystem.native.js +168 -205
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.cjs +73 -84
- package/dist/cjs/helpers/createStyledContext.native.cjs +97 -0
- package/dist/cjs/helpers/createStyledContext.native.js +78 -88
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +29 -32
- package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +60 -0
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +46 -48
- package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/defaultOffset.cjs +17 -20
- package/dist/cjs/helpers/defaultOffset.native.cjs +30 -0
- package/dist/cjs/helpers/defaultOffset.native.js +17 -19
- package/dist/cjs/helpers/defaultOffset.native.js.map +1 -1
- package/dist/cjs/helpers/directStyle.cjs +940 -0
- package/dist/cjs/helpers/directStyle.native.cjs +1145 -0
- package/dist/cjs/helpers/directStyle.native.js +1147 -0
- package/dist/cjs/helpers/directStyle.native.js.map +1 -0
- package/dist/cjs/helpers/expandStyle.cjs +132 -84
- package/dist/cjs/helpers/expandStyle.native.cjs +186 -0
- package/dist/cjs/helpers/expandStyle.native.js +154 -124
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +22 -25
- package/dist/cjs/helpers/expandStyles.native.cjs +47 -0
- package/dist/cjs/helpers/expandStyles.native.js +29 -31
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/extractPseudoState.cjs +45 -0
- package/dist/cjs/helpers/extractPseudoState.native.cjs +48 -0
- package/dist/cjs/helpers/extractPseudoState.native.js +50 -0
- package/dist/cjs/helpers/extractPseudoState.native.js.map +1 -0
- package/dist/cjs/helpers/formatDiagnostic.cjs +69 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +78 -0
- package/dist/cjs/helpers/formatDiagnostic.native.js +80 -0
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -0
- package/dist/cjs/helpers/frontendProgram.cjs +44 -0
- package/dist/cjs/helpers/frontendProgram.native.cjs +50 -0
- package/dist/cjs/helpers/frontendProgram.native.js +52 -0
- package/dist/cjs/helpers/frontendProgram.native.js.map +1 -0
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +200 -190
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +38 -0
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +21 -19
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getDefaultProps.cjs +15 -33
- package/dist/cjs/helpers/getDefaultProps.native.cjs +29 -0
- package/dist/cjs/helpers/getDefaultProps.native.js +17 -33
- package/dist/cjs/helpers/getDefaultProps.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +45 -52
- package/dist/cjs/helpers/getDynamicVal.native.cjs +68 -0
- package/dist/cjs/helpers/getDynamicVal.native.js +45 -51
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.cjs +17 -30
- package/dist/cjs/helpers/getExpandedShorthands.native.cjs +32 -0
- package/dist/cjs/helpers/getExpandedShorthands.native.js +18 -30
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/cjs/helpers/getFontLanguage.cjs +15 -18
- package/dist/cjs/helpers/getFontLanguage.native.cjs +29 -0
- package/dist/cjs/helpers/getFontLanguage.native.js +17 -19
- package/dist/cjs/helpers/getFontLanguage.native.js.map +1 -1
- package/dist/cjs/helpers/getShorthandValue.cjs +17 -20
- package/dist/cjs/helpers/getShorthandValue.native.cjs +33 -0
- package/dist/cjs/helpers/getShorthandValue.native.js +19 -21
- package/dist/cjs/helpers/getShorthandValue.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +711 -894
- package/dist/cjs/helpers/getSplitStyles.native.cjs +845 -0
- package/dist/cjs/helpers/getSplitStyles.native.js +788 -926
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +106 -109
- package/dist/cjs/helpers/getThemeCSSRules.native.cjs +29 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js +16 -18
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +71 -69
- package/dist/cjs/helpers/getVariantExtras.native.cjs +90 -0
- package/dist/cjs/helpers/getVariantExtras.native.js +72 -69
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +73 -0
- package/dist/cjs/helpers/grammarConfig.native.cjs +151 -0
- package/dist/cjs/helpers/grammarConfig.native.js +153 -0
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -0
- package/dist/cjs/helpers/insertStyleRule.cjs +249 -184
- package/dist/cjs/helpers/insertStyleRule.native.cjs +159 -0
- package/dist/cjs/helpers/insertStyleRule.native.js +120 -63
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.cjs +23 -16
- package/dist/cjs/helpers/isObj.native.cjs +43 -0
- package/dist/cjs/helpers/isObj.native.js +27 -20
- package/dist/cjs/helpers/isObj.native.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.cjs +18 -21
- package/dist/cjs/helpers/isTamaguiComponent.native.cjs +30 -0
- package/dist/cjs/helpers/isTamaguiComponent.native.js +18 -20
- package/dist/cjs/helpers/isTamaguiComponent.native.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.cjs +20 -28
- package/dist/cjs/helpers/isTamaguiElement.native.cjs +37 -0
- package/dist/cjs/helpers/isTamaguiElement.native.js +20 -27
- package/dist/cjs/helpers/isTamaguiElement.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +24 -27
- package/dist/cjs/helpers/log.native.cjs +39 -0
- package/dist/cjs/helpers/log.native.js +25 -27
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.cjs +15 -18
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +156 -0
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +139 -142
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.cjs +22 -23
- package/dist/cjs/helpers/matchMedia.native.cjs +69 -0
- package/dist/cjs/helpers/matchMedia.native.js +50 -41
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mediaObjectToString.cjs +35 -38
- package/dist/cjs/helpers/mediaObjectToString.native.cjs +53 -0
- package/dist/cjs/helpers/mediaObjectToString.native.js +38 -40
- package/dist/cjs/helpers/mediaObjectToString.native.js.map +1 -1
- package/dist/cjs/helpers/mediaState.cjs +23 -43
- package/dist/cjs/helpers/mediaState.native.cjs +41 -0
- package/dist/cjs/helpers/mediaState.native.js +26 -46
- package/dist/cjs/helpers/mediaState.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.cjs +51 -63
- package/dist/cjs/helpers/mergeProps.native.cjs +69 -0
- package/dist/cjs/helpers/mergeProps.native.js +54 -70
- package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
- package/dist/cjs/helpers/mergeRenderElementProps.cjs +18 -23
- package/dist/cjs/helpers/mergeRenderElementProps.native.cjs +32 -0
- package/dist/cjs/helpers/mergeRenderElementProps.native.js +18 -22
- package/dist/cjs/helpers/mergeRenderElementProps.native.js.map +1 -1
- package/dist/cjs/helpers/mergeSlotStyleProps.cjs +35 -38
- package/dist/cjs/helpers/mergeSlotStyleProps.native.cjs +51 -0
- package/dist/cjs/helpers/mergeSlotStyleProps.native.js +35 -37
- package/dist/cjs/helpers/mergeSlotStyleProps.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +52 -41
- package/dist/cjs/helpers/mergeVariants.native.cjs +66 -0
- package/dist/cjs/helpers/mergeVariants.native.js +54 -42
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +48 -51
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +61 -0
- package/dist/cjs/helpers/nativeOnlyProps.native.js +48 -50
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeStyleEngine.cjs +209 -0
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +303 -0
- package/dist/cjs/helpers/nativeStyleEngine.native.js +305 -0
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -0
- package/dist/cjs/helpers/nativeTransitionTarget.cjs +27 -0
- package/dist/cjs/helpers/nativeTransitionTarget.native.cjs +43 -0
- package/dist/cjs/helpers/nativeTransitionTarget.native.js +45 -0
- package/dist/cjs/helpers/nativeTransitionTarget.native.js.map +1 -0
- package/dist/cjs/helpers/normalizeColor.cjs +23 -35
- package/dist/cjs/helpers/normalizeColor.native.cjs +50 -0
- package/dist/cjs/helpers/normalizeColor.native.js +33 -34
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeShadow.cjs +26 -39
- package/dist/cjs/helpers/normalizeShadow.native.cjs +42 -0
- package/dist/cjs/helpers/normalizeShadow.native.js +27 -37
- package/dist/cjs/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +45 -60
- package/dist/cjs/helpers/normalizeStyle.native.cjs +80 -0
- package/dist/cjs/helpers/normalizeStyle.native.js +63 -79
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.cjs +15 -18
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +38 -0
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +25 -27
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +42 -39
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +64 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +45 -42
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/noteOnce.cjs +32 -0
- package/dist/cjs/helpers/noteOnce.native.cjs +34 -0
- package/dist/cjs/helpers/noteOnce.native.js +36 -0
- package/dist/cjs/helpers/noteOnce.native.js.map +1 -0
- package/dist/cjs/helpers/objectIdentityKey.cjs +31 -34
- package/dist/cjs/helpers/objectIdentityKey.native.cjs +49 -0
- package/dist/cjs/helpers/objectIdentityKey.native.js +34 -37
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.cjs +16 -19
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +97 -0
- package/dist/cjs/helpers/parseBorderShorthand.native.js +84 -71
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeStyle.native.cjs +205 -0
- package/dist/cjs/helpers/parseNativeStyle.native.js +182 -165
- package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeTransform.native.cjs +68 -0
- package/dist/cjs/helpers/parseNativeTransform.native.js +70 -0
- package/dist/cjs/helpers/parseNativeTransform.native.js.map +1 -0
- package/dist/cjs/helpers/parseOutlineShorthand.cjs +16 -19
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +85 -0
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +72 -65
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/pointerEvents.cjs +15 -18
- package/dist/cjs/helpers/pointerEvents.native.cjs +132 -0
- package/dist/cjs/helpers/pointerEvents.native.js +117 -144
- package/dist/cjs/helpers/pointerEvents.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +338 -252
- package/dist/cjs/helpers/propMapper.native.cjs +506 -0
- package/dist/cjs/helpers/propMapper.native.js +475 -348
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +40 -47
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +143 -0
- package/dist/cjs/helpers/proxyThemeToParents.native.js +125 -141
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.cjs +106 -60
- package/dist/cjs/helpers/registerCSSVariable.native.cjs +144 -0
- package/dist/cjs/helpers/registerCSSVariable.native.js +122 -61
- package/dist/cjs/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/cjs/helpers/resolveAnimationDriver.cjs +28 -26
- package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +45 -0
- package/dist/cjs/helpers/resolveAnimationDriver.native.js +32 -26
- package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/resolveRem.cjs +18 -19
- package/dist/cjs/helpers/resolveRem.native.cjs +57 -0
- package/dist/cjs/helpers/resolveRem.native.js +37 -37
- package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +114 -23
- package/dist/cjs/helpers/resolveSafeArea.native.cjs +130 -0
- package/dist/cjs/helpers/resolveSafeArea.native.js +115 -29
- package/dist/cjs/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.cjs +34 -0
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.cjs +52 -0
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js +54 -0
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js.map +1 -0
- package/dist/cjs/helpers/resolveVariableValue.cjs +35 -0
- package/dist/cjs/helpers/resolveVariableValue.native.cjs +39 -0
- package/dist/cjs/helpers/resolveVariableValue.native.js +41 -0
- package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -0
- package/dist/cjs/helpers/setElementProps.cjs +17 -20
- package/dist/cjs/helpers/setElementProps.native.cjs +35 -0
- package/dist/cjs/helpers/setElementProps.native.js +22 -24
- package/dist/cjs/helpers/setElementProps.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +31 -31
- package/dist/cjs/helpers/skipProps.native.cjs +48 -0
- package/dist/cjs/helpers/skipProps.native.js +31 -30
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/sortString.cjs +15 -18
- package/dist/cjs/helpers/sortString.native.cjs +29 -0
- package/dist/cjs/helpers/sortString.native.js +17 -19
- package/dist/cjs/helpers/sortString.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +31 -0
- package/dist/cjs/helpers/styleFrontend.native.cjs +35 -0
- package/dist/cjs/helpers/styleFrontend.native.js +37 -0
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -0
- package/dist/cjs/helpers/styleOriginalValues.cjs +15 -18
- package/dist/cjs/helpers/styleOriginalValues.native.cjs +27 -0
- package/dist/cjs/helpers/styleOriginalValues.native.js +16 -18
- package/dist/cjs/helpers/styleOriginalValues.native.js.map +1 -1
- package/dist/cjs/helpers/styleProvenance.cjs +26 -27
- package/dist/cjs/helpers/styleProvenance.native.cjs +44 -0
- package/dist/cjs/helpers/styleProvenance.native.js +26 -26
- package/dist/cjs/helpers/styleProvenance.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +77 -96
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +133 -0
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +118 -140
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/themeRef.cjs +42 -0
- package/dist/cjs/helpers/themeRef.native.cjs +48 -0
- package/dist/cjs/helpers/themeRef.native.js +50 -0
- package/dist/cjs/helpers/themeRef.native.js.map +1 -0
- package/dist/cjs/helpers/themeable.cjs +76 -97
- package/dist/cjs/helpers/themeable.native.cjs +96 -0
- package/dist/cjs/helpers/themeable.native.js +76 -97
- package/dist/cjs/helpers/themeable.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +30 -34
- package/dist/cjs/helpers/themes.native.cjs +44 -0
- package/dist/cjs/helpers/themes.native.js +30 -33
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/helpers/timer.cjs +16 -21
- package/dist/cjs/helpers/timer.native.cjs +31 -0
- package/dist/cjs/helpers/timer.native.js +18 -22
- package/dist/cjs/helpers/timer.native.js.map +1 -1
- package/dist/cjs/helpers/tokenCategories.cjs +103 -0
- package/dist/cjs/helpers/tokenCategories.native.cjs +107 -0
- package/dist/cjs/helpers/tokenCategories.native.js +109 -0
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -0
- package/dist/cjs/helpers/transformsToString.cjs +25 -31
- package/dist/cjs/helpers/transformsToString.native.cjs +56 -0
- package/dist/cjs/helpers/transformsToString.native.js +42 -30
- package/dist/cjs/helpers/transformsToString.native.js.map +1 -1
- package/dist/cjs/helpers/useRenderElement.cjs +34 -39
- package/dist/cjs/helpers/useRenderElement.native.cjs +54 -0
- package/dist/cjs/helpers/useRenderElement.native.js +38 -42
- package/dist/cjs/helpers/useRenderElement.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +611 -0
- package/dist/cjs/helpers/variables.native.cjs +873 -0
- package/dist/cjs/helpers/variables.native.js +875 -0
- package/dist/cjs/helpers/variables.native.js.map +1 -0
- package/dist/cjs/helpers/warnOnce.cjs +38 -0
- package/dist/cjs/helpers/warnOnce.native.cjs +41 -0
- package/dist/cjs/helpers/warnOnce.native.js +43 -0
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -0
- package/dist/cjs/helpers/webPropsToSkip.cjs +15 -18
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +68 -0
- package/dist/cjs/helpers/webPropsToSkip.native.js +54 -62
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +45 -48
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +30 -0
- package/dist/cjs/helpers/wrapStyleTags.native.js +16 -17
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.cjs +16 -19
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.cjs +32 -0
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js +17 -19
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +61 -58
- package/dist/cjs/hooks/getThemeProxied.native.cjs +124 -0
- package/dist/cjs/hooks/getThemeProxied.native.js +98 -79
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/isOptimizedForFirstRender.cjs +28 -0
- package/dist/cjs/hooks/isOptimizedForFirstRender.native.cjs +30 -0
- package/dist/cjs/hooks/isOptimizedForFirstRender.native.js +32 -0
- package/dist/cjs/hooks/isOptimizedForFirstRender.native.js.map +1 -0
- package/dist/cjs/hooks/useAnimationDriver.cjs +46 -0
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +54 -0
- package/dist/cjs/hooks/useAnimationDriver.native.js +56 -0
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -0
- package/dist/cjs/hooks/useComponentState.cjs +215 -199
- package/dist/cjs/hooks/useComponentState.native.cjs +250 -0
- package/dist/cjs/hooks/useComponentState.native.js +225 -208
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useDisableSSR.cjs +16 -19
- package/dist/cjs/hooks/useDisableSSR.native.cjs +31 -0
- package/dist/cjs/hooks/useDisableSSR.native.js +17 -19
- package/dist/cjs/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.cjs +16 -19
- package/dist/cjs/hooks/useIsTouchDevice.native.cjs +31 -0
- package/dist/cjs/hooks/useIsTouchDevice.native.js +17 -19
- package/dist/cjs/hooks/useIsTouchDevice.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +329 -256
- package/dist/cjs/hooks/useMedia.native.cjs +532 -0
- package/dist/cjs/hooks/useMedia.native.js +481 -305
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/usePortalThemeState.cjs +41 -0
- package/dist/cjs/hooks/usePortalThemeState.native.cjs +43 -0
- package/dist/cjs/hooks/usePortalThemeState.native.js +45 -0
- package/dist/cjs/hooks/usePortalThemeState.native.js.map +1 -0
- package/dist/cjs/hooks/useProps.cjs +96 -88
- package/dist/cjs/hooks/useProps.native.cjs +134 -0
- package/dist/cjs/hooks/useProps.native.js +100 -89
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +41 -49
- package/dist/cjs/hooks/useTheme.native.cjs +65 -0
- package/dist/cjs/hooks/useTheme.native.js +44 -52
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.cjs +20 -25
- package/dist/cjs/hooks/useThemeName.native.cjs +39 -0
- package/dist/cjs/hooks/useThemeName.native.js +23 -27
- package/dist/cjs/hooks/useThemeName.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +347 -364
- package/dist/cjs/hooks/useThemeState.native.cjs +442 -0
- package/dist/cjs/hooks/useThemeState.native.js +394 -473
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +62 -45
- package/dist/cjs/index.native.cjs +144 -0
- package/dist/cjs/index.native.js +62 -44
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/inject-styles.cjs +25 -31
- package/dist/cjs/inject-styles.native.cjs +39 -0
- package/dist/cjs/inject-styles.native.js +26 -31
- package/dist/cjs/inject-styles.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +61 -61
- package/dist/cjs/insertFont.native.cjs +79 -0
- package/dist/cjs/insertFont.native.js +54 -54
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/interfaces/CSSColorNames.cjs +167 -11
- package/dist/cjs/interfaces/CSSColorNames.native.cjs +176 -0
- package/dist/cjs/interfaces/CSSColorNames.native.js +167 -10
- package/dist/cjs/interfaces/CSSColorNames.native.js.map +1 -1
- package/dist/cjs/interfaces/GetRef.cjs +10 -11
- package/dist/cjs/interfaces/GetRef.native.cjs +19 -0
- package/dist/cjs/interfaces/GetRef.native.js +10 -10
- package/dist/cjs/interfaces/GetRef.native.js.map +1 -1
- package/dist/cjs/interfaces/RNExclusiveTypes.cjs +10 -11
- package/dist/cjs/interfaces/RNExclusiveTypes.native.cjs +19 -0
- package/dist/cjs/interfaces/RNExclusiveTypes.native.js +10 -10
- package/dist/cjs/interfaces/RNExclusiveTypes.native.js.map +1 -1
- package/dist/cjs/interfaces/TamaguiComponentEvents.cjs +10 -11
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.cjs +19 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js +10 -10
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js.map +1 -1
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.cjs +10 -11
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.cjs +19 -0
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js +10 -10
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +76 -0
- package/dist/cjs/internal-runtime.native.cjs +78 -0
- package/dist/cjs/internal-runtime.native.js +80 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -0
- package/dist/cjs/internalRuntimeTypes.cjs +17 -0
- package/dist/cjs/internalRuntimeTypes.native.cjs +19 -0
- package/dist/cjs/internalRuntimeTypes.native.js +21 -0
- package/dist/cjs/internalRuntimeTypes.native.js.map +1 -0
- package/dist/cjs/setupHooks.cjs +17 -18
- package/dist/cjs/setupHooks.native.cjs +33 -0
- package/dist/cjs/setupHooks.native.js +17 -17
- package/dist/cjs/setupHooks.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +40 -41
- package/dist/cjs/setupReactNative.native.cjs +56 -0
- package/dist/cjs/setupReactNative.native.js +41 -41
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/styled.cjs +170 -141
- package/dist/cjs/styled.native.cjs +198 -0
- package/dist/cjs/styled.native.js +179 -144
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/type-utils.cjs +10 -11
- package/dist/cjs/type-utils.native.cjs +19 -0
- package/dist/cjs/type-utils.native.js +10 -10
- package/dist/cjs/type-utils.native.js.map +1 -1
- package/dist/cjs/types.cjs +40 -11
- package/dist/cjs/types.native.cjs +49 -0
- package/dist/cjs/types.native.js +40 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/ConfigRevisionCheck.cjs +69 -0
- package/dist/cjs/views/ConfigRevisionCheck.native.cjs +74 -0
- package/dist/cjs/views/ConfigRevisionCheck.native.js +76 -0
- package/dist/cjs/views/ConfigRevisionCheck.native.js.map +1 -0
- package/dist/cjs/views/Configuration.cjs +27 -35
- package/dist/cjs/views/Configuration.native.cjs +47 -0
- package/dist/cjs/views/Configuration.native.js +28 -35
- package/dist/cjs/views/Configuration.native.js.map +1 -1
- package/dist/cjs/views/FontLanguage.cjs +21 -29
- package/dist/cjs/views/FontLanguage.native.cjs +47 -0
- package/dist/cjs/views/FontLanguage.native.js +28 -38
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/SafeAreaTracker.cjs +33 -0
- package/dist/cjs/views/SafeAreaTracker.native.cjs +37 -0
- package/dist/cjs/views/SafeAreaTracker.native.js +39 -0
- package/dist/cjs/views/SafeAreaTracker.native.js.map +1 -0
- package/dist/cjs/views/Slot.cjs +52 -59
- package/dist/cjs/views/Slot.native.cjs +78 -0
- package/dist/cjs/views/Slot.native.js +53 -59
- package/dist/cjs/views/Slot.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +74 -75
- package/dist/cjs/views/TamaguiProvider.native.cjs +104 -0
- package/dist/cjs/views/TamaguiProvider.native.js +73 -75
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/TamaguiRoot.cjs +47 -61
- package/dist/cjs/views/TamaguiRoot.native.cjs +29 -0
- package/dist/cjs/views/TamaguiRoot.native.js +16 -18
- package/dist/cjs/views/TamaguiRoot.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +44 -46
- package/dist/cjs/views/Text.native.cjs +47 -0
- package/dist/cjs/views/Text.native.js +33 -37
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +141 -166
- package/dist/cjs/views/Theme.native.cjs +171 -0
- package/dist/cjs/views/Theme.native.js +138 -172
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +77 -81
- package/dist/cjs/views/ThemeDebug.native.cjs +31 -0
- package/dist/cjs/views/ThemeDebug.native.js +17 -23
- package/dist/cjs/views/ThemeDebug.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.cjs +35 -39
- package/dist/cjs/views/ThemeProvider.native.cjs +44 -0
- package/dist/cjs/views/ThemeProvider.native.js +26 -28
- package/dist/cjs/views/ThemeProvider.native.js.map +1 -1
- package/dist/cjs/views/View.cjs +21 -19
- package/dist/cjs/views/View.native.cjs +37 -0
- package/dist/cjs/views/View.native.js +22 -19
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/Tamagui.mjs +27 -27
- package/dist/esm/Tamagui.mjs.map +1 -1
- package/dist/esm/Tamagui.native.js +76 -71
- package/dist/esm/Tamagui.native.js.map +1 -1
- package/dist/esm/_withNativeStyle.mjs +55 -0
- package/dist/esm/_withNativeStyle.mjs.map +1 -0
- package/dist/esm/_withNativeStyle.native.js +58 -0
- package/dist/esm/_withNativeStyle.native.js.map +1 -0
- package/dist/esm/_withStableStyle.mjs +44 -29
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +55 -33
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +90 -100
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +115 -129
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/accessibilityDirectMap.mjs +1 -0
- package/dist/esm/constants/accessibilityDirectMap.mjs.map +1 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +1 -0
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +1 -0
- package/dist/esm/constants/constants.mjs.map +1 -1
- package/dist/esm/constants/constants.native.js +1 -0
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/constants/isDevTools.mjs +7 -6
- package/dist/esm/constants/isDevTools.mjs.map +1 -1
- package/dist/esm/constants/isDevTools.native.js +9 -8
- package/dist/esm/constants/isDevTools.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +18 -8
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +19 -9
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/contexts/GroupContext.mjs +2 -0
- package/dist/esm/contexts/GroupContext.mjs.map +1 -1
- package/dist/esm/contexts/GroupContext.native.js +3 -1
- package/dist/esm/contexts/GroupContext.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +953 -988
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +1061 -970
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createFont.mjs +27 -18
- package/dist/esm/createFont.mjs.map +1 -1
- package/dist/esm/createFont.native.js +30 -21
- package/dist/esm/createFont.native.js.map +1 -1
- package/dist/esm/createShorthands.mjs +2 -1
- package/dist/esm/createShorthands.mjs.map +1 -1
- package/dist/esm/createShorthands.native.js +2 -1
- package/dist/esm/createShorthands.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +29 -0
- package/dist/esm/createStyledHOC.mjs.map +1 -0
- package/dist/esm/createStyledHOC.native.js +29 -0
- package/dist/esm/createStyledHOC.native.js.map +1 -0
- package/dist/esm/createTamagui.mjs +256 -207
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +289 -255
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +15 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +20 -2
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +69 -60
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +83 -75
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.mjs +37 -42
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js +41 -47
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/defaultComponentState.mjs +13 -12
- package/dist/esm/defaultComponentState.mjs.map +1 -1
- package/dist/esm/defaultComponentState.native.js +13 -12
- package/dist/esm/defaultComponentState.native.js.map +1 -1
- package/dist/esm/dom/adapters.mjs +67 -0
- package/dist/esm/dom/adapters.mjs.map +1 -0
- package/dist/esm/dom/adapters.native.js +86 -0
- package/dist/esm/dom/adapters.native.js.map +1 -0
- package/dist/esm/dom/contract.mjs +0 -0
- package/dist/esm/dom/contract.native.js +0 -0
- package/dist/esm/dom/domEventProps.native.js +34 -0
- package/dist/esm/dom/domEventProps.native.js.map +1 -0
- package/dist/esm/dom/html.mjs +563 -0
- package/dist/esm/dom/html.mjs.map +1 -0
- package/dist/esm/dom/html.native.js +930 -0
- package/dist/esm/dom/html.native.js.map +1 -0
- package/dist/esm/dom/htmlRuntime.native.js +143 -0
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -0
- package/dist/esm/dom/index.mjs +4 -0
- package/dist/esm/dom/index.native.js +5 -0
- package/dist/esm/dom/primitives.native.js +610 -0
- package/dist/esm/dom/primitives.native.js.map +1 -0
- package/dist/esm/dom/standalone.mjs +10 -0
- package/dist/esm/dom/standalone.mjs.map +1 -0
- package/dist/esm/dom/standalone.native.js +14 -0
- package/dist/esm/dom/standalone.native.js.map +1 -0
- package/dist/esm/dom/standaloneHtml.mjs +56 -0
- package/dist/esm/dom/standaloneHtml.mjs.map +1 -0
- package/dist/esm/dom/standaloneHtml.native.js +56 -0
- package/dist/esm/dom/standaloneHtml.native.js.map +1 -0
- package/dist/esm/dom/styleTypes.mjs +0 -0
- package/dist/esm/dom/styleTypes.native.js +0 -0
- package/dist/esm/eventDetails.mjs +18 -0
- package/dist/esm/eventDetails.mjs.map +1 -0
- package/dist/esm/eventDetails.native.js +18 -0
- package/dist/esm/eventDetails.native.js.map +1 -0
- package/dist/esm/eventHandling.mjs +14 -13
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +141 -163
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/componentDisplayName.mjs +11 -0
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -0
- package/dist/esm/helpers/componentDisplayName.native.js +11 -0
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -0
- package/dist/esm/helpers/consoleLog.native.js +2 -1
- package/dist/esm/helpers/consoleLog.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +133 -132
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +151 -186
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +57 -58
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +62 -63
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +15 -14
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +32 -31
- package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/defaultOffset.mjs +3 -2
- package/dist/esm/helpers/defaultOffset.mjs.map +1 -1
- package/dist/esm/helpers/defaultOffset.native.js +3 -2
- package/dist/esm/helpers/defaultOffset.native.js.map +1 -1
- package/dist/esm/helpers/directStyle.mjs +907 -0
- package/dist/esm/helpers/directStyle.mjs.map +1 -0
- package/dist/esm/helpers/directStyle.native.js +1112 -0
- package/dist/esm/helpers/directStyle.native.js.map +1 -0
- package/dist/esm/helpers/expandStyle.mjs +119 -66
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +141 -107
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +9 -7
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +16 -14
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/extractPseudoState.mjs +24 -0
- package/dist/esm/helpers/extractPseudoState.mjs.map +1 -0
- package/dist/esm/helpers/extractPseudoState.native.js +25 -0
- package/dist/esm/helpers/extractPseudoState.native.js.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.mjs +48 -0
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.native.js +55 -0
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -0
- package/dist/esm/helpers/frontendProgram.mjs +20 -0
- package/dist/esm/helpers/frontendProgram.mjs.map +1 -0
- package/dist/esm/helpers/frontendProgram.native.js +24 -0
- package/dist/esm/helpers/frontendProgram.native.js.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +186 -173
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +5 -3
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getDefaultProps.mjs +2 -16
- package/dist/esm/helpers/getDefaultProps.mjs.map +1 -1
- package/dist/esm/helpers/getDefaultProps.native.js +3 -16
- package/dist/esm/helpers/getDefaultProps.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +28 -33
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +28 -33
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.mjs +5 -12
- package/dist/esm/helpers/getExpandedShorthands.mjs.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.native.js +6 -13
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/esm/helpers/getFontLanguage.mjs +2 -1
- package/dist/esm/helpers/getFontLanguage.mjs.map +1 -1
- package/dist/esm/helpers/getFontLanguage.native.js +3 -2
- package/dist/esm/helpers/getFontLanguage.native.js.map +1 -1
- package/dist/esm/helpers/getShorthandValue.mjs +4 -2
- package/dist/esm/helpers/getShorthandValue.mjs.map +1 -1
- package/dist/esm/helpers/getShorthandValue.native.js +6 -4
- package/dist/esm/helpers/getShorthandValue.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +695 -868
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +773 -899
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +94 -92
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.native.js +2 -1
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +57 -52
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +58 -53
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +53 -0
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -0
- package/dist/esm/helpers/grammarConfig.native.js +129 -0
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -0
- package/dist/esm/helpers/insertStyleRule.mjs +228 -160
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +61 -24
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.mjs +10 -2
- package/dist/esm/helpers/isObj.mjs.map +1 -1
- package/dist/esm/helpers/isObj.native.js +13 -6
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.mjs +4 -3
- package/dist/esm/helpers/isTamaguiComponent.mjs.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.native.js +4 -3
- package/dist/esm/helpers/isTamaguiComponent.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.mjs +4 -2
- package/dist/esm/helpers/isTamaguiElement.mjs.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.native.js +4 -2
- package/dist/esm/helpers/isTamaguiElement.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +11 -9
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +12 -10
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.mjs +1 -0
- package/dist/esm/helpers/mainThreadPressEvents.mjs.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +126 -125
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.mjs +7 -6
- package/dist/esm/helpers/matchMedia.mjs.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +36 -25
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mediaObjectToString.mjs +21 -20
- package/dist/esm/helpers/mediaObjectToString.mjs.map +1 -1
- package/dist/esm/helpers/mediaObjectToString.native.js +24 -23
- package/dist/esm/helpers/mediaObjectToString.native.js.map +1 -1
- package/dist/esm/helpers/mediaState.mjs +7 -24
- package/dist/esm/helpers/mediaState.mjs.map +1 -1
- package/dist/esm/helpers/mediaState.native.js +9 -27
- package/dist/esm/helpers/mediaState.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.mjs +37 -47
- package/dist/esm/helpers/mergeProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +39 -54
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/mergeRenderElementProps.mjs +5 -5
- package/dist/esm/helpers/mergeRenderElementProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeRenderElementProps.native.js +5 -5
- package/dist/esm/helpers/mergeRenderElementProps.native.js.map +1 -1
- package/dist/esm/helpers/mergeSlotStyleProps.mjs +22 -20
- package/dist/esm/helpers/mergeSlotStyleProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeSlotStyleProps.native.js +22 -20
- package/dist/esm/helpers/mergeSlotStyleProps.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +39 -23
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +41 -25
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +34 -33
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +34 -33
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.mjs +178 -0
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -0
- package/dist/esm/helpers/nativeStyleEngine.native.js +270 -0
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -0
- package/dist/esm/helpers/nativeTransitionTarget.mjs +6 -0
- package/dist/esm/helpers/nativeTransitionTarget.mjs.map +1 -0
- package/dist/esm/helpers/nativeTransitionTarget.native.js +21 -0
- package/dist/esm/helpers/nativeTransitionTarget.native.js.map +1 -0
- package/dist/esm/helpers/normalizeColor.mjs +11 -18
- package/dist/esm/helpers/normalizeColor.mjs.map +1 -1
- package/dist/esm/helpers/normalizeColor.native.js +19 -19
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeShadow.mjs +13 -21
- package/dist/esm/helpers/normalizeShadow.mjs.map +1 -1
- package/dist/esm/helpers/normalizeShadow.native.js +14 -20
- package/dist/esm/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +32 -42
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +50 -62
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStylePropKeys.mjs +1 -0
- package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +11 -10
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +29 -21
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +32 -25
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/noteOnce.mjs +11 -0
- package/dist/esm/helpers/noteOnce.mjs.map +1 -0
- package/dist/esm/helpers/noteOnce.native.js +11 -0
- package/dist/esm/helpers/noteOnce.native.js.map +1 -0
- package/dist/esm/helpers/objectIdentityKey.mjs +18 -17
- package/dist/esm/helpers/objectIdentityKey.mjs.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +20 -20
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.mjs +2 -1
- package/dist/esm/helpers/parseBorderShorthand.mjs.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +70 -54
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeStyle.native.js +166 -146
- package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeTransform.native.js +45 -0
- package/dist/esm/helpers/parseNativeTransform.native.js.map +1 -0
- package/dist/esm/helpers/parseOutlineShorthand.mjs +2 -1
- package/dist/esm/helpers/parseOutlineShorthand.mjs.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +58 -48
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/pointerEvents.mjs +1 -0
- package/dist/esm/helpers/pointerEvents.mjs.map +1 -1
- package/dist/esm/helpers/pointerEvents.native.js +104 -127
- package/dist/esm/helpers/pointerEvents.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +325 -234
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +462 -332
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +25 -30
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +110 -125
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.mjs +84 -39
- package/dist/esm/helpers/registerCSSVariable.mjs.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.native.js +103 -44
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.mjs +14 -8
- package/dist/esm/helpers/resolveAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.native.js +18 -9
- package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/resolveRem.mjs +3 -2
- package/dist/esm/helpers/resolveRem.mjs.map +1 -1
- package/dist/esm/helpers/resolveRem.native.js +23 -21
- package/dist/esm/helpers/resolveRem.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +101 -9
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.native.js +101 -15
- package/dist/esm/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeAreaVariable.mjs +10 -0
- package/dist/esm/helpers/resolveSafeAreaVariable.mjs.map +1 -0
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js +27 -0
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.mjs +15 -0
- package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.native.js +17 -0
- package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -0
- package/dist/esm/helpers/setElementProps.mjs +4 -2
- package/dist/esm/helpers/setElementProps.mjs.map +1 -1
- package/dist/esm/helpers/setElementProps.native.js +8 -7
- package/dist/esm/helpers/setElementProps.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +18 -13
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +18 -13
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/sortString.mjs +1 -0
- package/dist/esm/helpers/sortString.mjs.map +1 -1
- package/dist/esm/helpers/sortString.native.js +3 -2
- package/dist/esm/helpers/sortString.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +6 -0
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -0
- package/dist/esm/helpers/styleFrontend.native.js +8 -0
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -0
- package/dist/esm/helpers/styleOriginalValues.mjs +2 -1
- package/dist/esm/helpers/styleOriginalValues.mjs.map +1 -1
- package/dist/esm/helpers/styleOriginalValues.native.js +2 -1
- package/dist/esm/helpers/styleOriginalValues.native.js.map +1 -1
- package/dist/esm/helpers/styleProvenance.mjs +10 -9
- package/dist/esm/helpers/styleProvenance.mjs.map +1 -1
- package/dist/esm/helpers/styleProvenance.native.js +10 -9
- package/dist/esm/helpers/styleProvenance.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +64 -78
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +105 -123
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/themeRef.mjs +17 -0
- package/dist/esm/helpers/themeRef.mjs.map +1 -0
- package/dist/esm/helpers/themeRef.native.js +21 -0
- package/dist/esm/helpers/themeRef.native.js.map +1 -0
- package/dist/esm/helpers/themeable.mjs +59 -71
- package/dist/esm/helpers/themeable.mjs.map +1 -1
- package/dist/esm/helpers/themeable.native.js +61 -73
- package/dist/esm/helpers/themeable.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +17 -16
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +17 -16
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/timer.mjs +9 -5
- package/dist/esm/helpers/timer.mjs.map +1 -1
- package/dist/esm/helpers/timer.native.js +9 -5
- package/dist/esm/helpers/timer.native.js.map +1 -1
- package/dist/esm/helpers/tokenCategories.mjs +80 -0
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -0
- package/dist/esm/helpers/tokenCategories.native.js +82 -0
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -0
- package/dist/esm/helpers/transformsToString.mjs +12 -13
- package/dist/esm/helpers/transformsToString.mjs.map +1 -1
- package/dist/esm/helpers/transformsToString.native.js +29 -13
- package/dist/esm/helpers/transformsToString.native.js.map +1 -1
- package/dist/esm/helpers/useRenderElement.mjs +19 -19
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js +24 -24
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +581 -0
- package/dist/esm/helpers/variables.mjs.map +1 -0
- package/dist/esm/helpers/variables.native.js +841 -0
- package/dist/esm/helpers/variables.native.js.map +1 -0
- package/dist/esm/helpers/warnOnce.mjs +14 -0
- package/dist/esm/helpers/warnOnce.mjs.map +1 -0
- package/dist/esm/helpers/warnOnce.native.js +15 -0
- package/dist/esm/helpers/warnOnce.native.js.map +1 -0
- package/dist/esm/helpers/webPropsToSkip.mjs +1 -0
- package/dist/esm/helpers/webPropsToSkip.mjs.map +1 -1
- package/dist/esm/helpers/webPropsToSkip.native.js +41 -45
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +32 -30
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -0
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/doesRootSchemeMatchSystem.mjs +2 -1
- package/dist/esm/hooks/doesRootSchemeMatchSystem.mjs.map +1 -1
- package/dist/esm/hooks/doesRootSchemeMatchSystem.native.js +4 -2
- package/dist/esm/hooks/doesRootSchemeMatchSystem.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +47 -40
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +85 -62
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/isOptimizedForFirstRender.mjs +8 -0
- package/dist/esm/hooks/isOptimizedForFirstRender.mjs.map +1 -0
- package/dist/esm/hooks/isOptimizedForFirstRender.native.js +8 -0
- package/dist/esm/hooks/isOptimizedForFirstRender.native.js.map +1 -0
- package/dist/esm/hooks/useAnimationDriver.mjs +20 -0
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -0
- package/dist/esm/hooks/useAnimationDriver.native.js +26 -0
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -0
- package/dist/esm/hooks/useComponentState.mjs +202 -181
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +212 -191
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useDisableSSR.mjs +3 -1
- package/dist/esm/hooks/useDisableSSR.mjs.map +1 -1
- package/dist/esm/hooks/useDisableSSR.native.js +4 -2
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.mjs +3 -1
- package/dist/esm/hooks/useIsTouchDevice.mjs.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.native.js +4 -2
- package/dist/esm/hooks/useIsTouchDevice.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +310 -231
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +462 -281
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/usePortalThemeState.mjs +21 -0
- package/dist/esm/hooks/usePortalThemeState.mjs.map +1 -0
- package/dist/esm/hooks/usePortalThemeState.native.js +21 -0
- package/dist/esm/hooks/usePortalThemeState.native.js.map +1 -0
- package/dist/esm/hooks/useProps.mjs +78 -62
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +82 -64
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +27 -32
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +30 -36
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeName.mjs +7 -7
- package/dist/esm/hooks/useThemeName.mjs.map +1 -1
- package/dist/esm/hooks/useThemeName.native.js +10 -10
- package/dist/esm/hooks/useThemeName.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +324 -345
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +370 -454
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +145 -72
- package/dist/esm/index.mjs +145 -72
- package/dist/esm/index.native.js +145 -72
- package/dist/esm/inject-styles.mjs +11 -13
- package/dist/esm/inject-styles.mjs.map +1 -1
- package/dist/esm/inject-styles.native.js +12 -14
- package/dist/esm/inject-styles.native.js.map +1 -1
- package/dist/esm/insertFont.mjs +44 -41
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +37 -35
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/interfaces/CSSColorNames.mjs +151 -0
- package/dist/esm/interfaces/CSSColorNames.mjs.map +1 -1
- package/dist/esm/interfaces/CSSColorNames.native.js +151 -0
- package/dist/esm/interfaces/CSSColorNames.native.js.map +1 -1
- package/dist/esm/interfaces/GetRef.mjs +0 -2
- package/dist/esm/interfaces/GetRef.native.js +0 -2
- package/dist/esm/interfaces/RNExclusiveTypes.mjs +0 -2
- package/dist/esm/interfaces/RNExclusiveTypes.native.js +0 -2
- package/dist/esm/interfaces/TamaguiComponentEvents.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js +0 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +0 -2
- package/dist/esm/internal-runtime.mjs +45 -0
- package/dist/esm/internal-runtime.mjs.map +1 -0
- package/dist/esm/internal-runtime.native.js +45 -0
- package/dist/esm/internal-runtime.native.js.map +1 -0
- package/dist/esm/internalRuntimeTypes.mjs +0 -0
- package/dist/esm/internalRuntimeTypes.native.js +0 -0
- package/dist/esm/setupHooks.mjs +2 -1
- package/dist/esm/setupHooks.mjs.map +1 -1
- package/dist/esm/setupHooks.native.js +2 -1
- package/dist/esm/setupHooks.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +26 -23
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +27 -24
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/styled.mjs +156 -126
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +164 -129
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/type-utils.mjs +0 -2
- package/dist/esm/type-utils.native.js +0 -2
- package/dist/esm/types.mjs +21 -0
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +21 -0
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/ConfigRevisionCheck.mjs +43 -0
- package/dist/esm/views/ConfigRevisionCheck.mjs.map +1 -0
- package/dist/esm/views/ConfigRevisionCheck.native.js +46 -0
- package/dist/esm/views/ConfigRevisionCheck.native.js.map +1 -0
- package/dist/esm/views/Configuration.mjs +11 -9
- package/dist/esm/views/Configuration.mjs.map +1 -1
- package/dist/esm/views/Configuration.native.js +13 -11
- package/dist/esm/views/Configuration.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.mjs +8 -11
- package/dist/esm/views/FontLanguage.mjs.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +13 -14
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/SafeAreaTracker.mjs +9 -0
- package/dist/esm/views/SafeAreaTracker.mjs.map +1 -0
- package/dist/esm/views/SafeAreaTracker.native.js +12 -0
- package/dist/esm/views/SafeAreaTracker.native.js.map +1 -0
- package/dist/esm/views/Slot.mjs +39 -44
- package/dist/esm/views/Slot.mjs.map +1 -1
- package/dist/esm/views/Slot.native.js +41 -46
- package/dist/esm/views/Slot.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +58 -49
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +56 -50
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/TamaguiRoot.mjs +31 -35
- package/dist/esm/views/TamaguiRoot.mjs.map +1 -1
- package/dist/esm/views/TamaguiRoot.native.js +2 -1
- package/dist/esm/views/TamaguiRoot.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +32 -32
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +19 -23
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +123 -144
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +120 -151
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +64 -63
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeDebug.native.js +3 -6
- package/dist/esm/views/ThemeDebug.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs +21 -20
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +12 -10
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/dist/esm/views/View.mjs +9 -5
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +9 -5
- package/dist/esm/views/View.native.js.map +1 -1
- package/internal-runtime/index.cjs +2 -0
- package/internal-runtime/index.js +4 -0
- package/internal-runtime/index.native.js +2 -0
- package/package.json +47 -15
- package/reset.css +1 -9
- package/src/_withNativeStyle.tsx +84 -0
- package/src/_withStableStyle.tsx +61 -43
- package/src/config.ts +26 -35
- package/src/contexts/ComponentContext.tsx +25 -8
- package/src/createComponent.tsx +482 -160
- package/src/createStyledHOC.tsx +88 -0
- package/src/createTamagui.ts +125 -78
- package/src/createTokens.ts +16 -0
- package/src/createVariable.ts +17 -2
- package/src/createVariables.ts +5 -17
- package/src/dom/adapters.ts +99 -0
- package/src/dom/contract.ts +60 -0
- package/src/dom/domEventProps.native.ts +40 -0
- package/src/dom/html.native.tsx +1405 -0
- package/src/dom/html.tsx +979 -0
- package/src/dom/htmlRuntime.native.tsx +220 -0
- package/src/dom/index.native.ts +28 -0
- package/src/dom/index.ts +16 -0
- package/src/dom/primitives.native.tsx +667 -0
- package/src/dom/standalone.ts +107 -0
- package/src/dom/standaloneHtml.ts +104 -0
- package/src/dom/styleTypes.ts +637 -0
- package/src/eventDetails.ts +85 -0
- package/src/eventHandling.native.ts +16 -16
- package/src/helpers/componentDisplayName.ts +14 -0
- package/src/helpers/createDesignSystem.ts +127 -87
- package/src/helpers/createStyledContext.tsx +87 -7
- package/src/helpers/directStyle.ts +1746 -0
- package/src/helpers/expandStyle.ts +17 -2
- package/src/helpers/extractPseudoState.ts +32 -0
- package/src/helpers/formatDiagnostic.ts +68 -0
- package/src/helpers/frontendProgram.ts +48 -0
- package/src/helpers/getCSSStylesAtomic.native.ts +1 -0
- package/src/helpers/getCSSStylesAtomic.ts +154 -95
- package/src/helpers/getDefaultProps.ts +1 -26
- package/src/helpers/getExpandedShorthands.ts +0 -17
- package/src/helpers/getSplitStyles.tsx +757 -1019
- package/src/helpers/getThemeCSSRules.ts +16 -1
- package/src/helpers/getVariantExtras.tsx +23 -8
- package/src/helpers/grammarConfig.ts +78 -0
- package/src/helpers/insertStyleRule.tsx +97 -19
- package/src/helpers/isObj.ts +8 -0
- package/src/helpers/isTamaguiComponent.tsx +2 -5
- package/src/helpers/isTamaguiElement.tsx +2 -3
- package/src/helpers/matchMedia.native.ts +16 -1
- package/src/helpers/mediaState.ts +4 -33
- package/src/helpers/mergeProps.ts +2 -32
- package/src/helpers/mergeVariants.ts +39 -17
- package/src/helpers/nativeStyleEngine.ts +291 -0
- package/src/helpers/nativeTransitionTarget.native.ts +22 -0
- package/src/helpers/nativeTransitionTarget.ts +6 -0
- package/src/helpers/normalizeColor.native.ts +2 -3
- package/src/helpers/normalizeColor.ts +4 -14
- package/src/helpers/normalizeShadow.native.ts +1 -1
- package/src/helpers/normalizeStyle.ts +1 -15
- package/src/helpers/normalizeValueWithProperty.ts +10 -1
- package/src/helpers/noteOnce.ts +9 -0
- package/src/helpers/{parseNativeStyle.ts → parseNativeStyle.native.ts} +50 -10
- package/src/helpers/parseNativeTransform.native.ts +35 -0
- package/src/helpers/propMapper.ts +347 -134
- package/src/helpers/registerCSSVariable.ts +80 -10
- package/src/helpers/resolveAnimationDriver.ts +16 -13
- package/src/helpers/resolveSafeArea.native.ts +90 -10
- package/src/helpers/resolveSafeArea.ts +113 -7
- package/src/helpers/resolveSafeAreaVariable.native.ts +28 -0
- package/src/helpers/resolveSafeAreaVariable.ts +10 -0
- package/src/helpers/resolveVariableValue.ts +31 -0
- package/src/helpers/skipProps.ts +8 -2
- package/src/helpers/styleFrontend.ts +104 -0
- package/src/helpers/styleProvenance.ts +17 -2
- package/src/helpers/themeRef.ts +34 -0
- package/src/helpers/themeable.tsx +4 -12
- package/src/helpers/themes.ts +9 -10
- package/src/helpers/tokenCategories.ts +104 -0
- package/src/helpers/transformsToString.ts +18 -16
- package/src/helpers/variables.ts +901 -0
- package/src/helpers/warnOnce.ts +47 -0
- package/src/helpers/webPropsToSkip.native.ts +7 -8
- package/src/helpers/wrapStyleTags.tsx +3 -1
- package/src/hooks/getThemeProxied.ts +136 -101
- package/src/hooks/isOptimizedForFirstRender.native.ts +7 -0
- package/src/hooks/isOptimizedForFirstRender.ts +7 -0
- package/src/hooks/useAnimationDriver.ts +37 -0
- package/src/hooks/useComponentState.ts +99 -24
- package/src/hooks/useMedia.tsx +260 -119
- package/src/hooks/usePortalThemeState.ts +34 -0
- package/src/hooks/useProps.tsx +34 -10
- package/src/hooks/useTheme.tsx +19 -6
- package/src/hooks/useThemeState.ts +204 -129
- package/src/index.ts +32 -6
- package/src/insertFont.ts +4 -4
- package/src/interfaces/CSSColorNames.tsx +152 -149
- package/src/interfaces/RNExclusiveTypes.ts +1 -0
- package/src/interfaces/TamaguiComponentEvents.tsx +0 -1
- package/src/interfaces/TamaguiComponentPropsBaseBase.tsx +2 -4
- package/src/internal-runtime.ts +107 -0
- package/src/internalRuntimeTypes.ts +22 -0
- package/src/setupHooks.ts +9 -1
- package/src/styled.tsx +302 -175
- package/src/types.tsx +650 -471
- package/src/views/ConfigRevisionCheck.tsx +55 -0
- package/src/views/SafeAreaTracker.native.tsx +10 -0
- package/src/views/SafeAreaTracker.tsx +7 -0
- package/src/views/Slot.tsx +3 -2
- package/src/views/TamaguiProvider.tsx +21 -8
- package/src/views/Text.tsx +15 -10
- package/src/views/Theme.tsx +112 -41
- package/src/views/ThemeDebug.tsx +0 -1
- package/src/views/ThemeProvider.tsx +6 -5
- package/src/views/View.tsx +16 -7
- package/types/Tamagui.d.ts.map +1 -1
- package/types/_withNativeStyle.d.ts +5 -0
- package/types/_withNativeStyle.d.ts.map +1 -0
- package/types/_withStableStyle.d.ts +1 -1
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/config.d.ts +22 -32
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +1 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createFont.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +4 -0
- package/types/createStyledHOC.d.ts.map +1 -0
- package/types/createTamagui.d.ts +2 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/createVariables.d.ts.map +1 -1
- package/types/dom/adapters.d.ts +42 -0
- package/types/dom/adapters.d.ts.map +1 -0
- package/types/dom/contract.d.ts +48 -0
- package/types/dom/contract.d.ts.map +1 -0
- package/types/dom/domEventProps.native.d.ts +7 -0
- package/types/dom/domEventProps.native.d.ts.map +1 -0
- package/types/dom/html.d.ts +54 -0
- package/types/dom/html.d.ts.map +1 -0
- package/types/dom/html.native.d.ts +63 -0
- package/types/dom/html.native.d.ts.map +1 -0
- package/types/dom/htmlRuntime.native.d.ts +63 -0
- package/types/dom/htmlRuntime.native.d.ts.map +1 -0
- package/types/dom/index.d.ts +11 -0
- package/types/dom/index.d.ts.map +1 -0
- package/types/dom/index.native.d.ts +12 -0
- package/types/dom/index.native.d.ts.map +1 -0
- package/types/dom/primitives.native.d.ts +43 -0
- package/types/dom/primitives.native.d.ts.map +1 -0
- package/types/dom/standalone.d.ts +89 -0
- package/types/dom/standalone.d.ts.map +1 -0
- package/types/dom/standaloneHtml.d.ts +67 -0
- package/types/dom/standaloneHtml.d.ts.map +1 -0
- package/types/dom/styleTypes.d.ts +494 -0
- package/types/dom/styleTypes.d.ts.map +1 -0
- package/types/eventDetails.d.ts +12 -0
- package/types/eventDetails.d.ts.map +1 -0
- package/types/helpers/componentDisplayName.d.ts +5 -0
- package/types/helpers/componentDisplayName.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts +24 -6
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts +29 -2
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/defaultOffset.d.ts.map +1 -1
- package/types/helpers/directStyle.d.ts +35 -0
- package/types/helpers/directStyle.d.ts.map +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/extractPseudoState.d.ts +14 -0
- package/types/helpers/extractPseudoState.d.ts.map +1 -0
- package/types/helpers/formatDiagnostic.d.ts +2 -0
- package/types/helpers/formatDiagnostic.d.ts.map +1 -0
- package/types/helpers/frontendProgram.d.ts +10 -0
- package/types/helpers/frontendProgram.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +3 -4
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +6 -3
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getDefaultProps.d.ts +1 -1
- package/types/helpers/getDefaultProps.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts +1 -1
- package/types/helpers/getExpandedShorthands.d.ts +0 -5
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -1
- package/types/helpers/getFontLanguage.d.ts.map +1 -1
- package/types/helpers/getShorthandValue.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +5 -5
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +9 -0
- package/types/helpers/grammarConfig.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +3 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/isObj.d.ts +1 -0
- package/types/helpers/isObj.d.ts.map +1 -1
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -1
- package/types/helpers/isTamaguiElement.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts.map +1 -1
- package/types/helpers/mediaState.d.ts +1 -2
- package/types/helpers/mediaState.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +0 -2
- package/types/helpers/mergeProps.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeStyleEngine.d.ts +69 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -0
- package/types/helpers/nativeTransitionTarget.d.ts +3 -0
- package/types/helpers/nativeTransitionTarget.d.ts.map +1 -0
- package/types/helpers/nativeTransitionTarget.native.d.ts +3 -0
- package/types/helpers/nativeTransitionTarget.native.d.ts.map +1 -0
- package/types/helpers/normalizeColor.d.ts +0 -6
- package/types/helpers/normalizeColor.d.ts.map +1 -1
- package/types/helpers/normalizeColor.native.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/normalizeStylePropKeys.native.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/noteOnce.d.ts +2 -0
- package/types/helpers/noteOnce.d.ts.map +1 -0
- package/types/helpers/{parseNativeStyle.d.ts → parseNativeStyle.native.d.ts} +1 -1
- package/types/helpers/parseNativeStyle.native.d.ts.map +1 -0
- package/types/helpers/parseNativeTransform.native.d.ts +2 -0
- package/types/helpers/parseNativeTransform.native.d.ts.map +1 -0
- package/types/helpers/propMapper.d.ts +2 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/registerCSSVariable.d.ts +12 -0
- package/types/helpers/registerCSSVariable.d.ts.map +1 -1
- package/types/helpers/resolveAnimationDriver.d.ts +4 -4
- package/types/helpers/resolveAnimationDriver.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +2 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.native.d.ts +2 -1
- package/types/helpers/resolveSafeArea.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeAreaVariable.d.ts +3 -0
- package/types/helpers/resolveSafeAreaVariable.d.ts.map +1 -0
- package/types/helpers/resolveSafeAreaVariable.native.d.ts +3 -0
- package/types/helpers/resolveSafeAreaVariable.native.d.ts.map +1 -0
- package/types/helpers/resolveVariableValue.d.ts +3 -0
- package/types/helpers/resolveVariableValue.d.ts.map +1 -0
- package/types/helpers/setElementProps.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +3 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/sortString.d.ts +1 -1
- package/types/helpers/sortString.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +87 -0
- package/types/helpers/styleFrontend.d.ts.map +1 -0
- package/types/helpers/styleProvenance.d.ts +14 -1
- package/types/helpers/styleProvenance.d.ts.map +1 -1
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/helpers/themeRef.d.ts +22 -0
- package/types/helpers/themeRef.d.ts.map +1 -0
- package/types/helpers/themeable.d.ts +1 -1
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/tokenCategories.d.ts +5 -0
- package/types/helpers/tokenCategories.d.ts.map +1 -0
- package/types/helpers/transformsToString.d.ts.map +1 -1
- package/types/helpers/variables.d.ts +90 -0
- package/types/helpers/variables.d.ts.map +1 -0
- package/types/helpers/warnOnce.d.ts +20 -0
- package/types/helpers/warnOnce.d.ts.map +1 -0
- package/types/helpers/webPropsToSkip.native.d.ts +63 -62
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/isOptimizedForFirstRender.d.ts +2 -0
- package/types/hooks/isOptimizedForFirstRender.d.ts.map +1 -0
- package/types/hooks/isOptimizedForFirstRender.native.d.ts +2 -0
- package/types/hooks/isOptimizedForFirstRender.native.d.ts.map +1 -0
- package/types/hooks/useAnimationDriver.d.ts +7 -0
- package/types/hooks/useAnimationDriver.d.ts.map +1 -0
- package/types/hooks/useComponentState.d.ts +5 -4
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +13 -7
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/usePortalThemeState.d.ts +15 -0
- package/types/hooks/usePortalThemeState.d.ts.map +1 -0
- package/types/hooks/useProps.d.ts +1 -3
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts +26 -3
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +14 -7
- package/types/index.d.ts.map +1 -1
- package/types/inject-styles.d.ts.map +1 -1
- package/types/interfaces/CSSColorNames.d.ts +2 -1
- package/types/interfaces/CSSColorNames.d.ts.map +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
- package/types/interfaces/TamaguiComponentEvents.d.ts +0 -1
- package/types/interfaces/TamaguiComponentEvents.d.ts.map +1 -1
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts +2 -4
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +33 -0
- package/types/internal-runtime.d.ts.map +1 -0
- package/types/internalRuntimeTypes.d.ts +16 -0
- package/types/internalRuntimeTypes.d.ts.map +1 -0
- package/types/setupHooks.d.ts +1 -1
- package/types/setupHooks.d.ts.map +1 -1
- package/types/styled.d.ts +47 -12
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +392 -231
- package/types/types.d.ts.map +1 -1
- package/types/views/ConfigRevisionCheck.d.ts +6 -0
- package/types/views/ConfigRevisionCheck.d.ts.map +1 -0
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +4 -4
- package/types/views/FontLanguage.d.ts.map +1 -1
- package/types/views/FontLanguage.native.d.ts +2 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/SafeAreaTracker.d.ts +3 -0
- package/types/views/SafeAreaTracker.d.ts.map +1 -0
- package/types/views/SafeAreaTracker.native.d.ts +3 -0
- package/types/views/SafeAreaTracker.native.d.ts.map +1 -0
- package/types/views/Slot.d.ts +7 -7
- package/types/views/Slot.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +2 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/TamaguiRoot.d.ts +1 -1
- package/types/views/TamaguiRoot.d.ts.map +1 -1
- package/types/views/Text.d.ts +6 -2
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts +16 -8
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/View.d.ts +8 -2
- package/types/views/View.d.ts.map +1 -1
- package/.turbo/turbo-build.log +0 -2
- package/.turbo/turbo-test$colon$web.log +0 -25
- package/dist/cjs/animationDriverTypes.test-d.cjs +0 -77
- package/dist/cjs/animationDriverTypes.test-d.native.js +0 -80
- package/dist/cjs/animationDriverTypes.test-d.native.js.map +0 -1
- package/dist/cjs/helpers/createMediaStyle.cjs +0 -127
- package/dist/cjs/helpers/createMediaStyle.native.js +0 -140
- package/dist/cjs/helpers/createMediaStyle.native.js.map +0 -1
- package/dist/cjs/helpers/getGroupPropParts.cjs +0 -54
- package/dist/cjs/helpers/getGroupPropParts.native.js +0 -59
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +0 -1
- package/dist/cjs/helpers/getTokenForKey.cjs +0 -174
- package/dist/cjs/helpers/getTokenForKey.native.js +0 -186
- package/dist/cjs/helpers/getTokenForKey.native.js.map +0 -1
- package/dist/cjs/helpers/isActivePlatform.cjs +0 -40
- package/dist/cjs/helpers/isActivePlatform.native.js +0 -43
- package/dist/cjs/helpers/isActivePlatform.native.js.map +0 -1
- package/dist/cjs/helpers/isActiveTheme.cjs +0 -31
- package/dist/cjs/helpers/isActiveTheme.native.js +0 -34
- package/dist/cjs/helpers/isActiveTheme.native.js.map +0 -1
- package/dist/cjs/helpers/parseNativeStyle.cjs +0 -167
- package/dist/cjs/helpers/platformResolveValue.cjs +0 -38
- package/dist/cjs/helpers/platformResolveValue.native.js +0 -74
- package/dist/cjs/helpers/platformResolveValue.native.js.map +0 -1
- package/dist/cjs/helpers/proxyThemeVariables.cjs +0 -38
- package/dist/cjs/helpers/proxyThemeVariables.native.js +0 -43
- package/dist/cjs/helpers/proxyThemeVariables.native.js.map +0 -1
- package/dist/cjs/helpers/pseudoDescriptors.cjs +0 -82
- package/dist/cjs/helpers/pseudoDescriptors.native.js +0 -85
- package/dist/cjs/helpers/pseudoDescriptors.native.js.map +0 -1
- package/dist/cjs/helpers/pseudoTransitions.cjs +0 -83
- package/dist/cjs/helpers/pseudoTransitions.native.js +0 -88
- package/dist/cjs/helpers/pseudoTransitions.native.js.map +0 -1
- package/dist/cjs/helpers/resolveCompoundTokens.cjs +0 -41
- package/dist/cjs/helpers/resolveCompoundTokens.native.js +0 -44
- package/dist/cjs/helpers/resolveCompoundTokens.native.js.map +0 -1
- package/dist/cjs/opacityModifier.test-d.cjs +0 -36
- package/dist/cjs/opacityModifier.test-d.native.js +0 -39
- package/dist/cjs/opacityModifier.test-d.native.js.map +0 -1
- package/dist/cjs/styledHtml.test-d.cjs +0 -187
- package/dist/cjs/styledHtml.test-d.native.js +0 -190
- package/dist/cjs/styledHtml.test-d.native.js.map +0 -1
- package/dist/cjs/styledNonStyleProps.test-d.cjs +0 -63
- package/dist/cjs/styledNonStyleProps.test-d.native.js +0 -66
- package/dist/cjs/styledNonStyleProps.test-d.native.js.map +0 -1
- package/dist/esm/animationDriverTypes.test-d.mjs +0 -78
- package/dist/esm/animationDriverTypes.test-d.mjs.map +0 -1
- package/dist/esm/animationDriverTypes.test-d.native.js +0 -78
- package/dist/esm/animationDriverTypes.test-d.native.js.map +0 -1
- package/dist/esm/helpers/createMediaStyle.mjs +0 -100
- package/dist/esm/helpers/createMediaStyle.mjs.map +0 -1
- package/dist/esm/helpers/createMediaStyle.native.js +0 -110
- package/dist/esm/helpers/createMediaStyle.native.js.map +0 -1
- package/dist/esm/helpers/getGroupPropParts.mjs +0 -29
- package/dist/esm/helpers/getGroupPropParts.mjs.map +0 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +0 -31
- package/dist/esm/helpers/getGroupPropParts.native.js.map +0 -1
- package/dist/esm/helpers/getTokenForKey.mjs +0 -146
- package/dist/esm/helpers/getTokenForKey.mjs.map +0 -1
- package/dist/esm/helpers/getTokenForKey.native.js +0 -155
- package/dist/esm/helpers/getTokenForKey.native.js.map +0 -1
- package/dist/esm/helpers/isActivePlatform.mjs +0 -14
- package/dist/esm/helpers/isActivePlatform.mjs.map +0 -1
- package/dist/esm/helpers/isActivePlatform.native.js +0 -14
- package/dist/esm/helpers/isActivePlatform.native.js.map +0 -1
- package/dist/esm/helpers/isActiveTheme.mjs +0 -6
- package/dist/esm/helpers/isActiveTheme.mjs.map +0 -1
- package/dist/esm/helpers/isActiveTheme.native.js +0 -6
- package/dist/esm/helpers/isActiveTheme.native.js.map +0 -1
- package/dist/esm/helpers/parseNativeStyle.mjs +0 -142
- package/dist/esm/helpers/parseNativeStyle.mjs.map +0 -1
- package/dist/esm/helpers/platformResolveValue.mjs +0 -13
- package/dist/esm/helpers/platformResolveValue.mjs.map +0 -1
- package/dist/esm/helpers/platformResolveValue.native.js +0 -46
- package/dist/esm/helpers/platformResolveValue.native.js.map +0 -1
- package/dist/esm/helpers/proxyThemeVariables.mjs +0 -13
- package/dist/esm/helpers/proxyThemeVariables.mjs.map +0 -1
- package/dist/esm/helpers/proxyThemeVariables.native.js +0 -15
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +0 -1
- package/dist/esm/helpers/pseudoDescriptors.mjs +0 -54
- package/dist/esm/helpers/pseudoDescriptors.mjs.map +0 -1
- package/dist/esm/helpers/pseudoDescriptors.native.js +0 -54
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +0 -1
- package/dist/esm/helpers/pseudoTransitions.mjs +0 -57
- package/dist/esm/helpers/pseudoTransitions.mjs.map +0 -1
- package/dist/esm/helpers/pseudoTransitions.native.js +0 -59
- package/dist/esm/helpers/pseudoTransitions.native.js.map +0 -1
- package/dist/esm/helpers/resolveCompoundTokens.mjs +0 -16
- package/dist/esm/helpers/resolveCompoundTokens.mjs.map +0 -1
- package/dist/esm/helpers/resolveCompoundTokens.native.js +0 -16
- package/dist/esm/helpers/resolveCompoundTokens.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/interfaces/GetRef.mjs.map +0 -1
- package/dist/esm/interfaces/GetRef.native.js.map +0 -1
- package/dist/esm/interfaces/RNExclusiveTypes.mjs.map +0 -1
- package/dist/esm/interfaces/RNExclusiveTypes.native.js.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentEvents.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +0 -1
- package/dist/esm/opacityModifier.test-d.mjs +0 -37
- package/dist/esm/opacityModifier.test-d.mjs.map +0 -1
- package/dist/esm/opacityModifier.test-d.native.js +0 -37
- package/dist/esm/opacityModifier.test-d.native.js.map +0 -1
- package/dist/esm/styledHtml.test-d.mjs +0 -188
- package/dist/esm/styledHtml.test-d.mjs.map +0 -1
- package/dist/esm/styledHtml.test-d.native.js +0 -188
- package/dist/esm/styledHtml.test-d.native.js.map +0 -1
- package/dist/esm/styledNonStyleProps.test-d.mjs +0 -64
- package/dist/esm/styledNonStyleProps.test-d.mjs.map +0 -1
- package/dist/esm/styledNonStyleProps.test-d.native.js +0 -64
- package/dist/esm/styledNonStyleProps.test-d.native.js.map +0 -1
- package/dist/esm/type-utils.mjs.map +0 -1
- package/dist/esm/type-utils.native.js.map +0 -1
- package/src/animationDriverTypes.test-d.ts +0 -332
- package/src/helpers/createMediaStyle.ts +0 -167
- package/src/helpers/getGroupPropParts.ts +0 -46
- package/src/helpers/getTokenForKey.ts +0 -236
- package/src/helpers/isActivePlatform.ts +0 -43
- package/src/helpers/isActiveTheme.ts +0 -4
- package/src/helpers/platformResolveValue.native.ts +0 -75
- package/src/helpers/platformResolveValue.ts +0 -26
- package/src/helpers/proxyThemeVariables.tsx +0 -13
- package/src/helpers/pseudoDescriptors.ts +0 -74
- package/src/helpers/pseudoTransitions.ts +0 -97
- package/src/helpers/resolveCompoundTokens.ts +0 -28
- package/src/opacityModifier.test-d.ts +0 -65
- package/src/styledHtml.test-d.ts +0 -286
- package/src/styledNonStyleProps.test-d.ts +0 -106
- package/tsconfig.json +0 -44
- package/tsconfig.test.json +0 -9
- package/types/helpers/createMediaStyle.d.ts +0 -5
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/getGroupPropParts.d.ts +0 -7
- package/types/helpers/getGroupPropParts.d.ts.map +0 -1
- package/types/helpers/getTokenForKey.d.ts +0 -6
- package/types/helpers/getTokenForKey.d.ts.map +0 -1
- package/types/helpers/isActivePlatform.d.ts +0 -16
- package/types/helpers/isActivePlatform.d.ts.map +0 -1
- package/types/helpers/isActiveTheme.d.ts +0 -2
- package/types/helpers/isActiveTheme.d.ts.map +0 -1
- package/types/helpers/parseNativeStyle.d.ts.map +0 -1
- package/types/helpers/platformResolveValue.d.ts +0 -6
- package/types/helpers/platformResolveValue.d.ts.map +0 -1
- package/types/helpers/platformResolveValue.native.d.ts +0 -7
- package/types/helpers/platformResolveValue.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts +0 -2
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/pseudoDescriptors.d.ts +0 -51
- package/types/helpers/pseudoDescriptors.d.ts.map +0 -1
- package/types/helpers/pseudoTransitions.d.ts +0 -29
- package/types/helpers/pseudoTransitions.d.ts.map +0 -1
- package/types/helpers/resolveCompoundTokens.d.ts +0 -9
- package/types/helpers/resolveCompoundTokens.d.ts.map +0 -1
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.ts +0 -14
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getPlatformDriver,
|
|
3
|
-
isAndroid,
|
|
4
|
-
isClient,
|
|
5
|
-
isWeb,
|
|
6
|
-
supportsDynamicColorIOS,
|
|
7
|
-
useIsomorphicLayoutEffect,
|
|
8
|
-
} from '@tamagui/constants'
|
|
1
|
+
import { isAndroid, isClient, isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
9
2
|
import {
|
|
10
3
|
StyleObjectIdentifier,
|
|
11
4
|
StyleObjectProperty,
|
|
12
5
|
StyleObjectPseudo,
|
|
13
6
|
StyleObjectRules,
|
|
14
7
|
nonAnimatableStyleProps,
|
|
8
|
+
stylePropsAll,
|
|
15
9
|
stylePropsText,
|
|
16
10
|
stylePropsTransform,
|
|
17
|
-
tokenCategories,
|
|
18
|
-
validPseudoKeys,
|
|
19
11
|
validStyles as validStylesView,
|
|
20
12
|
} from '@tamagui/helpers'
|
|
21
13
|
import React from 'react'
|
|
22
|
-
import { getConfig, getFont, getSetting } from '../config'
|
|
23
|
-
import { isDevTools } from '../constants/isDevTools'
|
|
24
14
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from '../
|
|
30
|
-
import { mediaState as globalMediaState
|
|
15
|
+
STYLE_FRONTEND_PASSTHROUGH_PREFIX,
|
|
16
|
+
STYLE_FRONTEND_PREPROCESSED,
|
|
17
|
+
} from './styleFrontend'
|
|
18
|
+
import { getConfig, getFont } from '../config'
|
|
19
|
+
import { isDevTools } from '../constants/isDevTools'
|
|
20
|
+
import { mediaState as globalMediaState } from './mediaState'
|
|
31
21
|
import type {
|
|
32
22
|
AllGroupContexts,
|
|
33
23
|
AnimationDriver,
|
|
24
|
+
AnimationDriverLike,
|
|
34
25
|
ClassNamesObject,
|
|
35
26
|
ComponentContextI,
|
|
36
27
|
DebugProp,
|
|
37
28
|
GetStyleResult,
|
|
38
29
|
GetStyleState,
|
|
39
|
-
|
|
30
|
+
GenericCompoundVariant,
|
|
40
31
|
RulesToInsert,
|
|
41
32
|
SpaceTokens,
|
|
42
33
|
SplitStyleProps,
|
|
@@ -46,50 +37,58 @@ import type {
|
|
|
46
37
|
TamaguiInternalConfig,
|
|
47
38
|
TextStyle,
|
|
48
39
|
ThemeParsed,
|
|
49
|
-
|
|
40
|
+
TransitionProp,
|
|
41
|
+
ViewStyleObject,
|
|
50
42
|
} from '../types'
|
|
51
|
-
import { createMediaStyle } from './createMediaStyle'
|
|
52
43
|
import { fixStyles } from './expandStyles'
|
|
53
|
-
import {
|
|
44
|
+
import { getCSSStyleAtomic, styleToCSS } from './getCSSStylesAtomic'
|
|
54
45
|
import { getDefaultProps } from './getDefaultProps'
|
|
55
|
-
import {
|
|
56
|
-
extractValueFromDynamic,
|
|
57
|
-
getDynamicVal,
|
|
58
|
-
getOppositeScheme,
|
|
59
|
-
isColorStyleKey,
|
|
60
|
-
} from './getDynamicVal'
|
|
61
|
-
import { getGroupPropParts } from './getGroupPropParts'
|
|
62
46
|
import { insertStyleRules, shouldInsertStyleRules, updateRules } from './insertStyleRule'
|
|
63
|
-
import {
|
|
64
|
-
import { isActiveTheme } from './isActiveTheme'
|
|
47
|
+
import { isPlainObject } from './isObj'
|
|
65
48
|
import { log } from './log'
|
|
66
49
|
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
67
|
-
import { propMapper } from './propMapper'
|
|
50
|
+
import { appendFlatClause, propMapper } from './propMapper'
|
|
68
51
|
import {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
clearDirectStyle,
|
|
53
|
+
contributeStyleValue,
|
|
54
|
+
contributeStyleString,
|
|
55
|
+
contributeVariantClauseValue,
|
|
56
|
+
directStyleSignature,
|
|
57
|
+
flushDirectStyles,
|
|
58
|
+
getDirectDynamicThemeAccess,
|
|
59
|
+
} from './directStyle'
|
|
60
|
+
import { contributeFrontendProgram, isFrontendProgram } from './frontendProgram'
|
|
74
61
|
import { skipProps } from './skipProps'
|
|
75
62
|
import { sortString } from './sortString'
|
|
76
63
|
import { styleOriginalValues } from './styleOriginalValues'
|
|
77
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
type StyleDebugReceipt,
|
|
66
|
+
type StyleTokenProvenance,
|
|
67
|
+
setStyleTokenProvenance,
|
|
68
|
+
} from './styleProvenance'
|
|
78
69
|
import { transformsToString } from './transformsToString'
|
|
79
70
|
|
|
80
71
|
export { styleOriginalValues }
|
|
81
72
|
export { getStyleTokenProvenance, STYLE_TOKEN_PROVENANCE_KEY } from './styleProvenance'
|
|
82
|
-
export type {
|
|
73
|
+
export type {
|
|
74
|
+
StyleDebugReceipt,
|
|
75
|
+
StyleDebugTier,
|
|
76
|
+
StyleTokenBinding,
|
|
77
|
+
StyleTokenProvenance,
|
|
78
|
+
} from './styleProvenance'
|
|
83
79
|
|
|
84
80
|
export type SplitStyles = ReturnType<typeof getSplitStyles>
|
|
85
81
|
|
|
86
82
|
const shouldTrackStyleTokenProvenance =
|
|
87
83
|
process.env.NODE_ENV === 'development' &&
|
|
88
84
|
process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === '1'
|
|
85
|
+
const validComponentClassName = /^[A-Za-z_][A-Za-z0-9_-]*$/
|
|
89
86
|
|
|
90
87
|
export type SplitStyleResult = ReturnType<typeof getSplitStyles>
|
|
91
88
|
|
|
92
|
-
|
|
89
|
+
// note: we intentionally don't cache conf at module level here
|
|
90
|
+
// because createTamagui may be called multiple times (HMR, tests)
|
|
91
|
+
// and getConfig() already has its own caching
|
|
93
92
|
|
|
94
93
|
type StyleSplitter = (
|
|
95
94
|
props: { [key: string]: any },
|
|
@@ -106,69 +105,195 @@ type StyleSplitter = (
|
|
|
106
105
|
startedUnhydrated?: boolean,
|
|
107
106
|
debug?: DebugProp,
|
|
108
107
|
// resolved animation driver (respects animatedBy prop)
|
|
109
|
-
animationDriver?:
|
|
108
|
+
animationDriver?: AnimationDriverLike | null
|
|
110
109
|
) => null | GetStyleResult
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
function compoundMatcherMatches(expected: any, actual: any) {
|
|
112
|
+
if (Array.isArray(expected)) {
|
|
113
|
+
return expected.some((value) => Object.is(value, actual))
|
|
114
|
+
}
|
|
115
|
+
return Object.is(expected, actual)
|
|
116
|
+
}
|
|
113
117
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
function compoundVariantMatches(
|
|
119
|
+
compoundVariant: GenericCompoundVariant,
|
|
120
|
+
props: Record<string, any>
|
|
121
|
+
) {
|
|
122
|
+
for (const key in compoundVariant) {
|
|
123
|
+
if (key === 'style') continue
|
|
124
|
+
if (!compoundMatcherMatches(compoundVariant[key], props[key])) {
|
|
125
|
+
return false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return true
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
type OrderedPropEntry = readonly [string, any]
|
|
132
|
+
|
|
133
|
+
// Styled defaults computed once per static config. mergeComponentProps replaces
|
|
134
|
+
// defaults at the prop level, but flat programs merge per clause slot: either a
|
|
135
|
+
// conditioned default or a conditioned prop therefore needs the displaced
|
|
136
|
+
// styled value re-injected at the styled-base position. This is what preserves
|
|
137
|
+
// `styled(View, { flexDirection: 'row' })` under `sm:column`.
|
|
138
|
+
const styledDefaultsCache = new WeakMap<object, OrderedPropEntry[] | null>()
|
|
139
|
+
|
|
140
|
+
function getStyledDefaults(staticConfig: StaticConfig): OrderedPropEntry[] | null {
|
|
141
|
+
let entries = styledDefaultsCache.get(staticConfig)
|
|
142
|
+
if (entries === undefined) {
|
|
143
|
+
entries = null
|
|
144
|
+
const defaults = staticConfig.defaultProps
|
|
145
|
+
if (defaults) {
|
|
146
|
+
for (const key in defaults) {
|
|
147
|
+
;(entries ||= []).push([key, defaults[key]])
|
|
148
|
+
}
|
|
130
149
|
}
|
|
150
|
+
styledDefaultsCache.set(staticConfig, entries)
|
|
131
151
|
}
|
|
132
|
-
return
|
|
152
|
+
return entries
|
|
133
153
|
}
|
|
134
154
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// hasMedia,
|
|
141
|
-
// fontFamily: styleState.fontFamily,
|
|
142
|
-
// viewProps: {
|
|
143
|
-
// children: props.children,
|
|
144
|
-
// },
|
|
145
|
-
// style: {
|
|
146
|
-
// borderColor: props.borderColor,
|
|
147
|
-
// borderWidth: props.borderWidth,
|
|
148
|
-
// padding: props.padding,
|
|
149
|
-
// },
|
|
150
|
-
// pseudos,
|
|
151
|
-
// classNames,
|
|
152
|
-
// rulesToInsert,
|
|
153
|
-
// dynamicThemeAccess,
|
|
154
|
-
// }
|
|
155
|
-
|
|
156
|
-
function isValidStyleKey(
|
|
157
|
-
key: string,
|
|
158
|
-
validStyles: Record<string, boolean>,
|
|
159
|
-
accept?: Record<string, any>
|
|
155
|
+
function contributeDisplacedStyledDefaults(
|
|
156
|
+
styledDefaults: OrderedPropEntry[] | null,
|
|
157
|
+
processedProps: Record<string, any>,
|
|
158
|
+
shorthands: Record<string, string>,
|
|
159
|
+
contribute: (key: string, value: any) => void
|
|
160
160
|
) {
|
|
161
|
-
|
|
161
|
+
if (!styledDefaults) return
|
|
162
|
+
for (let index = 0; index < styledDefaults.length; index++) {
|
|
163
|
+
const key = styledDefaults[index][0]
|
|
164
|
+
const styledValue = styledDefaults[index][1]
|
|
165
|
+
const propValue = processedProps[key]
|
|
166
|
+
if (!(key in stylePropsAll) && !(key in shorthands)) continue
|
|
167
|
+
// equal means the default flowed through the merge untouched and will be
|
|
168
|
+
// processed as an ordinary prop entry; different means a call-site value
|
|
169
|
+
// displaced it. Re-injection is only needed when either contribution is a
|
|
170
|
+
// program; ordinary values retain the prop-level fast path.
|
|
171
|
+
if (
|
|
172
|
+
propValue !== undefined &&
|
|
173
|
+
propValue !== styledValue &&
|
|
174
|
+
((typeof styledValue === 'string' && styledValue.includes(':')) ||
|
|
175
|
+
(typeof propValue === 'string' && propValue.includes(':')))
|
|
176
|
+
) {
|
|
177
|
+
contribute(key, styledValue)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
162
180
|
}
|
|
163
181
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Walks every style contribution in authored forward order and hands each one
|
|
184
|
+
* to `contribute`, without building an intermediate list.
|
|
185
|
+
*
|
|
186
|
+
* Order is base style, then any styled default a call-site value displaced,
|
|
187
|
+
* then the props. That is the cascade: last writer wins, so the props must come
|
|
188
|
+
* last.
|
|
189
|
+
*
|
|
190
|
+
* The common case touches each source object exactly once and allocates
|
|
191
|
+
* nothing. Only compound variants need a materialised list, because a matching
|
|
192
|
+
* compound has to run immediately after the LAST prop that selected it, and
|
|
193
|
+
* that anchor is not known until the props have been indexed.
|
|
194
|
+
*/
|
|
195
|
+
function forEachPropInForwardOrder(
|
|
196
|
+
processedProps: Record<string, any>,
|
|
197
|
+
staticConfig: StaticConfig,
|
|
198
|
+
shorthands: Record<string, string>,
|
|
199
|
+
contribute: (key: string, value: any) => void
|
|
200
|
+
) {
|
|
201
|
+
const processedBaseStyle = staticConfig.baseStyle
|
|
202
|
+
const compoundVariants = staticConfig.compoundVariants
|
|
203
|
+
const styledDefaults = getStyledDefaults(staticConfig)
|
|
204
|
+
|
|
205
|
+
if (!compoundVariants?.length) {
|
|
206
|
+
if (processedBaseStyle) {
|
|
207
|
+
for (const key in processedBaseStyle) contribute(key, processedBaseStyle[key])
|
|
208
|
+
}
|
|
209
|
+
contributeDisplacedStyledDefaults(
|
|
210
|
+
styledDefaults,
|
|
211
|
+
processedProps,
|
|
212
|
+
shorthands,
|
|
213
|
+
contribute
|
|
214
|
+
)
|
|
215
|
+
for (const key in processedProps) contribute(key, processedProps[key])
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// compound path: needs indexed prop entries to resolve each compound's anchor
|
|
220
|
+
const propEntries = Object.entries(processedProps) as OrderedPropEntry[]
|
|
221
|
+
const orderedEntries = processedBaseStyle
|
|
222
|
+
? (Object.entries(processedBaseStyle) as OrderedPropEntry[])
|
|
223
|
+
: []
|
|
224
|
+
contributeDisplacedStyledDefaults(styledDefaults, processedProps, shorthands, (k, v) =>
|
|
225
|
+
orderedEntries.push([k, v])
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
// Compounds are ordinary contributions in the same authored forward pass. A
|
|
229
|
+
// matching compound runs immediately after its last selector entry, then any
|
|
230
|
+
// later prop/style/className is free to override it. Never collect variants,
|
|
231
|
+
// compounds, or caller values into precedence tiers.
|
|
232
|
+
const compoundsByAnchor = new Map<number, OrderedPropEntry[]>()
|
|
233
|
+
for (const compoundVariant of compoundVariants) {
|
|
234
|
+
if (!compoundVariantMatches(compoundVariant, processedProps)) {
|
|
235
|
+
continue
|
|
236
|
+
}
|
|
237
|
+
const { style } = compoundVariant
|
|
238
|
+
if (!isPlainObject(style)) {
|
|
239
|
+
continue
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
let anchor = -1
|
|
243
|
+
for (const selectorKey in compoundVariant) {
|
|
244
|
+
if (selectorKey === 'style') continue
|
|
245
|
+
for (let index = propEntries.length - 1; index >= 0; index--) {
|
|
246
|
+
if (propEntries[index][0] === selectorKey) {
|
|
247
|
+
anchor = Math.max(anchor, index)
|
|
248
|
+
break
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const entries = compoundsByAnchor.get(anchor) || []
|
|
254
|
+
for (const key in style) {
|
|
255
|
+
entries.push([key, style[key]])
|
|
256
|
+
}
|
|
257
|
+
compoundsByAnchor.set(anchor, entries)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
for (let index = 0; index < orderedEntries.length; index++) {
|
|
261
|
+
contribute(orderedEntries[index][0], orderedEntries[index][1])
|
|
262
|
+
}
|
|
263
|
+
const beforeProps = compoundsByAnchor.get(-1)
|
|
264
|
+
if (beforeProps) {
|
|
265
|
+
for (let index = 0; index < beforeProps.length; index++) {
|
|
266
|
+
contribute(beforeProps[index][0], beforeProps[index][1])
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
for (let index = 0; index < propEntries.length; index++) {
|
|
270
|
+
contribute(propEntries[index][0], propEntries[index][1])
|
|
271
|
+
const compounds = compoundsByAnchor.get(index)
|
|
272
|
+
if (compounds) {
|
|
273
|
+
for (let i = 0; i < compounds.length; i++)
|
|
274
|
+
contribute(compounds[i][0], compounds[i][1])
|
|
275
|
+
}
|
|
170
276
|
}
|
|
171
|
-
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// exported so the compiler applies the SAME host-validity decision when it
|
|
280
|
+
// flattens: a style-shaped key that fails this check must be dropped with a
|
|
281
|
+
// diagnostic, never kept as a DOM attribute (one predicate, two hosts)
|
|
282
|
+
export function isValidStyleKey(
|
|
283
|
+
key: string,
|
|
284
|
+
validStyles: Record<string, boolean>,
|
|
285
|
+
accept?: Record<string, any>
|
|
286
|
+
) {
|
|
287
|
+
return Boolean(
|
|
288
|
+
key in validStyles ||
|
|
289
|
+
(isWeb &&
|
|
290
|
+
(key === 'transitionProperty' ||
|
|
291
|
+
key === 'transitionDuration' ||
|
|
292
|
+
key === 'transitionTimingFunction' ||
|
|
293
|
+
key === 'transitionDelay' ||
|
|
294
|
+
key === 'transitionBehavior')) ||
|
|
295
|
+
(accept && key in accept)
|
|
296
|
+
)
|
|
172
297
|
}
|
|
173
298
|
|
|
174
299
|
export const getSplitStyles: StyleSplitter = (
|
|
@@ -186,12 +311,22 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
186
311
|
debug,
|
|
187
312
|
animationDriver
|
|
188
313
|
) => {
|
|
189
|
-
conf =
|
|
314
|
+
const conf = getConfig()
|
|
315
|
+
// a frontend-bound component resolves its static style input (class-string
|
|
316
|
+
// base, string variants) through its own descriptor; implementations memoize
|
|
317
|
+
// per (staticConfig, config). components without a descriptor pay one read.
|
|
318
|
+
if (staticConfig.styleFrontend?.normalizeStaticConfig) {
|
|
319
|
+
staticConfig = staticConfig.styleFrontend.normalizeStaticConfig(
|
|
320
|
+
staticConfig as any,
|
|
321
|
+
conf
|
|
322
|
+
) as StaticConfig
|
|
323
|
+
}
|
|
190
324
|
// use passed animationDriver or fall back to context/config
|
|
191
325
|
const driver =
|
|
192
326
|
animationDriver ||
|
|
193
327
|
componentContext?.animationDriver ||
|
|
194
|
-
(conf.animations as
|
|
328
|
+
(conf.animations as AnimationDriverLike)
|
|
329
|
+
const resolvedDriver = driver?.isStub ? null : (driver as AnimationDriver | null)
|
|
195
330
|
|
|
196
331
|
if (props.passThrough) {
|
|
197
332
|
return null
|
|
@@ -215,7 +350,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
215
350
|
variants,
|
|
216
351
|
isReactNative,
|
|
217
352
|
inlineProps,
|
|
218
|
-
inlineWhenUnflattened,
|
|
219
353
|
parentStaticConfig,
|
|
220
354
|
acceptsClassName,
|
|
221
355
|
} = staticConfig
|
|
@@ -223,21 +357,26 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
223
357
|
const viewProps: GetStyleResult['viewProps'] = {}
|
|
224
358
|
const mediaState = styleProps.mediaState || globalMediaState
|
|
225
359
|
|
|
226
|
-
|
|
360
|
+
let shouldDoClasses = acceptsClassName && isWeb && !styleProps.noClass
|
|
227
361
|
|
|
228
362
|
const rulesToInsert: RulesToInsert =
|
|
229
363
|
process.env.TAMAGUI_TARGET === 'native' ? (undefined as any) : {}
|
|
230
364
|
const classNames: ClassNamesObject = {}
|
|
231
365
|
|
|
232
366
|
let space: SpaceTokens | null = props.space
|
|
233
|
-
let pseudos: PseudoStyles | null = null
|
|
234
367
|
let hasMedia: boolean | Set<string> = false
|
|
235
|
-
let dynamicThemeAccess: boolean | undefined
|
|
236
368
|
let pseudoGroups: Set<string> | undefined
|
|
237
369
|
let mediaGroups: Set<string> | undefined
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
370
|
+
// the frontend's normalizeStaticConfig partitions unclaimed styled-base
|
|
371
|
+
// classes into passthroughClassName (baseStyle holds styles only). they are
|
|
372
|
+
// the base's raw-interop className at the earliest forward position:
|
|
373
|
+
// prepend them and flip the cascade-preserving switch so every later
|
|
374
|
+
// Tamagui contribution keeps its last-wins position inline, exactly as a
|
|
375
|
+
// className prop does mid-loop
|
|
376
|
+
let className = staticConfig.passthroughClassName || ''
|
|
377
|
+
if (className) {
|
|
378
|
+
shouldDoClasses = false
|
|
379
|
+
}
|
|
241
380
|
const validStyles =
|
|
242
381
|
staticConfig.validStyles ||
|
|
243
382
|
(staticConfig.isText || staticConfig.isInput ? stylePropsText : validStylesView)
|
|
@@ -262,12 +401,16 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
262
401
|
staticConfig,
|
|
263
402
|
style: null,
|
|
264
403
|
theme,
|
|
265
|
-
usedKeys: {},
|
|
266
404
|
viewProps,
|
|
267
405
|
context: componentContext,
|
|
268
406
|
debug,
|
|
407
|
+
flatRulesToInsert: rulesToInsert,
|
|
408
|
+
flatShouldDoClasses: shouldDoClasses,
|
|
409
|
+
flatThemeName: themeName,
|
|
410
|
+
flatMediaState: mediaState,
|
|
411
|
+
flatGroupContext: groupContext,
|
|
269
412
|
// resolved animation driver (respects animatedBy prop)
|
|
270
|
-
animationDriver:
|
|
413
|
+
animationDriver: resolvedDriver,
|
|
271
414
|
}
|
|
272
415
|
|
|
273
416
|
// only used by compiler
|
|
@@ -310,17 +453,80 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
310
453
|
}
|
|
311
454
|
|
|
312
455
|
const { asChild } = props
|
|
313
|
-
const { accept } = staticConfig
|
|
456
|
+
const { accept, neverSkipProps } = staticConfig
|
|
314
457
|
const { noSkip, disableExpandShorthands, noExpand, styledContext } = styleProps
|
|
458
|
+
|
|
459
|
+
// frontend preprocessing runs once per render: createComponent already ran the
|
|
460
|
+
// descriptor's preprocessProps and marked the result, so this only fires for
|
|
461
|
+
// direct callers (tests, non-component paths), which self-process exactly once
|
|
462
|
+
let processedProps: Record<string, any>
|
|
463
|
+
const styleFrontend = staticConfig.styleFrontend
|
|
464
|
+
if (styleFrontend && !(props as any)[STYLE_FRONTEND_PREPROCESSED]) {
|
|
465
|
+
processedProps = styleFrontend.preprocessProps(props, conf)
|
|
466
|
+
} else {
|
|
467
|
+
processedProps = props
|
|
468
|
+
}
|
|
315
469
|
const { webContainerType } = conf.settings
|
|
316
470
|
const parentVariants = parentStaticConfig?.variants
|
|
317
|
-
|
|
471
|
+
|
|
472
|
+
const mergeStylePropAtCurrentPosition = (styleProp: any) => {
|
|
473
|
+
if (styleProps.noMergeStyle || !styleProp) return
|
|
474
|
+
if (isHOC) {
|
|
475
|
+
viewProps.style = normalizeStyle(styleProp)
|
|
476
|
+
return
|
|
477
|
+
}
|
|
478
|
+
const isArray = Array.isArray(styleProp)
|
|
479
|
+
const length = isArray ? styleProp.length : 1
|
|
480
|
+
for (let index = 0; index < length; index++) {
|
|
481
|
+
const style = isArray ? styleProp[index] : styleProp
|
|
482
|
+
if (!style) continue
|
|
483
|
+
if (style['$$css']) {
|
|
484
|
+
for (const key in style) clearDirectStyle(styleState, key)
|
|
485
|
+
Object.assign(styleState.classNames, style)
|
|
486
|
+
continue
|
|
487
|
+
}
|
|
488
|
+
const normalized = normalizeStyle(style)
|
|
489
|
+
const styleOriginals = shouldTrackStyleTokenProvenance
|
|
490
|
+
? styleOriginalValues.get(style)
|
|
491
|
+
: undefined
|
|
492
|
+
for (const key in normalized) {
|
|
493
|
+
if (normalized[key] == null) continue
|
|
494
|
+
contributeStyleValue(
|
|
495
|
+
styleState,
|
|
496
|
+
key,
|
|
497
|
+
normalized[key],
|
|
498
|
+
mergeStyle,
|
|
499
|
+
styleOriginals?.[key]
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
const flushForwardStylesToClasses = () => {
|
|
506
|
+
if (!shouldDoClasses) return
|
|
507
|
+
flushDirectStyles(styleState, true)
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// ONE forward pass over the props. the body is a closure so base style,
|
|
511
|
+
// displaced styled defaults and the props themselves feed it directly from
|
|
512
|
+
// their own objects — nothing is copied into an intermediate list first.
|
|
513
|
+
const contributeProp = (keyOg: string, valOg: any) => {
|
|
318
514
|
let keyInit = keyOg
|
|
319
|
-
let valInit =
|
|
515
|
+
let valInit = valOg
|
|
516
|
+
|
|
517
|
+
if (styleFrontend && keyInit.startsWith(STYLE_FRONTEND_PASSTHROUGH_PREFIX)) {
|
|
518
|
+
keyInit = 'className'
|
|
519
|
+
}
|
|
320
520
|
|
|
321
521
|
if (keyInit === 'children') {
|
|
322
522
|
viewProps[keyInit] = valInit
|
|
323
|
-
|
|
523
|
+
return
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (keyInit === 'ref') {
|
|
527
|
+
// ref is composed and assigned explicitly onto viewProps in createComponent;
|
|
528
|
+
// never forward the incoming ref through the style split onto the host element
|
|
529
|
+
return
|
|
324
530
|
}
|
|
325
531
|
|
|
326
532
|
// native: data-* attributes never become native props (they're stripped
|
|
@@ -332,7 +538,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
332
538
|
keyInit[0] === 'd' &&
|
|
333
539
|
keyInit.startsWith('data-')
|
|
334
540
|
) {
|
|
335
|
-
|
|
541
|
+
return
|
|
336
542
|
}
|
|
337
543
|
|
|
338
544
|
if (
|
|
@@ -344,7 +550,19 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
344
550
|
}
|
|
345
551
|
|
|
346
552
|
if (process.env.NODE_ENV === 'test' && keyInit === 'jestAnimatedStyle') {
|
|
347
|
-
|
|
553
|
+
return
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (
|
|
557
|
+
process.env.TAMAGUI_TARGET === 'native' &&
|
|
558
|
+
(keyInit === 'transition' ||
|
|
559
|
+
keyInit === 'transitionProperty' ||
|
|
560
|
+
keyInit === 'transitionDuration' ||
|
|
561
|
+
keyInit === 'transitionTimingFunction' ||
|
|
562
|
+
keyInit === 'transitionDelay' ||
|
|
563
|
+
keyInit === 'transitionBehavior')
|
|
564
|
+
) {
|
|
565
|
+
return
|
|
348
566
|
}
|
|
349
567
|
|
|
350
568
|
// for custom accept sub-styles
|
|
@@ -356,7 +574,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
356
574
|
typeof valInit === 'object'
|
|
357
575
|
) {
|
|
358
576
|
viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass)
|
|
359
|
-
|
|
577
|
+
return
|
|
360
578
|
}
|
|
361
579
|
}
|
|
362
580
|
|
|
@@ -367,7 +585,27 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
367
585
|
}
|
|
368
586
|
}
|
|
369
587
|
|
|
370
|
-
if (keyInit === 'className')
|
|
588
|
+
if (keyInit === 'className') {
|
|
589
|
+
if (typeof valInit === 'string' && valInit) {
|
|
590
|
+
// core className is raw interop: the string passes through untouched.
|
|
591
|
+
// a frontend-bound component's claimed candidates were already consumed
|
|
592
|
+
// by preprocessProps, so what remains here is passthrough CSS emitted
|
|
593
|
+
// after the base Tamagui layer — keep subsequent Tamagui contributions
|
|
594
|
+
// inline so they retain their later, last-wins cascade position
|
|
595
|
+
className = `${className} ${valInit}`.trim()
|
|
596
|
+
if (styleFrontend) {
|
|
597
|
+
flushForwardStylesToClasses()
|
|
598
|
+
shouldDoClasses = false
|
|
599
|
+
styleState.flatShouldDoClasses = false
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (keyInit === 'style') {
|
|
606
|
+
mergeStylePropAtCurrentPosition(valInit)
|
|
607
|
+
return
|
|
608
|
+
}
|
|
371
609
|
|
|
372
610
|
// when asChild, skip default props - they shouldn't be passed down to children
|
|
373
611
|
if (asChild) {
|
|
@@ -376,13 +614,13 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
376
614
|
// check both original key and expanded key (after shorthand expansion)
|
|
377
615
|
const defaultVal = defaults[keyOg] ?? defaults[keyInit]
|
|
378
616
|
if (defaultVal !== undefined && valInit === defaultVal) {
|
|
379
|
-
|
|
617
|
+
return
|
|
380
618
|
}
|
|
381
619
|
}
|
|
382
620
|
}
|
|
383
621
|
|
|
384
622
|
// keyInit === 'style' is handled in skipProps
|
|
385
|
-
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
623
|
+
if (keyInit in skipProps && !noSkip && !isHOC && !neverSkipProps?.[keyInit]) {
|
|
386
624
|
if (keyInit === 'group') {
|
|
387
625
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
388
626
|
// add container style
|
|
@@ -400,6 +638,21 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
400
638
|
addStyleToInsertRules(rulesToInsert, containerCSS)
|
|
401
639
|
}
|
|
402
640
|
}
|
|
641
|
+
if (keyInit === 'container' && valInit) {
|
|
642
|
+
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
643
|
+
// the boolean container shorthand: establish an unnamed inline-size
|
|
644
|
+
// query container (decision 17); `@sm:` clauses target it as the
|
|
645
|
+
// nearest container. named containers author container-name /
|
|
646
|
+
// container-type as regular style props instead
|
|
647
|
+
addStyleToInsertRules(rulesToInsert, [
|
|
648
|
+
'container',
|
|
649
|
+
undefined,
|
|
650
|
+
't_container',
|
|
651
|
+
undefined,
|
|
652
|
+
[`.t_container { container-type: ${webContainerType || 'inline-size'}; }`],
|
|
653
|
+
] satisfies StyleObject)
|
|
654
|
+
}
|
|
655
|
+
}
|
|
403
656
|
if (keyInit === 'transition' && typeof valInit === 'string') {
|
|
404
657
|
const animationConfig = driver?.animations?.[valInit]
|
|
405
658
|
if (
|
|
@@ -411,24 +664,55 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
411
664
|
// to ordinary css so the compiler can keep flattening.
|
|
412
665
|
valInit = `all ${animationConfig}`
|
|
413
666
|
} else if (animationConfig) {
|
|
414
|
-
|
|
667
|
+
// animation drivers consume configured preset names directly
|
|
668
|
+
return
|
|
415
669
|
}
|
|
416
|
-
// unknown names are raw CSS transition values and pass through.
|
|
417
670
|
} else {
|
|
418
|
-
|
|
671
|
+
return
|
|
419
672
|
}
|
|
420
673
|
}
|
|
421
674
|
|
|
675
|
+
// minted frontend values consume before style-key validity and
|
|
676
|
+
// propMapper: the transport key is only a position marker (unique per
|
|
677
|
+
// contribution, so repeated clauses on one property and interleaving
|
|
678
|
+
// with ordinary props survive in authored order). validity applies to
|
|
679
|
+
// the value's real property, so the host ruling still holds
|
|
680
|
+
if (isFrontendProgram(valInit)) {
|
|
681
|
+
if (isValidStyleKey(valInit.property, validStyles, accept)) {
|
|
682
|
+
contributeFrontendProgram(styleState, valInit, mergeStyle)
|
|
683
|
+
} else if (process.env.NODE_ENV === 'development') {
|
|
684
|
+
console.warn(
|
|
685
|
+
`[tamagui] "${valInit.property}" is not a valid style on this component; the frontend value is dropped.`
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
return
|
|
689
|
+
}
|
|
690
|
+
|
|
422
691
|
let isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept)
|
|
423
692
|
|
|
424
693
|
// this is all for partially optimized (not flattened)... maybe worth removing?
|
|
425
|
-
if (
|
|
426
|
-
//
|
|
427
|
-
|
|
694
|
+
if (isWeb) {
|
|
695
|
+
// React Native Web ignores direct data-* props. This includes ordinary
|
|
696
|
+
// Tamagui views whose final host is swapped to RNW Animated.View.
|
|
697
|
+
if (
|
|
698
|
+
(staticConfig.isReactNative ||
|
|
699
|
+
(styleProps.isAnimated &&
|
|
700
|
+
driver?.isReactNative &&
|
|
701
|
+
!driver.View?.acceptRenderProp)) &&
|
|
702
|
+
keyInit.startsWith('data-')
|
|
703
|
+
) {
|
|
428
704
|
keyInit = keyInit.replace('data-', '')
|
|
429
705
|
viewProps['dataSet'] ||= {}
|
|
430
706
|
viewProps['dataSet'][keyInit] = valInit
|
|
431
|
-
|
|
707
|
+
return
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// standard data attributes are view props, never styles or styled-context
|
|
711
|
+
// values. Context providers receive arbitrary JSX attributes, so handle
|
|
712
|
+
// these before a provider value can make the key look style-like.
|
|
713
|
+
if (keyInit.startsWith('data-')) {
|
|
714
|
+
viewProps[keyInit] = valInit
|
|
715
|
+
return
|
|
432
716
|
}
|
|
433
717
|
}
|
|
434
718
|
|
|
@@ -436,15 +720,23 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
436
720
|
if (!isValidStyleKeyInit) {
|
|
437
721
|
if (!isAndroid) {
|
|
438
722
|
// only works in android
|
|
439
|
-
if (keyInit === 'elevationAndroid')
|
|
723
|
+
if (keyInit === 'elevationAndroid') return
|
|
440
724
|
}
|
|
441
725
|
|
|
442
726
|
// map userSelect to native prop
|
|
443
727
|
if (keyInit === 'userSelect') {
|
|
444
728
|
keyInit = 'selectable'
|
|
445
729
|
valInit = valInit !== 'none'
|
|
730
|
+
} else if (keyInit === 'textOverflow') {
|
|
731
|
+
// map textOverflow="ellipsis" on Text to numberOfLines + ellipsizeMode.
|
|
732
|
+
// any other value (e.g. "clip") is a no-op on native (default behavior).
|
|
733
|
+
if (isText && valInit === 'ellipsis') {
|
|
734
|
+
viewProps.numberOfLines ??= 1
|
|
735
|
+
viewProps.ellipsizeMode ??= 'tail'
|
|
736
|
+
}
|
|
737
|
+
return
|
|
446
738
|
} else if (keyInit.startsWith('data-')) {
|
|
447
|
-
|
|
739
|
+
return
|
|
448
740
|
}
|
|
449
741
|
}
|
|
450
742
|
}
|
|
@@ -458,7 +750,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
458
750
|
|
|
459
751
|
if (keyInit === 'disabled' && valInit === true) {
|
|
460
752
|
viewProps['aria-disabled'] = true
|
|
461
|
-
// isInput: Input/TextArea wrap the real <input>/<textarea> in a
|
|
753
|
+
// isInput: Input/TextArea wrap the real <input>/<textarea> in a styled HOC, so
|
|
462
754
|
// elementType is the wrapper here - forward disabled down or it never reaches it
|
|
463
755
|
if (
|
|
464
756
|
isInput ||
|
|
@@ -471,7 +763,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
471
763
|
viewProps.disabled = true
|
|
472
764
|
}
|
|
473
765
|
if (!variants?.disabled) {
|
|
474
|
-
|
|
766
|
+
return
|
|
475
767
|
}
|
|
476
768
|
}
|
|
477
769
|
|
|
@@ -480,49 +772,32 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
480
772
|
viewProps.testID = valInit
|
|
481
773
|
} else {
|
|
482
774
|
viewProps['data-testid'] = valInit
|
|
483
|
-
// also keep testID when using RN animation driver (Animated.View
|
|
484
|
-
// from react-native-web only forwards testID, not data-testid)
|
|
485
|
-
|
|
775
|
+
// also keep testID when using the RN animation driver (Animated.View
|
|
776
|
+
// from react-native-web only forwards testID, not data-testid). isHOC
|
|
777
|
+
// wrappers don't animate themselves but forward to an inner animated
|
|
778
|
+
// component, so keep testID for them too — otherwise a styled/HOC
|
|
779
|
+
// primitive (e.g. a skinned Dialog.Overlay) loses its testID on native
|
|
780
|
+
// and becomes untestable.
|
|
781
|
+
if ((styleProps.isAnimated || staticConfig.isHOC) && driver?.isReactNative) {
|
|
486
782
|
viewProps.testID = valInit
|
|
487
783
|
}
|
|
488
784
|
}
|
|
489
|
-
|
|
785
|
+
return
|
|
490
786
|
}
|
|
491
787
|
|
|
492
788
|
if (keyInit === 'id') {
|
|
493
789
|
viewProps.id = valInit
|
|
494
|
-
|
|
790
|
+
return
|
|
495
791
|
}
|
|
496
792
|
}
|
|
497
793
|
}
|
|
498
794
|
|
|
499
|
-
/**
|
|
500
|
-
* There's (some) reason to this madness: we want to allow returning media/pseudo from variants
|
|
501
|
-
* Say you have a variant hoverable: { true: { hoverStyle: {} } }
|
|
502
|
-
* We run propMapper first to expand variant, then we run the inner loop and look again
|
|
503
|
-
* for if there's a pseudo/media returned from it.
|
|
504
|
-
*/
|
|
505
|
-
|
|
506
795
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants
|
|
507
|
-
|
|
508
796
|
const isStyleLikeKey = isValidStyleKeyInit || isVariant
|
|
509
|
-
|
|
510
|
-
let isPseudo = keyInit in validPseudoKeys
|
|
511
|
-
let isMedia = !isStyleLikeKey && !isPseudo ? getMediaKey(keyInit) : false
|
|
512
|
-
let isMediaOrPseudo = Boolean(isMedia || isPseudo)
|
|
513
|
-
|
|
514
|
-
if (isMediaOrPseudo && isMedia === 'group') {
|
|
515
|
-
keyInit = normalizeGroupKey(keyInit, groupContext)
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
const isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || (isVariant && !noExpand)
|
|
519
|
-
|
|
520
|
-
if (shouldSkipNativeHoverProp(keyInit, isMedia)) {
|
|
521
|
-
continue
|
|
522
|
-
}
|
|
797
|
+
const isStyleProp = isValidStyleKeyInit || (isVariant && !noExpand)
|
|
523
798
|
|
|
524
799
|
if (isStyleProp && (asChild === 'except-style' || asChild === 'except-style-web')) {
|
|
525
|
-
|
|
800
|
+
return
|
|
526
801
|
}
|
|
527
802
|
|
|
528
803
|
const shouldPassProp =
|
|
@@ -533,8 +808,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
533
808
|
|
|
534
809
|
const parentVariant = parentVariants?.[keyInit]
|
|
535
810
|
const isHOCShouldPassThrough = Boolean(
|
|
536
|
-
isHOC &&
|
|
537
|
-
(isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)
|
|
811
|
+
isHOC && (isValidStyleKeyInit || parentVariant || keyInit in skipProps)
|
|
538
812
|
)
|
|
539
813
|
|
|
540
814
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough
|
|
@@ -553,48 +827,27 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
553
827
|
variant: variants?.[keyInit],
|
|
554
828
|
isVariant,
|
|
555
829
|
isHOCShouldPassThrough,
|
|
556
|
-
usedKeys: { ...styleState.usedKeys },
|
|
557
830
|
parentStaticConfig,
|
|
558
831
|
})
|
|
559
832
|
}
|
|
560
833
|
}
|
|
561
834
|
|
|
562
835
|
if (shouldPassThrough) {
|
|
563
|
-
|
|
564
|
-
// if (isPseudo) {
|
|
565
|
-
// // this is a lot... but we need to track sub-keys so we don't override them in future things that aren't passed down
|
|
566
|
-
// // like our own variants that aren't in parent
|
|
567
|
-
// const pseudoStyleObject = getSubStyle(
|
|
568
|
-
// styleState,
|
|
569
|
-
// keyInit,
|
|
570
|
-
// valInit,
|
|
571
|
-
// fontFamily,
|
|
572
|
-
// true,
|
|
573
|
-
// state.noClass
|
|
574
|
-
// )
|
|
575
|
-
// const descriptor = pseudoDescriptors[keyInit]
|
|
576
|
-
// for (const key in pseudoStyleObject) {
|
|
577
|
-
// debugger
|
|
578
|
-
// }
|
|
579
|
-
// }
|
|
580
|
-
|
|
581
|
-
passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo)
|
|
836
|
+
passDownProp(viewProps, keyInit, valInit)
|
|
582
837
|
|
|
583
838
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
584
839
|
console.groupEnd()
|
|
585
840
|
}
|
|
586
841
|
|
|
587
|
-
//
|
|
588
|
-
//
|
|
589
|
-
// which now has it's own unstyled + the child unstyled...
|
|
590
|
-
// so *don't* skip applying the styles if its different from the parent one
|
|
842
|
+
// a styled child can pass through a parent variant and define the same key
|
|
843
|
+
// itself, so keep applying its own definition when the variants differ
|
|
591
844
|
if (!isVariant) {
|
|
592
|
-
|
|
845
|
+
return
|
|
593
846
|
}
|
|
594
847
|
}
|
|
595
848
|
|
|
596
849
|
// after shouldPassThrough
|
|
597
|
-
if (!noSkip) {
|
|
850
|
+
if (!noSkip && !neverSkipProps?.[keyInit]) {
|
|
598
851
|
if (
|
|
599
852
|
keyInit in skipProps &&
|
|
600
853
|
!(
|
|
@@ -606,7 +859,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
606
859
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
607
860
|
console.groupEnd()
|
|
608
861
|
}
|
|
609
|
-
|
|
862
|
+
return
|
|
610
863
|
}
|
|
611
864
|
}
|
|
612
865
|
|
|
@@ -621,592 +874,156 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
621
874
|
}
|
|
622
875
|
}
|
|
623
876
|
|
|
624
|
-
const disablePropMap =
|
|
625
|
-
|
|
626
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, (key, val, originalVal) => {
|
|
627
|
-
const isStyledContextProp = styledContext && key in styledContext
|
|
877
|
+
const disablePropMap = !isStyleLikeKey
|
|
628
878
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
879
|
+
// ordinary host styles scan and emit directly without propMapper
|
|
880
|
+
if (
|
|
881
|
+
!isHOC &&
|
|
882
|
+
isValidStyleKeyInit &&
|
|
883
|
+
valInit != null &&
|
|
884
|
+
!(process.env.TAMAGUI_TARGET === 'native' && valInit === 'unset') &&
|
|
885
|
+
!(variants && keyInit in variants) &&
|
|
886
|
+
!(accept && keyInit in accept) &&
|
|
887
|
+
!(styledContext && keyInit in styledContext)
|
|
888
|
+
) {
|
|
889
|
+
contributeStyleValue(styleState, keyInit, valInit, mergeStyle)
|
|
890
|
+
return
|
|
891
|
+
}
|
|
639
892
|
|
|
640
|
-
|
|
893
|
+
propMapper(
|
|
894
|
+
keyInit,
|
|
895
|
+
valInit,
|
|
896
|
+
styleState,
|
|
897
|
+
disablePropMap,
|
|
898
|
+
(key, val, originalVal, conditionSource) => {
|
|
899
|
+
const isStyledContextProp = styledContext && key in styledContext
|
|
900
|
+
|
|
901
|
+
if (key === 'className') {
|
|
902
|
+
if (typeof val === 'string' && val) {
|
|
903
|
+
className = `${className} ${val}`.trim()
|
|
904
|
+
}
|
|
905
|
+
return
|
|
906
|
+
}
|
|
641
907
|
|
|
642
|
-
|
|
643
|
-
|
|
908
|
+
if (!isHOC && disablePropMap && !isStyledContextProp) {
|
|
909
|
+
// a text-only style prop on a non-text host must not leak to the DOM
|
|
910
|
+
// as an unknown attribute (and RN would silently ignore it). every key
|
|
911
|
+
// here already failed this host's validity table, so the extra check
|
|
912
|
+
// only runs on that cold path
|
|
913
|
+
if (key in stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
914
|
+
if (process.env.NODE_ENV === 'development') {
|
|
915
|
+
console.warn(
|
|
916
|
+
`[tamagui] "${key}" is a text style prop and this component is not text — it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
return
|
|
920
|
+
}
|
|
644
921
|
viewProps[key] = val
|
|
645
922
|
return
|
|
646
923
|
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
if (
|
|
650
|
-
(!isHOC && isValidStyleKey(key, validStyles, accept)) ||
|
|
651
|
-
(process.env.TAMAGUI_TARGET === 'native' && isAndroid && key === 'elevation')
|
|
652
|
-
) {
|
|
653
|
-
mergeStyle(styleState, key, val, 1, false, originalVal)
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// re-run with expanded key
|
|
658
|
-
isPseudo = key in validPseudoKeys
|
|
659
|
-
isMedia = isPseudo ? false : getMediaKey(key)
|
|
660
|
-
isMediaOrPseudo = Boolean(isMedia || isPseudo)
|
|
661
|
-
isVariant = variants && key in variants
|
|
662
|
-
|
|
663
|
-
// handle group key transformation for variant-expanded keys (issue #3613)
|
|
664
|
-
if (isMedia === 'group') {
|
|
665
|
-
key = normalizeGroupKey(key, groupContext)
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
if (shouldSkipNativeHoverProp(key, isMedia)) {
|
|
669
|
-
return
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
if (
|
|
673
|
-
inlineProps?.has(key) ||
|
|
674
|
-
(process.env.IS_STATIC === 'is_static' && inlineWhenUnflattened?.has(key))
|
|
675
|
-
) {
|
|
676
|
-
viewProps[key] = props[key] ?? val
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
// have to run this logic again here because expansions may need to be passed down
|
|
680
|
-
// see StyledButtonVariantPseudoMerge test
|
|
681
|
-
const shouldPassThrough =
|
|
682
|
-
(styleProps.noExpand && isPseudo) ||
|
|
683
|
-
(isHOC && (isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit]))
|
|
684
924
|
|
|
685
|
-
if (shouldPassThrough) {
|
|
686
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo)
|
|
687
925
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
688
|
-
console.groupCollapsed(
|
|
689
|
-
log(
|
|
926
|
+
console.groupCollapsed(' 💠 expanded', keyInit, '=>', key)
|
|
927
|
+
log(val)
|
|
690
928
|
console.groupEnd()
|
|
691
929
|
}
|
|
692
|
-
return
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
if (isPseudo) {
|
|
696
|
-
if (!val) return
|
|
697
930
|
|
|
698
|
-
|
|
699
|
-
// (note: can't because we need to set defaults on enter/exit or else enforce that they should)
|
|
700
|
-
const pseudoStyleObject = getSubStyle(
|
|
701
|
-
styleState,
|
|
702
|
-
key,
|
|
703
|
-
val,
|
|
704
|
-
styleProps.noClass && !(process.env.IS_STATIC === 'is_static')
|
|
705
|
-
)
|
|
931
|
+
if (val == null) return
|
|
706
932
|
|
|
707
|
-
if (
|
|
708
|
-
|
|
709
|
-
pseudos[key] ||= {}
|
|
710
|
-
|
|
711
|
-
// if compiler we can just set this and continue on our way
|
|
712
|
-
if (process.env.IS_STATIC === 'is_static') {
|
|
713
|
-
Object.assign(pseudos[key], pseudoStyleObject)
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
const descriptor = pseudoDescriptors[key as keyof typeof pseudoDescriptors]
|
|
719
|
-
const isEnter = key === 'enterStyle'
|
|
720
|
-
const isExit = key === 'exitStyle'
|
|
721
|
-
|
|
722
|
-
// don't continue here on isEnter && !state.unmounted because we need to merge defaults
|
|
723
|
-
if (!descriptor) {
|
|
933
|
+
if (accept && key in accept) {
|
|
934
|
+
viewProps[key] = val
|
|
724
935
|
return
|
|
725
936
|
}
|
|
726
937
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
732
|
-
console.info('pseudo:', key, pseudoStyleObject, pseudoStyles)
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
for (const psuedoStyle of pseudoStyles) {
|
|
736
|
-
const fullKey = `${psuedoStyle[StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`
|
|
737
|
-
addStyleToInsertRules(rulesToInsert, psuedoStyle)
|
|
738
|
-
classNames[fullKey] = psuedoStyle[StyleObjectIdentifier]
|
|
739
|
-
}
|
|
740
|
-
}
|
|
938
|
+
const isHostStyleKey =
|
|
939
|
+
(!isHOC && isValidStyleKey(key, validStyles, accept)) ||
|
|
940
|
+
(process.env.TAMAGUI_TARGET === 'native' && isAndroid && key === 'elevation')
|
|
941
|
+
const isContextProgramKey = !isHOC && Boolean(isStyledContextProp)
|
|
741
942
|
|
|
742
|
-
if (
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const importance = descriptor.priority
|
|
765
|
-
|
|
766
|
-
const pseudoOriginalValues = styleOriginalValues.get(pseudoStyleObject)
|
|
767
|
-
for (const pkey in pseudoStyleObject) {
|
|
768
|
-
const val = pseudoStyleObject[pkey]
|
|
769
|
-
// when disabled ensure the default value is set for future animations to align
|
|
770
|
-
|
|
771
|
-
if (isDisabled) {
|
|
772
|
-
applyDefaultStyle(pkey, styleState)
|
|
773
|
-
} else {
|
|
774
|
-
const curImportance = styleState.usedKeys[pkey] || 0
|
|
775
|
-
const shouldMerge = importance >= curImportance
|
|
776
|
-
|
|
777
|
-
if (shouldMerge) {
|
|
778
|
-
if (process.env.IS_STATIC === 'is_static') {
|
|
779
|
-
pseudos ||= {}
|
|
780
|
-
pseudos[key] ||= {}
|
|
781
|
-
pseudos[key][pkey] = val
|
|
782
|
-
}
|
|
783
|
-
mergeStyle(
|
|
784
|
-
styleState,
|
|
785
|
-
pkey,
|
|
786
|
-
val,
|
|
787
|
-
importance,
|
|
788
|
-
false,
|
|
789
|
-
pseudoOriginalValues?.[pkey]
|
|
790
|
-
)
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
794
|
-
log(' subKey', pkey, shouldMerge, {
|
|
795
|
-
importance,
|
|
796
|
-
curImportance,
|
|
797
|
-
pkey,
|
|
798
|
-
val,
|
|
799
|
-
})
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
// set this after the loop over pseudoStyleObject so it applies before setting usedKeys
|
|
805
|
-
if (!isDisabled) {
|
|
806
|
-
// mark usedKeys based on pseudoStyleObject
|
|
807
|
-
for (const key in val) {
|
|
808
|
-
const k = shorthands[key] || key
|
|
809
|
-
styleState.usedKeys[k] = Math.max(importance, styleState.usedKeys[k] || 0)
|
|
943
|
+
if (conditionSource !== undefined) {
|
|
944
|
+
if (isHostStyleKey || isContextProgramKey) {
|
|
945
|
+
contributeVariantClauseValue(
|
|
946
|
+
styleState,
|
|
947
|
+
key,
|
|
948
|
+
val,
|
|
949
|
+
conditionSource,
|
|
950
|
+
mergeStyle,
|
|
951
|
+
originalVal,
|
|
952
|
+
!isHostStyleKey
|
|
953
|
+
)
|
|
954
|
+
} else if (isHOC) {
|
|
955
|
+
// reduce the clause back to flat-value string form so the wrapped
|
|
956
|
+
// component's own string parser applies the condition
|
|
957
|
+
const appended = appendFlatClause(viewProps[key], conditionSource, val)
|
|
958
|
+
if (appended !== undefined) {
|
|
959
|
+
viewProps[key] = appended
|
|
960
|
+
} else if (process.env.NODE_ENV === 'development') {
|
|
961
|
+
console.warn(
|
|
962
|
+
`[tamagui] conditional variant value for "${key}" is not string-representable; dropping the clause`
|
|
963
|
+
)
|
|
810
964
|
}
|
|
965
|
+
} else if (process.env.NODE_ENV === 'development') {
|
|
966
|
+
console.warn(
|
|
967
|
+
`[tamagui] "${key}" is not a valid style on this component; the conditional variant value is dropped.`
|
|
968
|
+
)
|
|
811
969
|
}
|
|
970
|
+
return
|
|
812
971
|
}
|
|
813
972
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
// media
|
|
818
|
-
if (isMedia) {
|
|
819
|
-
if (!val) return
|
|
820
|
-
|
|
821
|
-
// for some reason 'space' in val upsetting next ssr during prod build
|
|
822
|
-
// technically i guess this also will not apply if 0 space which makes sense?
|
|
823
|
-
const mediaKeyShort = key.slice(isMedia == 'theme' ? 7 : 1)
|
|
824
|
-
|
|
825
|
-
hasMedia ||= true
|
|
826
|
-
const hasSpace = val['space']
|
|
827
|
-
|
|
828
|
-
if (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
829
|
-
if (!hasMedia || typeof hasMedia === 'boolean') {
|
|
830
|
-
hasMedia = new Set()
|
|
831
|
-
}
|
|
832
|
-
hasMedia.add(mediaKeyShort)
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
// can bail early
|
|
836
|
-
if (isMedia === 'platform') {
|
|
837
|
-
if (!isActivePlatform(key)) {
|
|
838
|
-
return
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
843
|
-
log(` 📺 ${key}`, {
|
|
973
|
+
if (isHostStyleKey || isContextProgramKey) {
|
|
974
|
+
contributeStyleValue(
|
|
975
|
+
styleState,
|
|
844
976
|
key,
|
|
845
977
|
val,
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
mediaState,
|
|
851
|
-
})
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
const priority = mediaStylesSeen
|
|
855
|
-
mediaStylesSeen += 1
|
|
856
|
-
|
|
857
|
-
// the compiler has no window to match against, so a media block must stay
|
|
858
|
-
// conditional: keep it nested under its own key and let the extractor's
|
|
859
|
-
// atomic-CSS pass emit an @media rule. merging it into the flat style here
|
|
860
|
-
// bakes whichever medias node happens to consider active into the
|
|
861
|
-
// unconditional styles, which is how a variant's $lg block ended up
|
|
862
|
-
// applying at every width while its real breakpoint lost to the base.
|
|
863
|
-
if (process.env.IS_STATIC === 'is_static' && isMedia === true) {
|
|
864
|
-
const mediaStyle = getSubStyle(styleState, key, val, true)
|
|
865
|
-
styleState.style ||= {}
|
|
866
|
-
const existing = styleState.style[key]
|
|
867
|
-
styleState.style[key] = existing
|
|
868
|
-
? Object.assign(existing, mediaStyle)
|
|
869
|
-
: mediaStyle
|
|
978
|
+
mergeStyle,
|
|
979
|
+
originalVal,
|
|
980
|
+
!isHostStyleKey
|
|
981
|
+
)
|
|
870
982
|
return
|
|
871
983
|
}
|
|
872
984
|
|
|
873
|
-
|
|
874
|
-
// when noClass is set (inline animation drivers), de-opt to inline styles so the
|
|
875
|
-
if (shouldDoClasses) {
|
|
876
|
-
const mediaStyle = getSubStyle(styleState, key, val, false)
|
|
877
|
-
const mediaStyles = getCSSStylesAtomic(mediaStyle)
|
|
878
|
-
|
|
879
|
-
for (const style of mediaStyles) {
|
|
880
|
-
// handle nested media:
|
|
881
|
-
// for now we're doing weird stuff, getCSSStylesAtomic will put the
|
|
882
|
-
// $platform-web into property so we can check it here
|
|
883
|
-
const property = style[StyleObjectProperty]
|
|
884
|
-
const isSubStyle = property[0] === '$'
|
|
885
|
-
if (isSubStyle && !isActivePlatform(property)) {
|
|
886
|
-
continue
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
const out = createMediaStyle(
|
|
890
|
-
style,
|
|
891
|
-
mediaKeyShort,
|
|
892
|
-
mediaQueryConfig,
|
|
893
|
-
isMedia,
|
|
894
|
-
false,
|
|
895
|
-
priority
|
|
896
|
-
)
|
|
897
|
-
|
|
898
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
899
|
-
log(`📺 media style:`, out)
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
// this is imperfect it should be fixed further down, we mess up property when dealing with
|
|
903
|
-
// media-sub-style, like $sm={{ $platform-web: {} }}
|
|
904
|
-
// property is just $platform-web, it should br $platform-web-bg, so we add extra info from style
|
|
905
|
-
// but that info includes the value too
|
|
906
|
-
const subKey = isSubStyle ? style[2] : ''
|
|
907
|
-
const fullKey = `${
|
|
908
|
-
style[StyleObjectProperty]
|
|
909
|
-
}${subKey}${PROP_SPLIT}${mediaKeyShort}${style[StyleObjectPseudo] || ''}`
|
|
910
|
-
|
|
911
|
-
addStyleToInsertRules(rulesToInsert, out as any)
|
|
912
|
-
classNames[fullKey] = out[StyleObjectIdentifier]
|
|
913
|
-
}
|
|
914
|
-
} else {
|
|
915
|
-
const isThemeMedia = isMedia === 'theme'
|
|
916
|
-
const isGroupMedia = isMedia === 'group'
|
|
917
|
-
const isPlatformMedia = isMedia === 'platform'
|
|
918
|
-
|
|
919
|
-
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
920
|
-
if (!mediaState[mediaKeyShort]) {
|
|
921
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
922
|
-
log(` 📺 ❌ DISABLED ${mediaKeyShort}`)
|
|
923
|
-
}
|
|
924
|
-
return
|
|
925
|
-
}
|
|
926
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
927
|
-
log(` 📺 ✅ ENABLED ${mediaKeyShort}`)
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
const mediaStyle = getSubStyle(styleState, key, val, true)
|
|
932
|
-
|
|
933
|
-
let importanceBump = 0
|
|
934
|
-
|
|
935
|
-
if (isThemeMedia) {
|
|
936
|
-
if (
|
|
937
|
-
process.env.TAMAGUI_TARGET === 'native' &&
|
|
938
|
-
supportsDynamicColorIOS &&
|
|
939
|
-
getSetting('fastSchemeChange')
|
|
940
|
-
) {
|
|
941
|
-
// iOS will use https://reactnative.dev/docs/dynamiccolorios
|
|
942
|
-
// so need to predefine the dynamic color before merging the styles
|
|
943
|
-
// for example: <StyledYStack $theme-dark={{borderColor: '$red10'}} $theme-light={{borderColor: '$green10'}}> => {borderColor: {dynamic: {dark: '$red10', light: '$green10'}}}
|
|
944
|
-
|
|
945
|
-
styleState.style ||= {}
|
|
946
|
-
const scheme = mediaKeyShort
|
|
947
|
-
const oppositeScheme = getOppositeScheme(mediaKeyShort)
|
|
948
|
-
const themeOriginalValues = styleOriginalValues.get(mediaStyle)
|
|
949
|
-
const isCurrentScheme = themeName === scheme || themeName.startsWith(scheme)
|
|
950
|
-
|
|
951
|
-
for (const subKey in mediaStyle) {
|
|
952
|
-
const val = extractValueFromDynamic(mediaStyle[subKey], scheme)
|
|
953
|
-
const existing = styleState.style[subKey]
|
|
954
|
-
|
|
955
|
-
// Only color properties support DynamicColorIOS - non-color properties
|
|
956
|
-
// like opacity, dimensions, etc. will crash if wrapped with {dynamic: {...}}
|
|
957
|
-
// See: https://github.com/tamagui/tamagui/issues/3096
|
|
958
|
-
// See: https://github.com/tamagui/tamagui/issues/2980
|
|
959
|
-
if (!isColorStyleKey(subKey)) {
|
|
960
|
-
// non-color properties require re-render to update
|
|
961
|
-
dynamicThemeAccess = true
|
|
962
|
-
// only apply if this is the current theme
|
|
963
|
-
if (isCurrentScheme) {
|
|
964
|
-
// update mediaStyle so the later merge loop uses correct value
|
|
965
|
-
mediaStyle[subKey] = val
|
|
966
|
-
} else {
|
|
967
|
-
// remove from mediaStyle so it doesn't get merged with wrong theme's value
|
|
968
|
-
delete mediaStyle[subKey]
|
|
969
|
-
}
|
|
970
|
-
continue
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
// if there's already a dynamic object from the other theme pseudo prop,
|
|
974
|
-
// merge directly to avoid importance conflicts between $theme-dark and $theme-light
|
|
975
|
-
if (existing?.dynamic) {
|
|
976
|
-
existing.dynamic[scheme] = val
|
|
977
|
-
mediaStyle[subKey] = existing
|
|
978
|
-
} else {
|
|
979
|
-
const oppositeVal = extractValueFromDynamic(existing, oppositeScheme)
|
|
980
|
-
mediaStyle[subKey] = getDynamicVal({
|
|
981
|
-
scheme,
|
|
982
|
-
val,
|
|
983
|
-
oppositeVal,
|
|
984
|
-
})
|
|
985
|
-
mergeStyle(
|
|
986
|
-
styleState,
|
|
987
|
-
subKey,
|
|
988
|
-
mediaStyle[subKey],
|
|
989
|
-
priority,
|
|
990
|
-
false,
|
|
991
|
-
themeOriginalValues?.[subKey]
|
|
992
|
-
)
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
} else {
|
|
996
|
-
// non-ios or no fastschemechange - need re-renders for theme changes
|
|
997
|
-
dynamicThemeAccess = true
|
|
998
|
-
if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) {
|
|
999
|
-
return
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
} else if (isGroupMedia) {
|
|
1003
|
-
const groupInfo = getGroupPropParts(mediaKeyShort)
|
|
1004
|
-
const groupName = groupInfo.name
|
|
1005
|
-
|
|
1006
|
-
// $group-x
|
|
1007
|
-
const groupState = groupContext?.[groupName]?.state
|
|
1008
|
-
const groupPseudoKey = groupInfo.pseudo
|
|
1009
|
-
const groupMediaKey = groupInfo.media
|
|
1010
|
-
|
|
1011
|
-
if (process.env.TAMAGUI_TARGET === 'native' && groupPseudoKey === 'hover') {
|
|
1012
|
-
return
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
if (!groupState) {
|
|
1016
|
-
if (process.env.NODE_ENV === 'development' && debug) {
|
|
1017
|
-
log(`No parent with group prop, skipping styles: ${groupName}`)
|
|
1018
|
-
}
|
|
1019
|
-
// we still want to indicate we should listen! this is how subscribeToGroupContext knows to run
|
|
1020
|
-
pseudoGroups ||= new Set()
|
|
1021
|
-
return
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
const componentGroupState = componentState.group?.[groupName]
|
|
985
|
+
isVariant = variants && key in variants
|
|
1025
986
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
const mediaState = componentGroupState?.media
|
|
1030
|
-
let isActive = mediaState?.[groupMediaKey]
|
|
1031
|
-
|
|
1032
|
-
// use parent styles if width and height hardcoded we can do an inline media match and avoid double render
|
|
1033
|
-
if (!mediaState && groupState.layout) {
|
|
1034
|
-
isActive = mediaKeyMatch(groupMediaKey, groupState.layout)
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
1038
|
-
log(` 🏘️ GROUP media ${groupMediaKey} active? ${isActive}`, {
|
|
1039
|
-
...mediaState,
|
|
1040
|
-
usedKeys: { ...styleState.usedKeys },
|
|
1041
|
-
})
|
|
1042
|
-
}
|
|
1043
|
-
if (!isActive) {
|
|
1044
|
-
// ensure we set the defaults so animations work
|
|
1045
|
-
for (const pkey in mediaStyle) {
|
|
1046
|
-
applyDefaultStyle(pkey, styleState)
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
return
|
|
1050
|
-
}
|
|
1051
|
-
importanceBump = 2
|
|
1052
|
-
}
|
|
987
|
+
if (inlineProps?.has(key)) {
|
|
988
|
+
viewProps[key] = props[key] ?? val
|
|
989
|
+
}
|
|
1053
990
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
pseudoGroups.add(groupName)
|
|
1057
|
-
const componentGroupPseudoState = (
|
|
1058
|
-
componentGroupState ||
|
|
1059
|
-
// fallback to context initially
|
|
1060
|
-
groupContext?.[groupName].state
|
|
1061
|
-
)?.pseudo
|
|
1062
|
-
|
|
1063
|
-
const isActive = componentGroupPseudoState?.[groupPseudoKey]
|
|
1064
|
-
const priority = pseudoPriorities[groupPseudoKey]
|
|
1065
|
-
|
|
1066
|
-
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
1067
|
-
log(
|
|
1068
|
-
` 🏘️ GROUP pseudo ${groupMediaKey} active? ${isActive}, priority ${priority}`,
|
|
1069
|
-
{
|
|
1070
|
-
componentGroupPseudoState: { ...componentGroupPseudoState },
|
|
1071
|
-
usedKeys: { ...styleState.usedKeys },
|
|
1072
|
-
}
|
|
1073
|
-
)
|
|
1074
|
-
}
|
|
1075
|
-
if (!isActive) {
|
|
1076
|
-
// ensure we set the defaults so animations work
|
|
1077
|
-
for (const pkey in mediaStyle) {
|
|
1078
|
-
applyDefaultStyle(pkey, styleState)
|
|
1079
|
-
}
|
|
991
|
+
const shouldPassThrough =
|
|
992
|
+
isHOC && Boolean(parentStaticConfig?.variants?.[keyInit])
|
|
1080
993
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
// specific platform selectors reliably win over broader ones regardless
|
|
1088
|
-
// of prop declaration order (e.g. $platform-tv always overrides
|
|
1089
|
-
// $platform-native for the same property, even if tv is listed first).
|
|
1090
|
-
importanceBump = getPlatformSpecificityBump(mediaKeyShort)
|
|
994
|
+
if (shouldPassThrough) {
|
|
995
|
+
passDownProp(viewProps, key, val)
|
|
996
|
+
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
997
|
+
console.groupCollapsed(` - passing down prop ${key}`)
|
|
998
|
+
log({ val, after: { ...viewProps[key] } })
|
|
999
|
+
console.groupEnd()
|
|
1091
1000
|
}
|
|
1001
|
+
return
|
|
1002
|
+
}
|
|
1092
1003
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
styleState.pseudoTransitions ||= {}
|
|
1098
|
-
styleState.pseudoTransitions[
|
|
1099
|
-
`$${mediaKeyShort}` as keyof typeof styleState.pseudoTransitions
|
|
1100
|
-
] = mediaStyle.transition as any
|
|
1004
|
+
// pass to view props
|
|
1005
|
+
if (!isVariant) {
|
|
1006
|
+
if (isStyledContextProp) {
|
|
1007
|
+
return
|
|
1101
1008
|
}
|
|
1102
1009
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
styleState.style ||= {}
|
|
1113
|
-
const didMerge = mergeMediaByImportance(
|
|
1114
|
-
styleState,
|
|
1115
|
-
mediaKeyShort,
|
|
1116
|
-
key,
|
|
1117
|
-
val,
|
|
1118
|
-
mediaState[mediaKeyShort],
|
|
1119
|
-
importanceBump,
|
|
1120
|
-
debug,
|
|
1121
|
-
originalVal
|
|
1122
|
-
)
|
|
1123
|
-
if (didMerge && key === 'fontFamily') {
|
|
1124
|
-
styleState.fontFamily = mediaStyle.fontFamily as string
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
for (const subKey in mediaStyle) {
|
|
1129
|
-
if (subKey === 'space') {
|
|
1130
|
-
continue
|
|
1131
|
-
}
|
|
1132
|
-
if (subKey[0] === '$') {
|
|
1133
|
-
const subMediaType = getMediaKey(subKey)
|
|
1134
|
-
if (subMediaType === 'platform') {
|
|
1135
|
-
if (!isActivePlatform(subKey)) continue
|
|
1136
|
-
} else if (subMediaType === 'theme') {
|
|
1137
|
-
if (!isActiveTheme(subKey, themeName)) continue
|
|
1138
|
-
} else if (subMediaType === true) {
|
|
1139
|
-
// regular media query nested inside platform/theme/media
|
|
1140
|
-
const subKeyShort = subKey.slice(1)
|
|
1141
|
-
if (!mediaState[subKeyShort]) continue
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
const nestedVal = mediaStyle[subKey] as Record<string, any>
|
|
1145
|
-
const subOriginalValues = styleOriginalValues.get(nestedVal)
|
|
1146
|
-
|
|
1147
|
-
// Nested styles are more specific than their outer context because
|
|
1148
|
-
// they require both conditions to be true. Calculate an importance
|
|
1149
|
-
// that is the sum of both the outer and inner importances so that:
|
|
1150
|
-
// 1) nested always beats non-nested
|
|
1151
|
-
// 2) $xs={{ $platform-android: ... }} and
|
|
1152
|
-
// $platform-android={{ $xs: ... }} produce identical importance
|
|
1153
|
-
// (last-declared wins for the same property)
|
|
1154
|
-
const isSizeMediaKey = !!mediaState[mediaKeyShort]
|
|
1155
|
-
const outerBase = isSizeMediaKey
|
|
1156
|
-
? getMediaKeyImportance(mediaKeyShort)
|
|
1157
|
-
: defaultMediaImportance
|
|
1158
|
-
|
|
1159
|
-
let innerBase: number
|
|
1160
|
-
if (subMediaType === 'platform') {
|
|
1161
|
-
innerBase =
|
|
1162
|
-
defaultMediaImportance + getPlatformSpecificityBump(subKey.slice(1))
|
|
1163
|
-
} else if (subMediaType === true) {
|
|
1164
|
-
innerBase = getMediaKeyImportance(subKey.slice(1))
|
|
1165
|
-
} else {
|
|
1166
|
-
innerBase = defaultMediaImportance
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
const nestedImportance = outerBase + importanceBump + innerBase + 1
|
|
1170
|
-
|
|
1171
|
-
for (const subSubKey in nestedVal) {
|
|
1172
|
-
// expand shorthands, getSubStyle doesn't expand keys
|
|
1173
|
-
// inside nested $ objects (they pass through propMapper as-is)
|
|
1174
|
-
const expandedKey = shorthands[subSubKey] || subSubKey
|
|
1175
|
-
const { usedKeys } = styleState
|
|
1176
|
-
if (usedKeys[expandedKey] && usedKeys[expandedKey] > nestedImportance) {
|
|
1177
|
-
continue
|
|
1178
|
-
}
|
|
1179
|
-
styleState.style ||= {}
|
|
1180
|
-
mergeStyle(
|
|
1181
|
-
styleState,
|
|
1182
|
-
expandedKey,
|
|
1183
|
-
nestedVal[subSubKey],
|
|
1184
|
-
nestedImportance,
|
|
1185
|
-
false,
|
|
1186
|
-
subOriginalValues?.[subSubKey]
|
|
1187
|
-
)
|
|
1188
|
-
if (expandedKey === 'fontFamily') {
|
|
1189
|
-
styleState.fontFamily = nestedVal[subSubKey] as string
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
} else {
|
|
1193
|
-
mergeMediaStyle(subKey, mediaStyle[subKey], mediaOriginalValues?.[subKey])
|
|
1010
|
+
// a text-only style prop on a non-text host must not leak to the DOM
|
|
1011
|
+
// as an unknown attribute (and RN would silently ignore it): drop it
|
|
1012
|
+
// with a dev diagnostic naming the fix. cold path — only keys that
|
|
1013
|
+
// already failed this host's validity table get here
|
|
1014
|
+
if (key in stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
1015
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1016
|
+
console.warn(
|
|
1017
|
+
`[tamagui] "${key}" is a text style prop and this component is not text — it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`
|
|
1018
|
+
)
|
|
1194
1019
|
}
|
|
1020
|
+
return
|
|
1195
1021
|
}
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
return // end media
|
|
1199
|
-
}
|
|
1200
1022
|
|
|
1201
|
-
|
|
1202
|
-
if (!isVariant) {
|
|
1203
|
-
if (isStyledContextProp) {
|
|
1204
|
-
return
|
|
1023
|
+
viewProps[key] = val
|
|
1205
1024
|
}
|
|
1206
|
-
|
|
1207
|
-
viewProps[key] = val
|
|
1208
1025
|
}
|
|
1209
|
-
|
|
1026
|
+
)
|
|
1210
1027
|
|
|
1211
1028
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
1212
1029
|
try {
|
|
@@ -1219,7 +1036,9 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1219
1036
|
}
|
|
1220
1037
|
console.groupEnd()
|
|
1221
1038
|
}
|
|
1222
|
-
} // end prop
|
|
1039
|
+
} // end prop contribution
|
|
1040
|
+
|
|
1041
|
+
forEachPropInForwardOrder(processedProps, staticConfig, shorthands, contributeProp)
|
|
1223
1042
|
|
|
1224
1043
|
if (
|
|
1225
1044
|
process.env.NODE_ENV === 'development' &&
|
|
@@ -1229,6 +1048,59 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1229
1048
|
time`split-styles-propsend`
|
|
1230
1049
|
}
|
|
1231
1050
|
|
|
1051
|
+
const conditionalStates = styleState.flatStateKeys || null
|
|
1052
|
+
const usesSafeArea = !!styleState.flatUsesSafeArea
|
|
1053
|
+
if (styleState.flatMediaKeys?.size) {
|
|
1054
|
+
if (!hasMedia) hasMedia = new Set()
|
|
1055
|
+
if (typeof hasMedia !== 'boolean') {
|
|
1056
|
+
for (const key of styleState.flatMediaKeys) hasMedia.add(key)
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
if (styleState.flatGroupKeys?.size) {
|
|
1060
|
+
pseudoGroups ||= new Set()
|
|
1061
|
+
for (const key of styleState.flatGroupKeys) pseudoGroups.add(key)
|
|
1062
|
+
}
|
|
1063
|
+
if (styleState.flatGroupMedia?.size) {
|
|
1064
|
+
mediaGroups ||= new Set()
|
|
1065
|
+
for (const key of styleState.flatGroupMedia) mediaGroups.add(key)
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
// hand the selected transition to animation drivers and keep it out of native
|
|
1069
|
+
// destination styles, where `transition` is not a React Native style key.
|
|
1070
|
+
const effectiveTransition = styleState.style?.transition as
|
|
1071
|
+
| TransitionProp
|
|
1072
|
+
| null
|
|
1073
|
+
| undefined
|
|
1074
|
+
if (
|
|
1075
|
+
effectiveTransition != null &&
|
|
1076
|
+
styleState.style &&
|
|
1077
|
+
(process.env.TAMAGUI_TARGET === 'native' || driver?.outputStyle !== 'css')
|
|
1078
|
+
) {
|
|
1079
|
+
delete styleState.style.transition
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// on native, container config is context + layout measurement, never a
|
|
1083
|
+
// react-native style key
|
|
1084
|
+
if (process.env.TAMAGUI_TARGET === 'native' && styleState.style) {
|
|
1085
|
+
if ('containerType' in styleState.style) delete styleState.style.containerType
|
|
1086
|
+
if ('containerName' in styleState.style) delete styleState.style.containerName
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// a named container also establishes containment
|
|
1090
|
+
if (
|
|
1091
|
+
process.env.TAMAGUI_TARGET === 'web' &&
|
|
1092
|
+
(styleState.style?.containerName != null || classNames.containerName) &&
|
|
1093
|
+
!(styleState.style && 'containerType' in styleState.style) &&
|
|
1094
|
+
!classNames.containerType
|
|
1095
|
+
) {
|
|
1096
|
+
contributeStyleValue(
|
|
1097
|
+
styleState,
|
|
1098
|
+
'containerType',
|
|
1099
|
+
webContainerType || 'inline-size',
|
|
1100
|
+
mergeStyle
|
|
1101
|
+
)
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1232
1104
|
// style prop after:
|
|
1233
1105
|
|
|
1234
1106
|
const avoidNormalize = styleProps.noNormalize === false
|
|
@@ -1247,7 +1119,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1247
1119
|
|
|
1248
1120
|
// these are only the flat transforms
|
|
1249
1121
|
// always do this at the very end to preserve the order strictly (animations, origin)
|
|
1250
|
-
// and allow proper merging
|
|
1122
|
+
// and allow proper merging before applying
|
|
1251
1123
|
if (styleState.flatTransforms) {
|
|
1252
1124
|
// we need to match the order for animations to work because it needs consistent order
|
|
1253
1125
|
// was thinking of having something like `state.prevTransformsOrder = ['y', 'x', ...]
|
|
@@ -1298,59 +1170,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1298
1170
|
}
|
|
1299
1171
|
|
|
1300
1172
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
1301
|
-
|
|
1302
|
-
let retainedStyles: ViewStyleWithPseudos | undefined
|
|
1303
|
-
let shouldRetain = false
|
|
1304
|
-
|
|
1305
|
-
if (styleState.style['$$css']) {
|
|
1306
|
-
// avoid re-processing for rnw
|
|
1307
|
-
} else {
|
|
1308
|
-
const atomic = getCSSStylesAtomic(styleState.style)
|
|
1309
|
-
|
|
1310
|
-
for (const atomicStyle of atomic) {
|
|
1311
|
-
const [key, value, identifier] = atomicStyle
|
|
1312
|
-
|
|
1313
|
-
const isAnimatedAndTransitionOnly =
|
|
1314
|
-
styleProps.isAnimated &&
|
|
1315
|
-
styleProps.noClass &&
|
|
1316
|
-
props.animateOnly?.includes(key)
|
|
1317
|
-
|
|
1318
|
-
// animateOnly properties should always use className on server and initial
|
|
1319
|
-
// client render to avoid hydration mismatch (server has isAnimated=false but
|
|
1320
|
-
// client has isAnimated=true for CSS driver, causing different style output)
|
|
1321
|
-
const nonAnimatedTransitionOnly =
|
|
1322
|
-
!isAnimatedAndTransitionOnly &&
|
|
1323
|
-
!styleProps.isAnimated &&
|
|
1324
|
-
isClient &&
|
|
1325
|
-
driver?.outputStyle === 'css' &&
|
|
1326
|
-
props.animateOnly?.includes(key)
|
|
1327
|
-
|
|
1328
|
-
if (isAnimatedAndTransitionOnly) {
|
|
1329
|
-
retainedStyles ||= {}
|
|
1330
|
-
retainedStyles[key] = styleState.style[key]
|
|
1331
|
-
} else if (nonAnimatedTransitionOnly) {
|
|
1332
|
-
retainedStyles ||= {}
|
|
1333
|
-
retainedStyles[key] = value
|
|
1334
|
-
shouldRetain = true
|
|
1335
|
-
} else {
|
|
1336
|
-
addStyleToInsertRules(rulesToInsert, atomicStyle)
|
|
1337
|
-
classNames[key] = identifier
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
1342
|
-
// console.groupEnd() // ensure group ended from loop above
|
|
1343
|
-
console.groupCollapsed(`🔹 getSplitStyles final style object`)
|
|
1344
|
-
console.info(styleState.style)
|
|
1345
|
-
console.info(`retainedStyles`, retainedStyles)
|
|
1346
|
-
console.groupEnd()
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
if (shouldRetain || !(process.env.IS_STATIC === 'is_static')) {
|
|
1350
|
-
styleState.style = retainedStyles || {}
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1173
|
+
flushDirectStyles(styleState)
|
|
1354
1174
|
|
|
1355
1175
|
// when noClass is true (inline animation driver) extract non-animatable
|
|
1356
1176
|
// base styles to atomic CSS classNames so the driver doesn't manage them
|
|
@@ -1363,55 +1183,23 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1363
1183
|
!driver?.isReactNative
|
|
1364
1184
|
) {
|
|
1365
1185
|
if (!styleState.style['$$css']) {
|
|
1366
|
-
const toConvert: Record<string, any> = {}
|
|
1367
|
-
let hasProps = false
|
|
1368
|
-
const animateOnly = props.animateOnly as string[] | undefined
|
|
1369
1186
|
for (const key in styleState.style) {
|
|
1370
1187
|
if (key in nonAnimatableStyleProps) {
|
|
1371
|
-
|
|
1188
|
+
// reproduce the direct-emission identity so the surviving class
|
|
1189
|
+
// matches its server-rendered counterpart exactly
|
|
1190
|
+
const atomicStyle = getCSSStyleAtomic(
|
|
1191
|
+
key,
|
|
1192
|
+
styleState.style[key],
|
|
1193
|
+
'',
|
|
1194
|
+
undefined,
|
|
1195
|
+
directStyleSignature(key, styleState.style[key]),
|
|
1196
|
+
true
|
|
1197
|
+
)
|
|
1372
1198
|
delete styleState.style[key]
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
const atomic = getCSSStylesAtomic(toConvert)
|
|
1378
|
-
for (const atomicStyle of atomic) {
|
|
1379
|
-
addStyleToInsertRules(rulesToInsert, atomicStyle)
|
|
1380
|
-
classNames[atomicStyle[StyleObjectProperty]] =
|
|
1381
|
-
atomicStyle[StyleObjectIdentifier]
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
// merge after the prop loop - and always keep it on style dont turn into className except if RN gives us
|
|
1389
|
-
const styleProp = props.style
|
|
1390
|
-
|
|
1391
|
-
if (!styleProps.noMergeStyle && styleProp) {
|
|
1392
|
-
if (isHOC) {
|
|
1393
|
-
viewProps.style = normalizeStyle(styleProp)
|
|
1394
|
-
} else {
|
|
1395
|
-
const isArray = Array.isArray(styleProp)
|
|
1396
|
-
const len = isArray ? styleProp.length : 1
|
|
1397
|
-
for (let i = 0; i < len; i++) {
|
|
1398
|
-
const style = isArray ? styleProp[i] : styleProp
|
|
1399
|
-
if (style) {
|
|
1400
|
-
if (style['$$css']) {
|
|
1401
|
-
Object.assign(styleState.classNames, style)
|
|
1402
|
-
} else {
|
|
1403
|
-
styleState.style ||= {}
|
|
1404
|
-
const normalized = normalizeStyle(style)
|
|
1405
|
-
Object.assign(styleState.style, normalized)
|
|
1406
|
-
if (shouldTrackStyleTokenProvenance) {
|
|
1407
|
-
// the literal style prop is merged last and wins: carry its own
|
|
1408
|
-
// token provenance forward, and clear a prior token wherever it
|
|
1409
|
-
// supplies a literal (e.g. style={{ color: '#fff' }} over
|
|
1410
|
-
// color="$color9" must stay a literal).
|
|
1411
|
-
const styleOriginals = styleOriginalValues.get(normalized)
|
|
1412
|
-
for (const k in normalized) {
|
|
1413
|
-
recordStyleTokenProvenance(styleState, k, styleOriginals?.[k])
|
|
1414
|
-
}
|
|
1199
|
+
if (atomicStyle) {
|
|
1200
|
+
addStyleToInsertRules(rulesToInsert, atomicStyle)
|
|
1201
|
+
classNames[atomicStyle[StyleObjectProperty]] =
|
|
1202
|
+
atomicStyle[StyleObjectIdentifier]
|
|
1415
1203
|
}
|
|
1416
1204
|
}
|
|
1417
1205
|
}
|
|
@@ -1470,19 +1258,44 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1470
1258
|
}
|
|
1471
1259
|
}
|
|
1472
1260
|
|
|
1261
|
+
// built without conditional spreads: this runs once per component render and
|
|
1262
|
+
// each spread transpiles to an ownKeys/defineProperty helper chain that
|
|
1263
|
+
// profiles at several percent of total style-resolution time
|
|
1473
1264
|
const result: GetStyleResult = {
|
|
1474
1265
|
hasMedia,
|
|
1475
1266
|
fontFamily: styleState.fontFamily,
|
|
1476
1267
|
viewProps,
|
|
1477
1268
|
style: styleState.style as any,
|
|
1478
|
-
pseudos,
|
|
1479
1269
|
classNames,
|
|
1480
1270
|
rulesToInsert,
|
|
1481
|
-
dynamicThemeAccess,
|
|
1482
1271
|
pseudoGroups,
|
|
1483
1272
|
mediaGroups,
|
|
1484
1273
|
overriddenContextProps: styleState.overriddenContextProps,
|
|
1485
|
-
|
|
1274
|
+
}
|
|
1275
|
+
if (effectiveTransition != null) result.effectiveTransition = effectiveTransition
|
|
1276
|
+
if (conditionalStates) result.programStates = conditionalStates
|
|
1277
|
+
if (usesSafeArea) result.usesSafeArea = true
|
|
1278
|
+
if (getDirectDynamicThemeAccess(styleState)) result.dynamicThemeAccess = true
|
|
1279
|
+
|
|
1280
|
+
if (styleState.flatEnterKeys || styleState.flatExitKeys) {
|
|
1281
|
+
const effectiveKeys = (keys?: Set<string>) => {
|
|
1282
|
+
if (!keys) return
|
|
1283
|
+
const out = new Set<string>()
|
|
1284
|
+
for (const key of keys) {
|
|
1285
|
+
out.add(
|
|
1286
|
+
key === '--t-x' || key === '--t-y'
|
|
1287
|
+
? 'translate'
|
|
1288
|
+
: key === '--t-scale-x' || key === '--t-scale-y'
|
|
1289
|
+
? 'scale'
|
|
1290
|
+
: key
|
|
1291
|
+
)
|
|
1292
|
+
}
|
|
1293
|
+
return out
|
|
1294
|
+
}
|
|
1295
|
+
result.programLifecycleStyleKeys = {
|
|
1296
|
+
enter: effectiveKeys(styleState.flatEnterKeys),
|
|
1297
|
+
exit: effectiveKeys(styleState.flatExitKeys),
|
|
1298
|
+
}
|
|
1486
1299
|
}
|
|
1487
1300
|
|
|
1488
1301
|
const asChildExceptStyleLike =
|
|
@@ -1495,27 +1308,34 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1495
1308
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
1496
1309
|
// merge className and style back into viewProps:
|
|
1497
1310
|
// only emit font class if fontFamily was explicitly in props (not from defaults)
|
|
1498
|
-
|
|
1499
|
-
if (fontFamily && fontFamily[0] === '$') {
|
|
1500
|
-
fontFamily = fontFamily.slice(1)
|
|
1501
|
-
}
|
|
1311
|
+
const fontFamily = isText || isInput ? styleState.fontFamily : null
|
|
1502
1312
|
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : ''
|
|
1503
1313
|
const groupClassName = props.group ? `t_group_${props.group}` : ''
|
|
1504
|
-
const
|
|
1505
|
-
const
|
|
1506
|
-
props.asChild ||
|
|
1314
|
+
const containerClassName = props.container ? 't_container' : ''
|
|
1315
|
+
const displayNameClassName =
|
|
1316
|
+
props.asChild ||
|
|
1317
|
+
!styleProps.displayName ||
|
|
1318
|
+
styleProps.displayName === 'Text' ||
|
|
1319
|
+
styleProps.displayName === 'View' ||
|
|
1320
|
+
!validComponentClassName.test(styleProps.displayName)
|
|
1507
1321
|
? ''
|
|
1508
|
-
: `is_${
|
|
1322
|
+
: `is_${styleProps.displayName}`
|
|
1509
1323
|
|
|
1510
1324
|
let classList: string[] = []
|
|
1511
|
-
if (
|
|
1325
|
+
if (displayNameClassName) classList.push(displayNameClassName)
|
|
1512
1326
|
// is_View gets base flex styles + font reset, is_Text gets base text styles
|
|
1513
1327
|
if (!isText) classList.push('is_View')
|
|
1514
1328
|
else classList.push('is_Text')
|
|
1515
1329
|
if (fontFamilyClassName) classList.push(fontFamilyClassName)
|
|
1516
|
-
if (classNames)
|
|
1330
|
+
if (classNames) {
|
|
1331
|
+
for (const key in classNames) {
|
|
1332
|
+
classList.push(classNames[key])
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1517
1335
|
if (groupClassName) classList.push(groupClassName)
|
|
1518
|
-
if (
|
|
1336
|
+
if (containerClassName) classList.push(containerClassName)
|
|
1337
|
+
// use className variable which may have been updated by tailwind preprocessing
|
|
1338
|
+
if (className) classList.push(className)
|
|
1519
1339
|
const finalClassName = classList.join(' ')
|
|
1520
1340
|
|
|
1521
1341
|
// use $$css for RNW components OR when animated with RNW driver
|
|
@@ -1566,6 +1386,9 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1566
1386
|
try {
|
|
1567
1387
|
// prettier-ignore
|
|
1568
1388
|
const logs = {
|
|
1389
|
+
...((props as any).__tamaguiStyleDebugReceipt && {
|
|
1390
|
+
receipt: (props as any).__tamaguiStyleDebugReceipt as StyleDebugReceipt,
|
|
1391
|
+
}),
|
|
1569
1392
|
...result,
|
|
1570
1393
|
className,
|
|
1571
1394
|
componentState,
|
|
@@ -1595,36 +1418,73 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1595
1418
|
}
|
|
1596
1419
|
|
|
1597
1420
|
function mergeFlatTransforms(target: TextStyle, flatTransforms: Record<string, any>) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1421
|
+
const transform: Record<string, any>[] = []
|
|
1422
|
+
if ('x' in flatTransforms) transform.push({ translateX: flatTransforms.x })
|
|
1423
|
+
if ('y' in flatTransforms) transform.push({ translateY: flatTransforms.y })
|
|
1424
|
+
if ('rotate' in flatTransforms) transform.push({ rotate: flatTransforms.rotate })
|
|
1425
|
+
|
|
1426
|
+
const hasScaleX = 'scaleX' in flatTransforms
|
|
1427
|
+
const hasScaleY = 'scaleY' in flatTransforms
|
|
1428
|
+
if (hasScaleX && hasScaleY && Object.is(flatTransforms.scaleX, flatTransforms.scaleY)) {
|
|
1429
|
+
transform.push({ scale: flatTransforms.scaleX })
|
|
1430
|
+
} else {
|
|
1431
|
+
if (hasScaleX) transform.push({ scaleX: flatTransforms.scaleX })
|
|
1432
|
+
if (hasScaleY) transform.push({ scaleY: flatTransforms.scaleY })
|
|
1433
|
+
if (!hasScaleX && !hasScaleY && 'scale' in flatTransforms) {
|
|
1434
|
+
transform.push({ scale: flatTransforms.scale })
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
const keys: string[] = []
|
|
1439
|
+
for (const key in flatTransforms) {
|
|
1440
|
+
if (
|
|
1441
|
+
key !== 'x' &&
|
|
1442
|
+
key !== 'y' &&
|
|
1443
|
+
key !== 'rotate' &&
|
|
1444
|
+
key !== 'scale' &&
|
|
1445
|
+
key !== 'scaleX' &&
|
|
1446
|
+
key !== 'scaleY'
|
|
1447
|
+
)
|
|
1448
|
+
keys.push(key)
|
|
1449
|
+
}
|
|
1450
|
+
keys.sort(sortString)
|
|
1451
|
+
for (const key of keys) {
|
|
1452
|
+
transform.push({ [mapTransformKeys[key] || key]: flatTransforms[key] })
|
|
1453
|
+
}
|
|
1454
|
+
if (Array.isArray(target.transform)) {
|
|
1455
|
+
transform.push(...(target.transform as any))
|
|
1456
|
+
}
|
|
1457
|
+
target.transform = transform as any
|
|
1603
1458
|
}
|
|
1604
1459
|
|
|
1605
1460
|
function mergeStyle(
|
|
1606
1461
|
styleState: GetStyleState,
|
|
1607
1462
|
key: string,
|
|
1608
1463
|
val: any,
|
|
1609
|
-
|
|
1464
|
+
_importance: number,
|
|
1610
1465
|
disableNormalize = false,
|
|
1611
1466
|
originalVal?: any
|
|
1612
1467
|
) {
|
|
1613
|
-
const { viewProps, styleProps, staticConfig
|
|
1614
|
-
|
|
1615
|
-
const existingImportance = usedKeys[key] || 0
|
|
1616
|
-
if (existingImportance > importance) {
|
|
1617
|
-
return
|
|
1618
|
-
}
|
|
1468
|
+
const { viewProps, styleProps, staticConfig } = styleState
|
|
1619
1469
|
|
|
1620
1470
|
// track context overrides for pseudo/media styles (issues #3670, #3676)
|
|
1621
1471
|
// when a style sets a key that's in context props, update overriddenContextProps
|
|
1622
|
-
// so it propagates to children. use the original token value (like '
|
|
1472
|
+
// so it propagates to children. use the original token value (like '8')
|
|
1623
1473
|
// instead of the resolved CSS variable (like 'var(--t-space-8)')
|
|
1624
1474
|
// so children's functional variants can look up token values.
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1475
|
+
const contextConfig = staticConfig.context || staticConfig.parentStaticConfig?.context
|
|
1476
|
+
const contextProps = contextConfig?.props
|
|
1477
|
+
const inheritedContextPropKeys =
|
|
1478
|
+
!staticConfig.context ||
|
|
1479
|
+
staticConfig.context === staticConfig.parentStaticConfig?.context
|
|
1480
|
+
? staticConfig.parentStaticConfig?.contextProps
|
|
1481
|
+
: undefined
|
|
1482
|
+
const contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys
|
|
1483
|
+
const isContextProp =
|
|
1484
|
+
(contextProps && key in contextProps) ||
|
|
1485
|
+
contextPropKeys?.includes(key) ||
|
|
1486
|
+
contextConfig?.propKeys?.includes(key)
|
|
1487
|
+
if (isContextProp) {
|
|
1628
1488
|
styleState.overriddenContextProps ||= {}
|
|
1629
1489
|
// Priority: 1) originalVal from propMapper, 2) tracked original from variant resolution, 3) val
|
|
1630
1490
|
const originalFromState = styleState.originalContextPropValues?.[key]
|
|
@@ -1633,7 +1493,6 @@ function mergeStyle(
|
|
|
1633
1493
|
|
|
1634
1494
|
if (key in stylePropsTransform) {
|
|
1635
1495
|
styleState.flatTransforms ||= {}
|
|
1636
|
-
usedKeys[key] = importance
|
|
1637
1496
|
styleState.flatTransforms[key] = val
|
|
1638
1497
|
} else {
|
|
1639
1498
|
const shouldNormalize = isWeb && !disableNormalize && !styleProps.noNormalize
|
|
@@ -1646,15 +1505,14 @@ function mergeStyle(
|
|
|
1646
1505
|
viewProps[key] = out
|
|
1647
1506
|
} else {
|
|
1648
1507
|
styleState.style ||= {}
|
|
1649
|
-
usedKeys[key] = importance
|
|
1650
1508
|
styleState.style[key] =
|
|
1651
1509
|
// if you dont do this you'll be passing props.transform arrays directly here and then mutating them
|
|
1652
1510
|
// if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
|
|
1653
1511
|
key === 'transform' && Array.isArray(out) ? [...out] : out
|
|
1654
1512
|
if (shouldTrackStyleTokenProvenance) {
|
|
1655
|
-
// dev-tools token provenance: this write is the current winner for `key
|
|
1656
|
-
//
|
|
1657
|
-
//
|
|
1513
|
+
// dev-tools token provenance: this write is the current winner for `key`,
|
|
1514
|
+
// so record the token that produced it, or clear a prior token when a
|
|
1515
|
+
// literal wins, keeping literal-over-token exact.
|
|
1658
1516
|
recordStyleTokenProvenance(styleState, key, originalVal)
|
|
1659
1517
|
}
|
|
1660
1518
|
}
|
|
@@ -1663,14 +1521,31 @@ function mergeStyle(
|
|
|
1663
1521
|
|
|
1664
1522
|
// track which token produced the winning value for a style key so the final
|
|
1665
1523
|
// style object can expose exact provenance. only the base (painted) style is
|
|
1666
|
-
// tracked
|
|
1667
|
-
// and a literal override clears any earlier token for that key.
|
|
1524
|
+
// tracked, and a literal override clears any earlier token for that key.
|
|
1668
1525
|
function recordStyleTokenProvenance(
|
|
1669
1526
|
styleState: GetStyleState,
|
|
1670
1527
|
key: string,
|
|
1671
1528
|
originalVal: any
|
|
1672
1529
|
) {
|
|
1673
|
-
|
|
1530
|
+
let tokenName = typeof originalVal === 'string' ? originalVal : ''
|
|
1531
|
+
if (tokenName) {
|
|
1532
|
+
const slash = tokenName.lastIndexOf('/')
|
|
1533
|
+
const opacity = slash === -1 ? NaN : Number(tokenName.slice(slash + 1))
|
|
1534
|
+
if (Number.isInteger(opacity) && opacity >= 0 && opacity <= 100) {
|
|
1535
|
+
tokenName = tokenName.slice(0, slash)
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
const isConfiguredToken =
|
|
1539
|
+
tokenName !== '' &&
|
|
1540
|
+
(Object.prototype.hasOwnProperty.call(styleState.theme, tokenName) ||
|
|
1541
|
+
Object.prototype.hasOwnProperty.call(
|
|
1542
|
+
styleState.conf.themes?.[styleState.flatThemeName || ''] || {},
|
|
1543
|
+
tokenName
|
|
1544
|
+
) ||
|
|
1545
|
+
Object.values(styleState.conf.tokensParsed).some((category) =>
|
|
1546
|
+
Object.prototype.hasOwnProperty.call(category, tokenName)
|
|
1547
|
+
))
|
|
1548
|
+
if (isConfiguredToken) {
|
|
1674
1549
|
;(styleState.tokenProvenance ||= {})[key] = originalVal
|
|
1675
1550
|
} else if (styleState.tokenProvenance && key in styleState.tokenProvenance) {
|
|
1676
1551
|
delete styleState.tokenProvenance[key]
|
|
@@ -1679,7 +1554,7 @@ function recordStyleTokenProvenance(
|
|
|
1679
1554
|
|
|
1680
1555
|
export const getSubStyle = (
|
|
1681
1556
|
styleState: GetStyleState,
|
|
1682
|
-
|
|
1557
|
+
_subKey: string,
|
|
1683
1558
|
styleIn: object,
|
|
1684
1559
|
avoidMergeTransform?: boolean
|
|
1685
1560
|
): TextStyle => {
|
|
@@ -1688,41 +1563,19 @@ export const getSubStyle = (
|
|
|
1688
1563
|
let originalValues: Record<string, any> | undefined
|
|
1689
1564
|
const styleInOriginalValues = styleOriginalValues.get(styleIn)
|
|
1690
1565
|
const parentProps = styleState.props
|
|
1691
|
-
|
|
1566
|
+
// prototype-chain view instead of a spread copy: reads fall through to
|
|
1567
|
+
// parentProps, avoiding an O(parentProps) allocation per sub-style. define
|
|
1568
|
+
// styleIn as own props (not Object.assign) because parentProps is React's
|
|
1569
|
+
// frozen props object — [[Set]] of a key that exists read-only up the proto
|
|
1570
|
+
// chain (e.g. a base backgroundColor also set in a pseudo/media sub-style)
|
|
1571
|
+
// throws, whereas [[DefineOwnProperty]] via descriptors always writes an own.
|
|
1572
|
+
styleState.props = Object.create(parentProps, Object.getOwnPropertyDescriptors(styleIn))
|
|
1692
1573
|
|
|
1693
1574
|
try {
|
|
1694
1575
|
for (let key in styleIn) {
|
|
1695
1576
|
const val = styleIn[key]
|
|
1696
1577
|
key = conf.shorthands[key] || key
|
|
1697
1578
|
|
|
1698
|
-
// extract transition from pseudo-style props (e.g., hoverStyle.transition)
|
|
1699
|
-
// store it separately for animation drivers to use for enter/exit timing
|
|
1700
|
-
if (key === 'transition') {
|
|
1701
|
-
styleState.pseudoTransitions ||= {}
|
|
1702
|
-
styleState.pseudoTransitions[
|
|
1703
|
-
subKey as keyof typeof styleState.pseudoTransitions
|
|
1704
|
-
] = val
|
|
1705
|
-
// for CSS driver, also add transition to CSS output so native CSS transitions work
|
|
1706
|
-
// group styles ($group-*) need !important to override inline base transition
|
|
1707
|
-
const driver = styleState.animationDriver
|
|
1708
|
-
if (driver?.outputStyle === 'css') {
|
|
1709
|
-
const animationConfig = driver.animations?.[val as string]
|
|
1710
|
-
if (animationConfig) {
|
|
1711
|
-
const important = subKey[0] === '$' ? ' !important' : ''
|
|
1712
|
-
styleOut['transition'] = `all ${animationConfig}${important}`
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
// not a known animation name, pass through as raw CSS
|
|
1716
|
-
if (
|
|
1717
|
-
!styleOut['transition'] &&
|
|
1718
|
-
typeof val === 'string' &&
|
|
1719
|
-
!driver?.animations?.[val]
|
|
1720
|
-
) {
|
|
1721
|
-
styleOut['transition'] = val
|
|
1722
|
-
}
|
|
1723
|
-
continue
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
1579
|
const shouldSkip = !staticConfig.isHOC && key in skipProps && !styleProps.noSkip
|
|
1727
1580
|
if (shouldSkip) {
|
|
1728
1581
|
continue
|
|
@@ -1735,10 +1588,6 @@ export const getSubStyle = (
|
|
|
1735
1588
|
originalValues ||= {}
|
|
1736
1589
|
originalValues[skey] = trackedOriginalVal
|
|
1737
1590
|
}
|
|
1738
|
-
// pseudo inside media
|
|
1739
|
-
if (skey in validPseudoKeys) {
|
|
1740
|
-
sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)
|
|
1741
|
-
}
|
|
1742
1591
|
if (!avoidMergeTransform && skey in stylePropsTransform) {
|
|
1743
1592
|
mergeTransform(styleOut, skey, sval)
|
|
1744
1593
|
} else {
|
|
@@ -1802,7 +1651,9 @@ export const getSubStyle = (
|
|
|
1802
1651
|
}
|
|
1803
1652
|
|
|
1804
1653
|
// Store original values in WeakMap instead of on the object itself
|
|
1805
|
-
|
|
1654
|
+
// (originalValues is only ever created right before a key is set, so
|
|
1655
|
+
// defined implies non-empty)
|
|
1656
|
+
if (originalValues) {
|
|
1806
1657
|
styleOriginalValues.set(styleOut, originalValues)
|
|
1807
1658
|
}
|
|
1808
1659
|
|
|
@@ -1841,26 +1692,6 @@ function addStyleToInsertRules(rulesToInsert: RulesToInsert, styleObject: StyleO
|
|
|
1841
1692
|
}
|
|
1842
1693
|
}
|
|
1843
1694
|
|
|
1844
|
-
const defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || 'rgba(0,0,0,0)'
|
|
1845
|
-
const animatableDefaults = {
|
|
1846
|
-
...Object.fromEntries(
|
|
1847
|
-
Object.entries(tokenCategories.color).map(([k, v]) => [k, defaultColor])
|
|
1848
|
-
),
|
|
1849
|
-
opacity: 1,
|
|
1850
|
-
scale: 1,
|
|
1851
|
-
scaleX: 1,
|
|
1852
|
-
scaleY: 1,
|
|
1853
|
-
rotate: '0deg',
|
|
1854
|
-
rotateX: '0deg',
|
|
1855
|
-
rotateY: '0deg',
|
|
1856
|
-
rotateZ: '0deg',
|
|
1857
|
-
skewX: '0deg',
|
|
1858
|
-
skewY: '0deg',
|
|
1859
|
-
x: 0,
|
|
1860
|
-
y: 0,
|
|
1861
|
-
borderRadius: 0,
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
1695
|
const mergeTransform = (obj: TextStyle, key: string, val: any, backwards = false) => {
|
|
1865
1696
|
if (typeof obj.transform === 'string') {
|
|
1866
1697
|
return
|
|
@@ -1876,90 +1707,8 @@ const mapTransformKeys = {
|
|
|
1876
1707
|
y: 'translateY',
|
|
1877
1708
|
}
|
|
1878
1709
|
|
|
1879
|
-
function passDownProp(
|
|
1880
|
-
viewProps
|
|
1881
|
-
key: string,
|
|
1882
|
-
val: any,
|
|
1883
|
-
shouldMergeObject = false
|
|
1884
|
-
) {
|
|
1885
|
-
if (shouldMergeObject) {
|
|
1886
|
-
const next = {
|
|
1887
|
-
...viewProps[key],
|
|
1888
|
-
...val,
|
|
1889
|
-
}
|
|
1890
|
-
// need to re-insert it at current position
|
|
1891
|
-
delete viewProps[key]
|
|
1892
|
-
viewProps[key] = next
|
|
1893
|
-
} else {
|
|
1894
|
-
viewProps[key] = val
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
function mergeMediaByImportance(
|
|
1899
|
-
styleState: GetStyleState,
|
|
1900
|
-
mediaKey: string,
|
|
1901
|
-
key: string,
|
|
1902
|
-
value: any,
|
|
1903
|
-
isSizeMedia: boolean,
|
|
1904
|
-
importanceBump?: number,
|
|
1905
|
-
debugProp?: DebugProp,
|
|
1906
|
-
originalVal?: any
|
|
1907
|
-
) {
|
|
1908
|
-
const usedKeys = styleState.usedKeys
|
|
1909
|
-
let importance = getMediaImportanceIfMoreImportant(
|
|
1910
|
-
mediaKey,
|
|
1911
|
-
key,
|
|
1912
|
-
styleState,
|
|
1913
|
-
isSizeMedia
|
|
1914
|
-
)
|
|
1915
|
-
if (importanceBump) {
|
|
1916
|
-
// With a specificity bump, the effective importance is always
|
|
1917
|
-
// defaultMediaImportance + bump. This lets higher-specificity styles
|
|
1918
|
-
// (e.g. $platform-tv > $platform-native) override lower-specificity ones
|
|
1919
|
-
// regardless of prop declaration order, even when getMediaImportanceIfMoreImportant
|
|
1920
|
-
// returns null (meaning the same base importance was already applied).
|
|
1921
|
-
//
|
|
1922
|
-
// We must re-check `usedKeys[key]` here (rather than relying on the null
|
|
1923
|
-
// returned by getMediaImportanceIfMoreImportant) because that function only
|
|
1924
|
-
// compares against `defaultMediaImportance`, which equals our base before
|
|
1925
|
-
// the bump. We need to compare against the *bumped* value to correctly
|
|
1926
|
-
// allow a more-specific style to win.
|
|
1927
|
-
const bumpedImportance = defaultMediaImportance + importanceBump
|
|
1928
|
-
importance =
|
|
1929
|
-
!usedKeys[key] || bumpedImportance > usedKeys[key] ? bumpedImportance : null
|
|
1930
|
-
}
|
|
1931
|
-
if (process.env.NODE_ENV === 'development' && debugProp === 'verbose') {
|
|
1932
|
-
log(
|
|
1933
|
-
`mergeMediaByImportance ${key} importance usedKey ${usedKeys[key]} next ${importance}`
|
|
1934
|
-
)
|
|
1935
|
-
}
|
|
1936
|
-
if (importance === null) {
|
|
1937
|
-
return false
|
|
1938
|
-
}
|
|
1939
|
-
if (key in pseudoDescriptors) {
|
|
1940
|
-
const descriptor = pseudoDescriptors[key as PseudoDescriptorKey]
|
|
1941
|
-
const descriptorKey = descriptor.stateKey || descriptor.name
|
|
1942
|
-
const isDisabled = styleState.componentState[descriptorKey] === false
|
|
1943
|
-
if (isDisabled) {
|
|
1944
|
-
return false
|
|
1945
|
-
}
|
|
1946
|
-
// For pseudo inside media, value is an object with subkeys
|
|
1947
|
-
const pseudoOriginalValues = styleOriginalValues.get(value as object)
|
|
1948
|
-
for (const subKey in value) {
|
|
1949
|
-
mergeStyle(
|
|
1950
|
-
styleState,
|
|
1951
|
-
subKey,
|
|
1952
|
-
value[subKey],
|
|
1953
|
-
importance,
|
|
1954
|
-
false,
|
|
1955
|
-
pseudoOriginalValues?.[subKey]
|
|
1956
|
-
)
|
|
1957
|
-
}
|
|
1958
|
-
} else {
|
|
1959
|
-
mergeStyle(styleState, key, value, importance, false, originalVal)
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
return true
|
|
1710
|
+
function passDownProp(viewProps: object, key: string, val: any) {
|
|
1711
|
+
viewProps[key] = val
|
|
1963
1712
|
}
|
|
1964
1713
|
|
|
1965
1714
|
function normalizeStyle(style: any) {
|
|
@@ -1978,14 +1727,3 @@ function normalizeStyle(style: any) {
|
|
|
1978
1727
|
fixStyles(out)
|
|
1979
1728
|
return out
|
|
1980
1729
|
}
|
|
1981
|
-
|
|
1982
|
-
function applyDefaultStyle(pkey: string, styleState: GetStyleState) {
|
|
1983
|
-
const defaultValues = animatableDefaults[pkey]
|
|
1984
|
-
if (
|
|
1985
|
-
defaultValues != null &&
|
|
1986
|
-
!(pkey in styleState.usedKeys) &&
|
|
1987
|
-
(!styleState.style || !(pkey in styleState.style))
|
|
1988
|
-
) {
|
|
1989
|
-
mergeStyle(styleState, pkey, defaultValues, 1)
|
|
1990
|
-
}
|
|
1991
|
-
}
|