@tamagui/web 3.0.0-beta.924.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_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/types/types.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { StyleObject } from '@tamagui/helpers';
|
|
2
2
|
import type { CoreStateModifierName, TransformAccumulator } from '@tamagui/style-grammar/runtime';
|
|
3
3
|
import type { Properties } from 'csstype';
|
|
4
|
+
import type { UnprefixedCSSProperties } from './dom/styleTypes';
|
|
4
5
|
import type { CSSProperties, ComponentType, Context, Dispatch, FunctionComponent, HTMLAttributes, ProviderExoticComponent, Ref as ReactRef, ReactNode, RefObject, SetStateAction } from 'react';
|
|
5
|
-
import type { PressableProps,
|
|
6
|
+
import type { FontVariant, PressableProps, TextInstance as RNText, TextStyle as RNTextStyle, TextProps as ReactTextProps, ViewInstance as View, ViewProps, ViewStyle } from '@tamagui/react-native-types';
|
|
6
7
|
import type { NativeStyleEngineLinkHandle } from './helpers/nativeStyleEngine';
|
|
8
|
+
import type { AnimatedTextChannel, NativeTextContext, NativeTextMetrics } from './helpers/nativeTextMetrics';
|
|
9
|
+
export type { AnimatedTextChannel, NativeTextMetrics } from './helpers/nativeTextMetrics';
|
|
7
10
|
import type { StyleFrontend } from './helpers/styleFrontend';
|
|
8
11
|
import type { CSSColorNames } from './interfaces/CSSColorNames';
|
|
9
12
|
import type { RNOnlyProps } from './interfaces/RNExclusiveTypes';
|
|
@@ -221,6 +224,7 @@ export type ThemeState = {
|
|
|
221
224
|
isNew?: boolean;
|
|
222
225
|
parentId?: string;
|
|
223
226
|
scheme?: 'light' | 'dark';
|
|
227
|
+
schemeAuthored?: boolean;
|
|
224
228
|
};
|
|
225
229
|
export interface Variable<A = any> {
|
|
226
230
|
isVar: true;
|
|
@@ -298,14 +302,12 @@ export type ReactComponentWithRef<Props, Ref> = ComponentType<Props & {
|
|
|
298
302
|
}>;
|
|
299
303
|
export type ComponentSetStateShallow = React.Dispatch<React.SetStateAction<Partial<TamaguiComponentState>>>;
|
|
300
304
|
export type ComponentSetState = Dispatch<SetStateAction<TamaguiComponentState>>;
|
|
301
|
-
export type ComponentContextI = {
|
|
305
|
+
export type ComponentContextI = NativeTextContext & {
|
|
302
306
|
disableSSR?: boolean;
|
|
303
307
|
inText: boolean;
|
|
304
308
|
language: LanguageContextType | null;
|
|
305
309
|
animationDriver: AnimationDriver | null;
|
|
306
310
|
setParentFocusState: ComponentSetStateShallow | null;
|
|
307
|
-
mediaEmit?: (state: UseMediaState) => void;
|
|
308
|
-
mediaEmitListeners?: Set<(state: UseMediaState) => void>;
|
|
309
311
|
insets?: {
|
|
310
312
|
top: number;
|
|
311
313
|
right: number;
|
|
@@ -318,6 +320,8 @@ export type TamaguiComponentStateRef = {
|
|
|
318
320
|
optimizeForFirstRender?: boolean;
|
|
319
321
|
host?: TamaguiElement;
|
|
320
322
|
composedRef?: (x: TamaguiElement) => void;
|
|
323
|
+
composedForwardedRef?: React.Ref<TamaguiElement>;
|
|
324
|
+
attachedForwardedRef?: React.Ref<TamaguiElement>;
|
|
321
325
|
willHydrate?: boolean;
|
|
322
326
|
hasMeasured?: boolean;
|
|
323
327
|
hasAnimated?: boolean;
|
|
@@ -329,6 +333,7 @@ export type TamaguiComponentStateRef = {
|
|
|
329
333
|
hasEverResetPresence?: boolean;
|
|
330
334
|
hasHadEvents?: boolean;
|
|
331
335
|
hasRealPressEvents?: boolean;
|
|
336
|
+
hadAttachPress?: boolean;
|
|
332
337
|
isListeningToTheme?: boolean;
|
|
333
338
|
unPress?: Function;
|
|
334
339
|
setStateShallow?: ComponentSetStateShallow;
|
|
@@ -341,7 +346,8 @@ export type TamaguiComponentStateRef = {
|
|
|
341
346
|
nextState?: TamaguiComponentState;
|
|
342
347
|
nextMedia?: UseMediaState;
|
|
343
348
|
avoidReRenders?: boolean;
|
|
344
|
-
|
|
349
|
+
mediaEmit?: (state: UseMediaState) => void;
|
|
350
|
+
mediaEmitQueued?: boolean;
|
|
345
351
|
prevPseudoState?: {
|
|
346
352
|
hover?: boolean;
|
|
347
353
|
press?: boolean;
|
|
@@ -361,6 +367,7 @@ export type TamaguiComponentStateRef = {
|
|
|
361
367
|
nativeMediaQueued?: boolean;
|
|
362
368
|
nativeThemeState?: ThemeState;
|
|
363
369
|
nativePushedKeys?: Set<string>;
|
|
370
|
+
prevStyle?: Record<string, any> | null;
|
|
364
371
|
};
|
|
365
372
|
export type ComponentGroupEmitter = {
|
|
366
373
|
listeners: Set<GroupStateListener>;
|
|
@@ -374,6 +381,7 @@ export type WidthHeight = {
|
|
|
374
381
|
export type ChildGroupState = {
|
|
375
382
|
pseudo?: PseudoGroupState;
|
|
376
383
|
media?: Record<MediaQueryKey extends number ? never : MediaQueryKey, boolean>;
|
|
384
|
+
layout?: WidthHeight;
|
|
377
385
|
};
|
|
378
386
|
export type ComponentGroupState = {
|
|
379
387
|
pseudo?: PseudoGroupState;
|
|
@@ -510,7 +518,7 @@ export type OnlyAllowShorthandsSetting = TamaguiConfig['settings'] extends {
|
|
|
510
518
|
export type OnlyShorthandStylePropsSetting = TamaguiConfig['settings'] extends {
|
|
511
519
|
onlyShorthandStyleProps: infer X;
|
|
512
520
|
} ? X : false;
|
|
513
|
-
export type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts, H extends GenericTamaguiSettings = GenericTamaguiSettings, AnimDriverKeys extends string = string> = {
|
|
521
|
+
export type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts, H extends GenericTamaguiSettings = GenericTamaguiSettings, S extends GenericSizing = GenericSizing, AnimDriverKeys extends string = string> = {
|
|
514
522
|
fonts: RemoveLanguagePostfixes<F>;
|
|
515
523
|
fontLanguages: GetLanguagePostfixes<F> extends never ? string[] : GetLanguagePostfixes<F>[];
|
|
516
524
|
tokens: A;
|
|
@@ -524,6 +532,7 @@ export type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes
|
|
|
524
532
|
animations: AnimationDriverLike<E> | AnimationsConfigObject;
|
|
525
533
|
animationDriverKeys?: AnimDriverKeys;
|
|
526
534
|
settings: H;
|
|
535
|
+
sizing: S;
|
|
527
536
|
};
|
|
528
537
|
type GetLanguagePostfix<Set> = Set extends string ? Set extends `${string}_${infer Postfix}` ? Postfix : never : never;
|
|
529
538
|
type OmitLanguagePostfix<Set> = Set extends string ? Set extends `${infer Prefix}_${string}` ? Prefix : Set : never;
|
|
@@ -531,7 +540,7 @@ type RemoveLanguagePostfixes<F extends GenericFonts> = {
|
|
|
531
540
|
[Key in OmitLanguagePostfix<keyof F>]: F[Key];
|
|
532
541
|
};
|
|
533
542
|
type GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>;
|
|
534
|
-
type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
|
|
543
|
+
type ConfProps<A, B, C, D, E, F, I, S, V = undefined> = {
|
|
535
544
|
tokens?: A;
|
|
536
545
|
themes?: B;
|
|
537
546
|
shorthands?: C;
|
|
@@ -539,6 +548,7 @@ type ConfProps<A, B, C, D, E, F, I, V = undefined> = {
|
|
|
539
548
|
animations?: E;
|
|
540
549
|
fonts?: F;
|
|
541
550
|
settings?: I;
|
|
551
|
+
sizing?: S;
|
|
542
552
|
variables?: V;
|
|
543
553
|
};
|
|
544
554
|
type VariableValInScheme<V> = V extends {
|
|
@@ -570,7 +580,7 @@ type ExtractAnimationConfig<E> = E extends AnimationDriverLike<infer Config> ? C
|
|
|
570
580
|
type ExtractAnimationDriverKeys<E> = E extends AnimationDriverLike<any> ? 'default' : E extends {
|
|
571
581
|
default: AnimationDriverLike<any>;
|
|
572
582
|
} ? Extract<keyof E, string> : 'default';
|
|
573
|
-
export type InferTamaguiConfig<Conf> = Conf extends ConfProps<infer A, infer B, infer C, infer D, infer E, infer F, infer H, infer V> ? TamaguiInternalConfig<A extends GenericTokens ? A : EmptyTokens, B extends GenericThemes ? ThemesWithVariables<B, V> : EmptyThemes, C extends GenericShorthands ? C : EmptyShorthands, D extends GenericMedia ? D : EmptyMedia, ExtractAnimationConfig<E>, F extends GenericFonts ? F : EmptyFonts, H extends GenericTamaguiSettings ? H : EmptyTamaguiSettings, ExtractAnimationDriverKeys<E>> : unknown;
|
|
583
|
+
export type InferTamaguiConfig<Conf> = Conf extends ConfProps<infer A, infer B, infer C, infer D, infer E, infer F, infer H, infer S, infer V> ? TamaguiInternalConfig<A extends GenericTokens ? A : EmptyTokens, B extends GenericThemes ? ThemesWithVariables<B, V> : EmptyThemes, C extends GenericShorthands ? C : EmptyShorthands, D extends GenericMedia ? D : EmptyMedia, ExtractAnimationConfig<E>, F extends GenericFonts ? F : EmptyFonts, H extends GenericTamaguiSettings ? H : EmptyTamaguiSettings, S extends GenericSizing ? S : GenericSizing, ExtractAnimationDriverKeys<E>> : unknown;
|
|
574
584
|
export type GenericTamaguiConfig = CreateTamaguiConfig<GenericTokens, GenericThemes, GenericShorthands, GenericMedia, GenericAnimations, GenericFonts>;
|
|
575
585
|
export type RootThemeName<TK extends keyof Themes = keyof Themes> = TK extends string ? string extends TK ? never : TK extends `${string}_${string}` ? never : TK : never;
|
|
576
586
|
type BaseThemeDefinitions = TamaguiConfig['themes'][RootThemeName];
|
|
@@ -649,8 +659,9 @@ export interface GenericTamaguiSettings {
|
|
|
649
659
|
* controls style semantics where React Native/Yoga and CSS differ.
|
|
650
660
|
*
|
|
651
661
|
* - "legacy": preserves Tamagui v1 flex expansion.
|
|
652
|
-
* - "react-native": follows React Native/Yoga flex
|
|
653
|
-
* - "web": follows CSS flex
|
|
662
|
+
* - "react-native": follows React Native/Yoga flex expansion.
|
|
663
|
+
* - "web": follows CSS flex expansion.
|
|
664
|
+
* numeric Tamagui lineHeight values are ratios in every mode.
|
|
654
665
|
*
|
|
655
666
|
* @default "web"
|
|
656
667
|
*/
|
|
@@ -736,6 +747,17 @@ export interface GenericTamaguiSettings {
|
|
|
736
747
|
* two ways to style the same property.
|
|
737
748
|
*/
|
|
738
749
|
onlyAllowShorthands?: boolean | undefined;
|
|
750
|
+
/**
|
|
751
|
+
* Restrict conditional style values to one syntax. Flat values accept both
|
|
752
|
+
* the string form (`bg="red hover:blue"`) and the object form
|
|
753
|
+
* (`bg={{ base: 'red', hover: 'blue' }}`); set this to keep one of them,
|
|
754
|
+
* which narrows the types, makes the runtime warn on the other in
|
|
755
|
+
* development, and tells `tamagui generate-prompt` and the skills to only
|
|
756
|
+
* show that form.
|
|
757
|
+
*
|
|
758
|
+
* @default undefined - both forms are allowed
|
|
759
|
+
*/
|
|
760
|
+
styleValueSyntax?: 'string' | 'object' | undefined;
|
|
739
761
|
/**
|
|
740
762
|
* Define a default font, for better types and default font on Text
|
|
741
763
|
*/
|
|
@@ -811,6 +833,45 @@ export interface GenericTamaguiSettings {
|
|
|
811
833
|
*/
|
|
812
834
|
onlyShorthandStyleProps?: boolean;
|
|
813
835
|
}
|
|
836
|
+
/** one rung of the control ladder: token keys, plus optional pinned geometry */
|
|
837
|
+
export type SizeRecipe = {
|
|
838
|
+
fontSize: string;
|
|
839
|
+
/**
|
|
840
|
+
* the type-scale key the square controls (checkbox, radio, switch) size
|
|
841
|
+
* from. Usually the rung's own name, but text deliberately steps down at
|
|
842
|
+
* `md`/`lg` so buttons are not chunky while the squares stay on-scale.
|
|
843
|
+
*/
|
|
844
|
+
controlFontSize: string;
|
|
845
|
+
paddingInline: string;
|
|
846
|
+
paddingBlock: string;
|
|
847
|
+
gap: string;
|
|
848
|
+
radius: string;
|
|
849
|
+
/**
|
|
850
|
+
* explicit rung geometry, skipping derivation. For scales whose keys
|
|
851
|
+
* cannot derive the ladder (v5's numeric scales pin the frozen heights
|
|
852
|
+
* here so v5 apps never resize).
|
|
853
|
+
*/
|
|
854
|
+
px?: {
|
|
855
|
+
height: number;
|
|
856
|
+
icon: number;
|
|
857
|
+
square: number;
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
/**
|
|
861
|
+
* the user-configurable control ladder. Rung names become the accepted
|
|
862
|
+
* `size` values (see ComponentSize); the px derivations in resolveSizing are
|
|
863
|
+
* fixed formulas over the rung's tokens.
|
|
864
|
+
*/
|
|
865
|
+
export type GenericSizing = {
|
|
866
|
+
default: string;
|
|
867
|
+
sizes: Record<string, SizeRecipe>;
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* the config's control size names: the default ladder plus any custom rungs
|
|
871
|
+
* from `sizing.sizes`. Stays the five literals (never `string`) when no
|
|
872
|
+
* custom config is registered.
|
|
873
|
+
*/
|
|
874
|
+
export type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | (string extends keyof TamaguiConfig['sizing']['sizes'] ? never : Extract<keyof TamaguiConfig['sizing']['sizes'], string>);
|
|
814
875
|
export type TamaguiSettings = TamaguiConfig['settings'];
|
|
815
876
|
export type BaseStyleProps = {
|
|
816
877
|
[Key in keyof TextStylePropsBase]?: TextStyle[Key] | GetThemeValueForKey<Key>;
|
|
@@ -857,19 +918,18 @@ export type CreateTamaguiProps = {
|
|
|
857
918
|
variables?: GenericVariables;
|
|
858
919
|
settings?: Partial<GenericTamaguiSettings>;
|
|
859
920
|
/**
|
|
860
|
-
*
|
|
921
|
+
* the control size ladder: rung names become the accepted `size` values.
|
|
922
|
+
* Spread `defaultSizing` and override `sizes` to add or retune rungs; the
|
|
923
|
+
* px derivations are fixed formulas over each rung's tokens.
|
|
861
924
|
*/
|
|
862
|
-
|
|
863
|
-
backgroundColor?: any;
|
|
864
|
-
color?: any;
|
|
865
|
-
};
|
|
925
|
+
sizing?: GenericSizing;
|
|
866
926
|
};
|
|
867
927
|
export type GetCSS = (opts?: {
|
|
868
928
|
separator?: string;
|
|
869
929
|
exclude?: 'themes' | 'design-system' | null;
|
|
870
930
|
sinceLastCall?: boolean;
|
|
871
931
|
}) => string;
|
|
872
|
-
export type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B extends GenericThemes = GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts, G extends GenericTamaguiSettings = GenericTamaguiSettings, AnimDriverKeys extends string = string> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> & Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, AnimDriverKeys>, 'tokens'> & {
|
|
932
|
+
export type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B extends GenericThemes = GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts, G extends GenericTamaguiSettings = GenericTamaguiSettings, S extends GenericSizing = GenericSizing, AnimDriverKeys extends string = string> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> & Omit<CreateTamaguiConfig<A, B, C, D, E, F, G, S, AnimDriverKeys>, 'tokens'> & {
|
|
873
933
|
tokens: Tokenify<A>;
|
|
874
934
|
tokensParsed: Tokenify<A>;
|
|
875
935
|
themeConfig: any;
|
|
@@ -882,6 +942,7 @@ export type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B ext
|
|
|
882
942
|
reactNative?: any;
|
|
883
943
|
fontSizeTokens: Set<string>;
|
|
884
944
|
settings: Omit<GenericTamaguiSettings, keyof G> & G;
|
|
945
|
+
sizing: Omit<GenericSizing, keyof S> & S;
|
|
885
946
|
defaultFont?: string;
|
|
886
947
|
defaultFontToken: `${string}`;
|
|
887
948
|
animationDrivers?: Record<string, AnimationDriverLike | null>;
|
|
@@ -896,7 +957,7 @@ export type GenericFont<Key extends GenericFontKey = GenericFontKey> = {
|
|
|
896
957
|
};
|
|
897
958
|
family?: string | Variable;
|
|
898
959
|
lineHeight?: Partial<{
|
|
899
|
-
[key in Key]: number | Variable;
|
|
960
|
+
[key in Key]: number | Px | `${number}` | Variable;
|
|
900
961
|
}> | undefined;
|
|
901
962
|
letterSpacing?: Partial<{
|
|
902
963
|
[key in Key]: number | Variable;
|
|
@@ -953,52 +1014,81 @@ export interface MediaQueryList {
|
|
|
953
1014
|
export type MatchMedia = (query: string) => MediaQueryList;
|
|
954
1015
|
export type AnimationConfigType = any;
|
|
955
1016
|
/**
|
|
956
|
-
*
|
|
957
|
-
*
|
|
1017
|
+
* Low-level spring physics. A projection of `duration` + `bounce`, not a second
|
|
1018
|
+
* way to configure a spring: whichever you author, the other is derived, and
|
|
1019
|
+
* every driver ends up with the same motion.
|
|
1020
|
+
*
|
|
1021
|
+
* Reach for this only when you are porting a config you already tuned.
|
|
958
1022
|
*/
|
|
959
1023
|
export type TransitionSpringConfig = {
|
|
960
1024
|
stiffness?: number;
|
|
961
1025
|
damping?: number;
|
|
962
1026
|
mass?: number;
|
|
963
|
-
tension?: number;
|
|
964
|
-
friction?: number;
|
|
965
1027
|
velocity?: number;
|
|
966
1028
|
overshootClamping?: boolean;
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
speed?: number;
|
|
1029
|
+
restDisplacementThreshold?: number;
|
|
1030
|
+
restSpeedThreshold?: number;
|
|
970
1031
|
};
|
|
971
1032
|
/**
|
|
972
|
-
* A transition value: the name of a configured driver animation, or a
|
|
973
|
-
* transition string such as `200ms
|
|
974
|
-
*
|
|
975
|
-
*
|
|
976
|
-
*
|
|
1033
|
+
* A transition value: the name of a configured driver animation, or a CSS
|
|
1034
|
+
* transition string such as `200ms`, `200ms ease-out`, or
|
|
1035
|
+
* `opacity 150ms, transform 300ms`.
|
|
1036
|
+
*
|
|
1037
|
+
* Springs get a CSS-shaped function of their own: `spring(300ms, 0.4)` is a
|
|
1038
|
+
* 300ms spring with a bounce of 0.4. It works everywhere a timing function
|
|
1039
|
+
* does, including on the web, where it compiles to a `linear()` easing.
|
|
1040
|
+
*
|
|
1041
|
+
* A bare string that exactly matches a configured animation name is that
|
|
1042
|
+
* preset; everything else is CSS. `(string & {})` keeps preset names in
|
|
1043
|
+
* autocomplete instead of collapsing the union to plain `string`.
|
|
977
1044
|
*/
|
|
978
1045
|
export type TransitionValue = TransitionKeys | (string & {});
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1046
|
+
/**
|
|
1047
|
+
* The settings half of a transition object. Anything else in the object is a
|
|
1048
|
+
* style property name carrying its own transition.
|
|
1049
|
+
*/
|
|
1050
|
+
export type TransitionConfig = {
|
|
1051
|
+
/** a configured animation to start from */
|
|
1052
|
+
preset?: TransitionKeys;
|
|
1053
|
+
/** milliseconds, or a CSS time like `'200ms'` */
|
|
1054
|
+
duration?: number | string;
|
|
1055
|
+
/**
|
|
1056
|
+
* Makes it a spring. `0` is critically damped (no overshoot), approaching
|
|
1057
|
+
* `1` is loose and oscillating, negative is sluggish. `duration` stays the
|
|
1058
|
+
* perceptual "how fast does this feel" number either way.
|
|
1059
|
+
*/
|
|
1060
|
+
bounce?: number;
|
|
1061
|
+
/** any CSS timing function. Mutually exclusive with `bounce`. */
|
|
1062
|
+
easing?: string;
|
|
1063
|
+
/** milliseconds, or a CSS time */
|
|
1064
|
+
delay?: number | string;
|
|
1065
|
+
behavior?: 'normal' | 'allow-discrete';
|
|
1066
|
+
/** the CSS `transition-property` list these settings apply to */
|
|
1067
|
+
properties?: string;
|
|
1068
|
+
spring?: TransitionSpringConfig;
|
|
1069
|
+
/** the transition to use while mounting, if it differs */
|
|
1070
|
+
enter?: TransitionProp;
|
|
1071
|
+
/** the transition to use while unmounting, if it differs */
|
|
1072
|
+
exit?: TransitionProp;
|
|
1073
|
+
};
|
|
1074
|
+
/**
|
|
1075
|
+
* `transition` accepts a string or an object, and nothing else.
|
|
1076
|
+
*
|
|
1077
|
+
* ```tsx
|
|
1078
|
+
* transition="bouncy" // a configured preset
|
|
1079
|
+
* transition="200ms ease-out" // css
|
|
1080
|
+
* transition="opacity 150ms, transform spring(300ms, 0.4)"
|
|
1081
|
+
* transition={{ duration: 200, bounce: 0.15 }}
|
|
1082
|
+
* transition={{ preset: 'bouncy', opacity: '150ms' }} // per-property override
|
|
1083
|
+
* ```
|
|
1084
|
+
*
|
|
1085
|
+
* Per-property keys are later CSS entries, so they win for that property and
|
|
1086
|
+
* inherit nothing from the base, exactly as
|
|
1087
|
+
* `transition: all 200ms, opacity 150ms` behaves in a stylesheet.
|
|
1088
|
+
*/
|
|
1089
|
+
export type TransitionProp = TransitionValue | (TransitionConfig & {
|
|
1090
|
+
[property: string]: TransitionValue | TransitionConfig | unknown;
|
|
1091
|
+
});
|
|
1002
1092
|
/**
|
|
1003
1093
|
* Emitted by the animation driver at the start and end of a transition.
|
|
1004
1094
|
*
|
|
@@ -1022,8 +1112,30 @@ type SomewhatSpecificSizeValue = 'auto' | PercentString | RemString | UnionableN
|
|
|
1022
1112
|
type SomewhatSpecificSpaceValue = 'auto' | PercentString | RemString | UnionableNumber;
|
|
1023
1113
|
type VariableString = `var(${string})`;
|
|
1024
1114
|
export type SomewhatSpecificColorValue = CSSColorNames | 'transparent' | (`rgba(${string})` & {}) | (`rgb(${string})` & {}) | (`hsl(${string})` & {}) | (`hsla(${string})` & {}) | (`#${string}` & {});
|
|
1025
|
-
type WebOnlySizeValue = `${number}vw` | `${number}dvw` | `${number}lvw` | `${number}svw` | `${number}vh` | `${number}dvh` | `${number}lvh` | `${number}svh` | `calc(${string})` | `min(${string})` | `max(${string})` | 'max-content' | 'min-content';
|
|
1115
|
+
type WebOnlySizeValue = `${number}px` | `${number}em` | `${number}ch` | `${number}vmin` | `${number}vmax` | `${number}vw` | `${number}dvw` | `${number}lvw` | `${number}svw` | `${number}vh` | `${number}dvh` | `${number}lvh` | `${number}svh` | `calc(${string})` | `min(${string})` | `max(${string})` | `clamp(${string})` | 'max-content' | 'min-content';
|
|
1026
1116
|
type UserAllowedStyleValuesSetting = Exclude<TamaguiSettings['allowedStyleValues'], undefined>;
|
|
1117
|
+
/**
|
|
1118
|
+
* A flat value string that carries a clause (`red hover:blue`, `dark:red`)
|
|
1119
|
+
* or a multi-token payload (`1px solid red`). Its grammar is validated by the
|
|
1120
|
+
* language service and the runtime, not by the type system. With
|
|
1121
|
+
* `styleValueSyntax: 'object'` the `:` arm is dropped, so a clause-only
|
|
1122
|
+
* string like `hover:red` is a type error (a clause after a space still
|
|
1123
|
+
* passes through the multi-token arm).
|
|
1124
|
+
*/
|
|
1125
|
+
export type FlatClauseString = `${string} ${string}` | (StyleValueSyntaxSetting extends 'object' ? never : `${string}:${string}`);
|
|
1126
|
+
type StyleValueSyntaxSetting = TamaguiSettings extends {
|
|
1127
|
+
styleValueSyntax: infer S;
|
|
1128
|
+
} ? S : undefined;
|
|
1129
|
+
/**
|
|
1130
|
+
* The open string arm every style value carries. With no `allowedStyleValues`
|
|
1131
|
+
* setting (or a boolean one) it is `string & {}`, so any string is accepted.
|
|
1132
|
+
* With a strictness setting, a single-token string (no space, no `:`) has to
|
|
1133
|
+
* be a token, theme value, or a value the setting allows, so a typo like
|
|
1134
|
+
* `bg="backgroun"` is a type error; only clause strings stay open.
|
|
1135
|
+
*/
|
|
1136
|
+
export type OpenStyleString = TamaguiSettings extends {
|
|
1137
|
+
allowedStyleValues: infer Setting;
|
|
1138
|
+
} ? Setting extends boolean ? UnionableString : FlatClauseString : UnionableString;
|
|
1027
1139
|
export type GetThemeValueSettingForCategory<Cat extends keyof AllowedStyleValuesSettingPerCategory> = UserAllowedStyleValuesSetting extends AllowedValueSettingBase | undefined ? UserAllowedStyleValuesSetting : UserAllowedStyleValuesSetting extends AllowedStyleValuesSettingPerCategory ? UserAllowedStyleValuesSetting[Cat] : true;
|
|
1028
1140
|
export type GetThemeValueFallbackFor<Setting, StrictValue, SomewhatStrictValue, LooseValue, WebOnlyValue> = Setting extends 'strict' ? StrictValue : Setting extends 'strict-web' ? StrictValue | WebOnlyValue : Setting extends 'somewhat-strict' ? SomewhatStrictValue : Setting extends 'somewhat-strict-web' ? SomewhatStrictValue | WebOnlyValue : LooseValue;
|
|
1029
1141
|
export type ThemeValueFallback = (TamaguiSettings extends {
|
|
@@ -1042,13 +1154,13 @@ export type ThemeValueFallbackColor = ThemeValueFallback | GetThemeValueFallback
|
|
|
1042
1154
|
export type ThemeValueFallbackRadius = ThemeValueFallback | GetThemeValueFallbackFor<AllowedValueSettingRadius, never, UnionableNumber, UnionableNumber, WebStyleValueUniversal>;
|
|
1043
1155
|
export type ThemeValueFallbackZIndex = ThemeValueFallback | GetThemeValueFallbackFor<AllowedValueSettingZIndex, never, UnionableNumber, UnionableNumber, WebStyleValueUniversal>;
|
|
1044
1156
|
export type GetTokenString<A> = A extends string | number ? `${A}` : string;
|
|
1045
|
-
export type Size = ThemeValueFallbackSize | GetTokenString<keyof Tokens['size']> |
|
|
1157
|
+
export type Size = ThemeValueFallbackSize | GetTokenString<keyof Tokens['size']> | OpenStyleString | true;
|
|
1046
1158
|
export type SizeTokens = Size;
|
|
1047
1159
|
export type Space = GetTokenString<keyof Tokens['space']> | ThemeValueFallbackSpace | true;
|
|
1048
1160
|
export type SpaceTokens = Space;
|
|
1049
1161
|
type ColorTokenBase = GetTokenString<keyof Tokens['color']> | GetTokenString<keyof ThemeParsed>;
|
|
1050
1162
|
type TokenWithOpacity = `${string}/${number}`;
|
|
1051
|
-
export type Color = ColorTokenBase | CSSColorNames | TokenWithOpacity |
|
|
1163
|
+
export type Color = ColorTokenBase | CSSColorNames | TokenWithOpacity | OpenStyleString;
|
|
1052
1164
|
export type ColorTokens = Color;
|
|
1053
1165
|
export type ZIndex = GetTokenString<keyof Tokens['zIndex']> | ThemeValueFallbackZIndex | number | true;
|
|
1054
1166
|
export type ZIndexTokens = ZIndex;
|
|
@@ -1064,7 +1176,7 @@ export type FontTokens = GetTokenString<keyof TamaguiConfig['fonts']>;
|
|
|
1064
1176
|
export type FontFamilyTokens = FontTokens;
|
|
1065
1177
|
export type FontSize = GetTokenString<GetTokenFontKeysFor<'size'>> | number | RemString | true;
|
|
1066
1178
|
export type FontSizeTokens = FontSize;
|
|
1067
|
-
export type FontLineHeightTokens = GetTokenString<GetTokenFontKeysFor<'lineHeight'>> | number | RemString;
|
|
1179
|
+
export type FontLineHeightTokens = GetTokenString<GetTokenFontKeysFor<'lineHeight'>> | number | Px | `${number}` | RemString;
|
|
1068
1180
|
export type FontWeightValues = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | 'bold' | 'normal';
|
|
1069
1181
|
export type FontWeightTokens = GetTokenString<GetTokenFontKeysFor<'weight'>> | FontWeightValues;
|
|
1070
1182
|
type FontColorTokenBase = GetTokenString<GetTokenFontKeysFor<'color'>>;
|
|
@@ -1092,10 +1204,11 @@ export type FontLetterSpacingKeys = 'letterSpacing';
|
|
|
1092
1204
|
export type LineHeightKeys = 'lineHeight';
|
|
1093
1205
|
export type ZIndexKeys = 'zIndex';
|
|
1094
1206
|
export type OpacityKeys = 'opacity';
|
|
1095
|
-
|
|
1207
|
+
type FontStyleValueFallback = GetThemeValueFallbackFor<AllowedValueSettingSize, never, never, never, WebStyleValueUniversal | `${number}%`>;
|
|
1208
|
+
export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme' ? ThemeTokens : K extends SizeKeys ? SizeTokens : K extends FontKeys ? FontTokens : K extends FontSizeKeys ? FontSizeTokens | FontStyleValueFallback : K extends `${`border${string | ''}Radius`}` ? RadiusTokens : K extends SpaceKeys ? K extends 'shadowOffset' ? {
|
|
1096
1209
|
width: SpaceTokens;
|
|
1097
1210
|
height: SpaceTokens;
|
|
1098
|
-
} : SpaceTokens : K extends ColorKeys ? ColorTokens | ThemeValueFallbackColor : K extends ZIndexKeys ? ZIndexTokens : K extends LineHeightKeys ? FontLineHeightTokens : K extends FontWeightKeys ? FontWeightTokens : K extends FontLetterSpacingKeys ? FontLetterSpacingTokens : K extends OpacityKeys ? ThemeValueFallback : never;
|
|
1211
|
+
} : SpaceTokens : K extends ColorKeys ? ColorTokens | ThemeValueFallbackColor : K extends ZIndexKeys ? ZIndexTokens : K extends LineHeightKeys ? FontLineHeightTokens | FontStyleValueFallback : K extends FontWeightKeys ? FontWeightTokens : K extends FontLetterSpacingKeys ? FontLetterSpacingTokens : K extends OpacityKeys ? ThemeValueFallback : never;
|
|
1099
1212
|
export type GetThemeValueForKey<K extends string | symbol | number> = ThemeValueGet<K> | ThemeValueFallback;
|
|
1100
1213
|
export type SafeAreaValueKeys = 'padding' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingHorizontal' | 'paddingVertical' | 'paddingStart' | 'paddingEnd' | 'paddingBlock' | 'paddingInline' | 'paddingBlockStart' | 'paddingBlockEnd' | 'paddingInlineStart' | 'paddingInlineEnd' | 'margin' | 'marginTop' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginHorizontal' | 'marginVertical' | 'marginStart' | 'marginEnd' | 'marginBlock' | 'marginInline' | 'marginBlockStart' | 'marginBlockEnd' | 'marginInlineStart' | 'marginInlineEnd' | 'inset' | 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end';
|
|
1101
1214
|
/**
|
|
@@ -1123,21 +1236,21 @@ type FlatClauseName = ClauseModifierName | `${ClauseModifierName}:${string}` | `
|
|
|
1123
1236
|
* package boundaries.
|
|
1124
1237
|
*/
|
|
1125
1238
|
export type FlatStyleObject<T> = {
|
|
1126
|
-
default?: T |
|
|
1239
|
+
default?: T | OpenStyleString;
|
|
1127
1240
|
} & {
|
|
1128
|
-
[K in FlatClauseName]?: T |
|
|
1241
|
+
[K in FlatClauseName]?: T | OpenStyleString;
|
|
1129
1242
|
};
|
|
1130
1243
|
/**
|
|
1131
|
-
* The string arm stays at base values only: `
|
|
1244
|
+
* The string arm stays at base values only: `OpenStyleString` admits every
|
|
1132
1245
|
* clause string, and structured clause completion comes from the object
|
|
1133
1246
|
* form's keys (and the language-service plugin for strings). A per-prop
|
|
1134
1247
|
* `${modifier}:` prefix union used to ride along for first-prefix
|
|
1135
1248
|
* completion; it multiplied across the whole component prop graph and the
|
|
1136
1249
|
* object form made it redundant.
|
|
1137
1250
|
*/
|
|
1138
|
-
export type FlatStyleValue<T> = T | FlatStyleObject<T> |
|
|
1251
|
+
export type FlatStyleValue<T> = T | (StyleValueSyntaxSetting extends 'string' ? never : FlatStyleObject<T>) | OpenStyleString;
|
|
1139
1252
|
export type WithThemeValues<T extends object> = {
|
|
1140
|
-
[K in keyof T]: (ThemeValueGet<K> extends never ? K extends keyof ExtraBaseProps ? T[K] : FlatStyleValue<T[K] | 'unset'> : FlatStyleValue<GetThemeValueForKey<K> | Exclude<T[K], string> | 'unset'>) | (K extends SafeAreaValueKeys ? 'safe' : never);
|
|
1253
|
+
-readonly [K in keyof T]: (ThemeValueGet<K> extends never ? K extends keyof ExtraBaseProps ? T[K] : FlatStyleValue<T[K] | 'unset'> : FlatStyleValue<GetThemeValueForKey<K> | Exclude<T[K], string> | 'unset'>) | (K extends SafeAreaValueKeys ? 'safe' : never);
|
|
1141
1254
|
};
|
|
1142
1255
|
export type NarrowShorthands = Narrow<Shorthands>;
|
|
1143
1256
|
export type Longhands = NarrowShorthands[keyof NarrowShorthands];
|
|
@@ -1152,7 +1265,7 @@ type MaybeOmitLonghands<A> = OnlyShorthandStyleProps extends true ? Omit<A, Shor
|
|
|
1152
1265
|
export type WithFlatVariantValues<Variants> = {
|
|
1153
1266
|
[Key in keyof Variants]?: FlatStyleValue<NonNullable<Variants[Key]>>;
|
|
1154
1267
|
};
|
|
1155
|
-
export type WithThemeAndShorthands<A extends object, Variants = {}> = OnlyAllowShorthands extends true ? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands>>> & WithFlatVariantValues<Variants> & WithShorthands<WithThemeValues<A>> : WithThemeValues<MaybeOmitLonghands<A
|
|
1268
|
+
export type WithThemeAndShorthands<A extends object, Variants = {}> = OnlyAllowShorthands extends true ? WithThemeValues<MaybeOmitLonghands<Omit<A, Longhands | keyof Variants>>> & WithFlatVariantValues<Variants> & WithShorthands<WithThemeValues<A>> : WithThemeValues<MaybeOmitLonghands<Omit<A, keyof Variants>>> & WithFlatVariantValues<Variants> & WithShorthands<WithThemeValues<A>>;
|
|
1156
1269
|
/**
|
|
1157
1270
|
* Base style-only props (no media, pseudo):
|
|
1158
1271
|
*/
|
|
@@ -1161,13 +1274,13 @@ type PxOrPct = Px | `${string | number}%`;
|
|
|
1161
1274
|
type TwoValueTransformOrigin = `${PxOrPct | 'left' | 'center' | 'right'} ${PxOrPct | 'top' | 'center' | 'bottom'}`;
|
|
1162
1275
|
export interface TransformStyleProps {
|
|
1163
1276
|
/**
|
|
1164
|
-
* Maps to translateX
|
|
1277
|
+
* Maps to translateX. A percent string is relative to the element's own width.
|
|
1165
1278
|
*/
|
|
1166
|
-
x?: number
|
|
1279
|
+
x?: number | `${number}%`;
|
|
1167
1280
|
/**
|
|
1168
|
-
* Maps to translateY
|
|
1281
|
+
* Maps to translateY. A percent string is relative to the element's own height.
|
|
1169
1282
|
*/
|
|
1170
|
-
y?: number
|
|
1283
|
+
y?: number | `${number}%`;
|
|
1171
1284
|
perspective?: number;
|
|
1172
1285
|
scale?: number;
|
|
1173
1286
|
scaleX?: number;
|
|
@@ -1244,15 +1357,18 @@ interface ExtraStyleProps {
|
|
|
1244
1357
|
* backgroundColor and drops url()/gradient/multi-part values it can't express.
|
|
1245
1358
|
*
|
|
1246
1359
|
* The v6 shorthands map `bg` here rather than to `backgroundColor`, because
|
|
1247
|
-
* the background family splits a value like `url(x.png)
|
|
1360
|
+
* the background family splits a value like `url(x.png) color-1` across
|
|
1248
1361
|
* backgroundImage and backgroundColor. Color tokens lead the union so `bg`
|
|
1249
|
-
* completes them;
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
1362
|
+
* completes them; the CSS keywords and the function forms (`url()`,
|
|
1363
|
+
* gradients) keep the CSS shorthand, and multi-part values reach
|
|
1364
|
+
* `OpenStyleString` through their spaces. Adding this key to `ColorKeys`
|
|
1365
|
+
* instead would erase the CSS arm, since that path runs the value type
|
|
1366
|
+
* through `Exclude<T[K], string>`.
|
|
1252
1367
|
*/
|
|
1253
|
-
background?: ColorTokens |
|
|
1368
|
+
background?: ColorTokens | Exclude<ThemeValueFallbackColor, number> | 'none' | 'inherit' | 'initial' | 'unset' | 'revert' | `${string}(${string})` | OpenStyleString;
|
|
1254
1369
|
/**
|
|
1255
|
-
*
|
|
1370
|
+
* css background image. native maps supported linear gradients to
|
|
1371
|
+
* experimental_backgroundImage and drops values it cannot represent.
|
|
1256
1372
|
*/
|
|
1257
1373
|
backgroundImage?: Properties['backgroundImage'];
|
|
1258
1374
|
/**
|
|
@@ -1306,6 +1422,8 @@ interface ExtraStyleProps {
|
|
|
1306
1422
|
* Web-only style property. Will be omitted on native.
|
|
1307
1423
|
*/
|
|
1308
1424
|
resize?: Properties['resize'];
|
|
1425
|
+
/** react-native stops at visible/hidden/scroll; web also accepts auto and clip */
|
|
1426
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto' | 'clip';
|
|
1309
1427
|
/**
|
|
1310
1428
|
* Web-only style property. Will be omitted on native.
|
|
1311
1429
|
*/
|
|
@@ -1544,6 +1662,7 @@ interface ExtraStyleProps {
|
|
|
1544
1662
|
borderInlineWidth?: SpaceTokens | number;
|
|
1545
1663
|
borderInlineStartWidth?: SpaceTokens | number;
|
|
1546
1664
|
borderInlineEndWidth?: SpaceTokens | number;
|
|
1665
|
+
borderStyle?: ViewStyle['borderStyle'] | 'none' | 'hidden';
|
|
1547
1666
|
borderBlockStyle?: ViewStyle['borderStyle'];
|
|
1548
1667
|
borderBlockStartStyle?: ViewStyle['borderStyle'];
|
|
1549
1668
|
borderBlockEndStyle?: ViewStyle['borderStyle'];
|
|
@@ -1582,11 +1701,6 @@ interface ExtraBaseProps {
|
|
|
1582
1701
|
* See: https://tamagui.dev/docs/core/animations
|
|
1583
1702
|
*/
|
|
1584
1703
|
transition?: TransitionProp | null;
|
|
1585
|
-
/**
|
|
1586
|
-
* Pass an array of strings containing the long style property names
|
|
1587
|
-
* which will be exclusively transitioned.
|
|
1588
|
-
*/
|
|
1589
|
-
animateOnly?: string[];
|
|
1590
1704
|
/**
|
|
1591
1705
|
* If you'd like this component to not attach to the nearest parent AnimatePresence,
|
|
1592
1706
|
* set this to `false` and it will pass through to the next animated child.
|
|
@@ -1604,12 +1718,20 @@ interface ExtraBaseProps {
|
|
|
1604
1718
|
passThrough?: boolean;
|
|
1605
1719
|
}
|
|
1606
1720
|
interface ExtendedBaseProps extends TransformStyleProps, ExtendBaseTextProps, ExtendBaseStackProps, ExtraStyleProps, ExtraBaseProps {
|
|
1607
|
-
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex';
|
|
1721
|
+
display?: 'inherit' | 'none' | 'inline' | 'block' | 'inline-block' | 'contents' | 'flex' | 'inline-flex' | 'grid' | 'inline-grid';
|
|
1608
1722
|
position?: 'absolute' | 'relative' | 'fixed' | 'static' | 'sticky';
|
|
1609
1723
|
}
|
|
1610
|
-
export interface StackStyleBase extends Omit<ViewStyle, keyof ExtendedBaseProps | 'elevation'>, ExtendedBaseProps {
|
|
1724
|
+
export interface StackStyleBase extends Omit<ViewStyle, keyof ExtendedBaseProps | 'elevation'>, ExtendedBaseProps, Omit<UnprefixedCSSProperties, keyof ViewStyle | keyof ExtendedBaseProps | keyof TamaguiComponentPropsBaseBase> {
|
|
1611
1725
|
}
|
|
1612
|
-
export interface TextStylePropsBase extends Omit<RNTextStyle, keyof ExtendedBaseProps>, ExtendedBaseProps {
|
|
1726
|
+
export interface TextStylePropsBase extends Omit<RNTextStyle, keyof ExtendedBaseProps | 'fontVariant' | 'lineHeight' | 'includeFontPadding'>, ExtendedBaseProps, Omit<UnprefixedCSSProperties, keyof RNTextStyle | keyof ExtendedBaseProps | keyof TamaguiComponentPropsBaseBase | 'textShadow' | 'textDecoration' | 'font'> {
|
|
1727
|
+
lineHeight?: number | Px | `${number}`;
|
|
1728
|
+
/**
|
|
1729
|
+
* react-native types this as a mutable `FontVariant[]`, which an `as const` variant
|
|
1730
|
+
* definition can't satisfy — and a variants object that misses its constraint is
|
|
1731
|
+
* silently discarded whole, taking every variant on the component with it (#2787).
|
|
1732
|
+
* react-native types `transform` as readonly for the same reason.
|
|
1733
|
+
*/
|
|
1734
|
+
fontVariant?: readonly FontVariant[];
|
|
1613
1735
|
ellipsis?: boolean;
|
|
1614
1736
|
numberOfLines?: number;
|
|
1615
1737
|
textDecorationDistance?: number;
|
|
@@ -1627,17 +1749,16 @@ export interface TextStylePropsBase extends Omit<RNTextStyle, keyof ExtendedBase
|
|
|
1627
1749
|
*/
|
|
1628
1750
|
textDecoration?: string;
|
|
1629
1751
|
/**
|
|
1630
|
-
*
|
|
1631
|
-
* Splits by the CSS micro-syntax; ambiguous forms stay unparsed.
|
|
1752
|
+
* css font shorthand string, browser-only and dropped on native.
|
|
1632
1753
|
*/
|
|
1633
1754
|
font?: string;
|
|
1634
1755
|
}
|
|
1635
1756
|
type LooseCombinedObjects<A extends object, B extends object> = A | B | (A & B);
|
|
1636
|
-
export interface StackNonStyleProps extends Omit<ViewProps, 'hitSlop' | 'pointerEvents' | 'display' | 'children' | keyof
|
|
1757
|
+
export interface StackNonStyleProps extends Omit<ViewProps, 'hitSlop' | 'pointerEvents' | 'display' | 'children' | keyof TamaguiComponentPropsBase | RNOnlyProps | keyof ExtendBaseStackProps | 'style' | 'onFocus' | 'onBlur' | 'onPointerCancel' | 'onPointerDown' | 'onPointerMove' | 'onPointerUp'>, ExtendBaseStackProps, TamaguiComponentPropsBase {
|
|
1637
1758
|
style?: StyleProp<LooseCombinedObjects<React.CSSProperties, ViewStyle>>;
|
|
1638
1759
|
}
|
|
1639
1760
|
export type StackStyle = WithThemeAndShorthands<StackStyleBase>;
|
|
1640
|
-
export interface TextNonStyleProps extends Omit<ReactTextProps, 'children' | keyof
|
|
1761
|
+
export interface TextNonStyleProps extends Omit<ReactTextProps, 'children' | keyof TamaguiComponentPropsBase | RNOnlyProps | keyof ExtendBaseTextProps | 'style' | 'selectable' | 'numberOfLines' | 'pointerEvents'>, ExtendBaseTextProps, TamaguiComponentPropsBase {
|
|
1641
1762
|
style?: StyleProp<LooseCombinedObjects<React.CSSProperties, RNTextStyle>>;
|
|
1642
1763
|
}
|
|
1643
1764
|
export type TextStyle = WithThemeAndShorthands<TextStylePropsBase>;
|
|
@@ -1652,7 +1773,7 @@ export type StyledHOCOptions = {
|
|
|
1652
1773
|
staticConfig?: Partial<StaticConfig>;
|
|
1653
1774
|
};
|
|
1654
1775
|
export type StyledHOCMergedProps<Props, CustomProps> = keyof CustomProps extends never ? Props : Omit<Props, keyof CustomProps> & CustomProps;
|
|
1655
|
-
export type GetFinalProps<NonStyleProps, StylePropsBase, Variants> = Omit<NonStyleProps, keyof
|
|
1776
|
+
export type GetFinalProps<NonStyleProps, StylePropsBase, Variants> = Omit<NonStyleProps, keyof Variants> & (StylePropsBase extends object ? Omit<WithThemeAndShorthands<StylePropsBase, Variants>, Exclude<keyof NonStyleProps, keyof Variants>> : {});
|
|
1656
1777
|
export type TamaguiComponent<Props = any, Ref = any, NonStyledProps = {}, BaseStyles extends object = {}, Variants = {}, ParentStaticProperties = {}> = FunctionComponent<(Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, Variants> : Props) & {
|
|
1657
1778
|
ref?: ReactRef<Ref>;
|
|
1658
1779
|
}> & StaticComponentObject<Props, Ref, NonStyledProps, BaseStyles, Variants, ParentStaticProperties> & Omit<ParentStaticProperties, 'staticConfig'> & {
|
|
@@ -1729,6 +1850,7 @@ export type GetStyleState = {
|
|
|
1729
1850
|
conf: TamaguiInternalConfig;
|
|
1730
1851
|
avoidMergeTransform?: boolean;
|
|
1731
1852
|
fontFamily?: string;
|
|
1853
|
+
nativeLineHeight?: unknown;
|
|
1732
1854
|
debug?: DebugProp;
|
|
1733
1855
|
transformAccumulator?: TransformAccumulator;
|
|
1734
1856
|
flatRulesToInsert?: RulesToInsert;
|
|
@@ -1813,6 +1935,7 @@ export type StaticConfigPublic = {
|
|
|
1813
1935
|
contextProps?: readonly string[];
|
|
1814
1936
|
};
|
|
1815
1937
|
type StaticConfigBase = StaticConfigPublic & {
|
|
1938
|
+
isDOM?: boolean;
|
|
1816
1939
|
Component?: FunctionComponent<any> & StaticComponentObject<any, any, any, any, any, any>;
|
|
1817
1940
|
displayName?: string;
|
|
1818
1941
|
baseStyle?: Record<string, any>;
|
|
@@ -1895,6 +2018,7 @@ export type StyledDynamicEnv = {
|
|
|
1895
2018
|
theme: Themes extends {
|
|
1896
2019
|
[key: string]: infer B;
|
|
1897
2020
|
} ? B : unknown;
|
|
2021
|
+
sizing: GenericSizing;
|
|
1898
2022
|
fontFamily?: FontFamilyTokens;
|
|
1899
2023
|
font?: Font;
|
|
1900
2024
|
};
|
|
@@ -1918,20 +2042,32 @@ export type StyledDynamic<Val = any, Output extends object = Record<string, any>
|
|
|
1918
2042
|
export type StyledResolver<Props = Record<string, any>, Output extends object = Record<string, any>> = (props: Props, env: StyledDynamicEnv) => Partial<Output> | null | undefined;
|
|
1919
2043
|
export type VariantDefinitions<Parent extends StylableComponent = TamaguiComponent, StaticConfig extends StaticConfigPublic = Parent extends {
|
|
1920
2044
|
__tama: [any, any, any, any, any, infer S];
|
|
1921
|
-
} ? S : {}, MyProps extends object =
|
|
2045
|
+
} ? S : {}, MyProps extends object = VariantStyleProps<Parent, StaticConfig>, Val = any> = VariantDefinitionFromProps<MyProps, Val> & {
|
|
1922
2046
|
_isEmpty?: 1;
|
|
1923
2047
|
};
|
|
2048
|
+
export type InputColorStyleProps = {
|
|
2049
|
+
placeholderTextColor?: ColorStyleProp;
|
|
2050
|
+
selectionColor?: ColorStyleProp;
|
|
2051
|
+
cursorColor?: ColorStyleProp;
|
|
2052
|
+
selectionHandleColor?: ColorStyleProp;
|
|
2053
|
+
};
|
|
2054
|
+
export type VariantStyleProps<Parent extends StylableComponent, StaticConfig extends StaticConfigPublic> = Partial<GetVariantProps<Parent, StaticConfig['isText'] extends true ? true : StaticConfig['isInput'] extends true ? true : false>> & (GetStaticConfig<Parent, StaticConfig>['isInput'] extends true ? InputColorStyleProps : {});
|
|
2055
|
+
/**
|
|
2056
|
+
* the exact-key check styled() runs on the variants it infers: a key that is
|
|
2057
|
+
* not a style, shorthand, aria/data attribute, or variant of the component is
|
|
2058
|
+
* `never`, since inference alone never flags extra keys.
|
|
2059
|
+
*/
|
|
2060
|
+
export type StyleOnlyVariants<Variants, AllowedKeys extends PropertyKey> = {
|
|
2061
|
+
[Name in keyof Variants]: Variants[Name] extends StyledDynamic<any, any> ? Variants[Name] : {
|
|
2062
|
+
[Value in keyof Variants[Name]]: Variants[Name][Value] extends object ? {
|
|
2063
|
+
[Key in keyof Variants[Name][Value]]: Key extends AllowedKeys | keyof Variants | `aria-${string}` | `data-${string}` ? Variants[Name][Value][Key] : never;
|
|
2064
|
+
} : Variants[Name][Value];
|
|
2065
|
+
};
|
|
2066
|
+
};
|
|
1924
2067
|
export type StaticStyleInput = string;
|
|
1925
2068
|
export type GetVariantProps<A extends StylableComponent, IsText extends boolean | undefined> = A extends {
|
|
1926
|
-
__tama: [
|
|
1927
|
-
|
|
1928
|
-
any,
|
|
1929
|
-
infer NonStyledProps,
|
|
1930
|
-
infer BaseStyles,
|
|
1931
|
-
infer VariantProps,
|
|
1932
|
-
any
|
|
1933
|
-
];
|
|
1934
|
-
} ? Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps> : Props : WithThemeAndShorthands<IsText extends true ? TextStylePropsBase : StackStyleBase>;
|
|
2069
|
+
__tama: [any, any, any, infer BaseStyles, infer VariantProps, any];
|
|
2070
|
+
} ? BaseStyles extends object ? WithThemeAndShorthands<BaseStyles, VariantProps> : {} : WithThemeAndShorthands<IsText extends true ? TextStylePropsBase : StackStyleBase>;
|
|
1935
2071
|
export type VariantDefinitionFromProps<MyProps, Val> = MyProps extends object ? {
|
|
1936
2072
|
[propName: string]: StyledDynamic<any, MyProps> | {
|
|
1937
2073
|
[Key in string | number | 'true' | 'false']?: MyProps | StaticStyleInput;
|
|
@@ -1965,6 +2101,7 @@ export type SplitStyleProps = {
|
|
|
1965
2101
|
canPlatformPseudo?: boolean;
|
|
1966
2102
|
isAnimated: boolean;
|
|
1967
2103
|
isExiting?: boolean;
|
|
2104
|
+
prevStyle?: Record<string, any> | null;
|
|
1968
2105
|
};
|
|
1969
2106
|
export interface PresenceContextProps {
|
|
1970
2107
|
id: string;
|
|
@@ -2023,6 +2160,18 @@ type AnimationDriverBase<A extends AnimationConfig = AnimationConfig> = {
|
|
|
2023
2160
|
animations: A;
|
|
2024
2161
|
View?: any;
|
|
2025
2162
|
Text?: any;
|
|
2163
|
+
useTextMetrics?: (input: {
|
|
2164
|
+
inheritedText?: AnimatedTextChannel | null;
|
|
2165
|
+
lineHeight?: NativeTextMetrics['lineHeight'];
|
|
2166
|
+
}) => {
|
|
2167
|
+
textChannel: AnimatedTextChannel | null;
|
|
2168
|
+
} & ({
|
|
2169
|
+
style: null;
|
|
2170
|
+
} | {
|
|
2171
|
+
style: Record<string, unknown>;
|
|
2172
|
+
Text: ComponentType<any>;
|
|
2173
|
+
TextInput: ComponentType<any>;
|
|
2174
|
+
});
|
|
2026
2175
|
};
|
|
2027
2176
|
export type AnimationDriver<A extends AnimationConfig = AnimationConfig> = AnimationDriverBase<A> & {
|
|
2028
2177
|
/** When true, this is a stub driver with no real animation support */
|
|
@@ -2045,9 +2194,10 @@ export type AnimationDriverStub<A extends AnimationConfig = AnimationConfig> = A
|
|
|
2045
2194
|
};
|
|
2046
2195
|
export type AnimationDriverLike<A extends AnimationConfig = AnimationConfig> = AnimationDriver<A> | AnimationDriverStub<A>;
|
|
2047
2196
|
export type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
|
|
2048
|
-
type UseStyleListener = (nextStyle: Record<string, unknown>, effectiveTransition?: TransitionProp | null, pseudoActive?: boolean) => void;
|
|
2197
|
+
type UseStyleListener = (nextStyle: Record<string, unknown>, effectiveTransition?: TransitionProp | null, pseudoActive?: boolean, nativeTextMetrics?: NativeTextMetrics) => void;
|
|
2049
2198
|
export type UseStyleEmitter = (cb: UseStyleListener) => void;
|
|
2050
2199
|
export type UseAnimationHook = (props: {
|
|
2200
|
+
inheritedText?: AnimatedTextChannel | null;
|
|
2051
2201
|
style: Record<string, any>;
|
|
2052
2202
|
props: Record<string, any>;
|
|
2053
2203
|
styleState?: GetStyleResult | null;
|
|
@@ -2064,18 +2214,24 @@ export type UseAnimationHook = (props: {
|
|
|
2064
2214
|
onTransition?: OnTransition;
|
|
2065
2215
|
delay?: number;
|
|
2066
2216
|
}) => null | {
|
|
2217
|
+
textChannel?: AnimatedTextChannel | null;
|
|
2067
2218
|
style?: unknown;
|
|
2068
2219
|
className?: string;
|
|
2069
2220
|
ref?: any;
|
|
2070
2221
|
};
|
|
2071
|
-
export type GestureReponderEvent = Exclude<
|
|
2222
|
+
export type GestureReponderEvent = Exclude<ViewProps['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
|
|
2072
2223
|
export type RulesToInsert = Record<string, StyleObject>;
|
|
2073
2224
|
export type GetStyleResult = {
|
|
2074
|
-
style:
|
|
2225
|
+
style: {
|
|
2226
|
+
-readonly [K in keyof ViewStyle]: ViewStyle[K];
|
|
2227
|
+
} | null;
|
|
2075
2228
|
classNames: ClassNamesObject;
|
|
2076
2229
|
rulesToInsert: RulesToInsert;
|
|
2077
|
-
viewProps:
|
|
2230
|
+
viewProps: {
|
|
2231
|
+
-readonly [K in keyof (StackNonStyleProps & StackStyle)]: (StackNonStyleProps & StackStyle)[K];
|
|
2232
|
+
} & Record<string, any>;
|
|
2078
2233
|
fontFamily: string | undefined;
|
|
2234
|
+
nativeTextMetrics?: NativeTextMetrics;
|
|
2079
2235
|
space?: any;
|
|
2080
2236
|
hasMedia: boolean | Set<string>;
|
|
2081
2237
|
pseudoGroups?: Set<string>;
|
|
@@ -2118,7 +2274,7 @@ export interface RecursiveArray<T> extends Array<T | ReadonlyArray<T> | Recursiv
|
|
|
2118
2274
|
export type RegisteredStyle<T> = number & {
|
|
2119
2275
|
__registeredStyleBrand: T;
|
|
2120
2276
|
};
|
|
2121
|
-
export type StyleProp<T> = T | StylePiece | RegisteredStyle<T> |
|
|
2277
|
+
export type StyleProp<T> = T | StylePiece | RegisteredStyle<T> | ReadonlyArray<StyleProp<T>> | Falsy | void;
|
|
2122
2278
|
export type FillInFont<A extends GenericFont, DefaultKeys extends string | number> = {
|
|
2123
2279
|
family: string;
|
|
2124
2280
|
lineHeight: FillInFontValues<A, 'lineHeight', DefaultKeys>;
|