@tamagui/web 3.0.0-beta.924.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_withNativeStyle.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.js +3 -0
- package/dist/cjs/_withNativeStyle.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.cjs +1 -5
- package/dist/cjs/_withStableStyle.native.js +1 -5
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +6 -3
- package/dist/cjs/config.native.cjs +7 -5
- package/dist/cjs/config.native.js +7 -5
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.cjs +1 -0
- package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +46 -32
- package/dist/cjs/createComponent.native.cjs +92 -72
- package/dist/cjs/createComponent.native.js +92 -72
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +32 -14
- package/dist/cjs/createTamagui.native.cjs +33 -19
- package/dist/cjs/createTamagui.native.js +33 -19
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -5
- package/dist/cjs/createTokens.native.js +1 -5
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.native.cjs +1 -5
- package/dist/cjs/createVariable.native.js +1 -5
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/createVariables.native.cjs +2 -6
- package/dist/cjs/createVariables.native.js +2 -6
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +87 -329
- package/dist/cjs/dom/html.native.cjs +53 -2
- package/dist/cjs/dom/html.native.js +53 -2
- package/dist/cjs/dom/html.native.js.map +1 -1
- package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
- package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
- package/dist/cjs/dom/htmlReset.native.js +30 -0
- package/dist/cjs/dom/htmlReset.native.js.map +1 -0
- package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
- package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/cjs/dom/primitives.native.cjs +81 -34
- package/dist/cjs/dom/primitives.native.js +81 -34
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +10 -4
- package/dist/cjs/eventHandling.native.cjs +52 -16
- package/dist/cjs/eventHandling.native.js +52 -16
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
- package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/cjs/helpers/configVariables.native.cjs +2 -6
- package/dist/cjs/helpers/configVariables.native.js +2 -6
- package/dist/cjs/helpers/configVariables.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
- package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +45 -1
- package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
- package/dist/cjs/helpers/expandStyle.native.js +38 -2
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +15 -3
- package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
- package/dist/cjs/helpers/expandStyles.native.js +14 -8
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/fluid.cjs +56 -0
- package/dist/cjs/helpers/fluid.native.cjs +58 -0
- package/dist/cjs/helpers/fluid.native.js +60 -0
- package/dist/cjs/helpers/fluid.native.js.map +1 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
- package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
- package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
- package/dist/cjs/helpers/grammarConfig.cjs +6 -14
- package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
- package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.cjs +1 -5
- package/dist/cjs/helpers/isObj.native.js +1 -5
- package/dist/cjs/helpers/isObj.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.cjs +18 -21
- package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
- package/dist/cjs/helpers/mergeProps.native.js +20 -23
- package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeTextMetrics.cjs +74 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
- package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
- package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
- package/dist/cjs/helpers/resolveRem.native.js +18 -21
- package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +124 -0
- package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
- package/dist/cjs/helpers/resolveSizing.native.js +135 -0
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
- package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
- package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.js +0 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +5 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/themeRef.native.cjs +1 -5
- package/dist/cjs/helpers/themeRef.native.js +1 -5
- package/dist/cjs/helpers/themeRef.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +26 -11
- package/dist/cjs/helpers/themes.native.cjs +26 -11
- package/dist/cjs/helpers/themes.native.js +26 -11
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/helpers/tokenCategories.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +1 -1
- package/dist/cjs/helpers/variables.native.cjs +4 -8
- package/dist/cjs/helpers/variables.native.js +4 -8
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.js +6 -0
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
- package/dist/cjs/hooks/useComponentState.native.js +1 -5
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +27 -34
- package/dist/cjs/hooks/useMedia.native.cjs +45 -51
- package/dist/cjs/hooks/useMedia.native.js +45 -51
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +37 -47
- package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
- package/dist/cjs/hooks/useThemeState.native.js +44 -50
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/index.native.cjs +7 -0
- package/dist/cjs/index.native.js +7 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +22 -0
- package/dist/cjs/internal-runtime.native.cjs +22 -0
- package/dist/cjs/internal-runtime.native.js +22 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.native.cjs +2 -9
- package/dist/cjs/static-resolve.native.js +2 -9
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +1 -1
- package/dist/cjs/style.native.cjs +4 -7
- package/dist/cjs/style.native.js +4 -7
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +10 -17
- package/dist/cjs/views/Theme.native.cjs +9 -11
- package/dist/cjs/views/Theme.native.js +9 -11
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/_withNativeStyle.mjs +4 -1
- package/dist/esm/_withNativeStyle.mjs.map +1 -1
- package/dist/esm/_withNativeStyle.native.js +4 -1
- package/dist/esm/_withNativeStyle.native.js.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -5
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +6 -3
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +7 -5
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +9 -9
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +16 -9
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +45 -42
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +93 -82
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +33 -15
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +34 -20
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +1 -5
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +1 -5
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +2 -6
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +87 -329
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/html.native.js +53 -2
- package/dist/esm/dom/html.native.js.map +1 -1
- package/dist/esm/dom/htmlReset.mjs +6 -0
- package/dist/esm/dom/htmlReset.mjs.map +1 -0
- package/dist/esm/dom/htmlReset.native.js +6 -0
- package/dist/esm/dom/htmlReset.native.js.map +1 -0
- package/dist/esm/dom/htmlRuntime.native.js +4 -0
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
- package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
- package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
- package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/esm/dom/primitives.native.js +81 -34
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +10 -4
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +52 -16
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
- package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
- package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
- package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/esm/helpers/configVariables.native.js +2 -6
- package/dist/esm/helpers/configVariables.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +14 -10
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +4 -4
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +1 -5
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +41 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -3
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +15 -3
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +14 -8
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/fluid.mjs +36 -0
- package/dist/esm/helpers/fluid.mjs.map +1 -0
- package/dist/esm/helpers/fluid.native.js +36 -0
- package/dist/esm/helpers/fluid.native.js.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +364 -150
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +588 -188
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +6 -14
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +32 -22
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +11 -4
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -4
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +1 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.mjs +18 -21
- package/dist/esm/helpers/mergeProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +20 -23
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeTextMetrics.mjs +55 -0
- package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/esm/helpers/normalizeColor.native.js +17 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
- package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
- package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
- package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
- package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/esm/helpers/resolveRem.native.js +18 -21
- package/dist/esm/helpers/resolveRem.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +102 -0
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
- package/dist/esm/helpers/resolveSizing.native.js +109 -0
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
- package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
- package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +20 -1
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +20 -1
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +5 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +8 -7
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/themeRef.native.js +1 -5
- package/dist/esm/helpers/themeRef.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +20 -11
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +20 -11
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/tokenCategories.mjs +2 -2
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +2 -2
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +1 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +4 -8
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +6 -1
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -1
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +1 -5
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +27 -34
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +45 -51
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +36 -48
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +44 -50
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/internal-runtime.mjs +22 -3
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +22 -3
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.native.js +2 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +1 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +4 -7
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +15 -14
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +15 -15
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +20 -18
- package/reset.css +11 -0
- package/src/_withNativeStyle.tsx +6 -1
- package/src/config.ts +6 -6
- package/src/contexts/ComponentContext.tsx +8 -0
- package/src/createComponent.tsx +177 -57
- package/src/createStyledHOC.tsx +25 -26
- package/src/createTamagui.ts +47 -28
- package/src/dom/contract.ts +4 -1
- package/src/dom/html.native.tsx +55 -2
- package/src/dom/html.tsx +189 -388
- package/src/dom/htmlReset.ts +15 -0
- package/src/dom/htmlRuntime.native.tsx +5 -0
- package/src/dom/htmlStaticConfig.ts +40 -0
- package/src/dom/primitives.native.tsx +138 -33
- package/src/dom/standalone.ts +2 -1
- package/src/dom/styleTypes.ts +82 -92
- package/src/eventHandling.native.ts +61 -11
- package/src/eventHandling.ts +19 -4
- package/src/helpers/NativeTextBinding.tsx +26 -0
- package/src/helpers/createDesignSystem.ts +24 -8
- package/src/helpers/expandStyle.ts +88 -4
- package/src/helpers/expandStyles.ts +6 -11
- package/src/helpers/fluid.ts +66 -0
- package/src/helpers/getCSSStylesAtomic.ts +11 -6
- package/src/helpers/getSplitStyles.tsx +1032 -296
- package/src/helpers/getThemeCSSRules.ts +73 -35
- package/src/helpers/grammarConfig.ts +23 -8
- package/src/helpers/insertStyleRule.tsx +14 -8
- package/src/helpers/mainThreadPressEvents.native.ts +65 -141
- package/src/helpers/mergeProps.ts +29 -62
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeTextMetrics.ts +77 -0
- package/src/helpers/normalizeColor.native.ts +29 -4
- package/src/helpers/normalizeValueWithProperty.ts +2 -1
- package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
- package/src/helpers/proxyThemeToParents.ts +13 -2
- package/src/helpers/resolveNativeUnits.native.ts +247 -0
- package/src/helpers/resolveNativeUnits.ts +10 -0
- package/src/helpers/resolveRem.native.ts +25 -26
- package/src/helpers/resolveSizing.ts +167 -0
- package/src/helpers/resolveVariableValue.ts +21 -17
- package/src/helpers/skipProps.ts +0 -1
- package/src/helpers/styleFrontend.ts +39 -0
- package/src/helpers/styleProvenance.ts +1 -1
- package/src/helpers/styleStaticConfigCore.ts +15 -4
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +16 -7
- package/src/helpers/themes.ts +27 -11
- package/src/helpers/tokenCategories.ts +15 -3
- package/src/helpers/variables.ts +2 -2
- package/src/helpers/warnOnce.ts +6 -0
- package/src/helpers/webPropsToSkip.native.ts +9 -3
- package/src/helpers/wrapStyleTags.tsx +4 -1
- package/src/hooks/useMedia.tsx +36 -47
- package/src/hooks/useSplitStyles.tsx +4 -1
- package/src/hooks/useThemeState.ts +69 -74
- package/src/index.ts +13 -0
- package/src/interfaces/RNExclusiveTypes.ts +1 -3
- package/src/internal-runtime.ts +43 -2
- package/src/style.ts +4 -1
- package/src/styled.tsx +34 -3
- package/src/types.tsx +412 -132
- package/src/views/Theme.tsx +18 -21
- package/src/views/ThemeDebug.tsx +1 -1
- package/src/views/ThemeUpdate.tsx +1 -1
- package/types/_withNativeStyle.d.ts.map +1 -1
- 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/createStyledHOC.d.ts +5 -2
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/dom/contract.d.ts +4 -1
- package/types/dom/contract.d.ts.map +1 -1
- package/types/dom/html.d.ts +60 -51
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/html.native.d.ts.map +1 -1
- package/types/dom/htmlReset.d.ts +10 -0
- package/types/dom/htmlReset.d.ts.map +1 -0
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/htmlStaticConfig.d.ts +22 -0
- package/types/dom/htmlStaticConfig.d.ts.map +1 -0
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/dom/standalone.d.ts +2 -1
- package/types/dom/standalone.d.ts.map +1 -1
- package/types/dom/styleTypes.d.ts +63 -84
- package/types/dom/styleTypes.d.ts.map +1 -1
- package/types/eventHandling.d.ts +12 -4
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/NativeTextBinding.d.ts +11 -0
- package/types/helpers/NativeTextBinding.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/fluid.d.ts +21 -0
- package/types/helpers/fluid.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +1 -15
- package/types/helpers/mergeProps.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeTextMetrics.d.ts +16 -0
- package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
- package/types/helpers/normalizeColor.native.d.ts +4 -1
- package/types/helpers/normalizeColor.native.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.native.d.ts +3 -1
- package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
- package/types/helpers/parseNativeStyle.d.ts.map +1 -0
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/resolveNativeUnits.d.ts +6 -0
- package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
- package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
- package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
- package/types/helpers/resolveRem.native.d.ts +6 -4
- package/types/helpers/resolveRem.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts +90 -0
- package/types/helpers/resolveSizing.d.ts.map +1 -0
- package/types/helpers/resolveVariableValue.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +0 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +21 -0
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleProvenance.d.ts +1 -1
- package/types/helpers/styleProvenance.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts +1 -0
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +6 -2
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +5 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
- package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +12 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +7 -4
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +258 -102
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/dist/cjs/helpers/timer.native.js.map +0 -1
- package/dist/esm/helpers/timer.mjs +0 -13
- package/dist/esm/helpers/timer.mjs.map +0 -1
- package/dist/esm/helpers/timer.native.js +0 -13
- package/dist/esm/helpers/timer.native.js.map +0 -1
- package/src/helpers/timer.ts +0 -9
- package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
- package/types/helpers/timer.d.ts +0 -2
- package/types/helpers/timer.d.ts.map +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { getConfig } from '../config'
|
|
2
|
+
import { getVariableValue } from '../createVariable'
|
|
3
|
+
import type {
|
|
4
|
+
ComponentSize,
|
|
5
|
+
Font,
|
|
6
|
+
GenericSizing,
|
|
7
|
+
SizeRecipe,
|
|
8
|
+
TamaguiConfig,
|
|
9
|
+
TokensParsed,
|
|
10
|
+
} from '../types'
|
|
11
|
+
|
|
12
|
+
/** the env slice resolveSizing reads: a styled.dynamic env or hand-built */
|
|
13
|
+
export type SizingEnv = {
|
|
14
|
+
sizing: GenericSizing
|
|
15
|
+
fonts: TamaguiConfig['fonts']
|
|
16
|
+
tokens: TokensParsed
|
|
17
|
+
font?: Font
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* the default control ladder, transcribed from the Button frame/text tables
|
|
22
|
+
* so the derived px are identical by construction. v6 re-exports this;
|
|
23
|
+
* resolveSizing falls back to it when a config carries no `sizing`.
|
|
24
|
+
*/
|
|
25
|
+
export const defaultSizing = {
|
|
26
|
+
default: 'md',
|
|
27
|
+
sizes: {
|
|
28
|
+
xs: {
|
|
29
|
+
fontSize: 'xs',
|
|
30
|
+
controlFontSize: 'xs',
|
|
31
|
+
paddingInline: '2',
|
|
32
|
+
paddingBlock: '1',
|
|
33
|
+
gap: '1',
|
|
34
|
+
radius: 'sm',
|
|
35
|
+
},
|
|
36
|
+
sm: {
|
|
37
|
+
fontSize: 'sm',
|
|
38
|
+
controlFontSize: 'sm',
|
|
39
|
+
paddingInline: '3',
|
|
40
|
+
paddingBlock: '1.5',
|
|
41
|
+
gap: '1.5',
|
|
42
|
+
radius: 'md',
|
|
43
|
+
},
|
|
44
|
+
md: {
|
|
45
|
+
fontSize: 'sm',
|
|
46
|
+
controlFontSize: 'base',
|
|
47
|
+
paddingInline: '4',
|
|
48
|
+
paddingBlock: '2',
|
|
49
|
+
gap: '2',
|
|
50
|
+
radius: 'md',
|
|
51
|
+
},
|
|
52
|
+
lg: {
|
|
53
|
+
fontSize: 'base',
|
|
54
|
+
controlFontSize: 'lg',
|
|
55
|
+
paddingInline: '6',
|
|
56
|
+
paddingBlock: '2',
|
|
57
|
+
gap: '2',
|
|
58
|
+
radius: 'md',
|
|
59
|
+
},
|
|
60
|
+
xl: {
|
|
61
|
+
fontSize: 'lg',
|
|
62
|
+
controlFontSize: 'xl',
|
|
63
|
+
paddingInline: '8',
|
|
64
|
+
paddingBlock: '2.5',
|
|
65
|
+
gap: '2.5',
|
|
66
|
+
radius: 'lg',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
} as const satisfies GenericSizing
|
|
70
|
+
|
|
71
|
+
/** a rung resolved: token keys stay keys, geometry is px */
|
|
72
|
+
export type ResolvedSizing = {
|
|
73
|
+
/** the rung that rendered (degrades to the default in production) */
|
|
74
|
+
name: string
|
|
75
|
+
fontSize: string
|
|
76
|
+
lineHeight: string
|
|
77
|
+
paddingInline: string
|
|
78
|
+
paddingBlock: string
|
|
79
|
+
gap: string
|
|
80
|
+
radius: string
|
|
81
|
+
/** text line box plus vertical padding, before any border */
|
|
82
|
+
height: number
|
|
83
|
+
/** icon px for the rung */
|
|
84
|
+
icon: number
|
|
85
|
+
/** the square controls: checkbox box, radio circle, switch track height */
|
|
86
|
+
square: number
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const toPx = (value: unknown): number =>
|
|
90
|
+
typeof value === 'number' ? value : Number.parseFloat(value as string)
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* a size name -> its rung resolved to pixels, against the sizing in `env`.
|
|
94
|
+
* `true`/absent resolve to the default rung, `false` to no styles. Without
|
|
95
|
+
* an env (plain render code, no styled.dynamic callback) it reads the active
|
|
96
|
+
* config and default font: a sync global read, not a subscription, so static
|
|
97
|
+
* sizes never re-render on media or theme changes. Unknown names resolve to
|
|
98
|
+
* no styles, exactly like a miss in the old static tables: numeric sizes and
|
|
99
|
+
* cascaded values pass through variants that do not know them, and must never
|
|
100
|
+
* throw. A rung pointing at missing tokens is a broken config: it warns in
|
|
101
|
+
* development and resolves to no styles.
|
|
102
|
+
*/
|
|
103
|
+
export function resolveSizing(size: false, env?: SizingEnv): undefined
|
|
104
|
+
export function resolveSizing(
|
|
105
|
+
size: ComponentSize | true | undefined,
|
|
106
|
+
env?: SizingEnv
|
|
107
|
+
): ResolvedSizing
|
|
108
|
+
export function resolveSizing(
|
|
109
|
+
size: ComponentSize | boolean | undefined,
|
|
110
|
+
env?: SizingEnv
|
|
111
|
+
): ResolvedSizing | undefined
|
|
112
|
+
export function resolveSizing(
|
|
113
|
+
size: ComponentSize | boolean | undefined,
|
|
114
|
+
env?: SizingEnv
|
|
115
|
+
): ResolvedSizing | undefined {
|
|
116
|
+
if (size === false) return undefined
|
|
117
|
+
const conf = env?.fonts && env?.tokens ? undefined : getConfig()
|
|
118
|
+
const sizing = { ...defaultSizing, ...(env?.sizing ?? conf?.sizing) }
|
|
119
|
+
const name = size === true || size == null ? sizing.default : size
|
|
120
|
+
const rung: SizeRecipe | undefined = sizing.sizes[name]
|
|
121
|
+
if (!rung) return undefined
|
|
122
|
+
|
|
123
|
+
const keys = {
|
|
124
|
+
fontSize: rung.fontSize,
|
|
125
|
+
lineHeight: rung.fontSize,
|
|
126
|
+
paddingInline: rung.paddingInline,
|
|
127
|
+
paddingBlock: rung.paddingBlock,
|
|
128
|
+
gap: rung.gap,
|
|
129
|
+
radius: rung.radius,
|
|
130
|
+
}
|
|
131
|
+
// an explicit rung geometry wins over derivation (v5 pins its heights)
|
|
132
|
+
if (rung.px) {
|
|
133
|
+
return {
|
|
134
|
+
name,
|
|
135
|
+
...keys,
|
|
136
|
+
height: rung.px.height,
|
|
137
|
+
icon: rung.px.icon,
|
|
138
|
+
square: rung.px.square,
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const fonts = env?.fonts ?? conf?.fontsParsed
|
|
143
|
+
const tokens = env?.tokens ?? conf?.tokensParsed
|
|
144
|
+
const font = env?.font ?? fonts?.[conf?.defaultFontToken ?? 'body']
|
|
145
|
+
const px = {
|
|
146
|
+
fontSize: toPx(getVariableValue(font?.size?.[rung.fontSize])),
|
|
147
|
+
control: toPx(getVariableValue(font?.size?.[rung.controlFontSize])),
|
|
148
|
+
lineHeight: toPx(getVariableValue(font?.lineHeight?.[rung.fontSize])),
|
|
149
|
+
paddingBlock: toPx(getVariableValue(tokens?.space?.[rung.paddingBlock])),
|
|
150
|
+
}
|
|
151
|
+
if (!Object.values(px).every(Number.isFinite)) {
|
|
152
|
+
if (process.env.NODE_ENV === 'development') {
|
|
153
|
+
console.warn(
|
|
154
|
+
`[tamagui] size "${name}" references a missing token (fontSize "${rung.fontSize}", controlFontSize "${rung.controlFontSize}", paddingBlock "${rung.paddingBlock}"); resolving to no styles`
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
return undefined
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
name,
|
|
162
|
+
...keys,
|
|
163
|
+
height: px.lineHeight + px.paddingBlock * 2,
|
|
164
|
+
icon: Math.ceil(px.fontSize / 4) * 4,
|
|
165
|
+
square: Math.round(px.control * 1.4),
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -6,26 +6,30 @@ export function resolveVariableValue(
|
|
|
6
6
|
valOrVar: Variable | any,
|
|
7
7
|
resolveValues?: ResolveVariableAs
|
|
8
8
|
) {
|
|
9
|
-
if (resolveValues === 'none') {
|
|
9
|
+
if (resolveValues === 'none' || !isVariable(valOrVar)) {
|
|
10
10
|
return valOrVar
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
let value
|
|
13
|
+
if (resolveValues === 'value') {
|
|
14
|
+
value = valOrVar.val
|
|
15
|
+
} else {
|
|
17
16
|
// @ts-expect-error dynamic variables may expose a platform-aware getter
|
|
18
|
-
const get = valOrVar
|
|
19
|
-
|
|
20
|
-
// shadowColor doesn't support dynamic style
|
|
21
|
-
if (process.env.TAMAGUI_TARGET !== 'native' || key !== 'shadowColor') {
|
|
22
|
-
if (typeof get === 'function') {
|
|
23
|
-
const resolveDynamicFor = resolveValues === 'web' ? 'web' : undefined
|
|
24
|
-
return get(resolveDynamicFor)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
17
|
+
const get = valOrVar.get
|
|
27
18
|
|
|
28
|
-
|
|
19
|
+
// compound CSS strings cannot contain native dynamic color objects.
|
|
20
|
+
const needsLiteralColor =
|
|
21
|
+
key === 'shadowColor' ||
|
|
22
|
+
key === 'boxShadow' ||
|
|
23
|
+
key === 'textShadow' ||
|
|
24
|
+
key === 'backgroundImage'
|
|
25
|
+
value =
|
|
26
|
+
(process.env.TAMAGUI_TARGET !== 'native' || !needsLiteralColor) &&
|
|
27
|
+
typeof get === 'function'
|
|
28
|
+
? get(resolveValues === 'web' ? 'web' : undefined)
|
|
29
|
+
: process.env.TAMAGUI_TARGET === 'native'
|
|
30
|
+
? valOrVar.val
|
|
31
|
+
: valOrVar.variable
|
|
29
32
|
}
|
|
30
|
-
return
|
|
33
|
+
// compiler variables can return native literals from a web-built resolver.
|
|
34
|
+
return key === 'lineHeight' && typeof value === 'number' ? `${value}px` : value
|
|
31
35
|
}
|
package/src/helpers/skipProps.ts
CHANGED
|
@@ -66,6 +66,33 @@ export type FrontendClassPlan =
|
|
|
66
66
|
|
|
67
67
|
export type FrontendClassSink = (entry: FrontendClassPlanEntry) => void
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Fold one contribution into whatever a frontend already collected for the same
|
|
71
|
+
* property. A value already present becomes the `default` arm, so
|
|
72
|
+
* `ring-2 hover:ring-4` reads as `{ default, hover }`, and a later unconditional
|
|
73
|
+
* `ring-8` restates that `default` without dropping the `hover` arm.
|
|
74
|
+
*
|
|
75
|
+
* Both class-walk sinks use this: the one in `getSplitStyles` and the one the
|
|
76
|
+
* Tailwind frontend runs when it composes a class string statically.
|
|
77
|
+
*/
|
|
78
|
+
export function mergeFrontendCondition(
|
|
79
|
+
previous: unknown,
|
|
80
|
+
value: unknown,
|
|
81
|
+
condition: string | undefined
|
|
82
|
+
): unknown {
|
|
83
|
+
const merged =
|
|
84
|
+
previous !== null && typeof previous === 'object' && !Array.isArray(previous)
|
|
85
|
+
if (condition === undefined) {
|
|
86
|
+
return merged ? { ...(previous as Record<string, unknown>), default: value } : value
|
|
87
|
+
}
|
|
88
|
+
if (merged) {
|
|
89
|
+
return { ...(previous as Record<string, unknown>), [condition]: value }
|
|
90
|
+
}
|
|
91
|
+
return previous === undefined
|
|
92
|
+
? { [condition]: value }
|
|
93
|
+
: { default: previous, [condition]: value }
|
|
94
|
+
}
|
|
95
|
+
|
|
69
96
|
/**
|
|
70
97
|
* A component's authoring syntax. It is chosen by the package the component was
|
|
71
98
|
* imported from and frozen onto its static config when the component is created:
|
|
@@ -95,6 +122,18 @@ export type StyleFrontend = {
|
|
|
95
122
|
staticConfig: Config,
|
|
96
123
|
config: StyleFrontendConfig
|
|
97
124
|
) => FrontendStaticConfigNormalization
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Composes the N-to-1 utilities a class walk collected under `__`-prefixed keys
|
|
128
|
+
* (ring width plus ring color into one `boxShadow`, gradient stops into one
|
|
129
|
+
* `backgroundImage`, filter parts into one `filter`) into ordinary styles.
|
|
130
|
+
*
|
|
131
|
+
* Called once per pass and only when the walk actually collected such a key, so
|
|
132
|
+
* a component with no className, or none carrying a composed utility, never runs
|
|
133
|
+
* it. The output contributes at the className's own authored position, which is
|
|
134
|
+
* why an unrelated `ring-2` cannot change which layer owns `backgroundColor`.
|
|
135
|
+
*/
|
|
136
|
+
compose?: (collected: Record<string, any>) => Record<string, any> | null | undefined
|
|
98
137
|
}
|
|
99
138
|
|
|
100
139
|
/**
|
|
@@ -24,7 +24,7 @@ export const STYLE_TOKEN_PROVENANCE_KEY = 'tamagui.styleTokenProvenance'
|
|
|
24
24
|
const provenanceSymbol = /* @__PURE__ */ Symbol.for(STYLE_TOKEN_PROVENANCE_KEY)
|
|
25
25
|
|
|
26
26
|
export type StyleTokenBinding = {
|
|
27
|
-
/** original token string before resolution, e.g. 'background' or '
|
|
27
|
+
/** original token string before resolution, e.g. 'background' or 'color-9' */
|
|
28
28
|
token: string
|
|
29
29
|
/** full resolved theme name that produced the value, e.g. 'light_accent' */
|
|
30
30
|
theme: string
|
|
@@ -28,6 +28,8 @@ export function resolveStyleStaticConfig(
|
|
|
28
28
|
const variants = normalized ? normalized.variants : staticConfig.variants
|
|
29
29
|
const authoredBaseStyle = normalized ? normalized.baseStyle : staticConfig.baseStyle
|
|
30
30
|
const authoredDefaultProps = staticConfig.defaultProps
|
|
31
|
+
const keys = staticConfig.contextProps || staticConfig.context?.propKeys
|
|
32
|
+
const styledContextKeys = keys ? new Set(keys) : null
|
|
31
33
|
let baseStyle: Record<string, any> | undefined
|
|
32
34
|
let baseVariantProps: Record<string, any> | undefined
|
|
33
35
|
let defaultProps: Record<string, any> | undefined
|
|
@@ -47,7 +49,12 @@ export function resolveStyleStaticConfig(
|
|
|
47
49
|
;(baseStyle ||= authoredBaseStyle ? { ...authoredBaseStyle } : {})[key] =
|
|
48
50
|
authoredDefaultProps[key]
|
|
49
51
|
}
|
|
50
|
-
if (
|
|
52
|
+
if (
|
|
53
|
+
isVariant ||
|
|
54
|
+
!isStyle ||
|
|
55
|
+
staticConfig.inlineProps?.has(key) ||
|
|
56
|
+
styledContextKeys?.has(key)
|
|
57
|
+
) {
|
|
51
58
|
;(defaultProps ||= {})[key] = authoredDefaultProps[key]
|
|
52
59
|
}
|
|
53
60
|
if (isVariant) {
|
|
@@ -74,7 +81,12 @@ export function resolveStyleStaticConfig(
|
|
|
74
81
|
}
|
|
75
82
|
for (const key in resolvedBaseStyle) {
|
|
76
83
|
const expanded = conf.shorthands[key] || key
|
|
77
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
key !== 'transition' &&
|
|
86
|
+
!variants?.[key] &&
|
|
87
|
+
!staticConfig.inlineProps?.has(expanded) &&
|
|
88
|
+
expanded in validStyles
|
|
89
|
+
) {
|
|
78
90
|
;(directBaseStyle ||= {})[key] = resolvedBaseStyle[key]
|
|
79
91
|
;(directBaseKeys ||= []).push(key)
|
|
80
92
|
} else {
|
|
@@ -86,14 +98,13 @@ export function resolveStyleStaticConfig(
|
|
|
86
98
|
}
|
|
87
99
|
flushDirectBaseStyle()
|
|
88
100
|
}
|
|
89
|
-
const keys = staticConfig.contextProps || staticConfig.context?.propKeys
|
|
90
101
|
const value: StyleStaticConfig = {
|
|
91
102
|
baseStyle: resolvedBaseStyle,
|
|
92
103
|
baseVariantProps,
|
|
93
104
|
baseStylePiece,
|
|
94
105
|
baseStylePieces,
|
|
95
106
|
defaultProps,
|
|
96
|
-
styledContextKeys
|
|
107
|
+
styledContextKeys,
|
|
97
108
|
variants,
|
|
98
109
|
variantStyleResolver: (staticConfig as any).variantStyleResolver,
|
|
99
110
|
passthroughClassName: normalized
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getSetting } from '../config'
|
|
2
2
|
import { getVariableValue } from '../createVariable'
|
|
3
|
+
import { defaultSizing } from './resolveSizing'
|
|
3
4
|
import type {
|
|
4
5
|
GenericFonts,
|
|
5
6
|
GetStyleState,
|
|
@@ -151,7 +152,7 @@ export function styledDynamic(fn?: any) {
|
|
|
151
152
|
|
|
152
153
|
/**
|
|
153
154
|
* the env for `styled.dynamic` callbacks and `.resolve` resolvers: tokens,
|
|
154
|
-
* theme, fonts, and the active font. Built once per style pass.
|
|
155
|
+
* theme, fonts, sizing, and the active font. Built once per style pass.
|
|
155
156
|
*/
|
|
156
157
|
export function getDynamicEnv(styleState: GetStyleState): StyledDynamicEnv {
|
|
157
158
|
const cached = (styleState as any).flatDynamicEnv
|
|
@@ -167,6 +168,7 @@ export function getDynamicEnv(styleState: GetStyleState): StyledDynamicEnv {
|
|
|
167
168
|
fonts,
|
|
168
169
|
tokens: conf.tokensParsed,
|
|
169
170
|
theme,
|
|
171
|
+
sizing: { ...defaultSizing, ...conf.sizing },
|
|
170
172
|
get fontFamily() {
|
|
171
173
|
return (
|
|
172
174
|
getVariableValue(styleState.fontFamily || props.fontFamily) ||
|
|
@@ -96,13 +96,22 @@ const createGroupListener = (
|
|
|
96
96
|
Object.assign(group.pseudo, pseudo)
|
|
97
97
|
didChange = true
|
|
98
98
|
}
|
|
99
|
-
} else if (layout
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
} else if (layout) {
|
|
100
|
+
if (mediaGroups) {
|
|
101
|
+
group.media ||= {}
|
|
102
|
+
const mediaState = getMediaState(mediaGroups, layout)
|
|
103
|
+
const next = mergeIfNotShallowEqual(group.media, mediaState)
|
|
104
|
+
if (next !== group.media) {
|
|
105
|
+
Object.assign(group.media, next)
|
|
106
|
+
didChange = true
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (layout.width !== undefined) {
|
|
110
|
+
const prevWidth = group.layout?.width
|
|
111
|
+
if (prevWidth === undefined || Math.abs(prevWidth - layout.width) >= 0.5) {
|
|
112
|
+
group.layout = layout
|
|
113
|
+
didChange = true
|
|
114
|
+
}
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
|
package/src/helpers/themes.ts
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
import { createVariable, isVariable } from '../createVariable'
|
|
2
2
|
|
|
3
|
+
const schemeKey = /* @__PURE__ */ Symbol.for('tamagui.theme.scheme')
|
|
4
|
+
|
|
5
|
+
export function getAuthoredThemeScheme(theme: any): 'light' | 'dark' | undefined {
|
|
6
|
+
const scheme = theme[schemeKey]
|
|
7
|
+
return scheme === 'light' || scheme === 'dark' ? scheme : undefined
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function setAuthoredThemeScheme<T>(target: T, scheme: 'light' | 'dark'): T {
|
|
11
|
+
Object.defineProperty(target, schemeKey, { value: scheme })
|
|
12
|
+
return target
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function copyAuthoredThemeScheme<T>(target: T, source: any): T {
|
|
16
|
+
const scheme = getAuthoredThemeScheme(source)
|
|
17
|
+
if (scheme) setAuthoredThemeScheme(target, scheme)
|
|
18
|
+
return target
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// a client that rebuilds its themes from the generated css has no theme
|
|
22
|
+
// objects to read the authored scheme from, so each authored theme's rule
|
|
23
|
+
// carries it as a selector that never matches an element.
|
|
24
|
+
export const themeSchemeSelectorPrefix = '.tm_scheme_'
|
|
25
|
+
|
|
3
26
|
// mutates, freeze after
|
|
4
27
|
// shared by createTamagui so extracted here
|
|
5
28
|
export function ensureThemeVariable(theme: any, key: string) {
|
|
6
29
|
const val = theme[key]
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
theme[key] = createVariable({
|
|
10
|
-
key,
|
|
11
|
-
name: key,
|
|
12
|
-
val: value,
|
|
13
|
-
})
|
|
14
|
-
} else if (val.name !== key) {
|
|
15
|
-
// rename to theme name
|
|
30
|
+
const variable = isVariable(val)
|
|
31
|
+
if (!variable || val.name !== key) {
|
|
16
32
|
theme[key] = createVariable({
|
|
17
|
-
key: val.name,
|
|
33
|
+
key: variable ? val.name : key,
|
|
18
34
|
name: key,
|
|
19
|
-
val:
|
|
35
|
+
val: variable ? val.val : val,
|
|
20
36
|
})
|
|
21
37
|
}
|
|
22
38
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export type StyleTokenCategory = 'size' | 'space' | 'radius' | 'zIndex' | 'fontSize'
|
|
2
|
-
export type RuntimeTokenCategory =
|
|
2
|
+
export type RuntimeTokenCategory =
|
|
3
|
+
| StyleTokenCategory
|
|
4
|
+
| 'color'
|
|
5
|
+
| 'font'
|
|
6
|
+
| 'fontFamily'
|
|
7
|
+
| (string & {})
|
|
3
8
|
|
|
4
9
|
export function getTokenCategoryForProperty(
|
|
5
10
|
property: string
|
|
@@ -14,7 +19,13 @@ export function getTokenCategoryForProperty(
|
|
|
14
19
|
return 'font'
|
|
15
20
|
}
|
|
16
21
|
if (property === 'zIndex') return 'zIndex'
|
|
17
|
-
if (
|
|
22
|
+
if (
|
|
23
|
+
property === 'color' ||
|
|
24
|
+
property === 'fill' ||
|
|
25
|
+
property === 'stroke' ||
|
|
26
|
+
property.endsWith('Color')
|
|
27
|
+
)
|
|
28
|
+
return 'color'
|
|
18
29
|
if (property.endsWith('Radius')) {
|
|
19
30
|
return property === 'shadowRadius' ? 'size' : 'radius'
|
|
20
31
|
}
|
|
@@ -23,7 +34,8 @@ export function getTokenCategoryForProperty(
|
|
|
23
34
|
property.endsWith('BlockSize') ||
|
|
24
35
|
property.endsWith('InlineSize') ||
|
|
25
36
|
property === 'blockSize' ||
|
|
26
|
-
property === 'inlineSize'
|
|
37
|
+
property === 'inlineSize' ||
|
|
38
|
+
property === 'flexBasis'
|
|
27
39
|
) {
|
|
28
40
|
return 'size'
|
|
29
41
|
}
|
package/src/helpers/variables.ts
CHANGED
|
@@ -278,7 +278,7 @@ export function getVariablesCSSRules(
|
|
|
278
278
|
props: InlineValues,
|
|
279
279
|
conf: TamaguiInternalConfig
|
|
280
280
|
): VariablesCSS | null {
|
|
281
|
-
if (process.env.
|
|
281
|
+
if (process.env.TAMAGUI_RUNTIME === 'island') return null
|
|
282
282
|
const cycleDropped = getCycleDroppedKeys(props)
|
|
283
283
|
const themes = props.themes as
|
|
284
284
|
| Record<string, InlineValues['values'] | undefined>
|
|
@@ -417,7 +417,7 @@ export const getInlineValuesKey = (inline: InlineValues): string => {
|
|
|
417
417
|
return key
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
// ---- flat theme-value props: <ThemeUpdate background-hover="
|
|
420
|
+
// ---- flat theme-value props: <ThemeUpdate background-hover="blue-4 dark:blue-2"> ----
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
423
|
* One authored theme-value clause the parser could not use. The runtime warns
|
package/src/helpers/warnOnce.ts
CHANGED
|
@@ -22,6 +22,12 @@ export function warnOnce(key: string, message = key) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export function resetWarned() {
|
|
26
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
+
warned?.clear()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
/**
|
|
26
32
|
* A value the flat-value scanner refused, reported where the author can act on
|
|
27
33
|
* it. Item 5b left refusal silent, matching the clause scanner, so an author
|
|
@@ -3,14 +3,21 @@ import { webOnlyStylePropsText, webOnlyStylePropsView } from '@tamagui/helpers'
|
|
|
3
3
|
// textOverflow is in webOnlyStylePropsText for web CSS, but on native we map
|
|
4
4
|
// textOverflow="ellipsis" to numberOfLines={1} + ellipsizeMode="tail" on Text.
|
|
5
5
|
// Handled specially in getSplitStyles.tsx so we exclude it from the skip list.
|
|
6
|
-
const { textOverflow:
|
|
6
|
+
const { textOverflow: _textOverflow, ...webOnlyStylePropsTextWithoutTextOverflow } =
|
|
7
7
|
webOnlyStylePropsText
|
|
8
8
|
|
|
9
|
+
// userSelect is in webOnlyStylePropsView for web CSS, but on native it is the
|
|
10
|
+
// authoring name for Text's selectable prop, mapped in getSplitStyles.tsx. the
|
|
11
|
+
// skip check runs before that mapping, so leaving it in the list dropped the prop
|
|
12
|
+
// on native with no error.
|
|
13
|
+
const { userSelect: _userSelect, ...webOnlyStylePropsViewWithoutUserSelect } =
|
|
14
|
+
webOnlyStylePropsView
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* Web-only props and event handlers that should be skipped on native
|
|
11
18
|
*/
|
|
12
19
|
export const webPropsToSkip = {
|
|
13
|
-
...
|
|
20
|
+
...webOnlyStylePropsViewWithoutUserSelect,
|
|
14
21
|
...webOnlyStylePropsTextWithoutTextOverflow,
|
|
15
22
|
|
|
16
23
|
// Web-only event handlers
|
|
@@ -44,7 +51,6 @@ export const webPropsToSkip = {
|
|
|
44
51
|
onChange: 1,
|
|
45
52
|
onInput: 1,
|
|
46
53
|
onBeforeInput: 1,
|
|
47
|
-
onScroll: 1,
|
|
48
54
|
onCopy: 1,
|
|
49
55
|
onCut: 1,
|
|
50
56
|
onPaste: 1,
|
|
@@ -67,7 +67,10 @@ function getCachedStyleTag(styleObject: StyleObject) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export function getStyleTags(styles: StyleObject[]) {
|
|
70
|
-
if (
|
|
70
|
+
if (
|
|
71
|
+
process.env.TAMAGUI_RUNTIME !== 'island' &&
|
|
72
|
+
process.env.TAMAGUI_TARGET !== 'native'
|
|
73
|
+
) {
|
|
71
74
|
if (styles.length) {
|
|
72
75
|
queueStyleTagCacheClear()
|
|
73
76
|
return <>{styles.map(getCachedStyleTag)}</>
|