@tamagui/core 1.0.1-beta.21 → 1.0.1-beta.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +16 -12
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +80 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +34 -21
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +17 -24
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/{helpers/nativeGestureHandler.js → constants/isDevTools.js} +8 -8
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +32 -16
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/platform.native.js +62 -0
- package/dist/cjs/constants/platform.native.js.map +7 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +1 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/contexts/TextAncestorContext.js +30 -0
- package/dist/cjs/contexts/TextAncestorContext.js.map +7 -0
- package/dist/cjs/{ThemeContext.js → contexts/ThemeContext.js} +1 -0
- package/dist/cjs/contexts/ThemeContext.js.map +7 -0
- package/dist/cjs/createComponent.js +878 -509
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +5 -8
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js +1 -2
- package/dist/cjs/createShorthands.js.map +2 -2
- package/dist/cjs/createTamagui.js +134 -184
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +4 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +5 -25
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +51 -28
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +52 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/{ThemeManager.js → helpers/ThemeManager.js} +55 -60
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +3 -3
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +188 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +30 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/cache.js +43 -0
- package/dist/cjs/helpers/cache.js.map +7 -0
- package/dist/cjs/helpers/calc.js +71 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +26 -12
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +272 -122
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createProxy.js +43 -0
- package/dist/cjs/helpers/createProxy.js.map +7 -0
- package/dist/cjs/helpers/expandStyle.js +90 -0
- package/dist/cjs/helpers/expandStyle.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +115 -0
- package/dist/cjs/helpers/expandStyles.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +48 -37
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +3 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.js +32 -0
- package/dist/cjs/helpers/getAnimationDriver.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -5
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/{getTextSize.js → getFont.js} +22 -12
- package/dist/cjs/helpers/getFont.js.map +7 -0
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +19 -10
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +557 -213
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +19 -38
- package/dist/cjs/helpers/getStackSize.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +177 -131
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +103 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/{nativeGestureHandler.native.js → helpers/getThemeCSSRules.native.js} +18 -5
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +89 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +94 -51
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +2 -2
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +37 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/cjs/helpers/isTamaguiElement.js +5 -5
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -6
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +6 -3
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +54 -0
- package/dist/cjs/helpers/mergeProps.js.map +7 -0
- package/dist/cjs/helpers/mergeTransform.js +42 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/normalizeColor.js +80 -0
- package/dist/cjs/helpers/normalizeColor.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +123 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +4 -4
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +42 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/helpers/registerCSSVariable.js +40 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
- package/dist/cjs/helpers/{wrapThemeManagerContext.js → startTransition.js} +12 -15
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -40
- package/dist/cjs/helpers/themeable.js.map +3 -3
- package/dist/cjs/helpers/themes.js +79 -0
- package/dist/cjs/helpers/themes.js.map +7 -0
- package/dist/cjs/helpers/useShallowSetState.js +44 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -122
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +3 -3
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +37 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -2
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +92 -0
- package/dist/cjs/hooks/useElementLayout.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -33
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +3 -4
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsTouchDevice.js +6 -12
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +166 -123
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +4 -18
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +58 -0
- package/dist/cjs/hooks/useSafeRef.js.map +7 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +168 -134
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useUnmountEffect.js +1 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +49 -26
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/inject-styles.js +40 -0
- package/dist/cjs/inject-styles.js.map +7 -0
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +93 -0
- package/dist/cjs/insertFont.js.map +7 -0
- package/dist/cjs/react-native.js +22 -0
- package/dist/cjs/react-native.js.map +7 -0
- package/dist/cjs/setupReactNative.js +37 -0
- package/dist/cjs/setupReactNative.js.map +7 -0
- package/dist/cjs/static.js +2 -15
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +57 -51
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +2 -2
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/updateTheme.js +47 -0
- package/dist/cjs/updateTheme.js.map +7 -0
- package/dist/cjs/vendor/Pressability.js +32 -0
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/vendor/Pressability.native.js +32 -0
- package/dist/cjs/vendor/Pressability.native.js.map +7 -0
- package/dist/cjs/views/FontLanguage.js +38 -0
- package/dist/cjs/views/FontLanguage.js.map +7 -0
- package/dist/cjs/views/FontLanguage.native.js +38 -0
- package/dist/cjs/views/FontLanguage.native.js.map +7 -0
- package/dist/cjs/{helpers/nativeGestureHandler.native.js → views/FontLanguage.types.js} +4 -5
- package/dist/cjs/views/FontLanguage.types.js.map +7 -0
- package/dist/cjs/views/Slot.js +64 -72
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +86 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +32 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +43 -21
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +25 -25
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +35 -23
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +26 -20
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +11 -12
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +56 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/config.js +44 -0
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +12 -8
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +5 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +25 -12
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/platform.native.js +28 -0
- package/dist/esm/constants/platform.native.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +6 -0
- package/dist/esm/contexts/TextAncestorContext.js.map +7 -0
- package/dist/esm/{ThemeContext.js → contexts/ThemeContext.js} +0 -0
- package/dist/esm/contexts/ThemeContext.js.map +7 -0
- package/dist/esm/createComponent.js +843 -416
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +4 -9
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js +0 -3
- package/dist/esm/createShorthands.js.map +2 -2
- package/dist/esm/createTamagui.js +133 -165
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +3 -3
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +3 -24
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +46 -26
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +28 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/{ThemeManager.js → helpers/ThemeManager.js} +54 -61
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +2 -4
- package/dist/esm/helpers/areEqualSets.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/cache.js +18 -0
- package/dist/esm/helpers/cache.js.map +7 -0
- package/dist/esm/helpers/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +25 -13
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +267 -123
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createProxy.js +19 -0
- package/dist/esm/helpers/createProxy.js.map +7 -0
- package/dist/esm/helpers/expandStyle.js +66 -0
- package/dist/esm/helpers/expandStyle.js.map +7 -0
- package/dist/esm/helpers/expandStyles.js +89 -0
- package/dist/esm/helpers/expandStyles.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +34 -28
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +2 -4
- package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -5
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/{getTextSize.js → getFont.js} +17 -9
- package/dist/esm/helpers/getFont.js.map +7 -0
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getSize.js +16 -10
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +552 -197
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +17 -37
- package/dist/esm/helpers/getStackSize.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +174 -108
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +79 -0
- package/dist/esm/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/esm/helpers/getVariantExtras.js +64 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +89 -49
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +1 -3
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +13 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/esm/helpers/isTamaguiElement.js +4 -6
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -7
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +1 -3
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +30 -0
- package/dist/esm/helpers/mergeProps.js.map +7 -0
- package/dist/esm/helpers/mergeTransform.js +17 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/normalizeColor.js +49 -0
- package/dist/esm/helpers/normalizeColor.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +98 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +3 -5
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +18 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/registerCSSVariable.js +14 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +11 -9
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/themes.js +54 -0
- package/dist/esm/helpers/themes.js.map +7 -0
- package/dist/esm/helpers/useShallowSetState.js +20 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -75
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +2 -4
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/getThemeUnwrapped.js +12 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -4
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +66 -0
- package/dist/esm/hooks/useElementLayout.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -31
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -4
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsTouchDevice.js +5 -13
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +159 -113
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +2 -4
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +34 -0
- package/dist/esm/hooks/useSafeRef.js.map +7 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +161 -111
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useUnmountEffect.js +0 -3
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +44 -18
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/inject-styles.js +16 -0
- package/dist/esm/inject-styles.js.map +7 -0
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +67 -0
- package/dist/esm/insertFont.js.map +7 -0
- package/dist/esm/react-native.js +3 -0
- package/dist/esm/react-native.js.map +7 -0
- package/dist/esm/setupReactNative.js +12 -0
- package/dist/esm/setupReactNative.js.map +7 -0
- package/dist/esm/static.js +1 -15
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +50 -19
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types-rnw.js +0 -0
- package/dist/esm/types-rnw.js.map +0 -0
- package/dist/esm/types.js +0 -0
- package/dist/esm/types.js.map +0 -0
- package/dist/esm/updateTheme.js +23 -0
- package/dist/esm/updateTheme.js.map +7 -0
- package/dist/esm/vendor/Pressability.js +7 -0
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/vendor/Pressability.native.js +7 -0
- package/dist/esm/vendor/Pressability.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.js +14 -0
- package/dist/esm/views/FontLanguage.js.map +7 -0
- package/dist/esm/views/FontLanguage.native.js +14 -0
- package/dist/esm/views/FontLanguage.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.types.js +1 -0
- package/dist/{cjs/defaultComponentState.js.map → esm/views/FontLanguage.types.js.map} +0 -0
- package/dist/esm/views/Slot.js +55 -37
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +0 -0
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +56 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +17 -5
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +35 -19
- package/dist/esm/views/Theme.js.map +3 -3
- package/dist/esm/views/ThemeInverse.js +22 -20
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +28 -21
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +21 -20
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +52 -16
- package/reset.css +25 -4
- package/src/Tamagui.ts +48 -0
- package/src/addTheme.ts +68 -0
- package/src/config.ts +44 -0
- package/src/constants/constants.ts +19 -0
- package/src/constants/isDevTools.ts +6 -0
- package/src/contexts/ButtonInsideButtonContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +3 -0
- package/src/contexts/ThemeContext.tsx +5 -0
- package/src/createComponent.tsx +1460 -0
- package/src/createFont.ts +29 -0
- package/src/createShorthands.ts +7 -0
- package/src/createTamagui.ts +225 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.ts +83 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.tsx +227 -0
- package/src/helpers/areEqualSets.tsx +9 -0
- package/src/helpers/cache.ts +18 -0
- package/src/helpers/createMediaStyle.ts +55 -0
- package/src/helpers/createPropMapper.ts +526 -0
- package/src/helpers/createProxy.ts +16 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +75 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +901 -0
- package/src/helpers/getStylesAtomic.native.ts +3 -0
- package/src/helpers/getStylesAtomic.ts +272 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +105 -0
- package/src/helpers/getVariantExtras.tsx +85 -0
- package/src/helpers/insertStyleRule.tsx +163 -0
- package/src/helpers/isObj.ts +1 -0
- package/src/helpers/isTamaguiComponent.tsx +15 -0
- package/src/helpers/isTamaguiElement.tsx +12 -0
- package/src/helpers/matchMedia.native.ts +6 -0
- package/src/helpers/matchMedia.ts +17 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +16 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +110 -0
- package/src/helpers/proxyThemeVariables.tsx +15 -0
- package/src/helpers/pseudoDescriptors.ts +18 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/themeable.tsx +40 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/useShallowSetState.tsx +19 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +7 -0
- package/src/hooks/useElementLayout.tsx +90 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsTouchDevice.tsx +6 -0
- package/src/hooks/useMedia.tsx +265 -0
- package/src/hooks/useSafeRef.ts +48 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +300 -0
- package/src/index.ts +74 -0
- package/src/inject-styles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/setupReactNative.ts +9 -0
- package/src/static.ts +5 -0
- package/src/styled.tsx +204 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1327 -0
- package/src/updateTheme.ts +23 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +10 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +147 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +60 -0
- package/src/views/Text.tsx +86 -0
- package/src/views/Theme.tsx +72 -0
- package/src/views/ThemeInverse.tsx +33 -0
- package/src/views/ThemeProvider.tsx +63 -0
- package/src/views/ThemeReset.tsx +43 -0
- package/types/Tamagui.d.ts +11 -11
- package/types/addTheme.d.ts +11 -0
- package/types/config.d.ts +47 -0
- package/types/constants/constants.d.ts +15 -4
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/constants/platform.d.ts +7 -6
- package/types/constants/platform.native.d.ts +13 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/contexts/TextAncestorContext.d.ts +3 -0
- package/types/{ThemeContext.d.ts → contexts/ThemeContext.d.ts} +1 -1
- package/types/createComponent.d.ts +16 -14
- package/types/createShorthands.d.ts +2 -1
- package/types/createTamagui.d.ts +2 -17
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -6
- package/types/createVariable.d.ts +24 -12
- package/types/createVariables.d.ts +10 -0
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +45 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/cache.d.ts +12 -0
- package/types/helpers/calc.d.ts +1 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +6 -3
- package/types/helpers/createProxy.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +6 -0
- package/types/helpers/expandStyles.d.ts +26 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getFont.d.ts +3 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getSize.d.ts +3 -2
- package/types/helpers/getSplitStyles.d.ts +15 -12
- package/types/helpers/getStackSize.d.ts +6 -30
- package/types/helpers/getStylesAtomic.d.ts +14 -23
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +5 -0
- package/types/helpers/insertStyleRule.d.ts +8 -4
- package/types/helpers/isTamaguiComponent.d.ts +5 -0
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/mergeProps.d.ts +17 -0
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/normalizeColor.d.ts +3 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +7 -0
- package/types/helpers/pseudoDescriptors.d.ts +16 -0
- package/types/helpers/registerCSSVariable.d.ts +5 -0
- package/types/helpers/startTransition.d.ts +3 -0
- package/types/helpers/themeable.d.ts +4 -7
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/useShallowSetState.d.ts +3 -0
- package/types/helpers/validate.d.ts +0 -3
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useElementLayout.d.ts +27 -0
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useMedia.d.ts +22 -6
- package/types/hooks/useMedia.test.d.ts +1 -0
- package/types/hooks/usePressablePressResponder.d.ts +84 -0
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +22 -32
- package/types/index.d.ts +25 -14
- package/types/inject-styles.d.ts +7 -0
- package/types/injectStyles.d.ts +7 -0
- package/types/insertFont.d.ts +9 -0
- package/types/react-native.d.ts +8 -0
- package/types/setupReactNative.d.ts +3 -0
- package/types/static.d.ts +1 -15
- package/types/styled.d.ts +7 -3
- package/types/types.d.ts +314 -108
- package/types/updateTheme.d.ts +9 -0
- package/types/vendor/Pressability.d.ts +3 -0
- package/types/vendor/Pressability.native.d.ts +3 -0
- package/types/views/AbsoluteFill.d.ts +5 -0
- package/types/views/AbsoluteFill.native.d.ts +3 -0
- package/types/views/FontLanguage.d.ts +4 -0
- package/types/views/FontLanguage.native.d.ts +4 -0
- package/types/views/FontLanguage.types.d.ts +11 -0
- package/types/views/Slot.d.ts +5 -4
- package/types/views/Stack.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Text.d.ts +1 -1
- package/types/views/Theme.d.ts +3 -9
- package/types/views/ThemeInverse.d.ts +4 -8
- package/types/views/ThemeProvider.d.ts +2 -1
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js +0 -46
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/cjs/helpers/createShallowUpdate.js +0 -55
- package/dist/cjs/helpers/createShallowUpdate.js.map +0 -7
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -93
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -53
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/cjs/helpers/getButtonSize.js +0 -45
- package/dist/cjs/helpers/getButtonSize.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -228
- package/dist/cjs/hooks/useFeatures.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/views/TextAncestorContext.js +0 -45
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js +0 -36
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -24
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
- package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/esm/helpers/createShallowUpdate.js +0 -19
- package/dist/esm/helpers/createShallowUpdate.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -40
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -32
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/esm/helpers/getButtonSize.js +0 -24
- package/dist/esm/helpers/getButtonSize.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.native.js +0 -2
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -14
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -173
- package/dist/esm/hooks/useFeatures.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/nativeGestureHandler.native.js +0 -2
- package/dist/esm/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/views/TextAncestorContext.js +0 -18
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/dist/jsx/Tamagui.js +0 -41
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -186
- package/dist/jsx/conf.js +0 -35
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -23
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -636
- package/dist/jsx/createFont.js +0 -27
- package/dist/jsx/createShorthands.js +0 -9
- package/dist/jsx/createTamagui.js +0 -201
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -28
- package/dist/jsx/createVariable.js +0 -48
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
- package/dist/jsx/helpers/areEqualSets.js +0 -15
- package/dist/jsx/helpers/createMediaStyle.js +0 -30
- package/dist/jsx/helpers/createPropMapper.js +0 -237
- package/dist/jsx/helpers/createShallowUpdate.js +0 -18
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
- package/dist/jsx/helpers/extendStaticConfig.js +0 -61
- package/dist/jsx/helpers/fixNativeShadow.js +0 -7
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -31
- package/dist/jsx/helpers/getButtonSize.js +0 -23
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
- package/dist/jsx/helpers/getSize.js +0 -12
- package/dist/jsx/helpers/getSplitStyles.js +0 -322
- package/dist/jsx/helpers/getStackSize.js +0 -41
- package/dist/jsx/helpers/getStylesAtomic.js +0 -130
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
- package/dist/jsx/helpers/getTextSize.js +0 -33
- package/dist/jsx/helpers/insertStyleRule.js +0 -94
- package/dist/jsx/helpers/isObj.js +0 -6
- package/dist/jsx/helpers/isTamaguiElement.js +0 -10
- package/dist/jsx/helpers/matchMedia.js +0 -17
- package/dist/jsx/helpers/matchMedia.native.js +0 -8
- package/dist/jsx/helpers/nativeGestureHandler.js +0 -6
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
- package/dist/jsx/helpers/themeable.js +0 -24
- package/dist/jsx/helpers/validate.js +0 -75
- package/dist/jsx/helpers/withStaticProperties.js +0 -9
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
- package/dist/jsx/hooks/useConstant.js +0 -14
- package/dist/jsx/hooks/useFeatures.js +0 -167
- package/dist/jsx/hooks/useId.js +0 -34
- package/dist/jsx/hooks/useIsMounted.js +0 -18
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
- package/dist/jsx/hooks/useMedia.js +0 -158
- package/dist/jsx/hooks/usePressable.js +0 -13
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -177
- package/dist/jsx/hooks/useUnmountEffect.js +0 -10
- package/dist/jsx/index.js +0 -54
- package/dist/jsx/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/static.js +0 -16
- package/dist/jsx/styled.js +0 -47
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -75
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -56
- package/dist/jsx/views/TextAncestorContext.js +0 -15
- package/dist/jsx/views/Theme.js +0 -31
- package/dist/jsx/views/ThemeInverse.js +0 -27
- package/dist/jsx/views/ThemeProvider.js +0 -35
- package/dist/jsx/views/ThemeReset.js +0 -34
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -49
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts +0 -27
- package/types/conf.d.ts.map +0 -1
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/platform.d.ts.map +0 -1
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTheme.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/createVariable.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/defaultComponentState.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/addStylesUsingClassname.d.ts +0 -3
- package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/types/helpers/areEqualSets.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts +0 -4
- package/types/helpers/createShallowUpdate.d.ts.map +0 -1
- package/types/helpers/createTamaguiProvider.d.ts +0 -7
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.native.d.ts +0 -3
- package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/types/helpers/getButtonSize.d.ts +0 -8
- package/types/helpers/getButtonSize.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getSize.d.ts.map +0 -1
- package/types/helpers/getSplitStyles.d.ts.map +0 -1
- package/types/helpers/getStackSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getTextSize.d.ts +0 -3
- package/types/helpers/getTextSize.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts.map +0 -1
- package/types/hooks/useFeatures.d.ts +0 -18
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts.map +0 -1
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts.map +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/nativeGestureHandler.native.d.ts +0 -2
- package/types/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types-rnw.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/views/Slot.d.ts.map +0 -1
- package/types/views/Stack.d.ts.map +0 -1
- package/types/views/Text.d.ts.map +0 -1
- package/types/views/TextAncestorContext.d.ts +0 -5
- package/types/views/TextAncestorContext.d.ts.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts.map +0 -1
package/types/types.d.ts
CHANGED
|
@@ -1,11 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Variable } from './createVariable';
|
|
5
|
-
import { ResolveVariableTypes } from './helpers/createPropMapper';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import type { GestureResponderEvent, Image, PressableProps, TextProps as ReactTextProps, Text, TextInput, TextStyle, View, ViewProps, ViewStyle } from '@tamagui/types-react-native';
|
|
2
|
+
import type { Properties } from 'csstype';
|
|
3
|
+
import type { Component, ForwardRefExoticComponent, FunctionComponent, ReactNode, RefAttributes, RefObject } from 'react';
|
|
4
|
+
import type { Variable } from './createVariable';
|
|
5
|
+
import type { ResolveVariableTypes } from './helpers/createPropMapper';
|
|
6
|
+
import type { TamaguiReactElement } from './static';
|
|
7
|
+
import type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
8
|
+
import type { FontLanguageProps } from './views/FontLanguage.types';
|
|
9
|
+
import type { ThemeProviderProps } from './views/ThemeProvider';
|
|
10
|
+
export declare type SpaceDirection = 'vertical' | 'horizontal' | 'both';
|
|
11
|
+
export declare type TamaguiElement = HTMLElement | View;
|
|
12
|
+
export declare type DebugProp = boolean | 'break' | 'verbose';
|
|
13
|
+
export declare type TamaguiComponentPropsBase = {
|
|
14
|
+
hitSlop?: PressableProps['hitSlop'];
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
space?: SpaceTokens | null;
|
|
17
|
+
spaceDirection?: SpaceDirection;
|
|
18
|
+
separator?: ReactNode;
|
|
19
|
+
dangerouslySetInnerHTML?: {
|
|
20
|
+
__html: string;
|
|
21
|
+
};
|
|
22
|
+
animation?: AnimationProp;
|
|
23
|
+
animateOnly?: string[];
|
|
24
|
+
children?: any | any[];
|
|
25
|
+
debug?: DebugProp;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
themeShallow?: boolean;
|
|
29
|
+
id?: string;
|
|
30
|
+
tag?: string;
|
|
31
|
+
theme?: ThemeName | null;
|
|
32
|
+
componentName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Forces the pseudo style state to be on
|
|
35
|
+
*/
|
|
36
|
+
forceStyle?: 'hover' | 'press' | 'focus';
|
|
37
|
+
onHoverIn?: (e: MouseEvent) => any;
|
|
38
|
+
onHoverOut?: (e: MouseEvent) => any;
|
|
39
|
+
onPress?: (e: GestureResponderEvent) => any;
|
|
40
|
+
onPressIn?: (e: GestureResponderEvent) => any;
|
|
41
|
+
onPressOut?: (e: GestureResponderEvent) => any;
|
|
42
|
+
onMouseEnter?: (e: MouseEvent) => any;
|
|
43
|
+
onMouseLeave?: (e: MouseEvent) => any;
|
|
44
|
+
onMouseDown?: (e: MouseEvent) => any;
|
|
45
|
+
};
|
|
46
|
+
export declare type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<Props & RefAttributes<Ref>>;
|
|
9
47
|
export declare type ConfigListener = (conf: TamaguiInternalConfig) => void;
|
|
10
48
|
export declare type VariableVal = number | string | Variable;
|
|
11
49
|
export declare type VariableColorVal = string | Variable;
|
|
@@ -51,55 +89,132 @@ declare type GenericThemes = {
|
|
|
51
89
|
[key: string]: VariableVal;
|
|
52
90
|
});
|
|
53
91
|
};
|
|
54
|
-
declare type
|
|
55
|
-
declare type
|
|
56
|
-
[key
|
|
92
|
+
declare type AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase;
|
|
93
|
+
export declare type CreateShorthands = {
|
|
94
|
+
[key: string]: AllStyleKeys;
|
|
95
|
+
};
|
|
96
|
+
export declare type GenericShorthands = {};
|
|
97
|
+
declare type GenericMedia = {
|
|
98
|
+
[key: string]: {
|
|
57
99
|
[key: string]: number | string;
|
|
58
100
|
};
|
|
59
101
|
};
|
|
60
|
-
declare type GenericFonts =
|
|
61
|
-
[key: string]: GenericFont;
|
|
62
|
-
};
|
|
102
|
+
export declare type GenericFonts = Record<string, GenericFont>;
|
|
63
103
|
declare type GenericAnimations = {
|
|
64
104
|
[key: string]: string | {
|
|
65
105
|
[key: string]: any;
|
|
66
|
-
};
|
|
106
|
+
} | any[];
|
|
67
107
|
};
|
|
68
108
|
export interface TamaguiCustomConfig {
|
|
69
109
|
}
|
|
70
110
|
export interface TamaguiConfig extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>, TamaguiCustomConfig {
|
|
71
111
|
}
|
|
72
|
-
export declare type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> =
|
|
73
|
-
fonts: F
|
|
112
|
+
export declare type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = {
|
|
113
|
+
fonts: RemoveLanguagePostfixes<F>;
|
|
114
|
+
fontLanguages: GetLanguagePostfixes<F> extends never ? string[] : GetLanguagePostfixes<F>[];
|
|
74
115
|
tokens: A;
|
|
75
|
-
themes:
|
|
116
|
+
themes: {
|
|
117
|
+
[Name in keyof B]: {
|
|
118
|
+
[Key in keyof B[Name]]: Variable;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
76
121
|
shorthands: C;
|
|
77
122
|
media: D;
|
|
78
123
|
animations: AnimationDriver<E>;
|
|
79
124
|
};
|
|
125
|
+
declare type GetLanguagePostfix<Set> = Set extends string ? Set extends `${string}_${infer Postfix}` ? Postfix : never : never;
|
|
126
|
+
declare type OmitLanguagePostfix<Set> = Set extends string ? Set extends `${infer Prefix}_${string}` ? Prefix : Set : never;
|
|
127
|
+
declare type RemoveLanguagePostfixes<F extends GenericFonts> = {
|
|
128
|
+
[Key in OmitLanguagePostfix<keyof F>]: F[Key];
|
|
129
|
+
};
|
|
130
|
+
declare type GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>;
|
|
131
|
+
declare type ConfProps<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = {
|
|
132
|
+
tokens: A;
|
|
133
|
+
themes: B;
|
|
134
|
+
shorthands?: C;
|
|
135
|
+
media?: D;
|
|
136
|
+
animations?: AnimationDriver<E>;
|
|
137
|
+
fonts: F;
|
|
138
|
+
};
|
|
139
|
+
export declare type InferTamaguiConfig<Conf> = Conf extends ConfProps<infer A, infer B, infer C, infer D, infer E, infer F> ? TamaguiInternalConfig<A, B, C, D, E, F> : unknown;
|
|
80
140
|
export declare type GenericTamaguiConfig = CreateTamaguiConfig<GenericTokens, GenericThemes, GenericShorthands, GenericMedia, GenericAnimations, GenericFonts>;
|
|
81
|
-
export declare type
|
|
141
|
+
export declare type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']];
|
|
142
|
+
export declare type ThemeKeys = keyof ThemeDefinition;
|
|
143
|
+
export declare type ThemeParsed = {
|
|
144
|
+
[key in ThemeKeys]: Variable<any>;
|
|
145
|
+
};
|
|
82
146
|
export declare type Tokens = TamaguiConfig['tokens'];
|
|
83
147
|
export declare type Shorthands = TamaguiConfig['shorthands'];
|
|
84
148
|
export declare type Media = TamaguiConfig['media'];
|
|
85
149
|
export declare type Themes = TamaguiConfig['themes'];
|
|
86
|
-
export declare type ThemeName = GetAltThemeNames<keyof Themes>;
|
|
87
|
-
export declare type ThemeKeys = keyof ThemeObject;
|
|
150
|
+
export declare type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>;
|
|
88
151
|
export declare type ThemeTokens = `$${ThemeKeys}`;
|
|
89
|
-
export declare type AnimationKeys =
|
|
152
|
+
export declare type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<infer Config> ? keyof Config : string;
|
|
153
|
+
export declare type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>;
|
|
154
|
+
declare type ArrayIntersection<A extends any[]> = A[keyof A];
|
|
90
155
|
declare type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
|
|
91
|
-
|
|
92
|
-
|
|
156
|
+
declare type SpacerPropsBase = {
|
|
157
|
+
size?: number | SpaceTokens | null;
|
|
158
|
+
flex?: boolean | number;
|
|
159
|
+
direction?: SpaceDirection;
|
|
160
|
+
};
|
|
161
|
+
declare type SpacerOwnProps = SpacerPropsBase & WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>;
|
|
162
|
+
export declare type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> & SpacerOwnProps;
|
|
163
|
+
export declare type CreateTamaguiProps = {
|
|
164
|
+
reactNative?: any;
|
|
165
|
+
shorthands?: CreateShorthands;
|
|
166
|
+
media?: GenericTamaguiConfig['media'];
|
|
167
|
+
animations?: AnimationDriver<any>;
|
|
168
|
+
fonts: GenericTamaguiConfig['fonts'];
|
|
169
|
+
tokens: GenericTamaguiConfig['tokens'];
|
|
170
|
+
themes: {
|
|
171
|
+
[key: string]: {
|
|
172
|
+
[key: string]: string | number | Variable;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* *Advanced use case* For all CSS extracted views, this has no effect.
|
|
177
|
+
*
|
|
178
|
+
* For SSR compatibility on the web, Tamagui will render once with the settings
|
|
179
|
+
* from `mediaQueryDefaultActive` set for all media queries. Then, it will render
|
|
180
|
+
* again after the initial render using the proper media query values. This is so that
|
|
181
|
+
* hydration will match perfectly with the server.
|
|
182
|
+
*
|
|
183
|
+
* Setting disableSSR will avoid this second render by setting the media query state
|
|
184
|
+
* to the actual browser dimensions on initial load. This is only useful for client-only
|
|
185
|
+
* apps.
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
disableSSR?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.
|
|
191
|
+
* For custom use cases like integration with next-theme.
|
|
192
|
+
*/
|
|
193
|
+
disableRootThemeClass?: boolean;
|
|
194
|
+
defaultProps?: Record<string, any> & {
|
|
195
|
+
Stack?: StackProps;
|
|
196
|
+
Text?: TextProps;
|
|
197
|
+
Spacer?: SpacerProps;
|
|
198
|
+
};
|
|
199
|
+
mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>;
|
|
200
|
+
cssStyleSeparator?: string;
|
|
201
|
+
maxDarkLightNesting?: number;
|
|
202
|
+
shouldAddPrefersColorThemes?: boolean;
|
|
203
|
+
themeClassNameOnRoot?: boolean;
|
|
204
|
+
};
|
|
205
|
+
export declare 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> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> & CreateTamaguiConfig<A, B, C, D, E, F> & {
|
|
93
206
|
tokensParsed: CreateTokens<Variable>;
|
|
94
207
|
themeConfig: any;
|
|
95
208
|
fontsParsed: GenericFonts;
|
|
96
209
|
getCSS: () => string;
|
|
97
210
|
parsed: boolean;
|
|
211
|
+
inverseShorthands: Record<string, string>;
|
|
212
|
+
reactNative?: any;
|
|
98
213
|
};
|
|
99
|
-
export declare type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']
|
|
214
|
+
export declare type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations'];
|
|
100
215
|
export declare type UnionableString = string & {};
|
|
101
216
|
export declare type UnionableNumber = number & {};
|
|
102
|
-
export declare type PropTypes<A extends TamaguiComponent> = A extends
|
|
217
|
+
export declare type PropTypes<A extends TamaguiComponent> = A extends FunctionComponent<infer Props> ? Props : unknown;
|
|
103
218
|
export declare type GenericFont<Key extends number | string = number | string> = {
|
|
104
219
|
size: {
|
|
105
220
|
[key in Key]: number | Variable;
|
|
@@ -123,8 +238,13 @@ export declare type GenericFont<Key extends number | string = number | string> =
|
|
|
123
238
|
color?: Partial<{
|
|
124
239
|
[key in Key]: string | Variable;
|
|
125
240
|
}>;
|
|
241
|
+
face?: {
|
|
242
|
+
[key in FontWeightSteps]: {
|
|
243
|
+
normal?: string;
|
|
244
|
+
italic?: string;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
126
247
|
};
|
|
127
|
-
export declare type MediaKeys = keyof Media;
|
|
128
248
|
export declare type MediaQueryObject = {
|
|
129
249
|
[key: string]: string | number | string;
|
|
130
250
|
};
|
|
@@ -139,10 +259,6 @@ export declare type MediaProps<A> = {
|
|
|
139
259
|
export declare type MediaQueries = {
|
|
140
260
|
[key in MediaQueryKey]: MediaQueryObject;
|
|
141
261
|
};
|
|
142
|
-
export declare type ConfigureMediaQueryOptions = {
|
|
143
|
-
queries?: MediaQueries;
|
|
144
|
-
defaultActive?: MediaQueryKey[];
|
|
145
|
-
};
|
|
146
262
|
export declare type TransformStyleProps = {
|
|
147
263
|
x?: number;
|
|
148
264
|
y?: number;
|
|
@@ -173,43 +289,18 @@ export declare type AnimationProp = AnimationKeys | {
|
|
|
173
289
|
};
|
|
174
290
|
}
|
|
175
291
|
];
|
|
176
|
-
|
|
177
|
-
export declare type TamaguiComponentPropsBase = {
|
|
178
|
-
asChild?: boolean;
|
|
179
|
-
space?: SpaceTokens;
|
|
180
|
-
spaceDirection?: SpaceDirection;
|
|
181
|
-
dangerouslySetInnerHTML?: {
|
|
182
|
-
__html: string;
|
|
183
|
-
};
|
|
184
|
-
animation?: AnimationProp;
|
|
185
|
-
animateOnly?: string[];
|
|
186
|
-
children?: any | any[];
|
|
187
|
-
debug?: boolean | 'break' | 'verbose';
|
|
188
|
-
disabled?: boolean;
|
|
189
|
-
className?: string;
|
|
190
|
-
id?: string;
|
|
191
|
-
tag?: string;
|
|
192
|
-
theme?: ThemeName | null;
|
|
193
|
-
onHoverIn?: (e: MouseEvent) => any;
|
|
194
|
-
onHoverOut?: (e: MouseEvent) => any;
|
|
195
|
-
onPress?: (e: GestureResponderEvent) => any;
|
|
196
|
-
onPressIn?: (e: GestureResponderEvent) => any;
|
|
197
|
-
onPressOut?: (e: GestureResponderEvent) => any;
|
|
198
|
-
onMouseEnter?: (e: MouseEvent) => any;
|
|
199
|
-
onMouseLeave?: (e: MouseEvent) => any;
|
|
200
|
-
onMouseDown?: (e: MouseEvent) => any;
|
|
201
|
-
};
|
|
202
|
-
declare type GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight' | 'transform' | 'style' | 'color'> = keyof TamaguiConfig['fonts'][keyof TamaguiConfig['fonts']][A];
|
|
292
|
+
declare type GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight' | 'transform' | 'style' | 'color'> = keyof TamaguiConfig['fonts']['body'][A];
|
|
203
293
|
declare type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`;
|
|
204
294
|
export declare type SizeTokens = GetTokenString<keyof Tokens['size']> | number;
|
|
205
295
|
export declare type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean;
|
|
206
|
-
export declare type ColorTokens = GetTokenString<keyof Tokens['color']> | GetTokenString<keyof
|
|
296
|
+
export declare type ColorTokens = GetTokenString<keyof Tokens['color']> | GetTokenString<keyof ThemeParsed> | CSSColorNames;
|
|
207
297
|
export declare type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number;
|
|
208
298
|
export declare type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number;
|
|
209
299
|
export declare type FontTokens = GetTokenString<keyof TamaguiConfig['fonts']>;
|
|
210
300
|
export declare type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number;
|
|
211
301
|
export declare type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number;
|
|
212
|
-
export declare type
|
|
302
|
+
export declare type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`;
|
|
303
|
+
export declare type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps;
|
|
213
304
|
export declare type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number;
|
|
214
305
|
export declare type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number;
|
|
215
306
|
export declare type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | TextStyle['fontStyle'];
|
|
@@ -239,7 +330,7 @@ export declare type PseudoProps<A> = {
|
|
|
239
330
|
exitStyle?: A | null;
|
|
240
331
|
enterStyle?: A | null;
|
|
241
332
|
};
|
|
242
|
-
export declare type
|
|
333
|
+
export declare type PseudoPropKeys = keyof PseudoProps<any>;
|
|
243
334
|
export declare type PseudoStyles = {
|
|
244
335
|
hoverStyle?: ViewStyle;
|
|
245
336
|
pressStyle?: ViewStyle;
|
|
@@ -250,31 +341,33 @@ export declare type PseudoStyles = {
|
|
|
250
341
|
declare type WithThemeAndShorthands<A extends object> = WithThemeValues<A> & WithShorthands<WithThemeValues<A>>;
|
|
251
342
|
declare type WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>;
|
|
252
343
|
declare type WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
344
|
+
/**
|
|
345
|
+
* Base style-only props (no media, pseudo):
|
|
346
|
+
*/
|
|
347
|
+
declare type StylePropsWebOnly = {
|
|
257
348
|
pointerEvents?: ViewProps['pointerEvents'];
|
|
349
|
+
cursor?: Properties['cursor'];
|
|
350
|
+
contain?: Properties['contain'];
|
|
351
|
+
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex';
|
|
352
|
+
userSelect?: Properties['userSelect'];
|
|
258
353
|
};
|
|
259
|
-
export declare type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> & TransformStyleProps &
|
|
260
|
-
export declare type
|
|
261
|
-
export declare type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
|
|
262
|
-
export declare type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>;
|
|
263
|
-
export declare type StackProps = StackPropsBaseShared & StackStyleProps;
|
|
264
|
-
export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps & {
|
|
354
|
+
export declare type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> & TransformStyleProps & StylePropsWebOnly;
|
|
355
|
+
export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & StylePropsWebOnly & {
|
|
265
356
|
ellipse?: boolean;
|
|
266
357
|
selectable?: boolean;
|
|
267
358
|
textDecorationDistance?: number;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
export declare type
|
|
275
|
-
export declare type
|
|
359
|
+
textOverflow?: Properties['textOverflow'];
|
|
360
|
+
whiteSpace?: Properties['whiteSpace'];
|
|
361
|
+
wordWrap?: Properties['wordWrap'];
|
|
362
|
+
};
|
|
363
|
+
export declare type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> & RNWViewProps & TamaguiComponentPropsBase;
|
|
364
|
+
export declare type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
|
|
365
|
+
export declare type StackPropsBase = StackNonStyleProps & WithThemeAndShorthands<StackStylePropsBase>;
|
|
366
|
+
export declare type StackProps = StackNonStyleProps & StackStyleProps;
|
|
367
|
+
export declare type TextNonStyleProps = Omit<ReactTextProps, 'children'> & RNWTextProps & TamaguiComponentPropsBase;
|
|
368
|
+
export declare type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>;
|
|
276
369
|
export declare type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>;
|
|
277
|
-
export declare type TextProps =
|
|
370
|
+
export declare type TextProps = TextNonStyleProps & TextStyleProps;
|
|
278
371
|
export declare type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase>;
|
|
279
372
|
export declare type TamaguiComponent<Props = any, Ref = any, BaseProps = {}, VariantProps = {}> = ReactComponentWithRef<Props, Ref> & StaticComponentObject;
|
|
280
373
|
declare type StaticComponentObject = {
|
|
@@ -282,67 +375,144 @@ declare type StaticComponentObject = {
|
|
|
282
375
|
extractable: <X>(a: X, opts?: Partial<StaticConfig>) => X;
|
|
283
376
|
};
|
|
284
377
|
export declare type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {
|
|
285
|
-
|
|
286
|
-
|
|
378
|
+
config: TamaguiInternalConfig;
|
|
379
|
+
disableInjectCSS?: boolean;
|
|
380
|
+
children?: ReactNode;
|
|
287
381
|
};
|
|
382
|
+
export declare type PropMapper = (key: string, value: any, theme: ThemeParsed, props: Record<string, any>, state: Partial<SplitStyleState>, languageContext?: FontLanguageProps, avoidDefaultProps?: boolean, debug?: DebugProp) => undefined | [string, any][];
|
|
288
383
|
export declare type StaticConfigParsed = StaticConfig & {
|
|
289
384
|
parsed: true;
|
|
290
|
-
propMapper:
|
|
291
|
-
[key: string]: any;
|
|
292
|
-
};
|
|
385
|
+
propMapper: PropMapper;
|
|
293
386
|
variantsParsed?: {
|
|
294
387
|
[key: string]: {
|
|
295
388
|
[key: string]: any;
|
|
296
389
|
};
|
|
297
390
|
};
|
|
298
391
|
};
|
|
299
|
-
export declare type
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
[key: string]: ((a: any, b: any) => any) | {
|
|
304
|
-
[key: string]: any;
|
|
305
|
-
};
|
|
392
|
+
export declare type GenericVariantDefinitions = {
|
|
393
|
+
[key: string]: {
|
|
394
|
+
[key: string]: ((a: any, b: any) => any) | {
|
|
395
|
+
[key: string]: any;
|
|
306
396
|
};
|
|
307
397
|
};
|
|
308
|
-
|
|
398
|
+
};
|
|
399
|
+
export declare type StaticConfigPublic = {
|
|
400
|
+
/**
|
|
401
|
+
* (compiler) If you need to pass context or something, prevents from ever
|
|
402
|
+
* flattening. The 'jsx' option means it will never flatten. if you
|
|
403
|
+
* pass JSX as a children (if its purely string, it will still flatten).
|
|
404
|
+
*/
|
|
309
405
|
neverFlatten?: boolean | 'jsx';
|
|
406
|
+
/**
|
|
407
|
+
* Determines ultimate output tag (Text vs View)
|
|
408
|
+
*/
|
|
310
409
|
isText?: boolean;
|
|
311
|
-
|
|
312
|
-
|
|
410
|
+
/**
|
|
411
|
+
* Which style keys are allowed to be extracted.
|
|
412
|
+
*/
|
|
313
413
|
validStyles?: {
|
|
314
414
|
[key: string]: boolean;
|
|
315
415
|
};
|
|
316
|
-
|
|
416
|
+
/**
|
|
417
|
+
* (compiler) If these props are encountered, bail on all optimization.
|
|
418
|
+
*/
|
|
317
419
|
deoptProps?: Set<string>;
|
|
420
|
+
/**
|
|
421
|
+
* (compiler) If these props are encountered, leave them un-extracted.
|
|
422
|
+
*/
|
|
318
423
|
inlineProps?: Set<string>;
|
|
424
|
+
/**
|
|
425
|
+
* (compiler) If not flattening, leave this prop as original value.
|
|
426
|
+
* Only applies to style attributes
|
|
427
|
+
*/
|
|
428
|
+
inlineWhenUnflattened?: Set<string>;
|
|
429
|
+
/**
|
|
430
|
+
* (compiler) A bit odd, only for more advanced heirarchies.
|
|
431
|
+
* Indicates that the component will set this prop so the
|
|
432
|
+
* static extraction can ensure it sets them to ={undefined}
|
|
433
|
+
* so they get overriddent. In the future, this can be smarter.
|
|
434
|
+
*/
|
|
319
435
|
ensureOverriddenProp?: {
|
|
320
436
|
[key: string]: boolean;
|
|
321
437
|
};
|
|
438
|
+
/**
|
|
439
|
+
* Auto-detected, but can ovverride. Wraps children to space them on top
|
|
440
|
+
*/
|
|
322
441
|
isZStack?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Auto-detect, but can override, passes styles properly to react-native-web
|
|
444
|
+
*/
|
|
445
|
+
isReactNative?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
|
|
448
|
+
* it will assume the passed in component only accepts style={} for react-native compatibility.
|
|
449
|
+
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
450
|
+
*/
|
|
451
|
+
acceptsClassName?: boolean;
|
|
452
|
+
};
|
|
453
|
+
export declare type StaticConfig = StaticConfigPublic & {
|
|
454
|
+
Component?: FunctionComponent<any> & StaticComponentObject;
|
|
455
|
+
variants?: GenericVariantDefinitions;
|
|
456
|
+
/**
|
|
457
|
+
* Used for applying sub theme style
|
|
458
|
+
*/
|
|
459
|
+
componentName?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Same as React.defaultProps, be sure to sync
|
|
462
|
+
*/
|
|
463
|
+
defaultProps: Record<string, any>;
|
|
464
|
+
/**
|
|
465
|
+
* Merges into defaultProps later on, used internally yonly
|
|
466
|
+
*/
|
|
323
467
|
defaultVariants?: {
|
|
324
468
|
[key: string]: any;
|
|
325
469
|
};
|
|
326
|
-
|
|
327
|
-
|
|
470
|
+
/**
|
|
471
|
+
* Memoize the component
|
|
472
|
+
*/
|
|
328
473
|
memo?: boolean;
|
|
329
|
-
|
|
474
|
+
/**
|
|
475
|
+
* Used internally to handle extractable HoC separate
|
|
476
|
+
*/
|
|
477
|
+
isHOC?: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Used insternally to attach default props to names
|
|
480
|
+
*/
|
|
481
|
+
parentNames?: string[];
|
|
482
|
+
/**
|
|
483
|
+
* By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
|
|
484
|
+
* it will assume the passed in component only accepts style={} for react-native compatibility.
|
|
485
|
+
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
486
|
+
*/
|
|
487
|
+
acceptsClassName?: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Used internally for handling focus
|
|
490
|
+
*/
|
|
491
|
+
isInput?: boolean;
|
|
330
492
|
};
|
|
331
|
-
|
|
493
|
+
/**
|
|
494
|
+
* --------------------------------------------
|
|
495
|
+
* variants
|
|
496
|
+
* --------------------------------------------
|
|
497
|
+
*/
|
|
498
|
+
export declare type StylableComponent = TamaguiComponent | Component | ForwardRefExoticComponent<any> | ReactComponentWithRef<any, any> | (new (props: any) => any) | typeof View | typeof Text | typeof TextInput | typeof Image;
|
|
499
|
+
export declare type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<any, any, any, infer Variants> ? Variants : never;
|
|
332
500
|
export declare type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<any, any, infer BaseProps> ? BaseProps : never;
|
|
333
|
-
export declare type GetProps<A extends StylableComponent> = A extends TamaguiComponent<infer Props> ? Props : A extends
|
|
501
|
+
export declare type GetProps<A extends StylableComponent> = A extends TamaguiComponent<infer Props> ? Props : A extends TamaguiReactElement<infer Props> ? Props : A extends Component<infer Props> ? GetGenericComponentTamaguiProps<Props> : A extends new (props: infer Props) => any ? GetGenericComponentTamaguiProps<Props> : {};
|
|
334
502
|
declare type GetGenericComponentTamaguiProps<P> = P & Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>;
|
|
335
|
-
export declare type SpreadKeys = '...fontSize' | '...fontStyle' | '...fontTransform' | '...lineHeight' | '...letterSpacing' | '...size' | '...color' | '...zIndex' | '...theme' | '...radius';
|
|
503
|
+
export declare type SpreadKeys = '...fontSize' | '...fontStyle' | '...fontTransform' | '...lineHeight' | '...letterSpacing' | '...size' | '...space' | '...color' | '...zIndex' | '...theme' | '...radius';
|
|
336
504
|
export declare type VariantDefinitions<Parent extends StylableComponent = TamaguiComponent, MyProps extends Object = GetProps<Parent>, Val = any> = VariantDefinitionFromProps<MyProps, Val>;
|
|
337
505
|
export declare type VariantDefinitionFromProps<MyProps, Val> = MyProps extends Object ? {
|
|
338
506
|
[propName: string]: VariantSpreadFunction<MyProps, Val> | ({
|
|
339
|
-
[Key in SpreadKeys]?: Key extends '...fontSize' ? FontSizeVariantSpreadFunction<MyProps> : Key extends '...size' ? SizeVariantSpreadFunction<MyProps> : Key extends '...color' ? ColorVariantSpreadFunction<MyProps> : Key extends '...lineHeight' ? FontLineHeightVariantSpreadFunction<MyProps> : Key extends '...fontTransform' ? FontTransformVariantSpreadFunction<MyProps> : Key extends '...fontStyle' ? FontStyleVariantSpreadFunction<MyProps> : Key extends '...letterSpacing' ? FontLetterSpacingVariantSpreadFunction<MyProps> : Key extends '...zIndex' ? ZIndexVariantSpreadFunction<MyProps> : Key extends '...radius' ? RadiusVariantSpreadFunction<MyProps> : Key extends '...theme' ? ThemeVariantSpreadFunction<MyProps> : never;
|
|
507
|
+
[Key in SpreadKeys]?: Key extends '...fontSize' ? FontSizeVariantSpreadFunction<MyProps> : Key extends '...size' ? SizeVariantSpreadFunction<MyProps> : Key extends '...space' ? SpaceVariantSpreadFunction<MyProps> : Key extends '...color' ? ColorVariantSpreadFunction<MyProps> : Key extends '...lineHeight' ? FontLineHeightVariantSpreadFunction<MyProps> : Key extends '...fontTransform' ? FontTransformVariantSpreadFunction<MyProps> : Key extends '...fontStyle' ? FontStyleVariantSpreadFunction<MyProps> : Key extends '...letterSpacing' ? FontLetterSpacingVariantSpreadFunction<MyProps> : Key extends '...zIndex' ? ZIndexVariantSpreadFunction<MyProps> : Key extends '...radius' ? RadiusVariantSpreadFunction<MyProps> : Key extends '...theme' ? ThemeVariantSpreadFunction<MyProps> : never;
|
|
340
508
|
} & {
|
|
341
|
-
[Key in string | number]?: MyProps | VariantSpreadFunction<MyProps, Val>;
|
|
509
|
+
[Key in string | number | 'true' | 'false']?: MyProps | VariantSpreadFunction<MyProps, Val>;
|
|
342
510
|
} & {
|
|
343
511
|
[Key in VariantTypeKeys]?: Key extends ':number' ? VariantSpreadFunction<MyProps, number> : Key extends ':boolean' ? VariantSpreadFunction<MyProps, boolean> : Key extends ':string' ? VariantSpreadFunction<MyProps, string> : never;
|
|
344
512
|
});
|
|
345
513
|
} : never;
|
|
514
|
+
export declare type GenericStackVariants = VariantDefinitionFromProps<StackProps, any>;
|
|
515
|
+
export declare type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>;
|
|
346
516
|
export declare type GetVariantProps<Variants> = {
|
|
347
517
|
[Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>;
|
|
348
518
|
};
|
|
@@ -364,6 +534,7 @@ export declare type VariantTypeKeys = ':string' | ':boolean' | ':number';
|
|
|
364
534
|
export declare type GetVariantValues<Key> = Key extends `...${infer VariantSpread}` ? ThemeValueByCategory<VariantSpread> : Key extends 'true' | 'false' ? boolean : Key extends ':string' ? string : Key extends ':boolean' ? boolean : Key extends ':number' ? number : Key;
|
|
365
535
|
export declare type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontSizeTokens>;
|
|
366
536
|
export declare type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SizeTokens>;
|
|
537
|
+
export declare type SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SpaceTokens>;
|
|
367
538
|
export declare type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>;
|
|
368
539
|
export declare type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontLineHeightTokens>;
|
|
369
540
|
export declare type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontLetterSpacingTokens>;
|
|
@@ -372,6 +543,11 @@ export declare type FontTransformVariantSpreadFunction<A extends PropLike> = Var
|
|
|
372
543
|
export declare type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>;
|
|
373
544
|
export declare type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>;
|
|
374
545
|
export declare type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>;
|
|
546
|
+
/**
|
|
547
|
+
* --------------------------------------------
|
|
548
|
+
* end variants
|
|
549
|
+
* --------------------------------------------
|
|
550
|
+
*/
|
|
375
551
|
declare type SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'shadowRadius';
|
|
376
552
|
declare type ColorKeys = 'color' | 'backgroundColor' | 'borderColor' | 'borderBottomColor' | 'borderTopColor' | 'borderLeftColor' | 'borderRightColor' | 'shadowColor' | 'textShadowColor';
|
|
377
553
|
declare type SpaceKeys = 'space' | 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingLeft' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingEnd' | 'paddingStart' | 'margin' | 'marginHorizontal' | 'marginVertical' | 'marginLeft' | 'marginTop' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginEnd' | 'marginStart' | 'x' | 'y' | 'scale' | 'scaleX' | 'scaleY' | 'borderTopEndRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStartRadius' | 'borderBottomEndRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStartRadius' | 'borderBottomWidth' | 'borderLeftWidth' | 'borderRadius' | 'borderRightWidth' | 'borderTopEndRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderEndWidth' | 'borderStartWidth' | 'borderTopStartRadius' | 'borderTopWidth' | 'borderWidth' | 'left' | 'top' | 'right' | 'bottom' | 'shadowOffset';
|
|
@@ -382,6 +558,8 @@ export declare type TamaguiComponentState = {
|
|
|
382
558
|
pressIn: boolean;
|
|
383
559
|
focus: boolean;
|
|
384
560
|
mounted: boolean;
|
|
561
|
+
mediaState?: null | Record<string, boolean>;
|
|
562
|
+
hasAnimation?: boolean;
|
|
385
563
|
animation?: null | {
|
|
386
564
|
style?: any;
|
|
387
565
|
avoidClasses?: boolean;
|
|
@@ -389,24 +567,52 @@ export declare type TamaguiComponentState = {
|
|
|
389
567
|
};
|
|
390
568
|
export declare type SplitStyleState = TamaguiComponentState & {
|
|
391
569
|
noClassNames?: boolean;
|
|
570
|
+
dynamicStylesInline?: boolean;
|
|
392
571
|
resolveVariablesAs?: ResolveVariableTypes;
|
|
393
|
-
fallbackProps?:
|
|
572
|
+
fallbackProps?: Record<string, any>;
|
|
573
|
+
keepVariantsAsProps?: boolean;
|
|
574
|
+
hasTextAncestor?: boolean;
|
|
394
575
|
};
|
|
395
576
|
declare type AnimationConfig = {
|
|
396
577
|
[key: string]: any;
|
|
397
578
|
};
|
|
579
|
+
export declare type AnimatedNumberStrategy = {
|
|
580
|
+
type: 'spring';
|
|
581
|
+
stiffness?: number;
|
|
582
|
+
damping?: number;
|
|
583
|
+
mass?: number;
|
|
584
|
+
overshootClamping?: boolean;
|
|
585
|
+
restSpeedThreshold?: number;
|
|
586
|
+
restDisplacementThreshold?: number;
|
|
587
|
+
} | {
|
|
588
|
+
type: 'timing';
|
|
589
|
+
duration: number;
|
|
590
|
+
} | {
|
|
591
|
+
type: 'direct';
|
|
592
|
+
};
|
|
593
|
+
export declare type UniversalAnimatedNumber<A> = {
|
|
594
|
+
getInstance(): A;
|
|
595
|
+
getValue(): number;
|
|
596
|
+
setValue(next: number, config?: AnimatedNumberStrategy): void;
|
|
597
|
+
stop(): void;
|
|
598
|
+
};
|
|
398
599
|
export declare type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
399
|
-
|
|
600
|
+
isReactNative?: boolean;
|
|
400
601
|
useAnimations: UseAnimationHook;
|
|
602
|
+
useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>;
|
|
603
|
+
useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(val: V, getStyle: (current: any) => any) => any;
|
|
604
|
+
useAnimatedNumberReaction: (val: UniversalAnimatedNumber<any>, onValue: (current: number) => void) => void;
|
|
401
605
|
animations: A;
|
|
402
606
|
View?: any;
|
|
403
607
|
Text?: any;
|
|
404
608
|
};
|
|
405
609
|
export declare type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
|
|
406
610
|
export declare type UseAnimationHelpers = {
|
|
611
|
+
hostRef: RefObject<HTMLElement | View>;
|
|
407
612
|
staticConfig: StaticConfigParsed;
|
|
408
613
|
getStyle: (props?: {
|
|
409
614
|
isEntering?: boolean;
|
|
615
|
+
isExiting?: boolean;
|
|
410
616
|
exitVariant?: string | null;
|
|
411
617
|
enterVariant?: string | null;
|
|
412
618
|
}) => ViewStyle;
|
|
@@ -415,9 +621,9 @@ export declare type UseAnimationHelpers = {
|
|
|
415
621
|
onDidAnimate?: any;
|
|
416
622
|
delay?: number;
|
|
417
623
|
};
|
|
418
|
-
export declare type UseAnimationHook = (props: UseAnimationProps, helpers: UseAnimationHelpers) => {
|
|
624
|
+
export declare type UseAnimationHook = (props: UseAnimationProps, helpers: UseAnimationHelpers) => null | {
|
|
419
625
|
style?: StackStylePropsBase | StackStylePropsBase[];
|
|
420
|
-
safeToUnmount?: () => void;
|
|
421
626
|
};
|
|
627
|
+
export declare type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
|
|
422
628
|
export {};
|
|
423
629
|
//# sourceMappingURL=types.d.ts.map
|