@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
|
@@ -0,0 +1,1746 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAndroid,
|
|
3
|
+
isIos,
|
|
4
|
+
isTV,
|
|
5
|
+
isWeb,
|
|
6
|
+
supportsDynamicColorIOS,
|
|
7
|
+
} from '@tamagui/constants'
|
|
8
|
+
import {
|
|
9
|
+
StyleObjectIdentifier,
|
|
10
|
+
StyleObjectRules,
|
|
11
|
+
tokenCategories,
|
|
12
|
+
type StyleObject,
|
|
13
|
+
} from '@tamagui/helpers'
|
|
14
|
+
import {
|
|
15
|
+
canonicalClauseModifier,
|
|
16
|
+
clauseConditionSetKey,
|
|
17
|
+
clauseSubjectClassRepetitions,
|
|
18
|
+
compareClausePrecedence,
|
|
19
|
+
createClausePrecedenceOrder,
|
|
20
|
+
getClausePrecedenceKeyFromKinds,
|
|
21
|
+
isRootThemeName,
|
|
22
|
+
scanFlatValue,
|
|
23
|
+
type ClausePrecedenceKey,
|
|
24
|
+
type ClausePrecedenceOrder,
|
|
25
|
+
type ModifierKind,
|
|
26
|
+
type ParsedValue,
|
|
27
|
+
} from '@tamagui/style-grammar/runtime'
|
|
28
|
+
|
|
29
|
+
import { isVariable } from '../createVariable'
|
|
30
|
+
import { mediaKeyMatch } from '../hooks/useMedia'
|
|
31
|
+
import type { GetStyleState } from '../types'
|
|
32
|
+
import { warnOnce, warnRefusedValue } from './warnOnce'
|
|
33
|
+
import { expandStyle } from './expandStyle'
|
|
34
|
+
import { getCSSStyleAtomic } from './getCSSStylesAtomic'
|
|
35
|
+
import { isColorStyleKey } from './getDynamicVal'
|
|
36
|
+
import { shouldInsertStyleRules, updateRules } from './insertStyleRule'
|
|
37
|
+
import { mediaObjectToString } from './mediaObjectToString'
|
|
38
|
+
import { normalizeColor } from './normalizeColor'
|
|
39
|
+
import { parseNativeStyle } from './parseNativeStyle.native'
|
|
40
|
+
import { parseNativeTransform } from './parseNativeTransform.native'
|
|
41
|
+
import { getTokenCategoryForProperty, tokenCategoryByProperty } from './tokenCategories'
|
|
42
|
+
import { resolveSafeAreaVariable } from './resolveSafeAreaVariable'
|
|
43
|
+
import { expandSafeAreaValue, isSafeAreaKey } from './resolveSafeArea'
|
|
44
|
+
import { resolveVariableValue } from './resolveVariableValue'
|
|
45
|
+
import { THEME_REF_PREFIX } from './themeRef'
|
|
46
|
+
import { transformsToString } from './transformsToString'
|
|
47
|
+
|
|
48
|
+
export type MergeStyle = (
|
|
49
|
+
state: GetStyleState,
|
|
50
|
+
key: string,
|
|
51
|
+
value: any,
|
|
52
|
+
importance: number,
|
|
53
|
+
disableNormalize?: boolean,
|
|
54
|
+
originalValue?: any
|
|
55
|
+
) => void
|
|
56
|
+
|
|
57
|
+
type Condition = {
|
|
58
|
+
key: string
|
|
59
|
+
active: boolean
|
|
60
|
+
emit: boolean
|
|
61
|
+
selector: string
|
|
62
|
+
wrappers?: string[]
|
|
63
|
+
enter?: true
|
|
64
|
+
exit?: true
|
|
65
|
+
theme?: string
|
|
66
|
+
precedence: ClausePrecedenceKey
|
|
67
|
+
classRepetitions: number
|
|
68
|
+
unsupportedState?: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type DirectAtomic = {
|
|
72
|
+
baseRules: number
|
|
73
|
+
conditions?: Record<
|
|
74
|
+
string,
|
|
75
|
+
{
|
|
76
|
+
count: number
|
|
77
|
+
index: number
|
|
78
|
+
precedence: ClausePrecedenceKey
|
|
79
|
+
default?: boolean
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
signature: string
|
|
83
|
+
styleObject: StyleObject
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type DirectState = GetStyleState & {
|
|
87
|
+
flatAtomics?: Record<string, DirectAtomic>
|
|
88
|
+
flatBoxShadow?: any
|
|
89
|
+
flatDynamicColors?: Record<string, Record<string, any>>
|
|
90
|
+
flatDynamicThemeAccess?: boolean
|
|
91
|
+
flatLegacyTransforms?: Record<string, any>
|
|
92
|
+
flatPrecedence?: Record<string, ClausePrecedenceKey>
|
|
93
|
+
flatTextShadow?: Record<string, any>
|
|
94
|
+
flatWebShadow?: Record<string, any>
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const baseClausePrecedence = [0, 0, 0, 0] as const
|
|
98
|
+
|
|
99
|
+
// keyed by the CANONICAL modifier spelling: `canonicalClauseModifier` has
|
|
100
|
+
// already folded `active`, `pressed`, `starting` and `ending` into their one
|
|
101
|
+
// spelling before anything looks in here
|
|
102
|
+
const stateSelectors: Record<string, string> = {
|
|
103
|
+
hover: ':hover',
|
|
104
|
+
press: ':active',
|
|
105
|
+
focus: ':focus',
|
|
106
|
+
'focus-visible': ':focus-visible',
|
|
107
|
+
'focus-within': ':focus-within',
|
|
108
|
+
disabled: '[aria-disabled]',
|
|
109
|
+
open: '[data-state="open"]',
|
|
110
|
+
checked: '[data-state="checked"]',
|
|
111
|
+
highlighted: '[data-highlighted]',
|
|
112
|
+
selected: '[data-state="active"]',
|
|
113
|
+
invalid: '[aria-invalid="true"]',
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const legacyTransformParts = new Set([
|
|
117
|
+
'matrix',
|
|
118
|
+
'perspective',
|
|
119
|
+
'rotateX',
|
|
120
|
+
'rotateY',
|
|
121
|
+
'rotateZ',
|
|
122
|
+
'scaleZ',
|
|
123
|
+
'skewX',
|
|
124
|
+
'skewY',
|
|
125
|
+
])
|
|
126
|
+
|
|
127
|
+
const webShadowParts = new Set([
|
|
128
|
+
'shadowColor',
|
|
129
|
+
'shadowOffset',
|
|
130
|
+
'shadowOpacity',
|
|
131
|
+
'shadowRadius',
|
|
132
|
+
])
|
|
133
|
+
|
|
134
|
+
const webTextShadowParts = new Set([
|
|
135
|
+
'textShadowColor',
|
|
136
|
+
'textShadowOffset',
|
|
137
|
+
'textShadowRadius',
|
|
138
|
+
])
|
|
139
|
+
|
|
140
|
+
const lineStyles = new Set([
|
|
141
|
+
'none',
|
|
142
|
+
'hidden',
|
|
143
|
+
'dotted',
|
|
144
|
+
'dashed',
|
|
145
|
+
'solid',
|
|
146
|
+
'double',
|
|
147
|
+
'groove',
|
|
148
|
+
'ridge',
|
|
149
|
+
'inset',
|
|
150
|
+
'outset',
|
|
151
|
+
])
|
|
152
|
+
|
|
153
|
+
const borderTargets: Record<
|
|
154
|
+
string,
|
|
155
|
+
{ width: string[]; style: string[]; color: string[] }
|
|
156
|
+
> = {
|
|
157
|
+
border: {
|
|
158
|
+
width: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],
|
|
159
|
+
style: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],
|
|
160
|
+
color: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],
|
|
161
|
+
},
|
|
162
|
+
borderTop: {
|
|
163
|
+
width: ['borderTopWidth'],
|
|
164
|
+
style: ['borderTopStyle'],
|
|
165
|
+
color: ['borderTopColor'],
|
|
166
|
+
},
|
|
167
|
+
borderRight: {
|
|
168
|
+
width: ['borderRightWidth'],
|
|
169
|
+
style: ['borderRightStyle'],
|
|
170
|
+
color: ['borderRightColor'],
|
|
171
|
+
},
|
|
172
|
+
borderBottom: {
|
|
173
|
+
width: ['borderBottomWidth'],
|
|
174
|
+
style: ['borderBottomStyle'],
|
|
175
|
+
color: ['borderBottomColor'],
|
|
176
|
+
},
|
|
177
|
+
borderLeft: {
|
|
178
|
+
width: ['borderLeftWidth'],
|
|
179
|
+
style: ['borderLeftStyle'],
|
|
180
|
+
color: ['borderLeftColor'],
|
|
181
|
+
},
|
|
182
|
+
outline: {
|
|
183
|
+
width: ['outlineWidth'],
|
|
184
|
+
style: ['outlineStyle'],
|
|
185
|
+
color: ['outlineColor'],
|
|
186
|
+
},
|
|
187
|
+
borderBlock: {
|
|
188
|
+
width: ['borderBlockStartWidth', 'borderBlockEndWidth'],
|
|
189
|
+
style: ['borderBlockStartStyle', 'borderBlockEndStyle'],
|
|
190
|
+
color: ['borderBlockStartColor', 'borderBlockEndColor'],
|
|
191
|
+
},
|
|
192
|
+
borderInline: {
|
|
193
|
+
width: ['borderInlineStartWidth', 'borderInlineEndWidth'],
|
|
194
|
+
style: ['borderInlineStartStyle', 'borderInlineEndStyle'],
|
|
195
|
+
color: ['borderInlineStartColor', 'borderInlineEndColor'],
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const borderStyleDefaults: Record<string, string> = {
|
|
200
|
+
borderWidth: 'borderStyle',
|
|
201
|
+
borderTopWidth: 'borderTopStyle',
|
|
202
|
+
borderRightWidth: 'borderRightStyle',
|
|
203
|
+
borderBottomWidth: 'borderBottomStyle',
|
|
204
|
+
borderLeftWidth: 'borderLeftStyle',
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const mediaQueries = new WeakMap<object, Record<string, string>>()
|
|
208
|
+
const clausePrecedenceOrders = new WeakMap<object, ClausePrecedenceOrder>()
|
|
209
|
+
function queryFor(state: GetStyleState, name: string): string | undefined {
|
|
210
|
+
let queries = mediaQueries.get(state.conf)
|
|
211
|
+
if (!queries) {
|
|
212
|
+
queries = {}
|
|
213
|
+
const media = state.conf.media || {}
|
|
214
|
+
for (const key in media) queries[key] = mediaObjectToString(media[key])
|
|
215
|
+
mediaQueries.set(state.conf, queries)
|
|
216
|
+
}
|
|
217
|
+
return queries[name]
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function precedenceOrderFor(state: GetStyleState): ClausePrecedenceOrder {
|
|
221
|
+
let order = clausePrecedenceOrders.get(state.conf)
|
|
222
|
+
if (!order) {
|
|
223
|
+
order = createClausePrecedenceOrder(state.conf.media)
|
|
224
|
+
clausePrecedenceOrders.set(state.conf, order)
|
|
225
|
+
}
|
|
226
|
+
return order
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function stateIsActive(state: GetStyleState, name: string): boolean {
|
|
230
|
+
const component = state.componentState
|
|
231
|
+
if (name === 'hover') return !!component.hover
|
|
232
|
+
if (name === 'press') return !!(component.press || component.pressIn)
|
|
233
|
+
if (name === 'focus') return !!component.focus
|
|
234
|
+
if (name === 'focus-visible') return !!component.focusVisible
|
|
235
|
+
if (name === 'focus-within') return !!component.focusWithin
|
|
236
|
+
if (name === 'disabled') return !!(component.disabled || state.props.disabled)
|
|
237
|
+
if (name === 'enter') return !!component.unmounted
|
|
238
|
+
if (name === 'exit') return !!state.styleProps.isExiting
|
|
239
|
+
return false
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export function platformMatches(name: string): boolean {
|
|
243
|
+
if (name === 'web') return isWeb
|
|
244
|
+
if (name === 'native') return !isWeb
|
|
245
|
+
if (name === 'ios') return isIos
|
|
246
|
+
if (name === 'android') return isAndroid
|
|
247
|
+
if (name === 'tvos') return isIos && isTV
|
|
248
|
+
if (name === 'androidtv') return isAndroid && isTV
|
|
249
|
+
return name === 'tv' && isTV
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function groupCondition(state: GetStyleState, modifier: string, out: Condition) {
|
|
253
|
+
const slash = modifier.indexOf('/')
|
|
254
|
+
const stateName = modifier.slice(6, slash === -1 ? undefined : slash)
|
|
255
|
+
const groupName = slash === -1 ? 'true' : modifier.slice(slash + 1)
|
|
256
|
+
const selector = stateSelectors[stateName]
|
|
257
|
+
if (!selector || !groupName) return false
|
|
258
|
+
out.selector += `:where(.t_group_${groupName}${selector} *)`
|
|
259
|
+
if (stateName === 'hover') (out.wrappers ||= []).push('@media (hover: hover)')
|
|
260
|
+
const component = state.componentState.group?.[groupName]
|
|
261
|
+
const context = state.flatGroupContext?.[groupName]
|
|
262
|
+
out.active &&= !!(component?.pseudo ?? context?.state.pseudo)?.[stateName]
|
|
263
|
+
;(state.flatGroupKeys ||= new Set()).add(groupName)
|
|
264
|
+
return true
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function containerCondition(state: GetStyleState, modifier: string, out: Condition) {
|
|
268
|
+
const slash = modifier.indexOf('/')
|
|
269
|
+
const size = modifier.slice(1, slash === -1 ? undefined : slash)
|
|
270
|
+
const name = slash === -1 ? null : modifier.slice(slash + 1)
|
|
271
|
+
const query = queryFor(state, size)
|
|
272
|
+
if (!query || (name !== null && !name)) return false
|
|
273
|
+
const key = name === null ? '@' : `@${name}`
|
|
274
|
+
;(out.wrappers ||= []).push(
|
|
275
|
+
name === null ? `@container ${query}` : `@container ${name} ${query}`
|
|
276
|
+
)
|
|
277
|
+
const component = state.componentState.group?.[key]
|
|
278
|
+
const context = state.flatGroupContext?.[key]
|
|
279
|
+
const active = component?.media?.[size]
|
|
280
|
+
out.active &&=
|
|
281
|
+
active === undefined
|
|
282
|
+
? !!(context?.state.layout && mediaKeyMatch(size, context.state.layout))
|
|
283
|
+
: !!active
|
|
284
|
+
;(state.flatGroupKeys ||= new Set()).add(key)
|
|
285
|
+
;(state.flatGroupMedia ||= new Set()).add(size)
|
|
286
|
+
return true
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Resolve one modifier chain against the live state, or null when the runtime
|
|
291
|
+
* has no such modifier. Exported because the variant scanner in `propMapper`
|
|
292
|
+
* has to refuse exactly the chains this one refuses; two answers to "is this a
|
|
293
|
+
* modifier" is how the prop and variant paths came to disagree about how much
|
|
294
|
+
* of a bad value survives.
|
|
295
|
+
*/
|
|
296
|
+
export function getCondition(state: GetStyleState, source: string): Condition | null {
|
|
297
|
+
const out = { key: '', active: true, emit: true, selector: '' } as Condition
|
|
298
|
+
const canonical: string[] = []
|
|
299
|
+
const kinds: ModifierKind[] = []
|
|
300
|
+
const seenModifiers = new Set<string>()
|
|
301
|
+
let selfStateSpecificity = 0
|
|
302
|
+
let start = 0
|
|
303
|
+
for (let index = 0; index <= source.length; index++) {
|
|
304
|
+
if (index !== source.length && source.charCodeAt(index) !== 58) continue
|
|
305
|
+
let modifier = canonicalClauseModifier(source.slice(start, index))
|
|
306
|
+
start = index + 1
|
|
307
|
+
if (!modifier) return null
|
|
308
|
+
if (seenModifiers.has(modifier)) continue
|
|
309
|
+
seenModifiers.add(modifier)
|
|
310
|
+
|
|
311
|
+
if (modifier.startsWith('group-')) {
|
|
312
|
+
if (!groupCondition(state, modifier, out)) return null
|
|
313
|
+
canonical.push(modifier)
|
|
314
|
+
kinds.push('group')
|
|
315
|
+
continue
|
|
316
|
+
}
|
|
317
|
+
if (modifier.charCodeAt(0) === 64) {
|
|
318
|
+
if (!containerCondition(state, modifier, out)) return null
|
|
319
|
+
canonical.push(modifier)
|
|
320
|
+
kinds.push('container')
|
|
321
|
+
continue
|
|
322
|
+
}
|
|
323
|
+
if (modifier in stateSelectors || modifier === 'enter' || modifier === 'exit') {
|
|
324
|
+
canonical.push(modifier)
|
|
325
|
+
kinds.push('state')
|
|
326
|
+
selfStateSpecificity++
|
|
327
|
+
const selector = stateSelectors[modifier]
|
|
328
|
+
if (
|
|
329
|
+
!isWeb &&
|
|
330
|
+
modifier !== 'hover' &&
|
|
331
|
+
modifier !== 'press' &&
|
|
332
|
+
modifier !== 'focus' &&
|
|
333
|
+
modifier !== 'focus-visible' &&
|
|
334
|
+
modifier !== 'focus-within' &&
|
|
335
|
+
modifier !== 'disabled' &&
|
|
336
|
+
modifier !== 'enter' &&
|
|
337
|
+
modifier !== 'exit'
|
|
338
|
+
) {
|
|
339
|
+
out.unsupportedState = modifier
|
|
340
|
+
}
|
|
341
|
+
if (modifier === 'enter' || modifier === 'exit') {
|
|
342
|
+
const cls = modifier === 'enter' ? '.t_unmounted' : '.t_exiting'
|
|
343
|
+
out.selector += `:is(${cls}, ${cls} *)`
|
|
344
|
+
out[modifier] = true
|
|
345
|
+
} else if (selector) {
|
|
346
|
+
out.selector += selector
|
|
347
|
+
}
|
|
348
|
+
if (modifier === 'hover') (out.wrappers ||= []).push('@media (hover: hover)')
|
|
349
|
+
out.active &&= stateIsActive(state, modifier)
|
|
350
|
+
if (
|
|
351
|
+
modifier === 'hover' ||
|
|
352
|
+
modifier === 'press' ||
|
|
353
|
+
modifier === 'focus' ||
|
|
354
|
+
modifier === 'focus-visible' ||
|
|
355
|
+
modifier === 'focus-within'
|
|
356
|
+
) {
|
|
357
|
+
;(state.flatStateKeys ||= new Set()).add(modifier)
|
|
358
|
+
}
|
|
359
|
+
continue
|
|
360
|
+
}
|
|
361
|
+
if (modifier in (state.conf.media || {})) {
|
|
362
|
+
const query = queryFor(state, modifier)
|
|
363
|
+
if (!query) return null
|
|
364
|
+
canonical.push(modifier)
|
|
365
|
+
kinds.push('media')
|
|
366
|
+
;(out.wrappers ||= []).push(`@media ${query}`)
|
|
367
|
+
out.active &&= !!state.flatMediaState?.[modifier]
|
|
368
|
+
;(state.flatMediaKeys ||= new Set()).add(modifier)
|
|
369
|
+
continue
|
|
370
|
+
}
|
|
371
|
+
if (isRootThemeName(modifier) && modifier in (state.conf.themes || {})) {
|
|
372
|
+
canonical.push(modifier)
|
|
373
|
+
kinds.push('theme')
|
|
374
|
+
out.theme = modifier
|
|
375
|
+
out.selector += `:where(.t_${modifier}, .t_${modifier} *)`
|
|
376
|
+
out.active &&=
|
|
377
|
+
state.flatThemeName === modifier ||
|
|
378
|
+
state.flatThemeName?.startsWith(`${modifier}_`) === true
|
|
379
|
+
continue
|
|
380
|
+
}
|
|
381
|
+
if (
|
|
382
|
+
modifier === 'web' ||
|
|
383
|
+
modifier === 'native' ||
|
|
384
|
+
modifier === 'ios' ||
|
|
385
|
+
modifier === 'android' ||
|
|
386
|
+
modifier === 'tv' ||
|
|
387
|
+
modifier === 'tvos' ||
|
|
388
|
+
modifier === 'androidtv'
|
|
389
|
+
) {
|
|
390
|
+
canonical.push(modifier)
|
|
391
|
+
kinds.push('platform')
|
|
392
|
+
const matches = platformMatches(modifier)
|
|
393
|
+
out.active &&= matches
|
|
394
|
+
out.emit &&= matches
|
|
395
|
+
continue
|
|
396
|
+
}
|
|
397
|
+
return null
|
|
398
|
+
}
|
|
399
|
+
out.key = clauseConditionSetKey(canonical)
|
|
400
|
+
out.precedence = getClausePrecedenceKeyFromKinds(
|
|
401
|
+
canonical,
|
|
402
|
+
kinds,
|
|
403
|
+
precedenceOrderFor(state)
|
|
404
|
+
)
|
|
405
|
+
out.classRepetitions = clauseSubjectClassRepetitions(
|
|
406
|
+
out.precedence,
|
|
407
|
+
selfStateSpecificity
|
|
408
|
+
)
|
|
409
|
+
return out
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
interface TokenLookup {
|
|
413
|
+
value: any
|
|
414
|
+
/** The value resolved through the active theme, so it changes when the theme does. */
|
|
415
|
+
fromTheme: boolean
|
|
416
|
+
/** The normalized key the runtime theme object is indexed by. */
|
|
417
|
+
themeKey: string
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// single reused result object: tokenVariable runs on the style hot path and its
|
|
421
|
+
// one caller consumes the result before any re-entry, so this avoids allocating
|
|
422
|
+
// per token lookup
|
|
423
|
+
const tokenLookup: TokenLookup = { value: undefined, fromTheme: false, themeKey: '' }
|
|
424
|
+
|
|
425
|
+
function fillTokenLookup(value: any, fromTheme: boolean, themeKey: string): TokenLookup {
|
|
426
|
+
tokenLookup.value = value
|
|
427
|
+
tokenLookup.fromTheme = fromTheme
|
|
428
|
+
tokenLookup.themeKey = themeKey
|
|
429
|
+
return tokenLookup
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function tokenVariable(
|
|
433
|
+
state: GetStyleState,
|
|
434
|
+
property: string,
|
|
435
|
+
name: string
|
|
436
|
+
): TokenLookup | undefined {
|
|
437
|
+
// v3's canonical token representation is unprefixed, but classic `$token`
|
|
438
|
+
// values are still valid input: normalize here so `$background` and
|
|
439
|
+
// `background` resolve identically (themes, tokens, and fonts are all
|
|
440
|
+
// keyed unprefixed)
|
|
441
|
+
let lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name
|
|
442
|
+
if (property === 'fontFamily') {
|
|
443
|
+
const family = state.conf.fontsParsed[lookupName]?.family
|
|
444
|
+
return family ? fillTokenLookup(family, false, lookupName) : undefined
|
|
445
|
+
}
|
|
446
|
+
const fontKey =
|
|
447
|
+
property === 'fontSize'
|
|
448
|
+
? 'size'
|
|
449
|
+
: property === 'fontWeight'
|
|
450
|
+
? 'weight'
|
|
451
|
+
: property === 'lineHeight' || property === 'letterSpacing'
|
|
452
|
+
? property
|
|
453
|
+
: undefined
|
|
454
|
+
if (fontKey) {
|
|
455
|
+
const font =
|
|
456
|
+
state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] ||
|
|
457
|
+
state.conf.fontsParsed[state.conf.defaultFontToken]
|
|
458
|
+
const value = font?.[fontKey]?.[lookupName]
|
|
459
|
+
return value ? fillTokenLookup(value, false, lookupName) : undefined
|
|
460
|
+
}
|
|
461
|
+
const category = getTokenCategoryForProperty(property)
|
|
462
|
+
const dot = lookupName.indexOf('.')
|
|
463
|
+
if (dot !== -1) {
|
|
464
|
+
const prefix = lookupName.slice(0, dot)
|
|
465
|
+
if (!category || prefix === category || prefix === 'color') {
|
|
466
|
+
lookupName = lookupName.slice(dot + 1)
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (category) {
|
|
470
|
+
const own = state.conf.tokensParsed[category]?.[lookupName]
|
|
471
|
+
if (own) return fillTokenLookup(own, false, lookupName)
|
|
472
|
+
for (const sibling of ['color', 'space', 'size', 'radius', 'zIndex'] as const) {
|
|
473
|
+
if (sibling !== category && state.conf.tokensParsed[sibling]?.[lookupName]) return
|
|
474
|
+
}
|
|
475
|
+
} else {
|
|
476
|
+
const first = lookupName.charCodeAt(0)
|
|
477
|
+
if ((first >= 48 && first <= 57) || first === 43 || first === 45 || first === 46) {
|
|
478
|
+
return
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const theme =
|
|
482
|
+
state.theme?.[lookupName] ||
|
|
483
|
+
state.conf.themes?.[state.flatThemeName || '']?.[lookupName]
|
|
484
|
+
if (theme) return fillTokenLookup(theme, true, lookupName)
|
|
485
|
+
if (category) return
|
|
486
|
+
const token =
|
|
487
|
+
state.conf.tokensParsed.space?.[lookupName] ||
|
|
488
|
+
state.conf.tokensParsed.color?.[lookupName]
|
|
489
|
+
return token ? fillTokenLookup(token, false, lookupName) : undefined
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function configuredValue(state: GetStyleState, property: string, raw: string): any {
|
|
493
|
+
let name = raw
|
|
494
|
+
let opacity: number | undefined
|
|
495
|
+
const slash = raw.lastIndexOf('/')
|
|
496
|
+
if (slash > 0) {
|
|
497
|
+
const amount = Number(raw.slice(slash + 1))
|
|
498
|
+
if (Number.isInteger(amount) && amount >= 0 && amount <= 100) {
|
|
499
|
+
name = raw.slice(0, slash)
|
|
500
|
+
opacity = amount
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const safeArea = resolveSafeAreaVariable(name)
|
|
505
|
+
if (safeArea !== undefined) {
|
|
506
|
+
state.flatUsesSafeArea = true
|
|
507
|
+
return safeArea
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const lookup = tokenVariable(state, property, name)
|
|
511
|
+
if (!lookup || !isVariable(lookup.value)) {
|
|
512
|
+
if (
|
|
513
|
+
process.env.NODE_ENV === 'development' &&
|
|
514
|
+
tokenCategoryByProperty[property] &&
|
|
515
|
+
state.conf.tokensParsed.color?.[name]
|
|
516
|
+
) {
|
|
517
|
+
warnOnce(`"${name}" contributes to "color", not "${property}"; keeping it literal`)
|
|
518
|
+
}
|
|
519
|
+
return raw
|
|
520
|
+
}
|
|
521
|
+
const resolveValues =
|
|
522
|
+
isWeb && !state.flatShouldDoClasses && state.styleProps.resolveValues === 'auto'
|
|
523
|
+
? 'value'
|
|
524
|
+
: state.styleProps.resolveValues
|
|
525
|
+
// the static compiler resolves tokens but keeps theme-backed values symbolic
|
|
526
|
+
// so compiled output can read them through the live theme instead of freezing
|
|
527
|
+
// the build machine's first theme. an opacity modifier stays in the sentinel,
|
|
528
|
+
// which the compiler cannot represent and treats as a runtime-path bailout.
|
|
529
|
+
if (resolveValues === 'except-theme' && lookup.fromTheme) {
|
|
530
|
+
return `${THEME_REF_PREFIX}${lookup.themeKey}${opacity !== undefined ? `/${opacity}` : ''}`
|
|
531
|
+
}
|
|
532
|
+
let value = resolveVariableValue(property, lookup.value, resolveValues)
|
|
533
|
+
if (opacity !== undefined) {
|
|
534
|
+
value = isWeb
|
|
535
|
+
? `color-mix(in srgb, ${value} ${opacity}%, transparent)`
|
|
536
|
+
: normalizeColor(value, opacity / 100)
|
|
537
|
+
}
|
|
538
|
+
return value
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// a single function-call literal whose arguments contain no letters
|
|
542
|
+
// (rgb(99,102,241), hsl(0,100%,50%)) cannot hold token words; color literals
|
|
543
|
+
// like these are common enough on hot paths to be worth skipping the word scan
|
|
544
|
+
const letterFreeCallPattern = /^[A-Za-z-]+\([^A-Za-z]*\)$/
|
|
545
|
+
|
|
546
|
+
function resolveEmbeddedTokens(state: GetStyleState, property: string, raw: string) {
|
|
547
|
+
if (letterFreeCallPattern.test(raw)) return raw
|
|
548
|
+
return raw.replace(/[$A-Za-z_][\w.$-]*(?:\/\d+)?/g, (word, index) => {
|
|
549
|
+
if (word.charCodeAt(0) !== 36) {
|
|
550
|
+
const before = raw.charCodeAt(index - 1)
|
|
551
|
+
if (
|
|
552
|
+
(before >= 48 && before <= 57) ||
|
|
553
|
+
before === 35 ||
|
|
554
|
+
(before === 45 && raw.charCodeAt(index - 2) === 45) ||
|
|
555
|
+
raw.charCodeAt(index + word.length) === 40
|
|
556
|
+
) {
|
|
557
|
+
return word
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const value = configuredValue(state, property, word)
|
|
561
|
+
return value === word ? word : String(value)
|
|
562
|
+
})
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function normalizeTransitionNames(state: GetStyleState, raw: string) {
|
|
566
|
+
let quote = 0
|
|
567
|
+
let depth = 0
|
|
568
|
+
let copyFrom = 0
|
|
569
|
+
let out = ''
|
|
570
|
+
for (let index = 0; index < raw.length; index++) {
|
|
571
|
+
const code = raw.charCodeAt(index)
|
|
572
|
+
if (quote) {
|
|
573
|
+
if (code === 92) index++
|
|
574
|
+
else if (code === quote) quote = 0
|
|
575
|
+
continue
|
|
576
|
+
}
|
|
577
|
+
if (code === 34 || code === 39) {
|
|
578
|
+
quote = code
|
|
579
|
+
continue
|
|
580
|
+
}
|
|
581
|
+
if (code === 40) {
|
|
582
|
+
depth++
|
|
583
|
+
continue
|
|
584
|
+
}
|
|
585
|
+
if (code === 41) {
|
|
586
|
+
depth--
|
|
587
|
+
continue
|
|
588
|
+
}
|
|
589
|
+
if (
|
|
590
|
+
depth ||
|
|
591
|
+
!((code >= 65 && code <= 90) || (code >= 97 && code <= 122) || code === 95) ||
|
|
592
|
+
(index > 1 && raw.charCodeAt(index - 1) === 45 && raw.charCodeAt(index - 2) === 45)
|
|
593
|
+
) {
|
|
594
|
+
continue
|
|
595
|
+
}
|
|
596
|
+
let end = index + 1
|
|
597
|
+
while (end < raw.length) {
|
|
598
|
+
const next = raw.charCodeAt(end)
|
|
599
|
+
if (
|
|
600
|
+
(next >= 48 && next <= 57) ||
|
|
601
|
+
(next >= 65 && next <= 90) ||
|
|
602
|
+
(next >= 97 && next <= 122) ||
|
|
603
|
+
next === 45 ||
|
|
604
|
+
next === 95
|
|
605
|
+
) {
|
|
606
|
+
end++
|
|
607
|
+
} else {
|
|
608
|
+
break
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (raw.charCodeAt(end) !== 40) {
|
|
612
|
+
const authored = raw.slice(index, end)
|
|
613
|
+
let property = state.conf.shorthands[authored] || authored
|
|
614
|
+
if (property === 'x' || property === 'y') property = 'translate'
|
|
615
|
+
else if (property === 'scaleX' || property === 'scaleY') property = 'scale'
|
|
616
|
+
else if (legacyTransformParts.has(property)) property = 'transform'
|
|
617
|
+
if (property !== authored || /[A-Z]/.test(property)) {
|
|
618
|
+
out += raw.slice(copyFrom, index)
|
|
619
|
+
out += property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)
|
|
620
|
+
copyFrom = end
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
index = end - 1
|
|
624
|
+
}
|
|
625
|
+
return copyFrom ? out + raw.slice(copyFrom) : raw
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// one contribution's slice of an atomic identity; accumulated per atomicKey in
|
|
629
|
+
// directAtomic, and reproduced standalone by the getSplitStyles class-strip
|
|
630
|
+
// path so a surviving base style keeps its server-rendered identifier
|
|
631
|
+
export function directStyleSignature(
|
|
632
|
+
property: string,
|
|
633
|
+
value: unknown,
|
|
634
|
+
conditionKey = ''
|
|
635
|
+
) {
|
|
636
|
+
return `\u001f${property}\u001f${conditionKey}\u001e${String(value)}`
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
function directAtomic(
|
|
640
|
+
state: DirectState,
|
|
641
|
+
property: string,
|
|
642
|
+
value: any,
|
|
643
|
+
condition: Condition | null,
|
|
644
|
+
isDefault = false
|
|
645
|
+
) {
|
|
646
|
+
const atomics = (state.flatAtomics ||= {})
|
|
647
|
+
const atomicKey = property.startsWith('transition') ? 'transition' : property
|
|
648
|
+
const existing = atomics[atomicKey]
|
|
649
|
+
const contribution = directStyleSignature(property, value, condition?.key || '')
|
|
650
|
+
const signature = existing ? existing.signature + contribution : contribution
|
|
651
|
+
const next = getCSSStyleAtomic(
|
|
652
|
+
property,
|
|
653
|
+
value,
|
|
654
|
+
condition?.selector,
|
|
655
|
+
condition?.wrappers,
|
|
656
|
+
signature,
|
|
657
|
+
true,
|
|
658
|
+
atomicKey,
|
|
659
|
+
condition?.classRepetitions
|
|
660
|
+
)
|
|
661
|
+
if (!next) return
|
|
662
|
+
const identifier = next[StyleObjectIdentifier]
|
|
663
|
+
const nextRules = next[StyleObjectRules]
|
|
664
|
+
|
|
665
|
+
const slotted = condition || atomicKey === 'transition'
|
|
666
|
+
|
|
667
|
+
if (!existing) {
|
|
668
|
+
// one shape for every DirectAtomic: a conditional object spread here gives
|
|
669
|
+
// conditioned and unconditioned atomics different hidden classes, and every
|
|
670
|
+
// read of the record downstream goes polymorphic
|
|
671
|
+
const atomic: DirectAtomic = {
|
|
672
|
+
baseRules: slotted ? 0 : nextRules.length,
|
|
673
|
+
conditions: undefined,
|
|
674
|
+
signature,
|
|
675
|
+
styleObject: next,
|
|
676
|
+
}
|
|
677
|
+
if (slotted) {
|
|
678
|
+
atomic.conditions = {
|
|
679
|
+
[atomicKey === 'transition'
|
|
680
|
+
? `${condition?.key || ''}\0${property}`
|
|
681
|
+
: condition!.key]: {
|
|
682
|
+
count: nextRules.length,
|
|
683
|
+
index: 0,
|
|
684
|
+
precedence: condition?.precedence ?? baseClausePrecedence,
|
|
685
|
+
default: isDefault,
|
|
686
|
+
},
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
atomics[atomicKey] = atomic
|
|
690
|
+
} else {
|
|
691
|
+
const previousIdentifier = existing.styleObject[StyleObjectIdentifier]
|
|
692
|
+
const rules = existing.styleObject[StyleObjectRules]
|
|
693
|
+
if (!condition && !isDefault && existing.conditions) {
|
|
694
|
+
for (const key in existing.conditions) {
|
|
695
|
+
const entry = existing.conditions[key]
|
|
696
|
+
if (!entry.default) continue
|
|
697
|
+
rules.splice(entry.index, entry.count)
|
|
698
|
+
delete existing.conditions[key]
|
|
699
|
+
for (const otherKey in existing.conditions) {
|
|
700
|
+
const other = existing.conditions[otherKey]
|
|
701
|
+
if (other.index > entry.index) other.index -= entry.count
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (previousIdentifier !== identifier) {
|
|
706
|
+
const oldSelector = `.${previousIdentifier}`
|
|
707
|
+
const newSelector = `.${identifier}`
|
|
708
|
+
for (let index = 0; index < rules.length; index++) {
|
|
709
|
+
rules[index] = rules[index].replaceAll(oldSelector, newSelector)
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
if (slotted) {
|
|
713
|
+
const slot =
|
|
714
|
+
atomicKey === 'transition'
|
|
715
|
+
? `${condition?.key || ''}\0${property}`
|
|
716
|
+
: condition!.key
|
|
717
|
+
const previous = existing.conditions?.[slot]
|
|
718
|
+
if (previous) {
|
|
719
|
+
rules.splice(previous.index, previous.count)
|
|
720
|
+
if (existing.conditions) {
|
|
721
|
+
for (const key in existing.conditions) {
|
|
722
|
+
const entry = existing.conditions[key]
|
|
723
|
+
if (entry !== previous && entry.index > previous.index) {
|
|
724
|
+
entry.index -= previous.count
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
delete existing.conditions![slot]
|
|
729
|
+
}
|
|
730
|
+
const precedence = condition?.precedence ?? baseClausePrecedence
|
|
731
|
+
let insertionIndex = rules.length
|
|
732
|
+
if (existing.conditions) {
|
|
733
|
+
for (const key in existing.conditions) {
|
|
734
|
+
const entry = existing.conditions[key]
|
|
735
|
+
if (
|
|
736
|
+
compareClausePrecedence(entry.precedence, precedence) > 0 &&
|
|
737
|
+
entry.index < insertionIndex
|
|
738
|
+
) {
|
|
739
|
+
insertionIndex = entry.index
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
for (const key in existing.conditions) {
|
|
743
|
+
const entry = existing.conditions[key]
|
|
744
|
+
if (entry.index >= insertionIndex) entry.index += nextRules.length
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
;(existing.conditions ||= {})[slot] = {
|
|
748
|
+
count: nextRules.length,
|
|
749
|
+
index: insertionIndex,
|
|
750
|
+
precedence,
|
|
751
|
+
default: isDefault,
|
|
752
|
+
}
|
|
753
|
+
rules.splice(insertionIndex, 0, ...nextRules)
|
|
754
|
+
} else {
|
|
755
|
+
const difference = nextRules.length - existing.baseRules
|
|
756
|
+
rules.splice(0, existing.baseRules, ...nextRules)
|
|
757
|
+
if (difference && existing.conditions) {
|
|
758
|
+
for (const key in existing.conditions)
|
|
759
|
+
existing.conditions[key].index += difference
|
|
760
|
+
}
|
|
761
|
+
existing.baseRules = nextRules.length
|
|
762
|
+
}
|
|
763
|
+
existing.signature = signature
|
|
764
|
+
existing.styleObject[StyleObjectIdentifier] = identifier
|
|
765
|
+
existing.styleObject[1] = next[1]
|
|
766
|
+
}
|
|
767
|
+
state.classNames[atomicKey] = identifier
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
function emitBorderStyleDefault(
|
|
771
|
+
state: GetStyleState,
|
|
772
|
+
property: string,
|
|
773
|
+
condition: Condition | null
|
|
774
|
+
) {
|
|
775
|
+
if (!isWeb || !state.flatShouldDoClasses || state.styleProps.noNormalize === false) {
|
|
776
|
+
return
|
|
777
|
+
}
|
|
778
|
+
const target = borderStyleDefaults[property]
|
|
779
|
+
if (!target) return
|
|
780
|
+
const atomic = (state as DirectState).flatAtomics?.[target]
|
|
781
|
+
if (
|
|
782
|
+
atomic?.baseRules ||
|
|
783
|
+
(state.classNames[target] && !atomic) ||
|
|
784
|
+
(condition && atomic?.conditions?.[condition.key])
|
|
785
|
+
) {
|
|
786
|
+
return
|
|
787
|
+
}
|
|
788
|
+
directAtomic(state as DirectState, target, 'solid', condition, true)
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export function flushDirectStyles(state: GetStyleState, clear = false) {
|
|
792
|
+
const direct = state as DirectState
|
|
793
|
+
const atomics = direct.flatAtomics
|
|
794
|
+
if (!atomics) return
|
|
795
|
+
for (const property in atomics) {
|
|
796
|
+
const styleObject = atomics[property].styleObject
|
|
797
|
+
const identifier = styleObject[StyleObjectIdentifier]
|
|
798
|
+
if (shouldInsertStyleRules(identifier)) {
|
|
799
|
+
updateRules(identifier, styleObject[StyleObjectRules])
|
|
800
|
+
state.flatRulesToInsert![identifier] = styleObject
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (clear) direct.flatAtomics = undefined
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export function getDirectDynamicThemeAccess(state: GetStyleState) {
|
|
807
|
+
return (state as DirectState).flatDynamicThemeAccess
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
function emitProperty(
|
|
811
|
+
state: GetStyleState,
|
|
812
|
+
property: string,
|
|
813
|
+
value: any,
|
|
814
|
+
condition: Condition | null,
|
|
815
|
+
merge: MergeStyle,
|
|
816
|
+
originalValue: any,
|
|
817
|
+
contextOnly: boolean
|
|
818
|
+
) {
|
|
819
|
+
const direct = state as DirectState
|
|
820
|
+
if (condition?.enter) (state.flatEnterKeys ||= new Set()).add(property)
|
|
821
|
+
if (condition?.exit) (state.flatExitKeys ||= new Set()).add(property)
|
|
822
|
+
|
|
823
|
+
if (!isWeb && condition?.theme) {
|
|
824
|
+
if (supportsDynamicColorIOS && isColorStyleKey(property)) {
|
|
825
|
+
const schemes = ((direct.flatDynamicColors ||= {})[property] ||= {})
|
|
826
|
+
schemes[condition.theme] =
|
|
827
|
+
typeof originalValue === 'string' && /^[a-z]+$/i.test(originalValue)
|
|
828
|
+
? originalValue
|
|
829
|
+
: value
|
|
830
|
+
merge(state, property, { dynamic: { ...schemes } }, 1, false, originalValue)
|
|
831
|
+
return
|
|
832
|
+
}
|
|
833
|
+
direct.flatDynamicThemeAccess = true
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
if (contextOnly) {
|
|
837
|
+
if (!condition || condition.active) {
|
|
838
|
+
;(state.overriddenContextProps ||= {})[property] = originalValue
|
|
839
|
+
}
|
|
840
|
+
return
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
if (isWeb && state.flatShouldDoClasses) {
|
|
844
|
+
if (!condition) {
|
|
845
|
+
if (state.style) delete state.style[property]
|
|
846
|
+
}
|
|
847
|
+
directAtomic(state as DirectState, property, value, condition)
|
|
848
|
+
return
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (condition) {
|
|
852
|
+
if (!condition.active) return
|
|
853
|
+
const previous = direct.flatPrecedence?.[property]
|
|
854
|
+
if (previous && compareClausePrecedence(condition.precedence, previous) < 0) return
|
|
855
|
+
;(direct.flatPrecedence ||= {})[property] = condition.precedence
|
|
856
|
+
;(state.flatActiveConditions ||= {})[property] = true
|
|
857
|
+
} else if (state.flatActiveConditions?.[property]) {
|
|
858
|
+
return
|
|
859
|
+
}
|
|
860
|
+
merge(state, property, value, 1, true, originalValue)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function splitComponents(value: string) {
|
|
864
|
+
const parts: string[] = []
|
|
865
|
+
let start = 0
|
|
866
|
+
let quote = 0
|
|
867
|
+
let depth = 0
|
|
868
|
+
for (let index = 0; index <= value.length; index++) {
|
|
869
|
+
const code = index === value.length ? 32 : value.charCodeAt(index)
|
|
870
|
+
if (quote) {
|
|
871
|
+
if (code === 92) index++
|
|
872
|
+
else if (code === quote) quote = 0
|
|
873
|
+
continue
|
|
874
|
+
}
|
|
875
|
+
if (code === 34 || code === 39) quote = code
|
|
876
|
+
else if (code === 40) depth++
|
|
877
|
+
else if (code === 41) depth--
|
|
878
|
+
else if (!depth && code <= 32) {
|
|
879
|
+
if (index > start) parts.push(value.slice(start, index))
|
|
880
|
+
start = index + 1
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return parts
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
function emitBorder(
|
|
887
|
+
state: GetStyleState,
|
|
888
|
+
property: string,
|
|
889
|
+
raw: string,
|
|
890
|
+
condition: Condition | null,
|
|
891
|
+
merge: MergeStyle,
|
|
892
|
+
originalValue: any,
|
|
893
|
+
contextOnly: boolean
|
|
894
|
+
) {
|
|
895
|
+
if (!isWeb && (property === 'borderBlock' || property === 'borderInline')) {
|
|
896
|
+
if (process.env.NODE_ENV === 'development') {
|
|
897
|
+
warnOnce(`RN has no logical border shorthand "${property}"; dropping it`)
|
|
898
|
+
}
|
|
899
|
+
return
|
|
900
|
+
}
|
|
901
|
+
const targets = borderTargets[property]
|
|
902
|
+
let width: string | undefined
|
|
903
|
+
let style: string | undefined
|
|
904
|
+
let color: string | undefined
|
|
905
|
+
for (const part of splitComponents(raw)) {
|
|
906
|
+
const lower = part.toLowerCase()
|
|
907
|
+
if (lineStyles.has(lower) || (property === 'outline' && lower === 'auto')) {
|
|
908
|
+
style = part
|
|
909
|
+
} else if (
|
|
910
|
+
lower === 'thin' ||
|
|
911
|
+
lower === 'medium' ||
|
|
912
|
+
lower === 'thick' ||
|
|
913
|
+
/^-?(?:\d+\.?\d*|\.\d+)(?:[a-z%]+)?$/i.test(part) ||
|
|
914
|
+
/^(?:calc|var|min|max|clamp)\(/i.test(part)
|
|
915
|
+
) {
|
|
916
|
+
width = part
|
|
917
|
+
} else {
|
|
918
|
+
color = part
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
if (style === 'none' && width === undefined) width = '0'
|
|
922
|
+
if (width !== undefined) {
|
|
923
|
+
for (const target of targets.width) {
|
|
924
|
+
emitResolved(state, target, width, condition, merge, originalValue, contextOnly)
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
if (style !== undefined) {
|
|
928
|
+
const styleTargets = !isWeb && property === 'border' ? ['borderStyle'] : targets.style
|
|
929
|
+
for (const target of styleTargets) {
|
|
930
|
+
emitProperty(state, target, style, condition, merge, originalValue, contextOnly)
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (color !== undefined) {
|
|
934
|
+
for (const target of targets.color) {
|
|
935
|
+
emitResolved(state, target, color, condition, merge, originalValue, contextOnly)
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function emitTextDecoration(
|
|
941
|
+
state: GetStyleState,
|
|
942
|
+
raw: string,
|
|
943
|
+
condition: Condition | null,
|
|
944
|
+
merge: MergeStyle,
|
|
945
|
+
originalValue: any,
|
|
946
|
+
contextOnly: boolean
|
|
947
|
+
) {
|
|
948
|
+
for (const part of splitComponents(raw)) {
|
|
949
|
+
const property =
|
|
950
|
+
part === 'solid' ||
|
|
951
|
+
part === 'double' ||
|
|
952
|
+
part === 'dotted' ||
|
|
953
|
+
part === 'dashed' ||
|
|
954
|
+
part === 'wavy'
|
|
955
|
+
? 'textDecorationStyle'
|
|
956
|
+
: part === 'underline' ||
|
|
957
|
+
part === 'overline' ||
|
|
958
|
+
part === 'line-through' ||
|
|
959
|
+
part === 'none'
|
|
960
|
+
? 'textDecorationLine'
|
|
961
|
+
: 'textDecorationColor'
|
|
962
|
+
emitResolved(state, property, part, condition, merge, originalValue, contextOnly)
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function addComposition(state: GetStyleState, property: 'translate' | 'scale') {
|
|
967
|
+
if (state.classNames[property]) return
|
|
968
|
+
const value =
|
|
969
|
+
property === 'translate'
|
|
970
|
+
? 'var(--t-x, 0px) var(--t-y, 0px)'
|
|
971
|
+
: 'var(--t-scale-x, 1) var(--t-scale-y, 1)'
|
|
972
|
+
const defaults =
|
|
973
|
+
property === 'translate' ? '--t-x:0px;--t-y:0px' : '--t-scale-x:1;--t-scale-y:1'
|
|
974
|
+
const styleObject = getCSSStyleAtomic(property, value, '', undefined, undefined, true)!
|
|
975
|
+
const identifier = styleObject[StyleObjectIdentifier]
|
|
976
|
+
styleObject[StyleObjectRules].unshift(`:where(.${identifier}){${defaults}}`)
|
|
977
|
+
if (shouldInsertStyleRules(identifier)) {
|
|
978
|
+
updateRules(identifier, styleObject[StyleObjectRules])
|
|
979
|
+
state.flatRulesToInsert![identifier] = styleObject
|
|
980
|
+
}
|
|
981
|
+
state.classNames[property] = identifier
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
function emitTransform(
|
|
985
|
+
state: GetStyleState,
|
|
986
|
+
property: string,
|
|
987
|
+
value: any,
|
|
988
|
+
condition: Condition | null,
|
|
989
|
+
merge: MergeStyle,
|
|
990
|
+
originalValue: any,
|
|
991
|
+
contextOnly: boolean
|
|
992
|
+
) {
|
|
993
|
+
if (!isWeb || !state.flatShouldDoClasses) {
|
|
994
|
+
if (!isWeb && property === 'scale') {
|
|
995
|
+
emitProperty(state, 'scaleX', value, condition, merge, originalValue, contextOnly)
|
|
996
|
+
emitProperty(state, 'scaleY', value, condition, merge, originalValue, contextOnly)
|
|
997
|
+
} else {
|
|
998
|
+
emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
|
|
999
|
+
}
|
|
1000
|
+
return
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
const targets =
|
|
1004
|
+
property === 'scale'
|
|
1005
|
+
? ['--t-scale-x', '--t-scale-y']
|
|
1006
|
+
: [
|
|
1007
|
+
property === 'x'
|
|
1008
|
+
? '--t-x'
|
|
1009
|
+
: property === 'y'
|
|
1010
|
+
? '--t-y'
|
|
1011
|
+
: property === 'scaleX'
|
|
1012
|
+
? '--t-scale-x'
|
|
1013
|
+
: property === 'scaleY'
|
|
1014
|
+
? '--t-scale-y'
|
|
1015
|
+
: 'rotate',
|
|
1016
|
+
]
|
|
1017
|
+
for (const target of targets) {
|
|
1018
|
+
let targetValue = value
|
|
1019
|
+
if (typeof targetValue === 'number') {
|
|
1020
|
+
if (target === '--t-x' || target === '--t-y') targetValue = `${targetValue}px`
|
|
1021
|
+
else if (target === 'rotate') targetValue = `${targetValue}deg`
|
|
1022
|
+
}
|
|
1023
|
+
emitProperty(state, target, targetValue, condition, merge, originalValue, contextOnly)
|
|
1024
|
+
if (target === '--t-x' || target === '--t-y') addComposition(state, 'translate')
|
|
1025
|
+
else if (target.startsWith('--t-scale')) addComposition(state, 'scale')
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
function emitResolved(
|
|
1030
|
+
state: GetStyleState,
|
|
1031
|
+
property: string,
|
|
1032
|
+
raw: string,
|
|
1033
|
+
condition: Condition | null,
|
|
1034
|
+
merge: MergeStyle,
|
|
1035
|
+
originalValue: any,
|
|
1036
|
+
contextOnly: boolean
|
|
1037
|
+
) {
|
|
1038
|
+
let value = configuredValue(state, property, raw)
|
|
1039
|
+
if (value === raw && /[\s,(]/.test(raw)) {
|
|
1040
|
+
value = resolveEmbeddedTokens(state, property, raw)
|
|
1041
|
+
}
|
|
1042
|
+
if ((!isWeb || !state.flatShouldDoClasses) && typeof value === 'string') {
|
|
1043
|
+
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value)) {
|
|
1044
|
+
value = Number.parseFloat(value)
|
|
1045
|
+
} else if (value !== '' && Number.isFinite(Number(value))) {
|
|
1046
|
+
value = Number(value)
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
function shadowUnit(part: any) {
|
|
1053
|
+
return typeof part === 'number' ? `${part}px` : part || '0px'
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
function emitWebShadow(
|
|
1057
|
+
state: DirectState,
|
|
1058
|
+
property: string,
|
|
1059
|
+
value: any,
|
|
1060
|
+
merge: MergeStyle,
|
|
1061
|
+
originalValue: any,
|
|
1062
|
+
contextOnly: boolean
|
|
1063
|
+
) {
|
|
1064
|
+
const shadow = (state.flatWebShadow ||= {})
|
|
1065
|
+
shadow[property] = value
|
|
1066
|
+
const offset = shadow.shadowOffset || { width: 0, height: 0 }
|
|
1067
|
+
const color = normalizeColor(shadow.shadowColor, shadow.shadowOpacity ?? 1)
|
|
1068
|
+
if (!color) return
|
|
1069
|
+
const next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow.shadowRadius)} ${color}`
|
|
1070
|
+
emitProperty(
|
|
1071
|
+
state,
|
|
1072
|
+
'boxShadow',
|
|
1073
|
+
state.flatBoxShadow ? `${state.flatBoxShadow}, ${next}` : next,
|
|
1074
|
+
null,
|
|
1075
|
+
merge,
|
|
1076
|
+
originalValue,
|
|
1077
|
+
contextOnly
|
|
1078
|
+
)
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
function emitWebTextShadow(
|
|
1082
|
+
state: DirectState,
|
|
1083
|
+
property: string,
|
|
1084
|
+
value: any,
|
|
1085
|
+
merge: MergeStyle,
|
|
1086
|
+
originalValue: any,
|
|
1087
|
+
contextOnly: boolean
|
|
1088
|
+
) {
|
|
1089
|
+
const shadow = (state.flatTextShadow ||= {})
|
|
1090
|
+
shadow[property] = value
|
|
1091
|
+
const offset = shadow.textShadowOffset || { width: 0, height: 0 }
|
|
1092
|
+
if (!shadow.textShadowColor) return
|
|
1093
|
+
emitProperty(
|
|
1094
|
+
state,
|
|
1095
|
+
'textShadow',
|
|
1096
|
+
`${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow.textShadowRadius)} ${shadow.textShadowColor}`,
|
|
1097
|
+
null,
|
|
1098
|
+
merge,
|
|
1099
|
+
originalValue,
|
|
1100
|
+
contextOnly
|
|
1101
|
+
)
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
function emitValue(
|
|
1105
|
+
state: GetStyleState,
|
|
1106
|
+
property: string,
|
|
1107
|
+
raw: any,
|
|
1108
|
+
condition: Condition | null,
|
|
1109
|
+
merge: MergeStyle,
|
|
1110
|
+
originalValue: any,
|
|
1111
|
+
contextOnly: boolean
|
|
1112
|
+
) {
|
|
1113
|
+
if (typeof raw === 'string') {
|
|
1114
|
+
raw = raw.trim()
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (isVariable(raw)) {
|
|
1118
|
+
raw = resolveVariableValue(
|
|
1119
|
+
property,
|
|
1120
|
+
raw,
|
|
1121
|
+
isWeb && !state.flatShouldDoClasses && state.styleProps.resolveValues === 'auto'
|
|
1122
|
+
? 'value'
|
|
1123
|
+
: state.styleProps.resolveValues
|
|
1124
|
+
)
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
emitBorderStyleDefault(state, property, condition)
|
|
1128
|
+
|
|
1129
|
+
if (
|
|
1130
|
+
typeof raw === 'string' &&
|
|
1131
|
+
(property === 'transition' || property === 'transitionProperty')
|
|
1132
|
+
) {
|
|
1133
|
+
raw = normalizeTransitionNames(state, raw)
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
if (legacyTransformParts.has(property)) {
|
|
1137
|
+
if (isWeb && state.flatShouldDoClasses && state.classNames.transform) {
|
|
1138
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1139
|
+
warnOnce(
|
|
1140
|
+
`legacy transform part "${property}" is dropped because "transform" owns the property`
|
|
1141
|
+
)
|
|
1142
|
+
}
|
|
1143
|
+
return
|
|
1144
|
+
}
|
|
1145
|
+
const value = typeof raw === 'string' ? configuredValue(state, property, raw) : raw
|
|
1146
|
+
if (isWeb && state.flatShouldDoClasses && !condition) {
|
|
1147
|
+
const direct = state as DirectState
|
|
1148
|
+
;(direct.flatLegacyTransforms ||= {})[property] = value
|
|
1149
|
+
emitProperty(
|
|
1150
|
+
state,
|
|
1151
|
+
'transform',
|
|
1152
|
+
transformsToString(
|
|
1153
|
+
Object.keys(direct.flatLegacyTransforms)
|
|
1154
|
+
.sort()
|
|
1155
|
+
.map((key) => ({ [key]: direct.flatLegacyTransforms![key] }))
|
|
1156
|
+
),
|
|
1157
|
+
null,
|
|
1158
|
+
merge,
|
|
1159
|
+
originalValue,
|
|
1160
|
+
contextOnly
|
|
1161
|
+
)
|
|
1162
|
+
} else if (condition && isWeb && state.flatShouldDoClasses) {
|
|
1163
|
+
emitProperty(
|
|
1164
|
+
state,
|
|
1165
|
+
'transform',
|
|
1166
|
+
`${property}(${value})`,
|
|
1167
|
+
condition,
|
|
1168
|
+
merge,
|
|
1169
|
+
originalValue,
|
|
1170
|
+
contextOnly
|
|
1171
|
+
)
|
|
1172
|
+
} else {
|
|
1173
|
+
merge(state, property, value, 1, false, originalValue)
|
|
1174
|
+
}
|
|
1175
|
+
return
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
if (isWeb && webShadowParts.has(property)) {
|
|
1179
|
+
const value = typeof raw === 'string' ? configuredValue(state, property, raw) : raw
|
|
1180
|
+
if (state.flatShouldDoClasses) {
|
|
1181
|
+
emitWebShadow(
|
|
1182
|
+
state as DirectState,
|
|
1183
|
+
property,
|
|
1184
|
+
value,
|
|
1185
|
+
merge,
|
|
1186
|
+
originalValue,
|
|
1187
|
+
contextOnly
|
|
1188
|
+
)
|
|
1189
|
+
} else {
|
|
1190
|
+
merge(state, property, value, 1, false, originalValue)
|
|
1191
|
+
}
|
|
1192
|
+
return
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if (isWeb && webTextShadowParts.has(property)) {
|
|
1196
|
+
const value = typeof raw === 'string' ? configuredValue(state, property, raw) : raw
|
|
1197
|
+
if (state.flatShouldDoClasses) {
|
|
1198
|
+
emitWebTextShadow(
|
|
1199
|
+
state as DirectState,
|
|
1200
|
+
property,
|
|
1201
|
+
value,
|
|
1202
|
+
merge,
|
|
1203
|
+
originalValue,
|
|
1204
|
+
contextOnly
|
|
1205
|
+
)
|
|
1206
|
+
} else {
|
|
1207
|
+
merge(state, property, value, 1, false, originalValue)
|
|
1208
|
+
}
|
|
1209
|
+
return
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
if (isWeb && state.flatShouldDoClasses) {
|
|
1213
|
+
if (property === 'transform') {
|
|
1214
|
+
const direct = state as DirectState
|
|
1215
|
+
if (process.env.NODE_ENV === 'development' && direct.flatLegacyTransforms) {
|
|
1216
|
+
for (const part in direct.flatLegacyTransforms) {
|
|
1217
|
+
warnOnce(
|
|
1218
|
+
`legacy transform part "${part}" is dropped because "transform" owns the property`
|
|
1219
|
+
)
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
direct.flatLegacyTransforms = undefined
|
|
1223
|
+
if (state.flatTransforms) {
|
|
1224
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1225
|
+
for (const part in state.flatTransforms) {
|
|
1226
|
+
warnOnce(
|
|
1227
|
+
`legacy transform part "${part}" is dropped because "transform" owns the property`
|
|
1228
|
+
)
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
state.flatTransforms = undefined
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
if (
|
|
1237
|
+
isWeb &&
|
|
1238
|
+
state.flatShouldDoClasses &&
|
|
1239
|
+
property === 'transform' &&
|
|
1240
|
+
Array.isArray(raw)
|
|
1241
|
+
) {
|
|
1242
|
+
raw = transformsToString(raw)
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
if (typeof raw === 'string' && property in borderTargets) {
|
|
1246
|
+
emitBorder(state, property, raw, condition, merge, originalValue, contextOnly)
|
|
1247
|
+
return
|
|
1248
|
+
}
|
|
1249
|
+
if (typeof raw === 'string' && property === 'textDecoration') {
|
|
1250
|
+
emitTextDecoration(state, raw, condition, merge, originalValue, contextOnly)
|
|
1251
|
+
return
|
|
1252
|
+
}
|
|
1253
|
+
if (typeof raw === 'string' && property === 'background') {
|
|
1254
|
+
const parts = splitComponents(raw)
|
|
1255
|
+
if (parts.length === 1 && !/^(?:url|image-set|.*gradient)\(/i.test(parts[0])) {
|
|
1256
|
+
emitResolved(
|
|
1257
|
+
state,
|
|
1258
|
+
'backgroundColor',
|
|
1259
|
+
parts[0],
|
|
1260
|
+
condition,
|
|
1261
|
+
merge,
|
|
1262
|
+
originalValue,
|
|
1263
|
+
contextOnly
|
|
1264
|
+
)
|
|
1265
|
+
return
|
|
1266
|
+
}
|
|
1267
|
+
if (!isWeb) {
|
|
1268
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1269
|
+
warnOnce(`native background cannot represent "${raw}"; dropping it`)
|
|
1270
|
+
}
|
|
1271
|
+
return
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
if (
|
|
1276
|
+
property === 'x' ||
|
|
1277
|
+
property === 'y' ||
|
|
1278
|
+
property === 'scale' ||
|
|
1279
|
+
property === 'scaleX' ||
|
|
1280
|
+
property === 'scaleY' ||
|
|
1281
|
+
property === 'rotate'
|
|
1282
|
+
) {
|
|
1283
|
+
let value = typeof raw === 'string' ? configuredValue(state, property, raw) : raw
|
|
1284
|
+
// a transform going into a real style object rather than a CSS class has to
|
|
1285
|
+
// carry numbers: that is every native render and every web render an
|
|
1286
|
+
// animation driver drives inline. strings survive only on the class path.
|
|
1287
|
+
// a theme-ref sentinel is not a number and must pass through untouched.
|
|
1288
|
+
if (
|
|
1289
|
+
(!isWeb || !state.flatShouldDoClasses) &&
|
|
1290
|
+
typeof value === 'string' &&
|
|
1291
|
+
!value.startsWith(THEME_REF_PREFIX)
|
|
1292
|
+
) {
|
|
1293
|
+
if (property === 'rotate' && !/^-?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/i.test(value)) {
|
|
1294
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1295
|
+
warnOnce(
|
|
1296
|
+
`native transform "${property}" cannot represent "${value}"; dropping it`
|
|
1297
|
+
)
|
|
1298
|
+
}
|
|
1299
|
+
if (condition?.active && state.flatTransforms) {
|
|
1300
|
+
delete state.flatTransforms[property]
|
|
1301
|
+
}
|
|
1302
|
+
return
|
|
1303
|
+
}
|
|
1304
|
+
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value)) {
|
|
1305
|
+
value = Number.parseFloat(value)
|
|
1306
|
+
} else if (Number.isFinite(Number(value))) {
|
|
1307
|
+
value = Number(value)
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
emitTransform(state, property, value, condition, merge, originalValue, contextOnly)
|
|
1311
|
+
return
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
if (isWeb && !state.flatShouldDoClasses && !condition && property === 'borderRadius') {
|
|
1315
|
+
// css reads the shorthand, so skip the four-corner expansion here. a string
|
|
1316
|
+
// value still needs its token resolved, which is what emitResolved does.
|
|
1317
|
+
if (typeof raw === 'string') {
|
|
1318
|
+
emitResolved(state, property, raw, condition, merge, originalValue, contextOnly)
|
|
1319
|
+
} else {
|
|
1320
|
+
emitProperty(state, property, raw, condition, merge, originalValue, contextOnly)
|
|
1321
|
+
}
|
|
1322
|
+
return
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
if (
|
|
1326
|
+
process.env.TAMAGUI_TARGET === 'native' &&
|
|
1327
|
+
property === 'transform' &&
|
|
1328
|
+
typeof raw === 'string'
|
|
1329
|
+
) {
|
|
1330
|
+
const transform = parseNativeTransform(raw)
|
|
1331
|
+
if (transform) {
|
|
1332
|
+
emitProperty(
|
|
1333
|
+
state,
|
|
1334
|
+
property,
|
|
1335
|
+
transform,
|
|
1336
|
+
condition,
|
|
1337
|
+
merge,
|
|
1338
|
+
originalValue,
|
|
1339
|
+
contextOnly
|
|
1340
|
+
)
|
|
1341
|
+
return
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
let value: any = raw
|
|
1346
|
+
if (typeof raw === 'string') {
|
|
1347
|
+
value = configuredValue(state, property, raw)
|
|
1348
|
+
if (value === raw && /[\s,(]/.test(raw)) {
|
|
1349
|
+
value = resolveEmbeddedTokens(state, property, raw)
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
if ((!isWeb || !state.flatShouldDoClasses) && typeof value === 'string') {
|
|
1354
|
+
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value)) {
|
|
1355
|
+
value = Number.parseFloat(value)
|
|
1356
|
+
} else if (value !== '' && Number.isFinite(Number(value))) {
|
|
1357
|
+
value = Number(value)
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
if (isWeb && state.flatShouldDoClasses && property === 'boxShadow' && !condition) {
|
|
1361
|
+
;(state as DirectState).flatBoxShadow = value
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
if (
|
|
1365
|
+
process.env.TAMAGUI_TARGET === 'native' &&
|
|
1366
|
+
typeof value === 'string' &&
|
|
1367
|
+
(property === 'backgroundImage' ||
|
|
1368
|
+
property === 'boxShadow' ||
|
|
1369
|
+
property === 'textShadow')
|
|
1370
|
+
) {
|
|
1371
|
+
const parsed = parseNativeStyle(property, value)
|
|
1372
|
+
if (parsed) {
|
|
1373
|
+
if (property === 'textShadow') {
|
|
1374
|
+
for (const [key, parsedValue] of parsed) {
|
|
1375
|
+
emitProperty(
|
|
1376
|
+
state,
|
|
1377
|
+
key,
|
|
1378
|
+
parsedValue,
|
|
1379
|
+
condition,
|
|
1380
|
+
merge,
|
|
1381
|
+
originalValue,
|
|
1382
|
+
contextOnly
|
|
1383
|
+
)
|
|
1384
|
+
}
|
|
1385
|
+
} else {
|
|
1386
|
+
emitProperty(
|
|
1387
|
+
state,
|
|
1388
|
+
property === 'backgroundImage' ? 'experimental_backgroundImage' : property,
|
|
1389
|
+
parsed,
|
|
1390
|
+
condition,
|
|
1391
|
+
merge,
|
|
1392
|
+
originalValue,
|
|
1393
|
+
contextOnly
|
|
1394
|
+
)
|
|
1395
|
+
}
|
|
1396
|
+
return
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
if (!isWeb && property === 'fontVariant' && typeof value === 'string') {
|
|
1401
|
+
value = value.split(/[,\s]+/).filter(Boolean)
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
const expanded = state.styleProps.noExpand
|
|
1405
|
+
? null
|
|
1406
|
+
: expandStyle(property, value, state.conf.settings.styleCompat || 'web')
|
|
1407
|
+
if (!expanded) {
|
|
1408
|
+
emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
|
|
1409
|
+
return
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
if (typeof raw === 'string' && expanded.length > 1) {
|
|
1413
|
+
const parts = splitComponents(raw)
|
|
1414
|
+
if (parts.length > 0 && parts.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
1415
|
+
for (let index = 0; index < expanded.length; index++) {
|
|
1416
|
+
const partIndex =
|
|
1417
|
+
index === 0 || parts.length === 1
|
|
1418
|
+
? 0
|
|
1419
|
+
: index === 1 || (index === 3 && parts.length < 4)
|
|
1420
|
+
? 1
|
|
1421
|
+
: index === 2 && parts.length < 3
|
|
1422
|
+
? 0
|
|
1423
|
+
: index
|
|
1424
|
+
emitResolved(
|
|
1425
|
+
state,
|
|
1426
|
+
expanded[index][0],
|
|
1427
|
+
parts[partIndex],
|
|
1428
|
+
condition,
|
|
1429
|
+
merge,
|
|
1430
|
+
originalValue,
|
|
1431
|
+
contextOnly
|
|
1432
|
+
)
|
|
1433
|
+
}
|
|
1434
|
+
return
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
for (let index = 0; index < expanded.length; index++) {
|
|
1438
|
+
emitProperty(
|
|
1439
|
+
state,
|
|
1440
|
+
expanded[index][0],
|
|
1441
|
+
expanded[index][1],
|
|
1442
|
+
condition,
|
|
1443
|
+
merge,
|
|
1444
|
+
originalValue,
|
|
1445
|
+
contextOnly
|
|
1446
|
+
)
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
function emitSegment(
|
|
1451
|
+
state: GetStyleState,
|
|
1452
|
+
property: string,
|
|
1453
|
+
source: string,
|
|
1454
|
+
start: number,
|
|
1455
|
+
end: number,
|
|
1456
|
+
condition: Condition | null,
|
|
1457
|
+
merge: MergeStyle,
|
|
1458
|
+
originalValue: any,
|
|
1459
|
+
contextOnly: boolean
|
|
1460
|
+
) {
|
|
1461
|
+
while (start < end && source.charCodeAt(start) <= 32) start++
|
|
1462
|
+
while (end > start && source.charCodeAt(end - 1) <= 32) end--
|
|
1463
|
+
if (start === end) return false
|
|
1464
|
+
if (
|
|
1465
|
+
!condition ||
|
|
1466
|
+
(condition.emit &&
|
|
1467
|
+
(condition.active ||
|
|
1468
|
+
(isWeb && state.flatShouldDoClasses) ||
|
|
1469
|
+
(!isWeb &&
|
|
1470
|
+
condition.theme &&
|
|
1471
|
+
supportsDynamicColorIOS &&
|
|
1472
|
+
isColorStyleKey(property))))
|
|
1473
|
+
) {
|
|
1474
|
+
const value = source.slice(start, end)
|
|
1475
|
+
emitValue(state, property, value, condition, merge, value, contextOnly)
|
|
1476
|
+
}
|
|
1477
|
+
return true
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
export function contributeStyleString(
|
|
1481
|
+
state: GetStyleState,
|
|
1482
|
+
property: string,
|
|
1483
|
+
source: string,
|
|
1484
|
+
merge: MergeStyle,
|
|
1485
|
+
originalValue?: any,
|
|
1486
|
+
contextOnly = false
|
|
1487
|
+
) {
|
|
1488
|
+
if (
|
|
1489
|
+
isWeb &&
|
|
1490
|
+
source.indexOf(':') !== -1 &&
|
|
1491
|
+
(webShadowParts.has(property) || legacyTransformParts.has(property))
|
|
1492
|
+
) {
|
|
1493
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1494
|
+
warnOnce(`conditional "${property}" needs its composite property; dropping it`)
|
|
1495
|
+
}
|
|
1496
|
+
return true
|
|
1497
|
+
}
|
|
1498
|
+
// no clause to cut, so the scanner below never runs on this value. nothing
|
|
1499
|
+
// validates it either: the `carriesTopLevelInjection` guard that used to
|
|
1500
|
+
// refuse a rule-breaking value here was dropped by owner decision, so a value
|
|
1501
|
+
// with no colon is emitted verbatim by contract. Keep the two paths in mind
|
|
1502
|
+
// together when reading a bug report about one of them.
|
|
1503
|
+
if (source.indexOf(':') === -1) {
|
|
1504
|
+
emitValue(state, property, source, null, merge, originalValue ?? source, contextOnly)
|
|
1505
|
+
return true
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
// The scan collects and the emit happens after it, because `parseValue`
|
|
1509
|
+
// reports a refused modifier or a rule-breaking character as one failure over
|
|
1510
|
+
// the WHOLE value: there is no such thing as the good half of a value the
|
|
1511
|
+
// grammar rejects. Emitting as the scan went is what used to make this path
|
|
1512
|
+
// lose the base it had already read while the variant path kept it.
|
|
1513
|
+
const conditions: (Condition | null)[] = []
|
|
1514
|
+
const starts: number[] = []
|
|
1515
|
+
const ends: number[] = []
|
|
1516
|
+
let pending: Condition | null = null
|
|
1517
|
+
// the first thing that made the value unusable, and the whole refusal test
|
|
1518
|
+
let refused = ''
|
|
1519
|
+
let lifecycle = false
|
|
1520
|
+
|
|
1521
|
+
scanFlatValue(source, {
|
|
1522
|
+
segment(start, end, isBase) {
|
|
1523
|
+
if (start === end) {
|
|
1524
|
+
// an empty base is simply no base; an empty clause payload is a clause
|
|
1525
|
+
// with nothing in it, which parseValue reports as `empty-payload`
|
|
1526
|
+
if (!isBase && !refused) refused = 'a conditional clause has no value'
|
|
1527
|
+
return
|
|
1528
|
+
}
|
|
1529
|
+
conditions.push(pending)
|
|
1530
|
+
starts.push(start)
|
|
1531
|
+
ends.push(end)
|
|
1532
|
+
},
|
|
1533
|
+
chain(start, end) {
|
|
1534
|
+
if (refused) return false
|
|
1535
|
+
const next = getCondition(state, source.slice(start, end))
|
|
1536
|
+
if (!next) {
|
|
1537
|
+
refused = `unknown modifier "${source.slice(start, end)}"`
|
|
1538
|
+
return false
|
|
1539
|
+
}
|
|
1540
|
+
if (process.env.NODE_ENV === 'development' && next.unsupportedState) {
|
|
1541
|
+
warnOnce(
|
|
1542
|
+
`${property}: "${next.unsupportedState}:" has no native component-state source; dropping the clause`
|
|
1543
|
+
)
|
|
1544
|
+
}
|
|
1545
|
+
pending = next
|
|
1546
|
+
lifecycle ||= !!(next.enter || next.exit)
|
|
1547
|
+
return true
|
|
1548
|
+
},
|
|
1549
|
+
error(code, index) {
|
|
1550
|
+
if (refused) return
|
|
1551
|
+
refused =
|
|
1552
|
+
code === 'invalid-character'
|
|
1553
|
+
? `"${source[index]}" would end the declaration or rule`
|
|
1554
|
+
: code === 'unterminated-string'
|
|
1555
|
+
? 'an unterminated string'
|
|
1556
|
+
: code === 'unterminated-comment'
|
|
1557
|
+
? 'an unterminated "/*" comment'
|
|
1558
|
+
: code === 'stray-comment-close'
|
|
1559
|
+
? 'a stray "*/"'
|
|
1560
|
+
: 'an unterminated "("'
|
|
1561
|
+
},
|
|
1562
|
+
})
|
|
1563
|
+
|
|
1564
|
+
if (refused) {
|
|
1565
|
+
// `16:9` is the one value whose top-level colon is content rather than a
|
|
1566
|
+
// clause, and only this property can hold it
|
|
1567
|
+
if (property === 'aspectRatio') {
|
|
1568
|
+
emitValue(
|
|
1569
|
+
state,
|
|
1570
|
+
property,
|
|
1571
|
+
source,
|
|
1572
|
+
null,
|
|
1573
|
+
merge,
|
|
1574
|
+
originalValue ?? source,
|
|
1575
|
+
contextOnly
|
|
1576
|
+
)
|
|
1577
|
+
return true
|
|
1578
|
+
}
|
|
1579
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1580
|
+
warnRefusedValue(property, source, refused)
|
|
1581
|
+
}
|
|
1582
|
+
return true
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
let hasBase = false
|
|
1586
|
+
let lastPayloadStart = 0
|
|
1587
|
+
for (let index = 0; index < conditions.length; index++) {
|
|
1588
|
+
const condition = conditions[index]
|
|
1589
|
+
lastPayloadStart = starts[index]
|
|
1590
|
+
const emitted = emitSegment(
|
|
1591
|
+
state,
|
|
1592
|
+
property,
|
|
1593
|
+
source,
|
|
1594
|
+
starts[index],
|
|
1595
|
+
ends[index],
|
|
1596
|
+
condition,
|
|
1597
|
+
merge,
|
|
1598
|
+
originalValue,
|
|
1599
|
+
contextOnly
|
|
1600
|
+
)
|
|
1601
|
+
if (!condition && emitted) hasBase = true
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
if (
|
|
1605
|
+
process.env.NODE_ENV === 'development' &&
|
|
1606
|
+
!hasBase &&
|
|
1607
|
+
conditions.length > 0 &&
|
|
1608
|
+
(property in tokenCategories.color || property in tokenCategoryByProperty) &&
|
|
1609
|
+
splitComponents(source.slice(lastPayloadStart)).length > 1
|
|
1610
|
+
) {
|
|
1611
|
+
warnOnce(
|
|
1612
|
+
`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`
|
|
1613
|
+
)
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
// a lifecycle-only value (`opacity="enter:0 exit:0"`) has no resting value to
|
|
1617
|
+
// return to. CSS does not need one: the property is simply absent and the
|
|
1618
|
+
// browser's own default applies. A style object does need one, because an
|
|
1619
|
+
// animation driver can only animate between values it can see, and that is
|
|
1620
|
+
// every native render plus every web render a driver drives inline. Without
|
|
1621
|
+
// this the enter style lands and then the target style has no such key at
|
|
1622
|
+
// all, so the driver has nothing to animate toward and the element snaps.
|
|
1623
|
+
if ((!isWeb || !state.flatShouldDoClasses) && lifecycle && !hasBase) {
|
|
1624
|
+
const value =
|
|
1625
|
+
property === 'opacity'
|
|
1626
|
+
? 1
|
|
1627
|
+
: property === 'scale' || property === 'scaleX' || property === 'scaleY'
|
|
1628
|
+
? 1
|
|
1629
|
+
: property === 'rotate'
|
|
1630
|
+
? '0deg'
|
|
1631
|
+
: property === 'x' || property === 'y'
|
|
1632
|
+
? 0
|
|
1633
|
+
: null
|
|
1634
|
+
if (value !== null) {
|
|
1635
|
+
emitValue(state, property, value, null, merge, value, contextOnly)
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
return true
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
export function contributeFrontendValue(
|
|
1642
|
+
state: GetStyleState,
|
|
1643
|
+
property: string,
|
|
1644
|
+
value: ParsedValue,
|
|
1645
|
+
merge: MergeStyle,
|
|
1646
|
+
contextOnly = false
|
|
1647
|
+
) {
|
|
1648
|
+
if (value.base !== null) {
|
|
1649
|
+
emitValue(state, property, value.base, null, merge, value.base, contextOnly)
|
|
1650
|
+
}
|
|
1651
|
+
for (const clause of value.clauses) {
|
|
1652
|
+
const condition = getCondition(state, clause.modifiers.join(':'))
|
|
1653
|
+
if (
|
|
1654
|
+
condition &&
|
|
1655
|
+
condition.emit &&
|
|
1656
|
+
(condition.active || (isWeb && state.flatShouldDoClasses))
|
|
1657
|
+
) {
|
|
1658
|
+
emitValue(
|
|
1659
|
+
state,
|
|
1660
|
+
property,
|
|
1661
|
+
clause.payload,
|
|
1662
|
+
condition,
|
|
1663
|
+
merge,
|
|
1664
|
+
clause.payload,
|
|
1665
|
+
contextOnly
|
|
1666
|
+
)
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
return true
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
export function contributeVariantClauseValue(
|
|
1673
|
+
state: GetStyleState,
|
|
1674
|
+
property: string,
|
|
1675
|
+
value: any,
|
|
1676
|
+
conditionSource: string,
|
|
1677
|
+
merge: MergeStyle,
|
|
1678
|
+
originalValue?: any,
|
|
1679
|
+
contextOnly = false
|
|
1680
|
+
) {
|
|
1681
|
+
const condition = getCondition(state, conditionSource)
|
|
1682
|
+
if (!condition) {
|
|
1683
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1684
|
+
warnRefusedValue(property, value, `unknown modifier "${conditionSource}"`)
|
|
1685
|
+
}
|
|
1686
|
+
return
|
|
1687
|
+
}
|
|
1688
|
+
if (process.env.NODE_ENV === 'development' && condition.unsupportedState) {
|
|
1689
|
+
warnOnce(
|
|
1690
|
+
`${property}: "${condition.unsupportedState}:" has no native component-state source; dropping the clause`
|
|
1691
|
+
)
|
|
1692
|
+
}
|
|
1693
|
+
if (condition.emit && (condition.active || (isWeb && state.flatShouldDoClasses))) {
|
|
1694
|
+
emitValue(state, property, value, condition, merge, originalValue, contextOnly)
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
export function contributeStyleValue(
|
|
1699
|
+
state: GetStyleState,
|
|
1700
|
+
property: string,
|
|
1701
|
+
value: any,
|
|
1702
|
+
merge: MergeStyle,
|
|
1703
|
+
originalValue?: any,
|
|
1704
|
+
contextOnly = false
|
|
1705
|
+
) {
|
|
1706
|
+
if (value === 'safe' && isSafeAreaKey(property)) {
|
|
1707
|
+
const expanded = expandSafeAreaValue(property)
|
|
1708
|
+
if (expanded) {
|
|
1709
|
+
state.flatUsesSafeArea = true
|
|
1710
|
+
for (const [key, resolved] of expanded) {
|
|
1711
|
+
emitValue(state, key, resolved, null, merge, originalValue ?? value, contextOnly)
|
|
1712
|
+
}
|
|
1713
|
+
return true
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
if (typeof value === 'string') {
|
|
1717
|
+
return contributeStyleString(
|
|
1718
|
+
state,
|
|
1719
|
+
property,
|
|
1720
|
+
value,
|
|
1721
|
+
merge,
|
|
1722
|
+
originalValue,
|
|
1723
|
+
contextOnly
|
|
1724
|
+
)
|
|
1725
|
+
}
|
|
1726
|
+
if (value != null) {
|
|
1727
|
+
emitValue(state, property, value, null, merge, originalValue ?? value, contextOnly)
|
|
1728
|
+
return true
|
|
1729
|
+
}
|
|
1730
|
+
return false
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
export function clearDirectStyle(state: GetStyleState, property: string) {
|
|
1734
|
+
const direct = state as DirectState
|
|
1735
|
+
const atomicKey = property.startsWith('transition')
|
|
1736
|
+
? 'transition'
|
|
1737
|
+
: webShadowParts.has(property)
|
|
1738
|
+
? 'boxShadow'
|
|
1739
|
+
: webTextShadowParts.has(property)
|
|
1740
|
+
? 'textShadow'
|
|
1741
|
+
: legacyTransformParts.has(property)
|
|
1742
|
+
? 'transform'
|
|
1743
|
+
: property
|
|
1744
|
+
if (direct.flatAtomics) delete direct.flatAtomics[atomicKey]
|
|
1745
|
+
delete state.classNames[atomicKey]
|
|
1746
|
+
}
|