@tamagui/web 3.0.0-beta.924.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_withNativeStyle.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.js +3 -0
- package/dist/cjs/_withNativeStyle.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.cjs +1 -5
- package/dist/cjs/_withStableStyle.native.js +1 -5
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +6 -3
- package/dist/cjs/config.native.cjs +7 -5
- package/dist/cjs/config.native.js +7 -5
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.cjs +1 -0
- package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +46 -32
- package/dist/cjs/createComponent.native.cjs +92 -72
- package/dist/cjs/createComponent.native.js +92 -72
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +32 -14
- package/dist/cjs/createTamagui.native.cjs +33 -19
- package/dist/cjs/createTamagui.native.js +33 -19
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -5
- package/dist/cjs/createTokens.native.js +1 -5
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.native.cjs +1 -5
- package/dist/cjs/createVariable.native.js +1 -5
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/createVariables.native.cjs +2 -6
- package/dist/cjs/createVariables.native.js +2 -6
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +87 -329
- package/dist/cjs/dom/html.native.cjs +53 -2
- package/dist/cjs/dom/html.native.js +53 -2
- package/dist/cjs/dom/html.native.js.map +1 -1
- package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
- package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
- package/dist/cjs/dom/htmlReset.native.js +30 -0
- package/dist/cjs/dom/htmlReset.native.js.map +1 -0
- package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
- package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/cjs/dom/primitives.native.cjs +81 -34
- package/dist/cjs/dom/primitives.native.js +81 -34
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +10 -4
- package/dist/cjs/eventHandling.native.cjs +52 -16
- package/dist/cjs/eventHandling.native.js +52 -16
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
- package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/cjs/helpers/configVariables.native.cjs +2 -6
- package/dist/cjs/helpers/configVariables.native.js +2 -6
- package/dist/cjs/helpers/configVariables.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
- package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +45 -1
- package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
- package/dist/cjs/helpers/expandStyle.native.js +38 -2
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +15 -3
- package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
- package/dist/cjs/helpers/expandStyles.native.js +14 -8
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/fluid.cjs +56 -0
- package/dist/cjs/helpers/fluid.native.cjs +58 -0
- package/dist/cjs/helpers/fluid.native.js +60 -0
- package/dist/cjs/helpers/fluid.native.js.map +1 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
- package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
- package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
- package/dist/cjs/helpers/grammarConfig.cjs +6 -14
- package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
- package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.cjs +1 -5
- package/dist/cjs/helpers/isObj.native.js +1 -5
- package/dist/cjs/helpers/isObj.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.cjs +18 -21
- package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
- package/dist/cjs/helpers/mergeProps.native.js +20 -23
- package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeTextMetrics.cjs +74 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
- package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
- package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
- package/dist/cjs/helpers/resolveRem.native.js +18 -21
- package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +124 -0
- package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
- package/dist/cjs/helpers/resolveSizing.native.js +135 -0
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
- package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
- package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.js +0 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +5 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/themeRef.native.cjs +1 -5
- package/dist/cjs/helpers/themeRef.native.js +1 -5
- package/dist/cjs/helpers/themeRef.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +26 -11
- package/dist/cjs/helpers/themes.native.cjs +26 -11
- package/dist/cjs/helpers/themes.native.js +26 -11
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/helpers/tokenCategories.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +1 -1
- package/dist/cjs/helpers/variables.native.cjs +4 -8
- package/dist/cjs/helpers/variables.native.js +4 -8
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.js +6 -0
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
- package/dist/cjs/hooks/useComponentState.native.js +1 -5
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +27 -34
- package/dist/cjs/hooks/useMedia.native.cjs +45 -51
- package/dist/cjs/hooks/useMedia.native.js +45 -51
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +37 -47
- package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
- package/dist/cjs/hooks/useThemeState.native.js +44 -50
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/index.native.cjs +7 -0
- package/dist/cjs/index.native.js +7 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +22 -0
- package/dist/cjs/internal-runtime.native.cjs +22 -0
- package/dist/cjs/internal-runtime.native.js +22 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.native.cjs +2 -9
- package/dist/cjs/static-resolve.native.js +2 -9
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +1 -1
- package/dist/cjs/style.native.cjs +4 -7
- package/dist/cjs/style.native.js +4 -7
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +10 -17
- package/dist/cjs/views/Theme.native.cjs +9 -11
- package/dist/cjs/views/Theme.native.js +9 -11
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/_withNativeStyle.mjs +4 -1
- package/dist/esm/_withNativeStyle.mjs.map +1 -1
- package/dist/esm/_withNativeStyle.native.js +4 -1
- package/dist/esm/_withNativeStyle.native.js.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -5
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +6 -3
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +7 -5
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +9 -9
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +16 -9
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +45 -42
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +93 -82
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +33 -15
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +34 -20
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +1 -5
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +1 -5
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +2 -6
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +87 -329
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/html.native.js +53 -2
- package/dist/esm/dom/html.native.js.map +1 -1
- package/dist/esm/dom/htmlReset.mjs +6 -0
- package/dist/esm/dom/htmlReset.mjs.map +1 -0
- package/dist/esm/dom/htmlReset.native.js +6 -0
- package/dist/esm/dom/htmlReset.native.js.map +1 -0
- package/dist/esm/dom/htmlRuntime.native.js +4 -0
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
- package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
- package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
- package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/esm/dom/primitives.native.js +81 -34
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +10 -4
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +52 -16
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
- package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
- package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
- package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/esm/helpers/configVariables.native.js +2 -6
- package/dist/esm/helpers/configVariables.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +14 -10
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +4 -4
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +1 -5
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +41 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -3
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +15 -3
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +14 -8
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/fluid.mjs +36 -0
- package/dist/esm/helpers/fluid.mjs.map +1 -0
- package/dist/esm/helpers/fluid.native.js +36 -0
- package/dist/esm/helpers/fluid.native.js.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +364 -150
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +588 -188
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +6 -14
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +32 -22
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +11 -4
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -4
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +1 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.mjs +18 -21
- package/dist/esm/helpers/mergeProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +20 -23
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeTextMetrics.mjs +55 -0
- package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/esm/helpers/normalizeColor.native.js +17 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
- package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
- package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
- package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
- package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/esm/helpers/resolveRem.native.js +18 -21
- package/dist/esm/helpers/resolveRem.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +102 -0
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
- package/dist/esm/helpers/resolveSizing.native.js +109 -0
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
- package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
- package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +20 -1
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +20 -1
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +5 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +8 -7
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/themeRef.native.js +1 -5
- package/dist/esm/helpers/themeRef.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +20 -11
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +20 -11
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/tokenCategories.mjs +2 -2
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +2 -2
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +1 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +4 -8
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +6 -1
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -1
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +1 -5
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +27 -34
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +45 -51
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +36 -48
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +44 -50
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/internal-runtime.mjs +22 -3
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +22 -3
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.native.js +2 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +1 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +4 -7
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +15 -14
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +15 -15
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +20 -18
- package/reset.css +11 -0
- package/src/_withNativeStyle.tsx +6 -1
- package/src/config.ts +6 -6
- package/src/contexts/ComponentContext.tsx +8 -0
- package/src/createComponent.tsx +177 -57
- package/src/createStyledHOC.tsx +25 -26
- package/src/createTamagui.ts +47 -28
- package/src/dom/contract.ts +4 -1
- package/src/dom/html.native.tsx +55 -2
- package/src/dom/html.tsx +189 -388
- package/src/dom/htmlReset.ts +15 -0
- package/src/dom/htmlRuntime.native.tsx +5 -0
- package/src/dom/htmlStaticConfig.ts +40 -0
- package/src/dom/primitives.native.tsx +138 -33
- package/src/dom/standalone.ts +2 -1
- package/src/dom/styleTypes.ts +82 -92
- package/src/eventHandling.native.ts +61 -11
- package/src/eventHandling.ts +19 -4
- package/src/helpers/NativeTextBinding.tsx +26 -0
- package/src/helpers/createDesignSystem.ts +24 -8
- package/src/helpers/expandStyle.ts +88 -4
- package/src/helpers/expandStyles.ts +6 -11
- package/src/helpers/fluid.ts +66 -0
- package/src/helpers/getCSSStylesAtomic.ts +11 -6
- package/src/helpers/getSplitStyles.tsx +1032 -296
- package/src/helpers/getThemeCSSRules.ts +73 -35
- package/src/helpers/grammarConfig.ts +23 -8
- package/src/helpers/insertStyleRule.tsx +14 -8
- package/src/helpers/mainThreadPressEvents.native.ts +65 -141
- package/src/helpers/mergeProps.ts +29 -62
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeTextMetrics.ts +77 -0
- package/src/helpers/normalizeColor.native.ts +29 -4
- package/src/helpers/normalizeValueWithProperty.ts +2 -1
- package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
- package/src/helpers/proxyThemeToParents.ts +13 -2
- package/src/helpers/resolveNativeUnits.native.ts +247 -0
- package/src/helpers/resolveNativeUnits.ts +10 -0
- package/src/helpers/resolveRem.native.ts +25 -26
- package/src/helpers/resolveSizing.ts +167 -0
- package/src/helpers/resolveVariableValue.ts +21 -17
- package/src/helpers/skipProps.ts +0 -1
- package/src/helpers/styleFrontend.ts +39 -0
- package/src/helpers/styleProvenance.ts +1 -1
- package/src/helpers/styleStaticConfigCore.ts +15 -4
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +16 -7
- package/src/helpers/themes.ts +27 -11
- package/src/helpers/tokenCategories.ts +15 -3
- package/src/helpers/variables.ts +2 -2
- package/src/helpers/warnOnce.ts +6 -0
- package/src/helpers/webPropsToSkip.native.ts +9 -3
- package/src/helpers/wrapStyleTags.tsx +4 -1
- package/src/hooks/useMedia.tsx +36 -47
- package/src/hooks/useSplitStyles.tsx +4 -1
- package/src/hooks/useThemeState.ts +69 -74
- package/src/index.ts +13 -0
- package/src/interfaces/RNExclusiveTypes.ts +1 -3
- package/src/internal-runtime.ts +43 -2
- package/src/style.ts +4 -1
- package/src/styled.tsx +34 -3
- package/src/types.tsx +412 -132
- package/src/views/Theme.tsx +18 -21
- package/src/views/ThemeDebug.tsx +1 -1
- package/src/views/ThemeUpdate.tsx +1 -1
- package/types/_withNativeStyle.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +1 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +5 -2
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/dom/contract.d.ts +4 -1
- package/types/dom/contract.d.ts.map +1 -1
- package/types/dom/html.d.ts +60 -51
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/html.native.d.ts.map +1 -1
- package/types/dom/htmlReset.d.ts +10 -0
- package/types/dom/htmlReset.d.ts.map +1 -0
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/htmlStaticConfig.d.ts +22 -0
- package/types/dom/htmlStaticConfig.d.ts.map +1 -0
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/dom/standalone.d.ts +2 -1
- package/types/dom/standalone.d.ts.map +1 -1
- package/types/dom/styleTypes.d.ts +63 -84
- package/types/dom/styleTypes.d.ts.map +1 -1
- package/types/eventHandling.d.ts +12 -4
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/NativeTextBinding.d.ts +11 -0
- package/types/helpers/NativeTextBinding.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/fluid.d.ts +21 -0
- package/types/helpers/fluid.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +1 -15
- package/types/helpers/mergeProps.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeTextMetrics.d.ts +16 -0
- package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
- package/types/helpers/normalizeColor.native.d.ts +4 -1
- package/types/helpers/normalizeColor.native.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.native.d.ts +3 -1
- package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
- package/types/helpers/parseNativeStyle.d.ts.map +1 -0
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/resolveNativeUnits.d.ts +6 -0
- package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
- package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
- package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
- package/types/helpers/resolveRem.native.d.ts +6 -4
- package/types/helpers/resolveRem.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts +90 -0
- package/types/helpers/resolveSizing.d.ts.map +1 -0
- package/types/helpers/resolveVariableValue.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +0 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +21 -0
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleProvenance.d.ts +1 -1
- package/types/helpers/styleProvenance.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts +1 -0
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +6 -2
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +5 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
- package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +12 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +7 -4
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +258 -102
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/dist/cjs/helpers/timer.native.js.map +0 -1
- package/dist/esm/helpers/timer.mjs +0 -13
- package/dist/esm/helpers/timer.mjs.map +0 -1
- package/dist/esm/helpers/timer.native.js +0 -13
- package/dist/esm/helpers/timer.native.js.map +0 -1
- package/src/helpers/timer.ts +0 -9
- package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
- package/types/helpers/timer.d.ts +0 -2
- package/types/helpers/timer.d.ts.map +0 -1
package/src/dom/styleTypes.ts
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import type { Properties } from 'csstype'
|
|
2
2
|
|
|
3
|
+
export type UnprefixedCSSProperties<Length = string | number> = Omit<
|
|
4
|
+
Properties<Length>,
|
|
5
|
+
`${'Webkit' | 'Moz' | 'ms'}${string}`
|
|
6
|
+
>
|
|
7
|
+
|
|
3
8
|
/**
|
|
4
|
-
* The style grammar `style()` accepts
|
|
9
|
+
* The web style contract: the style grammar `style()` accepts and the surface
|
|
10
|
+
* every `html.*` tag is typed against, owned by Tamagui rather than borrowed
|
|
5
11
|
* from react-native.
|
|
6
12
|
*
|
|
7
13
|
* `@tamagui/core/dom` is the one entry that must typecheck in a project with no
|
|
8
14
|
* react-native installed, so nothing here may reference it. The regular
|
|
9
|
-
* `View`/`Text` props
|
|
10
|
-
*
|
|
11
|
-
*
|
|
15
|
+
* `View`/`Text` props combine react-native's style types with the canonical CSS
|
|
16
|
+
* properties (see `StackStyleBase` / `TextStylePropsBase` in `../types`). This
|
|
17
|
+
* entry uses the same CSS properties with its own native-free overrides.
|
|
12
18
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* The react-native-only keys (`elevation`, `marginHorizontal`,
|
|
20
|
+
* `marginVertical`, `paddingHorizontal`, `paddingVertical`, the `shadow*`
|
|
21
|
+
* longhands, `textAlignVertical`, `includeFontPadding`, `writingDirection`)
|
|
22
|
+
* are absent here rather than deprecated: on web their replacements
|
|
23
|
+
* (`boxShadow`, the logical box props, `direction`, `verticalAlign`) are the
|
|
24
|
+
* contract. `styleTypes.test-d.ts` holds this to that: it runs where
|
|
25
|
+
* react-native *is* available and asserts, at the type level, that this key
|
|
26
|
+
* set is exactly the key set of `StackStyleBase & TextStylePropsBase` minus
|
|
27
|
+
* those keys, and that every value the regular props accept is accepted here
|
|
28
|
+
* too.
|
|
19
29
|
*
|
|
20
30
|
* Three value forms are deliberately absent, because they only exist at runtime
|
|
21
31
|
* and `style()` is resolved by the compiler:
|
|
@@ -32,16 +42,16 @@ import type { Properties } from 'csstype'
|
|
|
32
42
|
*/
|
|
33
43
|
|
|
34
44
|
/** a length, a percentage, or `auto` — react-native's `DimensionValue` */
|
|
35
|
-
type DimensionValue = number |
|
|
45
|
+
type DimensionValue = number | string | null
|
|
36
46
|
|
|
37
47
|
/** a color: a theme or token name, a CSS color, or a clause like `'a hover:b'` */
|
|
38
|
-
type ColorValue = string
|
|
48
|
+
type ColorValue = string | number | null
|
|
39
49
|
|
|
40
50
|
/**
|
|
41
51
|
* `color` and `outlineColor` also take the theme-value fallbacks, which include
|
|
42
52
|
* a bare number.
|
|
43
53
|
*/
|
|
44
|
-
type ThemeColorValue =
|
|
54
|
+
type ThemeColorValue = ColorValue
|
|
45
55
|
|
|
46
56
|
/** a size token name, a CSS length, or `true` for the token named `true` */
|
|
47
57
|
type SizeValue = number | string | true
|
|
@@ -51,7 +61,7 @@ type SpaceValue = number | string | true
|
|
|
51
61
|
|
|
52
62
|
type FlexAlignType = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
|
|
53
63
|
|
|
54
|
-
type BorderStyleValue = 'solid' | 'dotted' | 'dashed'
|
|
64
|
+
type BorderStyleValue = 'solid' | 'dotted' | 'dashed' | 'none' | 'hidden'
|
|
55
65
|
|
|
56
66
|
type FontVariantValue =
|
|
57
67
|
| 'small-caps'
|
|
@@ -141,15 +151,16 @@ interface TransformFunctions {
|
|
|
141
151
|
scale: number
|
|
142
152
|
scaleX: number
|
|
143
153
|
scaleY: number
|
|
144
|
-
|
|
145
|
-
|
|
154
|
+
translate: readonly [number | string, number | string]
|
|
155
|
+
translateX: number | string
|
|
156
|
+
translateY: number | string
|
|
146
157
|
skewX: string
|
|
147
158
|
skewY: string
|
|
148
|
-
matrix: number[]
|
|
159
|
+
matrix: readonly number[]
|
|
149
160
|
}
|
|
150
161
|
|
|
151
162
|
type TransformFunction = {
|
|
152
|
-
[K in keyof TransformFunctions]: Pick<TransformFunctions, K
|
|
163
|
+
[K in keyof TransformFunctions]: Partial<Pick<TransformFunctions, K>> &
|
|
153
164
|
Partial<Record<Exclude<keyof TransformFunctions, K>, undefined>>
|
|
154
165
|
}[keyof TransformFunctions]
|
|
155
166
|
|
|
@@ -184,7 +195,17 @@ interface LayoutStyle {
|
|
|
184
195
|
columnGap?: number | string
|
|
185
196
|
direction?: 'inherit' | 'ltr' | 'rtl'
|
|
186
197
|
/** extends react-native's `display` with the web values */
|
|
187
|
-
display?:
|
|
198
|
+
display?:
|
|
199
|
+
| 'inherit'
|
|
200
|
+
| 'none'
|
|
201
|
+
| 'inline'
|
|
202
|
+
| 'block'
|
|
203
|
+
| 'inline-block'
|
|
204
|
+
| 'contents'
|
|
205
|
+
| 'flex'
|
|
206
|
+
| 'inline-flex'
|
|
207
|
+
| 'grid'
|
|
208
|
+
| 'inline-grid'
|
|
188
209
|
end?: DimensionValue
|
|
189
210
|
flex?: number
|
|
190
211
|
flexBasis?: DimensionValue
|
|
@@ -205,26 +226,22 @@ interface LayoutStyle {
|
|
|
205
226
|
margin?: DimensionValue
|
|
206
227
|
marginBottom?: DimensionValue
|
|
207
228
|
marginEnd?: DimensionValue
|
|
208
|
-
marginHorizontal?: DimensionValue
|
|
209
229
|
marginLeft?: DimensionValue
|
|
210
230
|
marginRight?: DimensionValue
|
|
211
231
|
marginStart?: DimensionValue
|
|
212
232
|
marginTop?: DimensionValue
|
|
213
|
-
marginVertical?: DimensionValue
|
|
214
233
|
maxHeight?: DimensionValue
|
|
215
234
|
maxWidth?: DimensionValue
|
|
216
235
|
minHeight?: DimensionValue
|
|
217
236
|
minWidth?: DimensionValue
|
|
218
|
-
overflow?: 'visible' | 'hidden' | 'scroll'
|
|
237
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto' | 'clip'
|
|
219
238
|
padding?: DimensionValue
|
|
220
239
|
paddingBottom?: DimensionValue
|
|
221
240
|
paddingEnd?: DimensionValue
|
|
222
|
-
paddingHorizontal?: DimensionValue
|
|
223
241
|
paddingLeft?: DimensionValue
|
|
224
242
|
paddingRight?: DimensionValue
|
|
225
243
|
paddingStart?: DimensionValue
|
|
226
244
|
paddingTop?: DimensionValue
|
|
227
|
-
paddingVertical?: DimensionValue
|
|
228
245
|
/** extends react-native's `position` with the web values */
|
|
229
246
|
position?: 'absolute' | 'relative' | 'fixed' | 'static' | 'sticky'
|
|
230
247
|
right?: DimensionValue
|
|
@@ -349,7 +366,6 @@ interface PaintStyle {
|
|
|
349
366
|
boxShadow?: ShorthandString
|
|
350
367
|
caretColor?: Properties['caretColor']
|
|
351
368
|
clipPath?: Properties['clipPath']
|
|
352
|
-
elevation?: number
|
|
353
369
|
experimental_backgroundImage?: string | readonly BackgroundImageValue[]
|
|
354
370
|
experimental_backgroundSize?: string | readonly BackgroundSizeValue[]
|
|
355
371
|
experimental_backgroundPosition?: string | readonly RadialGradientPosition[]
|
|
@@ -375,10 +391,6 @@ interface PaintStyle {
|
|
|
375
391
|
| 'luminosity'
|
|
376
392
|
| 'plus-lighter'
|
|
377
393
|
opacity?: number
|
|
378
|
-
shadowColor?: ColorValue
|
|
379
|
-
shadowOffset?: Readonly<{ width: number; height: number }>
|
|
380
|
-
shadowOpacity?: number
|
|
381
|
-
shadowRadius?: number
|
|
382
394
|
visibility?: Properties['visibility']
|
|
383
395
|
}
|
|
384
396
|
|
|
@@ -432,7 +444,8 @@ interface TextStyle {
|
|
|
432
444
|
fontFamily?: string
|
|
433
445
|
fontSize?: number
|
|
434
446
|
fontStyle?: 'normal' | 'italic'
|
|
435
|
-
|
|
447
|
+
// readonly so an `as const` style literal still assigns (#2787)
|
|
448
|
+
fontVariant?: readonly FontVariantValue[]
|
|
436
449
|
fontWeight?:
|
|
437
450
|
| 'normal'
|
|
438
451
|
| 'bold'
|
|
@@ -464,17 +477,15 @@ interface TextStyle {
|
|
|
464
477
|
| 'condensed'
|
|
465
478
|
| 'heavy'
|
|
466
479
|
| 'black'
|
|
467
|
-
includeFontPadding?: boolean
|
|
468
480
|
letterSpacing?: number
|
|
469
|
-
lineHeight?: number
|
|
481
|
+
lineHeight?: number | Px | `${number}`
|
|
470
482
|
numberOfLines?: number
|
|
471
|
-
textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify'
|
|
472
|
-
textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center'
|
|
483
|
+
textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | 'start' | 'end'
|
|
473
484
|
textDecoration?: ShorthandString
|
|
474
485
|
textDecorationColor?: ColorValue
|
|
475
486
|
textDecorationDistance?: number
|
|
476
487
|
textDecorationLine?: 'none' | 'underline' | 'line-through' | 'underline line-through'
|
|
477
|
-
textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed'
|
|
488
|
+
textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy'
|
|
478
489
|
textEmphasis?: Properties['textEmphasis']
|
|
479
490
|
textOverflow?: Properties['textOverflow']
|
|
480
491
|
textShadow?: ShorthandString
|
|
@@ -486,7 +497,6 @@ interface TextStyle {
|
|
|
486
497
|
verticalAlign?: Properties['verticalAlign']
|
|
487
498
|
whiteSpace?: Properties['whiteSpace']
|
|
488
499
|
wordWrap?: Properties['wordWrap']
|
|
489
|
-
writingDirection?: 'auto' | 'ltr' | 'rtl'
|
|
490
500
|
}
|
|
491
501
|
|
|
492
502
|
/**
|
|
@@ -505,7 +515,7 @@ interface TransformStyle {
|
|
|
505
515
|
scaleY?: number
|
|
506
516
|
skewX?: string
|
|
507
517
|
skewY?: string
|
|
508
|
-
transform?: string | readonly TransformFunction[]
|
|
518
|
+
transform?: string | readonly (TransformFunction | undefined)[]
|
|
509
519
|
transformOrigin?:
|
|
510
520
|
| PxOrPct
|
|
511
521
|
| 'left'
|
|
@@ -516,18 +526,10 @@ interface TransformStyle {
|
|
|
516
526
|
| TwoValueTransformOrigin
|
|
517
527
|
| `${TwoValueTransformOrigin} ${Px}`
|
|
518
528
|
transformStyle?: Properties['transformStyle']
|
|
519
|
-
/** maps to `translateX
|
|
520
|
-
x?: number
|
|
521
|
-
/** maps to `translateY
|
|
522
|
-
y?: number
|
|
523
|
-
/** @deprecated use `matrix` in `transform` */
|
|
524
|
-
transformMatrix?: number[]
|
|
525
|
-
/** @deprecated use `rotate` */
|
|
526
|
-
rotation?: number
|
|
527
|
-
/** @deprecated use `x` */
|
|
528
|
-
translateX?: number
|
|
529
|
-
/** @deprecated use `y` */
|
|
530
|
-
translateY?: number
|
|
529
|
+
/** maps to `translateX`; a percent string is relative to the element's own width */
|
|
530
|
+
x?: number | `${number}%`
|
|
531
|
+
/** maps to `translateY`; a percent string is relative to the element's own height */
|
|
532
|
+
y?: number | `${number}%`
|
|
531
533
|
}
|
|
532
534
|
|
|
533
535
|
/**
|
|
@@ -551,58 +553,41 @@ interface WebStyle {
|
|
|
551
553
|
userSelect?: Properties['userSelect']
|
|
552
554
|
}
|
|
553
555
|
|
|
556
|
+
/** low-level spring physics, for porting an already-tuned config */
|
|
554
557
|
type TransitionSpringConfig = {
|
|
555
558
|
stiffness?: number
|
|
556
559
|
damping?: number
|
|
557
560
|
mass?: number
|
|
558
|
-
tension?: number
|
|
559
|
-
friction?: number
|
|
560
561
|
velocity?: number
|
|
561
562
|
overshootClamping?: boolean
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
speed?: number
|
|
563
|
+
restDisplacementThreshold?: number
|
|
564
|
+
restSpeedThreshold?: number
|
|
565
565
|
}
|
|
566
566
|
|
|
567
|
-
/**
|
|
567
|
+
/**
|
|
568
|
+
* A configured driver animation name, or a CSS transition string like `'200ms'`,
|
|
569
|
+
* `'200ms ease-out'`, or `'opacity 150ms, transform spring(300ms, 0.4)'`.
|
|
570
|
+
*/
|
|
568
571
|
type TransitionValue = string
|
|
569
572
|
|
|
573
|
+
type TransitionConfig = {
|
|
574
|
+
preset?: string
|
|
575
|
+
duration?: number | string
|
|
576
|
+
bounce?: number
|
|
577
|
+
easing?: string
|
|
578
|
+
delay?: number | string
|
|
579
|
+
behavior?: 'normal' | 'allow-discrete'
|
|
580
|
+
properties?: string
|
|
581
|
+
spring?: TransitionSpringConfig
|
|
582
|
+
enter?: TransitionProp
|
|
583
|
+
exit?: TransitionProp
|
|
584
|
+
}
|
|
585
|
+
|
|
570
586
|
type TransitionProp =
|
|
571
587
|
| TransitionValue
|
|
572
|
-
| ({
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
exit?: TransitionValue
|
|
576
|
-
delay?: number
|
|
577
|
-
} & TransitionSpringConfig & {
|
|
578
|
-
[key: string]:
|
|
579
|
-
| TransitionValue
|
|
580
|
-
| {
|
|
581
|
-
type: TransitionValue
|
|
582
|
-
[key: string]: any
|
|
583
|
-
}
|
|
584
|
-
| number
|
|
585
|
-
| boolean
|
|
586
|
-
| undefined
|
|
587
|
-
})
|
|
588
|
-
| [
|
|
589
|
-
TransitionValue,
|
|
590
|
-
{
|
|
591
|
-
delay?: number
|
|
592
|
-
enter?: TransitionValue
|
|
593
|
-
exit?: TransitionValue
|
|
594
|
-
} & TransitionSpringConfig & {
|
|
595
|
-
[key: string]:
|
|
596
|
-
| TransitionValue
|
|
597
|
-
| {
|
|
598
|
-
type?: TransitionValue
|
|
599
|
-
[key: string]: any
|
|
600
|
-
}
|
|
601
|
-
| number
|
|
602
|
-
| boolean
|
|
603
|
-
| undefined
|
|
604
|
-
},
|
|
605
|
-
]
|
|
588
|
+
| (TransitionConfig & {
|
|
589
|
+
[property: string]: TransitionValue | TransitionConfig | unknown
|
|
590
|
+
})
|
|
606
591
|
|
|
607
592
|
/**
|
|
608
593
|
* The animation props, which ride along with the style grammar because a
|
|
@@ -610,7 +595,6 @@ type TransitionProp =
|
|
|
610
595
|
*/
|
|
611
596
|
interface AnimationStyle {
|
|
612
597
|
transition?: TransitionProp | null
|
|
613
|
-
animateOnly?: string[]
|
|
614
598
|
animatePresence?: boolean
|
|
615
599
|
onTransition?: (event: {
|
|
616
600
|
phase: 'start' | 'end'
|
|
@@ -621,9 +605,9 @@ interface AnimationStyle {
|
|
|
621
605
|
}
|
|
622
606
|
|
|
623
607
|
/**
|
|
624
|
-
*
|
|
608
|
+
* the owned overrides in the web style grammar.
|
|
625
609
|
*/
|
|
626
|
-
|
|
610
|
+
interface TamaguiStylePropsBase
|
|
627
611
|
extends
|
|
628
612
|
LayoutStyle,
|
|
629
613
|
LogicalStyle,
|
|
@@ -635,3 +619,9 @@ export interface TamaguiStyleProps
|
|
|
635
619
|
TransformStyle,
|
|
636
620
|
WebStyle,
|
|
637
621
|
AnimationStyle {}
|
|
622
|
+
|
|
623
|
+
/** the whole style grammar; container remains a component query prop. */
|
|
624
|
+
export interface TamaguiStyleProps
|
|
625
|
+
extends
|
|
626
|
+
TamaguiStylePropsBase,
|
|
627
|
+
Omit<UnprefixedCSSProperties, keyof TamaguiStylePropsBase | 'container'> {}
|
|
@@ -152,7 +152,46 @@ export function useEvents(
|
|
|
152
152
|
// rngh path - hooks
|
|
153
153
|
const callbacksRef = useRef<any>(isUsingRNGH ? {} : null)
|
|
154
154
|
const gestureRef = useRef<any>(null)
|
|
155
|
+
// pairs pressIn with exactly one pressOut across the Manual observer's
|
|
156
|
+
// touchesDown/touchesUp/touchesCancelled/finalize channels. RNGH can drop a
|
|
157
|
+
// trailing touch event (the handler is re-attached to a new view mid-touch,
|
|
158
|
+
// or cancelled without a touch-cancel), and because the press state lives in
|
|
159
|
+
// the component's own state a dropped release latches the press look with no
|
|
160
|
+
// event left to clear it. Guarding here means a stray duplicate release is a
|
|
161
|
+
// no-op while a missing one is caught by onFinalize / the detach clear below.
|
|
162
|
+
const longPressTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
163
|
+
const longPressedRef = useRef(false)
|
|
164
|
+
const clearLongPress = () => {
|
|
165
|
+
if (longPressTimerRef.current) clearTimeout(longPressTimerRef.current)
|
|
166
|
+
longPressTimerRef.current = null
|
|
167
|
+
}
|
|
168
|
+
React.useEffect(() => clearLongPress, [])
|
|
169
|
+
const pressActiveRef = useRef(false)
|
|
170
|
+
const beginPress = (e?: any) => {
|
|
171
|
+
if (pressActiveRef.current) return
|
|
172
|
+
pressActiveRef.current = true
|
|
173
|
+
if (isInsideNativeMenu) {
|
|
174
|
+
clearLongPress()
|
|
175
|
+
longPressedRef.current = false
|
|
176
|
+
if (callbacksRef.current.onLongPress) {
|
|
177
|
+
longPressTimerRef.current = setTimeout(() => {
|
|
178
|
+
longPressTimerRef.current = null
|
|
179
|
+
longPressedRef.current = true
|
|
180
|
+
callbacksRef.current.onLongPress?.(e ?? {})
|
|
181
|
+
}, callbacksRef.current.delayLongPress ?? 500)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
callbacksRef.current.onPressIn?.(e ?? {})
|
|
185
|
+
}
|
|
186
|
+
const endPress = (e?: any, firePress = false) => {
|
|
187
|
+
clearLongPress()
|
|
188
|
+
if (!pressActiveRef.current) return
|
|
189
|
+
pressActiveRef.current = false
|
|
190
|
+
if (firePress && !longPressedRef.current) callbacksRef.current.onPress?.(e ?? {})
|
|
191
|
+
callbacksRef.current.onPressOut?.(e ?? {})
|
|
192
|
+
}
|
|
155
193
|
|
|
194
|
+
// native menu triggers leave responder ownership to the adapter.
|
|
156
195
|
// Real press handlers use the responder system for delivery even when RNGH
|
|
157
196
|
// is configured. RNGH Tap begin/end ordering is not stable enough for
|
|
158
197
|
// nested Tamagui press arbitration, and Fabric can mount a stale Tap that
|
|
@@ -164,9 +203,9 @@ export function useEvents(
|
|
|
164
203
|
// freezes Android — see top-of-file isAndroid comment). Hook is called
|
|
165
204
|
// unconditionally here for stable hooks order; useMainThreadPressEvents
|
|
166
205
|
// no-ops when enabled is false.
|
|
167
|
-
const useResponderFallback =
|
|
168
|
-
!isInsideNativeMenu &&
|
|
169
|
-
|
|
206
|
+
const useResponderFallback = Boolean(
|
|
207
|
+
!isInsideNativeMenu && (hasRealPressEvents || (getIsAndroid() && hasPressEvents))
|
|
208
|
+
)
|
|
170
209
|
useMainThreadPressEvents(events, viewProps, useResponderFallback, debugName)
|
|
171
210
|
|
|
172
211
|
if (everEnabled) {
|
|
@@ -177,6 +216,7 @@ export function useEvents(
|
|
|
177
216
|
onPressOut: events.onPressOut,
|
|
178
217
|
onPress: events.onPress,
|
|
179
218
|
onLongPress: events.onLongPress,
|
|
219
|
+
delayLongPress: events.delayLongPress,
|
|
180
220
|
}
|
|
181
221
|
: {}
|
|
182
222
|
|
|
@@ -184,6 +224,10 @@ export function useEvents(
|
|
|
184
224
|
// Real handlers are delivered by useMainThreadPressEvents above. Clear
|
|
185
225
|
// any cached press-clause observer from an earlier render so it cannot
|
|
186
226
|
// double-fire after onPress appears dynamically.
|
|
227
|
+
// No observer will run for this component after the swap, so an
|
|
228
|
+
// in-flight press from that observer is definitionally orphaned —
|
|
229
|
+
// release it before dropping the gesture.
|
|
230
|
+
endPress()
|
|
187
231
|
gestureRef.current = null
|
|
188
232
|
return null
|
|
189
233
|
}
|
|
@@ -200,14 +244,16 @@ export function useEvents(
|
|
|
200
244
|
.runOnJS(true)
|
|
201
245
|
.manualActivation(true)
|
|
202
246
|
.onTouchesDown(() => {
|
|
203
|
-
|
|
247
|
+
beginPress()
|
|
204
248
|
})
|
|
205
249
|
.onTouchesUp(() => {
|
|
206
|
-
|
|
207
|
-
callbacksRef.current.onPressOut?.({})
|
|
250
|
+
endPress(undefined, true)
|
|
208
251
|
})
|
|
209
252
|
.onTouchesCancelled(() => {
|
|
210
|
-
|
|
253
|
+
endPress()
|
|
254
|
+
})
|
|
255
|
+
.onFinalize(() => {
|
|
256
|
+
endPress()
|
|
211
257
|
})
|
|
212
258
|
gestureRef.current = manual
|
|
213
259
|
} else if (!getIsAndroid()) {
|
|
@@ -222,15 +268,19 @@ export function useEvents(
|
|
|
222
268
|
//
|
|
223
269
|
// Android: skipped — see isAndroid comment at top. Synthesized
|
|
224
270
|
// press-clause handlers fall through to viewProps responder events.
|
|
271
|
+
//
|
|
272
|
+
// onFinalize is the safety net for a release RNGH never delivers as a
|
|
273
|
+
// touch event (handler cancelled/failed without a touch-cancel): it
|
|
274
|
+
// fires on the gesture's own end/cancel and clears the latch.
|
|
225
275
|
gestureRef.current = Gesture.Manual()
|
|
226
276
|
.runOnJS(true)
|
|
227
277
|
.manualActivation(true)
|
|
228
|
-
.onTouchesDown((e: any) =>
|
|
278
|
+
.onTouchesDown((e: any) => beginPress(e))
|
|
229
279
|
.onTouchesUp((e: any) => {
|
|
230
|
-
|
|
231
|
-
callbacksRef.current.onPressOut?.(e)
|
|
280
|
+
endPress(e, true)
|
|
232
281
|
})
|
|
233
|
-
.onTouchesCancelled((e: any) =>
|
|
282
|
+
.onTouchesCancelled((e: any) => endPress(e))
|
|
283
|
+
.onFinalize(() => endPress())
|
|
234
284
|
}
|
|
235
285
|
}
|
|
236
286
|
// TODO update viewProps.hitSlop / events.delayLongPress!
|
package/src/eventHandling.ts
CHANGED
|
@@ -7,15 +7,30 @@ import type { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents
|
|
|
7
7
|
type EventKeys = keyof TamaguiComponentEvents
|
|
8
8
|
type EventLikeObject = { [key in EventKeys]?: any }
|
|
9
9
|
|
|
10
|
+
// a tap on a touch screen fires touchstart and touchend, then the browser's
|
|
11
|
+
// compatibility mousedown and mouseup for the same tap. press in and press out
|
|
12
|
+
// listen to both so a mouse presses too, so without this every press-in and
|
|
13
|
+
// press-out handler ran twice per tap (a toggle opened and closed again).
|
|
14
|
+
let lastTouch = -1e9
|
|
15
|
+
|
|
16
|
+
// a mouse event within a second of a touch is that compatibility echo
|
|
17
|
+
const pressFrom = (touch: boolean, handler?: (e: { timeStamp: number }) => void) =>
|
|
18
|
+
handler &&
|
|
19
|
+
((e: { timeStamp: number }) => {
|
|
20
|
+
if (touch) lastTouch = e.timeStamp
|
|
21
|
+
else if (e.timeStamp - lastTouch < 1000) return
|
|
22
|
+
handler(e)
|
|
23
|
+
})
|
|
24
|
+
|
|
10
25
|
export function getWebEvents<E extends EventLikeObject>(events: E, webStyle = true) {
|
|
11
26
|
return {
|
|
12
27
|
onMouseEnter: events.onMouseEnter,
|
|
13
28
|
onMouseLeave: events.onMouseLeave,
|
|
14
29
|
[webStyle ? 'onClick' : 'onPress']: events.onPress,
|
|
15
|
-
onMouseDown: events.onPressIn,
|
|
16
|
-
onMouseUp: events.onPressOut,
|
|
17
|
-
onTouchStart: events.onPressIn,
|
|
18
|
-
onTouchEnd: events.onPressOut,
|
|
30
|
+
onMouseDown: pressFrom(false, events.onPressIn),
|
|
31
|
+
onMouseUp: pressFrom(false, events.onPressOut),
|
|
32
|
+
onTouchStart: pressFrom(true, events.onPressIn),
|
|
33
|
+
onTouchEnd: pressFrom(true, events.onPressOut),
|
|
19
34
|
onFocus: events.onFocus,
|
|
20
35
|
onBlur: events.onBlur,
|
|
21
36
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createElement, type ReactElement } from 'react'
|
|
2
|
+
import type { AnimationDriverLike } from '../types'
|
|
3
|
+
import type { AnimatedTextChannel, NativeTextMetrics } from './nativeTextMetrics'
|
|
4
|
+
|
|
5
|
+
// only inherited animated text mounts this hook boundary; ordinary text keeps its host.
|
|
6
|
+
export function NativeTextBinding({
|
|
7
|
+
element,
|
|
8
|
+
useTextMetrics,
|
|
9
|
+
inheritedText,
|
|
10
|
+
lineHeight,
|
|
11
|
+
isInput,
|
|
12
|
+
}: {
|
|
13
|
+
element: ReactElement<any>
|
|
14
|
+
useTextMetrics: NonNullable<AnimationDriverLike['useTextMetrics']>
|
|
15
|
+
inheritedText: AnimatedTextChannel
|
|
16
|
+
lineHeight: NativeTextMetrics['lineHeight']
|
|
17
|
+
isInput?: boolean
|
|
18
|
+
}) {
|
|
19
|
+
const binding = useTextMetrics({ inheritedText, lineHeight })
|
|
20
|
+
if (!binding.style) return element
|
|
21
|
+
const Host = isInput ? binding.TextInput : binding.Text
|
|
22
|
+
return createElement(Host, {
|
|
23
|
+
...element.props,
|
|
24
|
+
style: [element.props.style, binding.style],
|
|
25
|
+
})
|
|
26
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
variableToCSS,
|
|
8
8
|
} from './registerCSSVariable'
|
|
9
9
|
import { getConfigMaybe } from '../config'
|
|
10
|
+
import { htmlResetCSS } from '../dom/htmlReset'
|
|
10
11
|
import { getThemeCSSRules } from './getThemeCSSRules'
|
|
11
12
|
import { getAllRules, wrapStyleRules } from './insertStyleRule'
|
|
12
13
|
|
|
@@ -95,10 +96,13 @@ export function buildCSSRuleSets(
|
|
|
95
96
|
): string[] {
|
|
96
97
|
if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
|
|
97
98
|
const cssRuleSets: string[] = []
|
|
98
|
-
const
|
|
99
|
+
const developmentWhitespace = process.env.NODE_ENV === 'development'
|
|
100
|
+
const sep = developmentWhitespace ? ' ' : ''
|
|
99
101
|
|
|
100
102
|
function declarationsToRuleSet(decs: string[], selector = '') {
|
|
101
|
-
return `:root${selector}
|
|
103
|
+
return `:root${selector}${sep}{${sep}${[...decs].join(`;${sep}`)}${
|
|
104
|
+
developmentWhitespace ? '\n' : ''
|
|
105
|
+
}}`
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
// non-font tokens
|
|
@@ -129,7 +133,7 @@ export function buildCSSRuleSets(
|
|
|
129
133
|
// These are defaults, so an atomic style prop must be able to override
|
|
130
134
|
// them regardless of stylesheet insertion order.
|
|
131
135
|
const sharedSelectors = `:where(${[...fontSelectors, '.is_View'].join(', ')})`
|
|
132
|
-
cssRuleSets.push(`${sharedSelectors}
|
|
136
|
+
cssRuleSets.push(`${sharedSelectors}${sep}{font-family:${sep}var(--f-family)}`)
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
|
|
@@ -233,18 +237,30 @@ const getStaticCSS = (
|
|
|
233
237
|
._hsb-y::-webkit-scrollbar:vertical { display: none !important; }
|
|
234
238
|
._hsb-x { scrollbar-width: none !important; }
|
|
235
239
|
._hsb-y { scrollbar-width: none !important; }`
|
|
236
|
-
const pointerEventsCSS = `:
|
|
237
|
-
:
|
|
240
|
+
const pointerEventsCSS = `:where(._pe-boxonly)>* {pointer-events:none;}
|
|
241
|
+
:where(._pe-boxnone)>* {pointer-events:auto;}`
|
|
238
242
|
|
|
239
|
-
const
|
|
240
|
-
.t_unmounted .is_View, .t_unmounted .is_Text { transition: none !important; }
|
|
243
|
+
const baseDesignSystem = `._ovs-contain {overscroll-behavior:contain;}
|
|
244
|
+
.t_unmounted .is_View, .t_unmounted .is_Text, .t_unmounted .is_DOM { transition: none !important; }
|
|
241
245
|
:where(.is_View) { display: flex; align-items: stretch; flex-direction: column; flex-basis: auto; box-sizing: border-box; min-height: 0; min-width: 0; flex-shrink: 0; }
|
|
242
246
|
:where(.is_Text) { display: inline; box-sizing: border-box; word-wrap: break-word; white-space: pre-wrap; margin: 0; }
|
|
247
|
+
${htmlResetCSS}
|
|
243
248
|
@scope (.is_Text) to (.is_View) { :where(.is_Text) { white-space: inherit; word-wrap: inherit; } }
|
|
244
249
|
._dsp_contents {display:contents;}
|
|
245
250
|
._no_backdrop::backdrop {display: none;}
|
|
246
251
|
${pointerEventsCSS}
|
|
247
|
-
${hideScrollBarsCSS}
|
|
252
|
+
${hideScrollBarsCSS}`
|
|
253
|
+
const designSystem = `${
|
|
254
|
+
process.env.NODE_ENV === 'production'
|
|
255
|
+
? baseDesignSystem
|
|
256
|
+
.replaceAll(' {', '{')
|
|
257
|
+
.replaceAll('{ ', '{')
|
|
258
|
+
.replaceAll(': ', ':')
|
|
259
|
+
.replaceAll('; ', ';')
|
|
260
|
+
.replaceAll(';}', '}')
|
|
261
|
+
.replaceAll('\n', '')
|
|
262
|
+
: baseDesignSystem
|
|
263
|
+
}
|
|
248
264
|
${autoVarCSS}
|
|
249
265
|
${themeConfig.cssRuleSets.join(separator)}`
|
|
250
266
|
|