@tamagui/web 3.0.0-beta.922.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
package/src/types.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
TransformAccumulator,
|
|
5
5
|
} from '@tamagui/style-grammar/runtime'
|
|
6
6
|
import type { Properties } from 'csstype'
|
|
7
|
+
import type { UnprefixedCSSProperties } from './dom/styleTypes'
|
|
7
8
|
import type {
|
|
8
9
|
CSSProperties,
|
|
9
10
|
ComponentType,
|
|
@@ -18,16 +19,23 @@ import type {
|
|
|
18
19
|
SetStateAction,
|
|
19
20
|
} from 'react'
|
|
20
21
|
import type {
|
|
22
|
+
FontVariant,
|
|
21
23
|
PressableProps,
|
|
22
|
-
|
|
24
|
+
TextInstance as RNText,
|
|
23
25
|
TextStyle as RNTextStyle,
|
|
24
26
|
TextProps as ReactTextProps,
|
|
25
|
-
View,
|
|
27
|
+
ViewInstance as View,
|
|
26
28
|
ViewProps,
|
|
27
29
|
ViewStyle,
|
|
28
|
-
} from 'react-native'
|
|
30
|
+
} from '@tamagui/react-native-types'
|
|
29
31
|
|
|
30
32
|
import type { NativeStyleEngineLinkHandle } from './helpers/nativeStyleEngine'
|
|
33
|
+
import type {
|
|
34
|
+
AnimatedTextChannel,
|
|
35
|
+
NativeTextContext,
|
|
36
|
+
NativeTextMetrics,
|
|
37
|
+
} from './helpers/nativeTextMetrics'
|
|
38
|
+
export type { AnimatedTextChannel, NativeTextMetrics } from './helpers/nativeTextMetrics'
|
|
31
39
|
import type { StyleFrontend } from './helpers/styleFrontend'
|
|
32
40
|
import type { CSSColorNames } from './interfaces/CSSColorNames'
|
|
33
41
|
import type { RNOnlyProps } from './interfaces/RNExclusiveTypes'
|
|
@@ -484,6 +492,12 @@ export type ThemeState = {
|
|
|
484
492
|
isNew?: boolean
|
|
485
493
|
parentId?: string
|
|
486
494
|
scheme?: 'light' | 'dark'
|
|
495
|
+
// true when a `<Theme name="light_blue">` at or above this state named its
|
|
496
|
+
// scheme outright, rather than inheriting the scheme from the root. Only such
|
|
497
|
+
// a state may emit the scheme-qualified `t_light_blue` class; everything else
|
|
498
|
+
// stays scheme-relative so server output renders correctly under either root
|
|
499
|
+
// scheme. Cumulative: once an ancestor pins, descendants stay pinned.
|
|
500
|
+
schemeAuthored?: boolean
|
|
487
501
|
}
|
|
488
502
|
|
|
489
503
|
export interface Variable<A = any> {
|
|
@@ -613,14 +627,12 @@ export type ComponentSetStateShallow = React.Dispatch<
|
|
|
613
627
|
|
|
614
628
|
export type ComponentSetState = Dispatch<SetStateAction<TamaguiComponentState>>
|
|
615
629
|
|
|
616
|
-
export type ComponentContextI = {
|
|
630
|
+
export type ComponentContextI = NativeTextContext & {
|
|
617
631
|
disableSSR?: boolean
|
|
618
632
|
inText: boolean
|
|
619
633
|
language: LanguageContextType | null
|
|
620
634
|
animationDriver: AnimationDriver | null
|
|
621
635
|
setParentFocusState: ComponentSetStateShallow | null
|
|
622
|
-
mediaEmit?: (state: UseMediaState) => void
|
|
623
|
-
mediaEmitListeners?: Set<(state: UseMediaState) => void>
|
|
624
636
|
insets?: { top: number; right: number; bottom: number; left: number } | null
|
|
625
637
|
}
|
|
626
638
|
|
|
@@ -630,6 +642,12 @@ export type TamaguiComponentStateRef = {
|
|
|
630
642
|
|
|
631
643
|
host?: TamaguiElement
|
|
632
644
|
composedRef?: (x: TamaguiElement) => void
|
|
645
|
+
// the forwarded ref composedRef writes to right now, read at attach time so the
|
|
646
|
+
// cached callback never pins the first render's ref
|
|
647
|
+
composedForwardedRef?: React.Ref<TamaguiElement>
|
|
648
|
+
// the forwarded ref composedRef last handed the host to, so a swap can be
|
|
649
|
+
// detected without a render-phase "previous" pointer (see createComponent)
|
|
650
|
+
attachedForwardedRef?: React.Ref<TamaguiElement>
|
|
633
651
|
willHydrate?: boolean
|
|
634
652
|
hasMeasured?: boolean
|
|
635
653
|
hasAnimated?: boolean
|
|
@@ -641,6 +659,9 @@ export type TamaguiComponentStateRef = {
|
|
|
641
659
|
hasEverResetPresence?: boolean
|
|
642
660
|
hasHadEvents?: boolean
|
|
643
661
|
hasRealPressEvents?: boolean
|
|
662
|
+
// previous render's press-plumbing presence, so a detach mid-press can drop
|
|
663
|
+
// the in-flight press instead of latching it (see createComponent)
|
|
664
|
+
hadAttachPress?: boolean
|
|
644
665
|
isListeningToTheme?: boolean
|
|
645
666
|
unPress?: Function
|
|
646
667
|
setStateShallow?: ComponentSetStateShallow
|
|
@@ -665,8 +686,11 @@ export type TamaguiComponentStateRef = {
|
|
|
665
686
|
// per-render animatedBy prop; hooks gated on it must keep a stable count)
|
|
666
687
|
avoidReRenders?: boolean
|
|
667
688
|
|
|
668
|
-
//
|
|
669
|
-
|
|
689
|
+
// avoidReRenders: this instance's useMedia emits media changes here instead
|
|
690
|
+
// of re-rendering
|
|
691
|
+
mediaEmit?: (state: UseMediaState) => void
|
|
692
|
+
// a restyle from mediaEmit is queued for this event turn
|
|
693
|
+
mediaEmitQueued?: boolean
|
|
670
694
|
|
|
671
695
|
// previous pseudo state for detecting enter vs exit transitions
|
|
672
696
|
prevPseudoState?: {
|
|
@@ -701,6 +725,10 @@ export type TamaguiComponentStateRef = {
|
|
|
701
725
|
// but absent from the next push are sent as null (reset-to-default),
|
|
702
726
|
// matching what a real re-render's style diff would do
|
|
703
727
|
nativePushedKeys?: Set<string>
|
|
728
|
+
|
|
729
|
+
// native style stability: the most recently resolved style object, reused
|
|
730
|
+
// when the next render's resolved values are identical (see getSplitStyles)
|
|
731
|
+
prevStyle?: Record<string, any> | null
|
|
704
732
|
}
|
|
705
733
|
|
|
706
734
|
export type ComponentGroupEmitter = {
|
|
@@ -717,6 +745,7 @@ export type WidthHeight = {
|
|
|
717
745
|
export type ChildGroupState = {
|
|
718
746
|
pseudo?: PseudoGroupState
|
|
719
747
|
media?: Record<MediaQueryKey extends number ? never : MediaQueryKey, boolean>
|
|
748
|
+
layout?: WidthHeight
|
|
720
749
|
}
|
|
721
750
|
|
|
722
751
|
export type ComponentGroupState = {
|
|
@@ -899,6 +928,7 @@ export type CreateTamaguiConfig<
|
|
|
899
928
|
E extends GenericAnimations = GenericAnimations,
|
|
900
929
|
F extends GenericFonts = GenericFonts,
|
|
901
930
|
H extends GenericTamaguiSettings = GenericTamaguiSettings,
|
|
931
|
+
S extends GenericSizing = GenericSizing,
|
|
902
932
|
// preserve the raw animation driver keys ('default' | 'css' | etc)
|
|
903
933
|
// defaults to string so generic TamaguiInternalConfig accepts any driver keys
|
|
904
934
|
AnimDriverKeys extends string = string,
|
|
@@ -923,6 +953,7 @@ export type CreateTamaguiConfig<
|
|
|
923
953
|
// phantom type for preserving driver keys - never set at runtime, only for type inference
|
|
924
954
|
animationDriverKeys?: AnimDriverKeys
|
|
925
955
|
settings: H
|
|
956
|
+
sizing: S
|
|
926
957
|
}
|
|
927
958
|
|
|
928
959
|
type GetLanguagePostfix<Set> = Set extends string
|
|
@@ -949,7 +980,7 @@ type GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>
|
|
|
949
980
|
// body_en: any
|
|
950
981
|
// }>['fonts']
|
|
951
982
|
|
|
952
|
-
type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
|
|
983
|
+
type ConfProps<A, B, C, D, E, F, I, S, V = undefined> = {
|
|
953
984
|
tokens?: A
|
|
954
985
|
themes?: B
|
|
955
986
|
shorthands?: C
|
|
@@ -957,6 +988,7 @@ type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
|
|
|
957
988
|
animations?: E
|
|
958
989
|
fonts?: F
|
|
959
990
|
settings?: I
|
|
991
|
+
sizing?: S
|
|
960
992
|
variables?: V
|
|
961
993
|
}
|
|
962
994
|
|
|
@@ -1022,6 +1054,7 @@ export type InferTamaguiConfig<Conf> =
|
|
|
1022
1054
|
infer E,
|
|
1023
1055
|
infer F,
|
|
1024
1056
|
infer H,
|
|
1057
|
+
infer S,
|
|
1025
1058
|
infer V
|
|
1026
1059
|
>
|
|
1027
1060
|
? TamaguiInternalConfig<
|
|
@@ -1032,6 +1065,7 @@ export type InferTamaguiConfig<Conf> =
|
|
|
1032
1065
|
ExtractAnimationConfig<E>,
|
|
1033
1066
|
F extends GenericFonts ? F : EmptyFonts,
|
|
1034
1067
|
H extends GenericTamaguiSettings ? H : EmptyTamaguiSettings,
|
|
1068
|
+
S extends GenericSizing ? S : GenericSizing,
|
|
1035
1069
|
ExtractAnimationDriverKeys<E>
|
|
1036
1070
|
>
|
|
1037
1071
|
: unknown
|
|
@@ -1204,8 +1238,9 @@ export interface GenericTamaguiSettings {
|
|
|
1204
1238
|
* controls style semantics where React Native/Yoga and CSS differ.
|
|
1205
1239
|
*
|
|
1206
1240
|
* - "legacy": preserves Tamagui v1 flex expansion.
|
|
1207
|
-
* - "react-native": follows React Native/Yoga flex
|
|
1208
|
-
* - "web": follows CSS flex
|
|
1241
|
+
* - "react-native": follows React Native/Yoga flex expansion.
|
|
1242
|
+
* - "web": follows CSS flex expansion.
|
|
1243
|
+
* numeric Tamagui lineHeight values are ratios in every mode.
|
|
1209
1244
|
*
|
|
1210
1245
|
* @default "web"
|
|
1211
1246
|
*/
|
|
@@ -1299,6 +1334,18 @@ export interface GenericTamaguiSettings {
|
|
|
1299
1334
|
*/
|
|
1300
1335
|
onlyAllowShorthands?: boolean | undefined
|
|
1301
1336
|
|
|
1337
|
+
/**
|
|
1338
|
+
* Restrict conditional style values to one syntax. Flat values accept both
|
|
1339
|
+
* the string form (`bg="red hover:blue"`) and the object form
|
|
1340
|
+
* (`bg={{ base: 'red', hover: 'blue' }}`); set this to keep one of them,
|
|
1341
|
+
* which narrows the types, makes the runtime warn on the other in
|
|
1342
|
+
* development, and tells `tamagui generate-prompt` and the skills to only
|
|
1343
|
+
* show that form.
|
|
1344
|
+
*
|
|
1345
|
+
* @default undefined - both forms are allowed
|
|
1346
|
+
*/
|
|
1347
|
+
styleValueSyntax?: 'string' | 'object' | undefined
|
|
1348
|
+
|
|
1302
1349
|
/**
|
|
1303
1350
|
* Define a default font, for better types and default font on Text
|
|
1304
1351
|
*/
|
|
@@ -1383,6 +1430,56 @@ export interface GenericTamaguiSettings {
|
|
|
1383
1430
|
onlyShorthandStyleProps?: boolean
|
|
1384
1431
|
}
|
|
1385
1432
|
|
|
1433
|
+
/** one rung of the control ladder: token keys, plus optional pinned geometry */
|
|
1434
|
+
export type SizeRecipe = {
|
|
1435
|
+
fontSize: string
|
|
1436
|
+
/**
|
|
1437
|
+
* the type-scale key the square controls (checkbox, radio, switch) size
|
|
1438
|
+
* from. Usually the rung's own name, but text deliberately steps down at
|
|
1439
|
+
* `md`/`lg` so buttons are not chunky while the squares stay on-scale.
|
|
1440
|
+
*/
|
|
1441
|
+
controlFontSize: string
|
|
1442
|
+
paddingInline: string
|
|
1443
|
+
paddingBlock: string
|
|
1444
|
+
gap: string
|
|
1445
|
+
radius: string
|
|
1446
|
+
/**
|
|
1447
|
+
* explicit rung geometry, skipping derivation. For scales whose keys
|
|
1448
|
+
* cannot derive the ladder (v5's numeric scales pin the frozen heights
|
|
1449
|
+
* here so v5 apps never resize).
|
|
1450
|
+
*/
|
|
1451
|
+
px?: {
|
|
1452
|
+
height: number
|
|
1453
|
+
icon: number
|
|
1454
|
+
square: number
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* the user-configurable control ladder. Rung names become the accepted
|
|
1460
|
+
* `size` values (see ComponentSize); the px derivations in resolveSizing are
|
|
1461
|
+
* fixed formulas over the rung's tokens.
|
|
1462
|
+
*/
|
|
1463
|
+
export type GenericSizing = {
|
|
1464
|
+
default: string
|
|
1465
|
+
sizes: Record<string, SizeRecipe>
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
/**
|
|
1469
|
+
* the config's control size names: the default ladder plus any custom rungs
|
|
1470
|
+
* from `sizing.sizes`. Stays the five literals (never `string`) when no
|
|
1471
|
+
* custom config is registered.
|
|
1472
|
+
*/
|
|
1473
|
+
export type ComponentSize =
|
|
1474
|
+
| 'xs'
|
|
1475
|
+
| 'sm'
|
|
1476
|
+
| 'md'
|
|
1477
|
+
| 'lg'
|
|
1478
|
+
| 'xl'
|
|
1479
|
+
| (string extends keyof TamaguiConfig['sizing']['sizes']
|
|
1480
|
+
? never
|
|
1481
|
+
: Extract<keyof TamaguiConfig['sizing']['sizes'], string>)
|
|
1482
|
+
|
|
1386
1483
|
export type TamaguiSettings = TamaguiConfig['settings']
|
|
1387
1484
|
|
|
1388
1485
|
export type BaseStyleProps = {
|
|
@@ -1436,12 +1533,11 @@ export type CreateTamaguiProps = {
|
|
|
1436
1533
|
settings?: Partial<GenericTamaguiSettings>
|
|
1437
1534
|
|
|
1438
1535
|
/**
|
|
1439
|
-
*
|
|
1536
|
+
* the control size ladder: rung names become the accepted `size` values.
|
|
1537
|
+
* Spread `defaultSizing` and override `sizes` to add or retune rungs; the
|
|
1538
|
+
* px derivations are fixed formulas over each rung's tokens.
|
|
1440
1539
|
*/
|
|
1441
|
-
|
|
1442
|
-
backgroundColor?: any
|
|
1443
|
-
color?: any
|
|
1444
|
-
}
|
|
1540
|
+
sizing?: GenericSizing
|
|
1445
1541
|
}
|
|
1446
1542
|
|
|
1447
1543
|
export type GetCSS = (opts?: {
|
|
@@ -1459,11 +1555,12 @@ export type TamaguiInternalConfig<
|
|
|
1459
1555
|
E extends GenericAnimations = GenericAnimations,
|
|
1460
1556
|
F extends GenericFonts = GenericFonts,
|
|
1461
1557
|
G extends GenericTamaguiSettings = GenericTamaguiSettings,
|
|
1558
|
+
S extends GenericSizing = GenericSizing,
|
|
1462
1559
|
// preserve the raw animation driver keys ('default' | 'css' | etc)
|
|
1463
1560
|
// defaults to string so generic TamaguiInternalConfig accepts any driver keys
|
|
1464
1561
|
AnimDriverKeys extends string = string,
|
|
1465
1562
|
> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &
|
|
1466
|
-
Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, AnimDriverKeys>, 'tokens'> & {
|
|
1563
|
+
Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, S, AnimDriverKeys>, 'tokens'> & {
|
|
1467
1564
|
// TODO need to make it this but this breaks types, revisit
|
|
1468
1565
|
// animations: E //AnimationDriver<E>
|
|
1469
1566
|
tokens: Tokenify<A>
|
|
@@ -1478,6 +1575,7 @@ export type TamaguiInternalConfig<
|
|
|
1478
1575
|
reactNative?: any
|
|
1479
1576
|
fontSizeTokens: Set<string>
|
|
1480
1577
|
settings: Omit<GenericTamaguiSettings, keyof G> & G
|
|
1578
|
+
sizing: Omit<GenericSizing, keyof S> & S
|
|
1481
1579
|
defaultFont?: string
|
|
1482
1580
|
defaultFontToken: `${string}`
|
|
1483
1581
|
// multi-driver animation config (e.g., { default: motionDriver, css: cssDriver })
|
|
@@ -1496,7 +1594,7 @@ type GenericFontKey = string | number | symbol
|
|
|
1496
1594
|
export type GenericFont<Key extends GenericFontKey = GenericFontKey> = {
|
|
1497
1595
|
size: { [key in Key]: number | Variable }
|
|
1498
1596
|
family?: string | Variable
|
|
1499
|
-
lineHeight?: Partial<{ [key in Key]: number | Variable }> | undefined
|
|
1597
|
+
lineHeight?: Partial<{ [key in Key]: number | Px | `${number}` | Variable }> | undefined
|
|
1500
1598
|
letterSpacing?: Partial<{ [key in Key]: number | Variable }> | undefined
|
|
1501
1599
|
weight?: Partial<{ [key in Key]: number | string | Variable }> | undefined
|
|
1502
1600
|
style?: Partial<{ [key in Key]: RNTextStyle['fontStyle'] | Variable }> | undefined
|
|
@@ -1553,75 +1651,90 @@ export type MatchMedia = (query: string) => MediaQueryList
|
|
|
1553
1651
|
|
|
1554
1652
|
// createComponent props helpers
|
|
1555
1653
|
|
|
1556
|
-
// transition="bouncy"
|
|
1557
|
-
// transition={['bouncy', { }]}
|
|
1558
|
-
// { all: 'name' }
|
|
1559
|
-
|
|
1560
1654
|
// TODO can override for better types
|
|
1561
1655
|
export type AnimationConfigType = any
|
|
1562
1656
|
|
|
1563
1657
|
/**
|
|
1564
|
-
*
|
|
1565
|
-
*
|
|
1658
|
+
* Low-level spring physics. A projection of `duration` + `bounce`, not a second
|
|
1659
|
+
* way to configure a spring: whichever you author, the other is derived, and
|
|
1660
|
+
* every driver ends up with the same motion.
|
|
1661
|
+
*
|
|
1662
|
+
* Reach for this only when you are porting a config you already tuned.
|
|
1566
1663
|
*/
|
|
1567
1664
|
export type TransitionSpringConfig = {
|
|
1568
1665
|
stiffness?: number
|
|
1569
1666
|
damping?: number
|
|
1570
1667
|
mass?: number
|
|
1571
|
-
tension?: number
|
|
1572
|
-
friction?: number
|
|
1573
1668
|
velocity?: number
|
|
1574
1669
|
overshootClamping?: boolean
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
speed?: number
|
|
1670
|
+
restDisplacementThreshold?: number
|
|
1671
|
+
restSpeedThreshold?: number
|
|
1578
1672
|
}
|
|
1579
1673
|
|
|
1580
1674
|
/**
|
|
1581
|
-
* A transition value: the name of a configured driver animation, or a
|
|
1582
|
-
* transition string such as `200ms
|
|
1583
|
-
*
|
|
1584
|
-
*
|
|
1585
|
-
*
|
|
1675
|
+
* A transition value: the name of a configured driver animation, or a CSS
|
|
1676
|
+
* transition string such as `200ms`, `200ms ease-out`, or
|
|
1677
|
+
* `opacity 150ms, transform 300ms`.
|
|
1678
|
+
*
|
|
1679
|
+
* Springs get a CSS-shaped function of their own: `spring(300ms, 0.4)` is a
|
|
1680
|
+
* 300ms spring with a bounce of 0.4. It works everywhere a timing function
|
|
1681
|
+
* does, including on the web, where it compiles to a `linear()` easing.
|
|
1682
|
+
*
|
|
1683
|
+
* A bare string that exactly matches a configured animation name is that
|
|
1684
|
+
* preset; everything else is CSS. `(string & {})` keeps preset names in
|
|
1685
|
+
* autocomplete instead of collapsing the union to plain `string`.
|
|
1586
1686
|
*/
|
|
1587
1687
|
export type TransitionValue = TransitionKeys | (string & {})
|
|
1588
1688
|
|
|
1689
|
+
/**
|
|
1690
|
+
* The settings half of a transition object. Anything else in the object is a
|
|
1691
|
+
* style property name carrying its own transition.
|
|
1692
|
+
*/
|
|
1693
|
+
export type TransitionConfig = {
|
|
1694
|
+
/** a configured animation to start from */
|
|
1695
|
+
preset?: TransitionKeys
|
|
1696
|
+
/** milliseconds, or a CSS time like `'200ms'` */
|
|
1697
|
+
duration?: number | string
|
|
1698
|
+
/**
|
|
1699
|
+
* Makes it a spring. `0` is critically damped (no overshoot), approaching
|
|
1700
|
+
* `1` is loose and oscillating, negative is sluggish. `duration` stays the
|
|
1701
|
+
* perceptual "how fast does this feel" number either way.
|
|
1702
|
+
*/
|
|
1703
|
+
bounce?: number
|
|
1704
|
+
/** any CSS timing function. Mutually exclusive with `bounce`. */
|
|
1705
|
+
easing?: string
|
|
1706
|
+
/** milliseconds, or a CSS time */
|
|
1707
|
+
delay?: number | string
|
|
1708
|
+
behavior?: 'normal' | 'allow-discrete'
|
|
1709
|
+
/** the CSS `transition-property` list these settings apply to */
|
|
1710
|
+
properties?: string
|
|
1711
|
+
spring?: TransitionSpringConfig
|
|
1712
|
+
/** the transition to use while mounting, if it differs */
|
|
1713
|
+
enter?: TransitionProp
|
|
1714
|
+
/** the transition to use while unmounting, if it differs */
|
|
1715
|
+
exit?: TransitionProp
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* `transition` accepts a string or an object, and nothing else.
|
|
1720
|
+
*
|
|
1721
|
+
* ```tsx
|
|
1722
|
+
* transition="bouncy" // a configured preset
|
|
1723
|
+
* transition="200ms ease-out" // css
|
|
1724
|
+
* transition="opacity 150ms, transform spring(300ms, 0.4)"
|
|
1725
|
+
* transition={{ duration: 200, bounce: 0.15 }}
|
|
1726
|
+
* transition={{ preset: 'bouncy', opacity: '150ms' }} // per-property override
|
|
1727
|
+
* ```
|
|
1728
|
+
*
|
|
1729
|
+
* Per-property keys are later CSS entries, so they win for that property and
|
|
1730
|
+
* inherit nothing from the base, exactly as
|
|
1731
|
+
* `transition: all 200ms, opacity 150ms` behaves in a stylesheet.
|
|
1732
|
+
*/
|
|
1589
1733
|
export type TransitionProp =
|
|
1590
1734
|
| TransitionValue
|
|
1591
|
-
| ({
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
exit?: TransitionValue
|
|
1595
|
-
delay?: number
|
|
1596
|
-
} & TransitionSpringConfig & {
|
|
1597
|
-
[key: string]:
|
|
1598
|
-
| TransitionValue
|
|
1599
|
-
| {
|
|
1600
|
-
type: TransitionValue
|
|
1601
|
-
[key: string]: any
|
|
1602
|
-
}
|
|
1603
|
-
| number
|
|
1604
|
-
| boolean
|
|
1605
|
-
| undefined
|
|
1606
|
-
})
|
|
1607
|
-
| [
|
|
1608
|
-
TransitionValue,
|
|
1609
|
-
{
|
|
1610
|
-
delay?: number
|
|
1611
|
-
enter?: TransitionValue
|
|
1612
|
-
exit?: TransitionValue
|
|
1613
|
-
} & TransitionSpringConfig & {
|
|
1614
|
-
[key: string]:
|
|
1615
|
-
| TransitionValue
|
|
1616
|
-
| {
|
|
1617
|
-
type?: TransitionValue
|
|
1618
|
-
[key: string]: any
|
|
1619
|
-
}
|
|
1620
|
-
| number
|
|
1621
|
-
| boolean
|
|
1622
|
-
| undefined
|
|
1623
|
-
},
|
|
1624
|
-
]
|
|
1735
|
+
| (TransitionConfig & {
|
|
1736
|
+
[property: string]: TransitionValue | TransitionConfig | unknown
|
|
1737
|
+
})
|
|
1625
1738
|
|
|
1626
1739
|
/**
|
|
1627
1740
|
* Emitted by the animation driver at the start and end of a transition.
|
|
@@ -1661,6 +1774,11 @@ export type SomewhatSpecificColorValue =
|
|
|
1661
1774
|
| (`#${string}` & {})
|
|
1662
1775
|
|
|
1663
1776
|
type WebOnlySizeValue =
|
|
1777
|
+
| `${number}px`
|
|
1778
|
+
| `${number}em`
|
|
1779
|
+
| `${number}ch`
|
|
1780
|
+
| `${number}vmin`
|
|
1781
|
+
| `${number}vmax`
|
|
1664
1782
|
| `${number}vw`
|
|
1665
1783
|
| `${number}dvw`
|
|
1666
1784
|
| `${number}lvw`
|
|
@@ -1672,6 +1790,7 @@ type WebOnlySizeValue =
|
|
|
1672
1790
|
| `calc(${string})`
|
|
1673
1791
|
| `min(${string})`
|
|
1674
1792
|
| `max(${string})`
|
|
1793
|
+
| `clamp(${string})`
|
|
1675
1794
|
| 'max-content'
|
|
1676
1795
|
| 'min-content'
|
|
1677
1796
|
|
|
@@ -1680,6 +1799,37 @@ type UserAllowedStyleValuesSetting = Exclude<
|
|
|
1680
1799
|
undefined
|
|
1681
1800
|
>
|
|
1682
1801
|
|
|
1802
|
+
/**
|
|
1803
|
+
* A flat value string that carries a clause (`red hover:blue`, `dark:red`)
|
|
1804
|
+
* or a multi-token payload (`1px solid red`). Its grammar is validated by the
|
|
1805
|
+
* language service and the runtime, not by the type system. With
|
|
1806
|
+
* `styleValueSyntax: 'object'` the `:` arm is dropped, so a clause-only
|
|
1807
|
+
* string like `hover:red` is a type error (a clause after a space still
|
|
1808
|
+
* passes through the multi-token arm).
|
|
1809
|
+
*/
|
|
1810
|
+
export type FlatClauseString =
|
|
1811
|
+
| `${string} ${string}`
|
|
1812
|
+
| (StyleValueSyntaxSetting extends 'object' ? never : `${string}:${string}`)
|
|
1813
|
+
|
|
1814
|
+
type StyleValueSyntaxSetting = TamaguiSettings extends { styleValueSyntax: infer S }
|
|
1815
|
+
? S
|
|
1816
|
+
: undefined
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* The open string arm every style value carries. With no `allowedStyleValues`
|
|
1820
|
+
* setting (or a boolean one) it is `string & {}`, so any string is accepted.
|
|
1821
|
+
* With a strictness setting, a single-token string (no space, no `:`) has to
|
|
1822
|
+
* be a token, theme value, or a value the setting allows, so a typo like
|
|
1823
|
+
* `bg="backgroun"` is a type error; only clause strings stay open.
|
|
1824
|
+
*/
|
|
1825
|
+
export type OpenStyleString = TamaguiSettings extends {
|
|
1826
|
+
allowedStyleValues: infer Setting
|
|
1827
|
+
}
|
|
1828
|
+
? Setting extends boolean
|
|
1829
|
+
? UnionableString
|
|
1830
|
+
: FlatClauseString
|
|
1831
|
+
: UnionableString
|
|
1832
|
+
|
|
1683
1833
|
export type GetThemeValueSettingForCategory<
|
|
1684
1834
|
Cat extends keyof AllowedStyleValuesSettingPerCategory,
|
|
1685
1835
|
> = UserAllowedStyleValuesSetting extends AllowedValueSettingBase | undefined
|
|
@@ -1774,7 +1924,7 @@ export type GetTokenString<A> = A extends string | number ? `${A}` : string
|
|
|
1774
1924
|
export type Size =
|
|
1775
1925
|
| ThemeValueFallbackSize
|
|
1776
1926
|
| GetTokenString<keyof Tokens['size']>
|
|
1777
|
-
|
|
|
1927
|
+
| OpenStyleString
|
|
1778
1928
|
| true
|
|
1779
1929
|
|
|
1780
1930
|
export type SizeTokens = Size
|
|
@@ -1799,7 +1949,7 @@ export type Color =
|
|
|
1799
1949
|
| TokenWithOpacity
|
|
1800
1950
|
// clause-bearing values are intentionally open-ended; the language service
|
|
1801
1951
|
// validates the grammar without materializing a combinatorial type union
|
|
1802
|
-
|
|
|
1952
|
+
| OpenStyleString
|
|
1803
1953
|
|
|
1804
1954
|
export type ColorTokens = Color
|
|
1805
1955
|
|
|
@@ -1862,6 +2012,8 @@ export type FontSizeTokens = FontSize
|
|
|
1862
2012
|
export type FontLineHeightTokens =
|
|
1863
2013
|
| GetTokenString<GetTokenFontKeysFor<'lineHeight'>>
|
|
1864
2014
|
| number
|
|
2015
|
+
| Px
|
|
2016
|
+
| `${number}`
|
|
1865
2017
|
| RemString
|
|
1866
2018
|
export type FontWeightValues =
|
|
1867
2019
|
| `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`
|
|
@@ -1938,6 +2090,14 @@ export type LineHeightKeys = 'lineHeight'
|
|
|
1938
2090
|
export type ZIndexKeys = 'zIndex'
|
|
1939
2091
|
export type OpacityKeys = 'opacity'
|
|
1940
2092
|
|
|
2093
|
+
type FontStyleValueFallback = GetThemeValueFallbackFor<
|
|
2094
|
+
AllowedValueSettingSize,
|
|
2095
|
+
never,
|
|
2096
|
+
never,
|
|
2097
|
+
never,
|
|
2098
|
+
WebStyleValueUniversal | `${number}%`
|
|
2099
|
+
>
|
|
2100
|
+
|
|
1941
2101
|
export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'
|
|
1942
2102
|
? ThemeTokens
|
|
1943
2103
|
: K extends SizeKeys
|
|
@@ -1945,7 +2105,7 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
|
|
|
1945
2105
|
: K extends FontKeys
|
|
1946
2106
|
? FontTokens
|
|
1947
2107
|
: K extends FontSizeKeys
|
|
1948
|
-
? FontSizeTokens
|
|
2108
|
+
? FontSizeTokens | FontStyleValueFallback
|
|
1949
2109
|
: K extends `${`border${string | ''}Radius`}`
|
|
1950
2110
|
? RadiusTokens
|
|
1951
2111
|
: K extends SpaceKeys
|
|
@@ -1957,7 +2117,7 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
|
|
|
1957
2117
|
: K extends ZIndexKeys
|
|
1958
2118
|
? ZIndexTokens
|
|
1959
2119
|
: K extends LineHeightKeys
|
|
1960
|
-
? FontLineHeightTokens
|
|
2120
|
+
? FontLineHeightTokens | FontStyleValueFallback
|
|
1961
2121
|
: K extends FontWeightKeys
|
|
1962
2122
|
? FontWeightTokens
|
|
1963
2123
|
: K extends FontLetterSpacingKeys
|
|
@@ -2047,22 +2207,25 @@ type FlatClauseName =
|
|
|
2047
2207
|
* string members ('unset', a fallback union) stop being assignable across
|
|
2048
2208
|
* package boundaries.
|
|
2049
2209
|
*/
|
|
2050
|
-
export type FlatStyleObject<T> = { default?: T |
|
|
2051
|
-
[K in FlatClauseName]?: T |
|
|
2210
|
+
export type FlatStyleObject<T> = { default?: T | OpenStyleString } & {
|
|
2211
|
+
[K in FlatClauseName]?: T | OpenStyleString
|
|
2052
2212
|
}
|
|
2053
2213
|
|
|
2054
2214
|
/**
|
|
2055
|
-
* The string arm stays at base values only: `
|
|
2215
|
+
* The string arm stays at base values only: `OpenStyleString` admits every
|
|
2056
2216
|
* clause string, and structured clause completion comes from the object
|
|
2057
2217
|
* form's keys (and the language-service plugin for strings). A per-prop
|
|
2058
2218
|
* `${modifier}:` prefix union used to ride along for first-prefix
|
|
2059
2219
|
* completion; it multiplied across the whole component prop graph and the
|
|
2060
2220
|
* object form made it redundant.
|
|
2061
2221
|
*/
|
|
2062
|
-
export type FlatStyleValue<T> =
|
|
2222
|
+
export type FlatStyleValue<T> =
|
|
2223
|
+
| T
|
|
2224
|
+
| (StyleValueSyntaxSetting extends 'string' ? never : FlatStyleObject<T>)
|
|
2225
|
+
| OpenStyleString
|
|
2063
2226
|
|
|
2064
2227
|
export type WithThemeValues<T extends object> = {
|
|
2065
|
-
[K in keyof T]:
|
|
2228
|
+
-readonly [K in keyof T]:
|
|
2066
2229
|
| (ThemeValueGet<K> extends never
|
|
2067
2230
|
? K extends keyof ExtraBaseProps
|
|
2068
2231
|
? T[K]
|
|
@@ -2129,10 +2292,10 @@ export type WithThemeAndShorthands<
|
|
|
2129
2292
|
A extends object,
|
|
2130
2293
|
Variants = {},
|
|
2131
2294
|
> = OnlyAllowShorthands extends true
|
|
2132
|
-
? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands>>> &
|
|
2295
|
+
? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands | keyof Variants>>> &
|
|
2133
2296
|
WithFlatVariantValues<Variants> &
|
|
2134
2297
|
WithShorthands<WithThemeValues<A>>
|
|
2135
|
-
: WithThemeValues<MaybeOmitLonghands<A
|
|
2298
|
+
: WithThemeValues<MaybeOmitLonghands<Omit<A, keyof Variants>>> &
|
|
2136
2299
|
WithFlatVariantValues<Variants> &
|
|
2137
2300
|
WithShorthands<WithThemeValues<A>>
|
|
2138
2301
|
|
|
@@ -2150,13 +2313,13 @@ type TwoValueTransformOrigin = `${PxOrPct | 'left' | 'center' | 'right'} ${
|
|
|
2150
2313
|
|
|
2151
2314
|
export interface TransformStyleProps {
|
|
2152
2315
|
/**
|
|
2153
|
-
* Maps to translateX
|
|
2316
|
+
* Maps to translateX. A percent string is relative to the element's own width.
|
|
2154
2317
|
*/
|
|
2155
|
-
x?: number
|
|
2318
|
+
x?: number | `${number}%`
|
|
2156
2319
|
/**
|
|
2157
|
-
* Maps to translateY
|
|
2320
|
+
* Maps to translateY. A percent string is relative to the element's own height.
|
|
2158
2321
|
*/
|
|
2159
|
-
y?: number
|
|
2322
|
+
y?: number | `${number}%`
|
|
2160
2323
|
perspective?: number
|
|
2161
2324
|
scale?: number
|
|
2162
2325
|
scaleX?: number
|
|
@@ -2284,15 +2447,27 @@ interface ExtraStyleProps {
|
|
|
2284
2447
|
* backgroundColor and drops url()/gradient/multi-part values it can't express.
|
|
2285
2448
|
*
|
|
2286
2449
|
* The v6 shorthands map `bg` here rather than to `backgroundColor`, because
|
|
2287
|
-
* the background family splits a value like `url(x.png)
|
|
2450
|
+
* the background family splits a value like `url(x.png) color-1` across
|
|
2288
2451
|
* backgroundImage and backgroundColor. Color tokens lead the union so `bg`
|
|
2289
|
-
* completes them;
|
|
2290
|
-
*
|
|
2291
|
-
*
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2452
|
+
* completes them; the CSS keywords and the function forms (`url()`,
|
|
2453
|
+
* gradients) keep the CSS shorthand, and multi-part values reach
|
|
2454
|
+
* `OpenStyleString` through their spaces. Adding this key to `ColorKeys`
|
|
2455
|
+
* instead would erase the CSS arm, since that path runs the value type
|
|
2456
|
+
* through `Exclude<T[K], string>`.
|
|
2457
|
+
*/
|
|
2458
|
+
background?:
|
|
2459
|
+
| ColorTokens
|
|
2460
|
+
| Exclude<ThemeValueFallbackColor, number>
|
|
2461
|
+
| 'none'
|
|
2462
|
+
| 'inherit'
|
|
2463
|
+
| 'initial'
|
|
2464
|
+
| 'unset'
|
|
2465
|
+
| 'revert'
|
|
2466
|
+
| `${string}(${string})`
|
|
2467
|
+
| OpenStyleString
|
|
2468
|
+
/**
|
|
2469
|
+
* css background image. native maps supported linear gradients to
|
|
2470
|
+
* experimental_backgroundImage and drops values it cannot represent.
|
|
2296
2471
|
*/
|
|
2297
2472
|
backgroundImage?: Properties['backgroundImage']
|
|
2298
2473
|
/**
|
|
@@ -2347,6 +2522,8 @@ interface ExtraStyleProps {
|
|
|
2347
2522
|
* Web-only style property. Will be omitted on native.
|
|
2348
2523
|
*/
|
|
2349
2524
|
resize?: Properties['resize']
|
|
2525
|
+
/** react-native stops at visible/hidden/scroll; web also accepts auto and clip */
|
|
2526
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto' | 'clip'
|
|
2350
2527
|
/**
|
|
2351
2528
|
* Web-only style property. Will be omitted on native.
|
|
2352
2529
|
*/
|
|
@@ -2601,6 +2778,7 @@ interface ExtraStyleProps {
|
|
|
2601
2778
|
borderInlineWidth?: SpaceTokens | number
|
|
2602
2779
|
borderInlineStartWidth?: SpaceTokens | number
|
|
2603
2780
|
borderInlineEndWidth?: SpaceTokens | number
|
|
2781
|
+
borderStyle?: ViewStyle['borderStyle'] | 'none' | 'hidden'
|
|
2604
2782
|
borderBlockStyle?: ViewStyle['borderStyle']
|
|
2605
2783
|
borderBlockStartStyle?: ViewStyle['borderStyle']
|
|
2606
2784
|
borderBlockEndStyle?: ViewStyle['borderStyle']
|
|
@@ -2640,12 +2818,6 @@ interface ExtraBaseProps {
|
|
|
2640
2818
|
*/
|
|
2641
2819
|
transition?: TransitionProp | null
|
|
2642
2820
|
|
|
2643
|
-
/**
|
|
2644
|
-
* Pass an array of strings containing the long style property names
|
|
2645
|
-
* which will be exclusively transitioned.
|
|
2646
|
-
*/
|
|
2647
|
-
animateOnly?: string[]
|
|
2648
|
-
|
|
2649
2821
|
/**
|
|
2650
2822
|
* If you'd like this component to not attach to the nearest parent AnimatePresence,
|
|
2651
2823
|
* set this to `false` and it will pass through to the next animated child.
|
|
@@ -2672,16 +2844,54 @@ interface ExtendedBaseProps
|
|
|
2672
2844
|
ExtendBaseStackProps,
|
|
2673
2845
|
ExtraStyleProps,
|
|
2674
2846
|
ExtraBaseProps {
|
|
2675
|
-
display?:
|
|
2847
|
+
display?:
|
|
2848
|
+
| 'inherit'
|
|
2849
|
+
| 'none'
|
|
2850
|
+
| 'inline'
|
|
2851
|
+
| 'block'
|
|
2852
|
+
| 'inline-block'
|
|
2853
|
+
| 'contents'
|
|
2854
|
+
| 'flex'
|
|
2855
|
+
| 'inline-flex'
|
|
2856
|
+
| 'grid'
|
|
2857
|
+
| 'inline-grid'
|
|
2676
2858
|
// extends RN's position to include 'fixed' (converted to 'absolute' on native)
|
|
2677
2859
|
position?: 'absolute' | 'relative' | 'fixed' | 'static' | 'sticky'
|
|
2678
2860
|
}
|
|
2679
2861
|
|
|
2680
2862
|
export interface StackStyleBase
|
|
2681
|
-
extends
|
|
2863
|
+
extends
|
|
2864
|
+
Omit<ViewStyle, keyof ExtendedBaseProps | 'elevation'>,
|
|
2865
|
+
ExtendedBaseProps,
|
|
2866
|
+
Omit<
|
|
2867
|
+
UnprefixedCSSProperties,
|
|
2868
|
+
keyof ViewStyle | keyof ExtendedBaseProps | keyof TamaguiComponentPropsBaseBase
|
|
2869
|
+
> {}
|
|
2682
2870
|
|
|
2683
2871
|
export interface TextStylePropsBase
|
|
2684
|
-
extends
|
|
2872
|
+
extends
|
|
2873
|
+
Omit<
|
|
2874
|
+
RNTextStyle,
|
|
2875
|
+
keyof ExtendedBaseProps | 'fontVariant' | 'lineHeight' | 'includeFontPadding'
|
|
2876
|
+
>,
|
|
2877
|
+
ExtendedBaseProps,
|
|
2878
|
+
Omit<
|
|
2879
|
+
UnprefixedCSSProperties,
|
|
2880
|
+
| keyof RNTextStyle
|
|
2881
|
+
| keyof ExtendedBaseProps
|
|
2882
|
+
| keyof TamaguiComponentPropsBaseBase
|
|
2883
|
+
| 'textShadow'
|
|
2884
|
+
| 'textDecoration'
|
|
2885
|
+
| 'font'
|
|
2886
|
+
> {
|
|
2887
|
+
lineHeight?: number | Px | `${number}`
|
|
2888
|
+
/**
|
|
2889
|
+
* react-native types this as a mutable `FontVariant[]`, which an `as const` variant
|
|
2890
|
+
* definition can't satisfy — and a variants object that misses its constraint is
|
|
2891
|
+
* silently discarded whole, taking every variant on the component with it (#2787).
|
|
2892
|
+
* react-native types `transform` as readonly for the same reason.
|
|
2893
|
+
*/
|
|
2894
|
+
fontVariant?: readonly FontVariant[]
|
|
2685
2895
|
ellipsis?: boolean
|
|
2686
2896
|
numberOfLines?: number
|
|
2687
2897
|
textDecorationDistance?: number
|
|
@@ -2699,8 +2909,7 @@ export interface TextStylePropsBase
|
|
|
2699
2909
|
*/
|
|
2700
2910
|
textDecoration?: string
|
|
2701
2911
|
/**
|
|
2702
|
-
*
|
|
2703
|
-
* Splits by the CSS micro-syntax; ambiguous forms stay unparsed.
|
|
2912
|
+
* css font shorthand string, browser-only and dropped on native.
|
|
2704
2913
|
*/
|
|
2705
2914
|
font?: string
|
|
2706
2915
|
}
|
|
@@ -2731,7 +2940,7 @@ export interface StackNonStyleProps
|
|
|
2731
2940
|
| 'pointerEvents'
|
|
2732
2941
|
| 'display'
|
|
2733
2942
|
| 'children'
|
|
2734
|
-
| keyof
|
|
2943
|
+
| keyof TamaguiComponentPropsBase
|
|
2735
2944
|
// these are added back in by core
|
|
2736
2945
|
| RNOnlyProps
|
|
2737
2946
|
| keyof ExtendBaseStackProps
|
|
@@ -2761,7 +2970,7 @@ export interface TextNonStyleProps
|
|
|
2761
2970
|
Omit<
|
|
2762
2971
|
ReactTextProps,
|
|
2763
2972
|
| 'children'
|
|
2764
|
-
| keyof
|
|
2973
|
+
| keyof TamaguiComponentPropsBase
|
|
2765
2974
|
// these are added back in by core
|
|
2766
2975
|
| RNOnlyProps
|
|
2767
2976
|
| keyof ExtendBaseTextProps
|
|
@@ -2802,11 +3011,18 @@ export type StyledHOCMergedProps<Props, CustomProps> = keyof CustomProps extends
|
|
|
2802
3011
|
? Props
|
|
2803
3012
|
: Omit<Props, keyof CustomProps> & CustomProps
|
|
2804
3013
|
|
|
3014
|
+
// declared receiver props keep their type when a new css name joins the style
|
|
3015
|
+
// surface. variants remain the explicit owner over either source.
|
|
2805
3016
|
export type GetFinalProps<NonStyleProps, StylePropsBase, Variants> = Omit<
|
|
2806
3017
|
NonStyleProps,
|
|
2807
|
-
keyof
|
|
3018
|
+
keyof Variants
|
|
2808
3019
|
> &
|
|
2809
|
-
(StylePropsBase extends object
|
|
3020
|
+
(StylePropsBase extends object
|
|
3021
|
+
? Omit<
|
|
3022
|
+
WithThemeAndShorthands<StylePropsBase, Variants>,
|
|
3023
|
+
Exclude<keyof NonStyleProps, keyof Variants>
|
|
3024
|
+
>
|
|
3025
|
+
: {})
|
|
2810
3026
|
|
|
2811
3027
|
export type TamaguiComponent<
|
|
2812
3028
|
Props = any,
|
|
@@ -2967,6 +3183,7 @@ export type GetStyleState = {
|
|
|
2967
3183
|
conf: TamaguiInternalConfig
|
|
2968
3184
|
avoidMergeTransform?: boolean
|
|
2969
3185
|
fontFamily?: string
|
|
3186
|
+
nativeLineHeight?: unknown
|
|
2970
3187
|
debug?: DebugProp
|
|
2971
3188
|
transformAccumulator?: TransformAccumulator
|
|
2972
3189
|
// direct flat-value scan context and its subscription output
|
|
@@ -3091,6 +3308,8 @@ export type StaticConfigPublic = {
|
|
|
3091
3308
|
}
|
|
3092
3309
|
|
|
3093
3310
|
type StaticConfigBase = StaticConfigPublic & {
|
|
3311
|
+
// native DOM primitives own text inheritance and receive semantic metrics separately.
|
|
3312
|
+
isDOM?: boolean
|
|
3094
3313
|
Component?: FunctionComponent<any> & StaticComponentObject<any, any, any, any, any, any>
|
|
3095
3314
|
|
|
3096
3315
|
displayName?: string
|
|
@@ -3195,6 +3414,7 @@ export type StyledDynamicEnv = {
|
|
|
3195
3414
|
fonts: TamaguiConfig['fonts']
|
|
3196
3415
|
tokens: TokensParsed
|
|
3197
3416
|
theme: Themes extends { [key: string]: infer B } ? B : unknown
|
|
3417
|
+
sizing: GenericSizing
|
|
3198
3418
|
fontFamily?: FontFamilyTokens
|
|
3199
3419
|
font?: Font
|
|
3200
3420
|
}
|
|
@@ -3233,39 +3453,74 @@ export type VariantDefinitions<
|
|
|
3233
3453
|
}
|
|
3234
3454
|
? S
|
|
3235
3455
|
: {},
|
|
3236
|
-
MyProps extends object =
|
|
3237
|
-
GetVariantProps<
|
|
3238
|
-
Parent,
|
|
3239
|
-
StaticConfig['isText'] extends true
|
|
3240
|
-
? true
|
|
3241
|
-
: StaticConfig['isInput'] extends true
|
|
3242
|
-
? true
|
|
3243
|
-
: false
|
|
3244
|
-
>
|
|
3245
|
-
>,
|
|
3456
|
+
MyProps extends object = VariantStyleProps<Parent, StaticConfig>,
|
|
3246
3457
|
Val = any,
|
|
3247
3458
|
> = VariantDefinitionFromProps<MyProps, Val> & {
|
|
3248
3459
|
_isEmpty?: 1
|
|
3249
3460
|
}
|
|
3250
3461
|
|
|
3462
|
+
// the color style props only an input takes (runtime stylePropsInput)
|
|
3463
|
+
export type InputColorStyleProps = {
|
|
3464
|
+
placeholderTextColor?: ColorStyleProp
|
|
3465
|
+
selectionColor?: ColorStyleProp
|
|
3466
|
+
cursorColor?: ColorStyleProp
|
|
3467
|
+
selectionHandleColor?: ColorStyleProp
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
export type VariantStyleProps<
|
|
3471
|
+
Parent extends StylableComponent,
|
|
3472
|
+
StaticConfig extends StaticConfigPublic,
|
|
3473
|
+
> = Partial<
|
|
3474
|
+
GetVariantProps<
|
|
3475
|
+
Parent,
|
|
3476
|
+
StaticConfig['isText'] extends true
|
|
3477
|
+
? true
|
|
3478
|
+
: StaticConfig['isInput'] extends true
|
|
3479
|
+
? true
|
|
3480
|
+
: false
|
|
3481
|
+
>
|
|
3482
|
+
> &
|
|
3483
|
+
(GetStaticConfig<Parent, StaticConfig>['isInput'] extends true
|
|
3484
|
+
? InputColorStyleProps
|
|
3485
|
+
: {})
|
|
3486
|
+
|
|
3487
|
+
/**
|
|
3488
|
+
* the exact-key check styled() runs on the variants it infers: a key that is
|
|
3489
|
+
* not a style, shorthand, aria/data attribute, or variant of the component is
|
|
3490
|
+
* `never`, since inference alone never flags extra keys.
|
|
3491
|
+
*/
|
|
3492
|
+
export type StyleOnlyVariants<Variants, AllowedKeys extends PropertyKey> = {
|
|
3493
|
+
[Name in keyof Variants]: Variants[Name] extends StyledDynamic<any, any>
|
|
3494
|
+
? Variants[Name]
|
|
3495
|
+
: {
|
|
3496
|
+
[Value in keyof Variants[Name]]: Variants[Name][Value] extends object
|
|
3497
|
+
? {
|
|
3498
|
+
[Key in keyof Variants[Name][Value]]: Key extends
|
|
3499
|
+
| AllowedKeys
|
|
3500
|
+
| keyof Variants
|
|
3501
|
+
| `aria-${string}`
|
|
3502
|
+
| `data-${string}`
|
|
3503
|
+
? Variants[Name][Value][Key]
|
|
3504
|
+
: never
|
|
3505
|
+
}
|
|
3506
|
+
: Variants[Name][Value]
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3251
3510
|
export type StaticStyleInput = string
|
|
3252
3511
|
|
|
3512
|
+
// variants are styles only: a variant value holds style props and the parent's
|
|
3513
|
+
// variants, never a non-style prop such as theme. a component that changes
|
|
3514
|
+
// theme with a variant does it one level up, as a theme prop.
|
|
3253
3515
|
export type GetVariantProps<
|
|
3254
3516
|
A extends StylableComponent,
|
|
3255
3517
|
IsText extends boolean | undefined,
|
|
3256
3518
|
> = A extends {
|
|
3257
|
-
__tama: [
|
|
3258
|
-
infer Props,
|
|
3259
|
-
any,
|
|
3260
|
-
infer NonStyledProps,
|
|
3261
|
-
infer BaseStyles,
|
|
3262
|
-
infer VariantProps,
|
|
3263
|
-
any,
|
|
3264
|
-
]
|
|
3519
|
+
__tama: [any, any, any, infer BaseStyles, infer VariantProps, any]
|
|
3265
3520
|
}
|
|
3266
|
-
?
|
|
3267
|
-
?
|
|
3268
|
-
:
|
|
3521
|
+
? BaseStyles extends object
|
|
3522
|
+
? WithThemeAndShorthands<BaseStyles, VariantProps>
|
|
3523
|
+
: {}
|
|
3269
3524
|
: WithThemeAndShorthands<IsText extends true ? TextStylePropsBase : StackStyleBase>
|
|
3270
3525
|
|
|
3271
3526
|
export type VariantDefinitionFromProps<MyProps, Val> = MyProps extends object
|
|
@@ -3319,6 +3574,10 @@ export type SplitStyleProps = {
|
|
|
3319
3574
|
canPlatformPseudo?: boolean
|
|
3320
3575
|
isAnimated: boolean
|
|
3321
3576
|
isExiting?: boolean
|
|
3577
|
+
// native style stability: previous render's resolved style object, used to
|
|
3578
|
+
// return the same reference when the resolved values haven't changed (avoids
|
|
3579
|
+
// React Native's diffNestedProperty + cloneNodeWithNewProps on every re-render)
|
|
3580
|
+
prevStyle?: Record<string, any> | null
|
|
3322
3581
|
}
|
|
3323
3582
|
|
|
3324
3583
|
// Presence
|
|
@@ -3405,6 +3664,19 @@ type AnimationDriverBase<A extends AnimationConfig = AnimationConfig> = {
|
|
|
3405
3664
|
animations: A
|
|
3406
3665
|
View?: any
|
|
3407
3666
|
Text?: any
|
|
3667
|
+
useTextMetrics?: (input: {
|
|
3668
|
+
inheritedText?: AnimatedTextChannel | null
|
|
3669
|
+
lineHeight?: NativeTextMetrics['lineHeight']
|
|
3670
|
+
}) => {
|
|
3671
|
+
textChannel: AnimatedTextChannel | null
|
|
3672
|
+
} & (
|
|
3673
|
+
| { style: null }
|
|
3674
|
+
| {
|
|
3675
|
+
style: Record<string, unknown>
|
|
3676
|
+
Text: ComponentType<any>
|
|
3677
|
+
TextInput: ComponentType<any>
|
|
3678
|
+
}
|
|
3679
|
+
)
|
|
3408
3680
|
}
|
|
3409
3681
|
|
|
3410
3682
|
export type AnimationDriver<A extends AnimationConfig = AnimationConfig> =
|
|
@@ -3445,11 +3717,13 @@ type UseStyleListener = (
|
|
|
3445
3717
|
// true while a self pseudo (hover/press/focus) is active. lets avoidReRenders drivers know
|
|
3446
3718
|
// the emitted style is a transient pseudo override that a real re-render must not be allowed
|
|
3447
3719
|
// to reconcile away, vs the no-pseudo base which renders own again.
|
|
3448
|
-
pseudoActive?: boolean
|
|
3720
|
+
pseudoActive?: boolean,
|
|
3721
|
+
nativeTextMetrics?: NativeTextMetrics
|
|
3449
3722
|
) => void
|
|
3450
3723
|
export type UseStyleEmitter = (cb: UseStyleListener) => void
|
|
3451
3724
|
|
|
3452
3725
|
export type UseAnimationHook = (props: {
|
|
3726
|
+
inheritedText?: AnimatedTextChannel | null
|
|
3453
3727
|
style: Record<string, any>
|
|
3454
3728
|
props: Record<string, any>
|
|
3455
3729
|
styleState?: GetStyleResult | null
|
|
@@ -3464,24 +3738,29 @@ export type UseAnimationHook = (props: {
|
|
|
3464
3738
|
onTransition?: OnTransition
|
|
3465
3739
|
delay?: number
|
|
3466
3740
|
}) => null | {
|
|
3741
|
+
textChannel?: AnimatedTextChannel | null
|
|
3467
3742
|
style?: unknown
|
|
3468
3743
|
className?: string
|
|
3469
3744
|
ref?: any
|
|
3470
3745
|
}
|
|
3471
3746
|
|
|
3472
3747
|
export type GestureReponderEvent =
|
|
3473
|
-
Exclude<
|
|
3748
|
+
Exclude<ViewProps['onResponderMove'], void> extends (event: infer Event) => void
|
|
3474
3749
|
? Event
|
|
3475
3750
|
: never
|
|
3476
3751
|
|
|
3477
3752
|
export type RulesToInsert = Record<string, StyleObject>
|
|
3478
3753
|
|
|
3479
3754
|
export type GetStyleResult = {
|
|
3480
|
-
style: ViewStyle | null
|
|
3755
|
+
style: { -readonly [K in keyof ViewStyle]: ViewStyle[K] } | null
|
|
3481
3756
|
classNames: ClassNamesObject
|
|
3482
3757
|
rulesToInsert: RulesToInsert
|
|
3483
|
-
viewProps:
|
|
3758
|
+
viewProps: {
|
|
3759
|
+
-readonly [K in keyof (StackNonStyleProps & StackStyle)]: (StackNonStyleProps &
|
|
3760
|
+
StackStyle)[K]
|
|
3761
|
+
} & Record<string, any>
|
|
3484
3762
|
fontFamily: string | undefined
|
|
3763
|
+
nativeTextMetrics?: NativeTextMetrics
|
|
3485
3764
|
space?: any // SpaceTokens?
|
|
3486
3765
|
hasMedia: boolean | Set<string>
|
|
3487
3766
|
pseudoGroups?: Set<string>
|
|
@@ -3560,8 +3839,9 @@ export type StyleProp<T> =
|
|
|
3560
3839
|
| T
|
|
3561
3840
|
| StylePiece
|
|
3562
3841
|
| RegisteredStyle<T>
|
|
3563
|
-
|
|
|
3842
|
+
| ReadonlyArray<StyleProp<T>>
|
|
3564
3843
|
| Falsy
|
|
3844
|
+
| void
|
|
3565
3845
|
|
|
3566
3846
|
export type FillInFont<A extends GenericFont, DefaultKeys extends string | number> = {
|
|
3567
3847
|
family: string
|