@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
|
@@ -1,636 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { stylePropsView } from "@tamagui/helpers";
|
|
4
|
-
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
5
|
-
import React, {
|
|
6
|
-
Children,
|
|
7
|
-
Fragment,
|
|
8
|
-
createElement,
|
|
9
|
-
forwardRef,
|
|
10
|
-
memo,
|
|
11
|
-
useCallback,
|
|
12
|
-
useContext,
|
|
13
|
-
useRef,
|
|
14
|
-
useState
|
|
15
|
-
} from "react";
|
|
16
|
-
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
17
|
-
import { onConfiguredOnce } from "./conf";
|
|
18
|
-
import { stackDefaultStyles } from "./constants/constants";
|
|
19
|
-
import { isAndroid, isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
20
|
-
import { rnw } from "./constants/rnw";
|
|
21
|
-
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
22
|
-
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
23
|
-
import { insertSplitStyles, useSplitStyles } from "./helpers/getSplitStyles";
|
|
24
|
-
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
25
|
-
import { BaseButton } from "./helpers/nativeGestureHandler";
|
|
26
|
-
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
27
|
-
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
28
|
-
import { useFeatures } from "./hooks/useFeatures";
|
|
29
|
-
import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
30
|
-
import { usePressable } from "./hooks/usePressable";
|
|
31
|
-
import { getThemeManagerIfChanged, useTheme } from "./hooks/useTheme";
|
|
32
|
-
import { Slot } from "./views/Slot";
|
|
33
|
-
import { TextAncestorContext } from "./views/TextAncestorContext";
|
|
34
|
-
React["keep"];
|
|
35
|
-
const defaultComponentState = {
|
|
36
|
-
hover: false,
|
|
37
|
-
press: false,
|
|
38
|
-
pressIn: false,
|
|
39
|
-
focus: false,
|
|
40
|
-
mounted: false,
|
|
41
|
-
animation: null
|
|
42
|
-
};
|
|
43
|
-
const mouseUps = /* @__PURE__ */ new Set();
|
|
44
|
-
if (typeof document !== "undefined") {
|
|
45
|
-
document.addEventListener("mouseup", () => {
|
|
46
|
-
mouseUps.forEach((x) => x());
|
|
47
|
-
mouseUps.clear();
|
|
48
|
-
});
|
|
49
|
-
document.addEventListener("touchend", () => {
|
|
50
|
-
mouseUps.forEach((x) => x());
|
|
51
|
-
mouseUps.clear();
|
|
52
|
-
});
|
|
53
|
-
document.addEventListener("touchcancel", () => {
|
|
54
|
-
mouseUps.forEach((x) => x());
|
|
55
|
-
mouseUps.clear();
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
59
|
-
for (const key in defaultProps) {
|
|
60
|
-
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
__name(mergeShorthands, "mergeShorthands");
|
|
64
|
-
let initialTheme;
|
|
65
|
-
function createComponent(configIn, ParentComponent) {
|
|
66
|
-
const staticConfig = (() => {
|
|
67
|
-
const config = extendStaticConfig(configIn, ParentComponent);
|
|
68
|
-
if ("parsed" in config) {
|
|
69
|
-
return config;
|
|
70
|
-
} else {
|
|
71
|
-
return parseStaticConfig(config);
|
|
72
|
-
}
|
|
73
|
-
})();
|
|
74
|
-
const componentClassName = `is_${staticConfig.componentName}`;
|
|
75
|
-
let tamaguiConfig;
|
|
76
|
-
let AnimatedText;
|
|
77
|
-
let AnimatedView;
|
|
78
|
-
let avoidClasses = true;
|
|
79
|
-
let defaultNativeStyle;
|
|
80
|
-
let defaultNativeStyleSheet;
|
|
81
|
-
let tamaguiDefaultProps;
|
|
82
|
-
let initialSplitStyles;
|
|
83
|
-
function addPseudoToStyles(styles, name, pseudos) {
|
|
84
|
-
const pseudoStyle = pseudos[name];
|
|
85
|
-
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
86
|
-
const defaultPseudoStyle = initialSplitStyles.pseudos[name];
|
|
87
|
-
if (defaultPseudoStyle) {
|
|
88
|
-
styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle);
|
|
89
|
-
}
|
|
90
|
-
if (pseudoStyle) {
|
|
91
|
-
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
__name(addPseudoToStyles, "addPseudoToStyles");
|
|
95
|
-
const component = forwardRef((props, forwardedRef) => {
|
|
96
|
-
var _a, _b, _c;
|
|
97
|
-
props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props;
|
|
98
|
-
const { Component, componentName, isText, isZStack } = staticConfig;
|
|
99
|
-
if (process.env.NODE_ENV === "development") {
|
|
100
|
-
if (props["debug"]) {
|
|
101
|
-
console.log("\u26A0\uFE0F", staticConfig.componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
|
|
102
|
-
console.log("props in:", props, Object.keys(props));
|
|
103
|
-
if (props["debug"] === "break")
|
|
104
|
-
debugger;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const forceUpdate = useForceUpdate();
|
|
108
|
-
const theme = useTheme(props.theme, staticConfig.componentName, props, forceUpdate);
|
|
109
|
-
const [state, set_] = useState(defaultComponentState);
|
|
110
|
-
const setStateShallow = createShallowUpdate(set_);
|
|
111
|
-
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
112
|
-
const splitStyles = useSplitStyles(props, staticConfig, theme, shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: "value" } : state, shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames);
|
|
113
|
-
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
114
|
-
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
115
|
-
const isAnimated = !!(useAnimations && props.animation);
|
|
116
|
-
const hasEnterStyle = !!props.enterStyle;
|
|
117
|
-
const features = useFeatures(props, {
|
|
118
|
-
forceUpdate,
|
|
119
|
-
setStateShallow,
|
|
120
|
-
useAnimations,
|
|
121
|
-
state,
|
|
122
|
-
style: props.animation ? { ...defaultNativeStyle, ...style } : null,
|
|
123
|
-
pseudos,
|
|
124
|
-
staticConfig,
|
|
125
|
-
theme,
|
|
126
|
-
onDidAnimate: props.onDidAnimate
|
|
127
|
-
});
|
|
128
|
-
const {
|
|
129
|
-
tag,
|
|
130
|
-
hitSlop,
|
|
131
|
-
asChild,
|
|
132
|
-
children,
|
|
133
|
-
pointerEvents,
|
|
134
|
-
onPress,
|
|
135
|
-
onPressIn,
|
|
136
|
-
onPressOut,
|
|
137
|
-
onHoverIn,
|
|
138
|
-
onHoverOut,
|
|
139
|
-
space,
|
|
140
|
-
disabled,
|
|
141
|
-
onMouseEnter,
|
|
142
|
-
onMouseLeave,
|
|
143
|
-
hrefAttrs,
|
|
144
|
-
onMoveShouldSetResponder,
|
|
145
|
-
onMoveShouldSetResponderCapture,
|
|
146
|
-
onResponderEnd,
|
|
147
|
-
onResponderGrant,
|
|
148
|
-
onResponderMove,
|
|
149
|
-
onResponderReject,
|
|
150
|
-
onResponderRelease,
|
|
151
|
-
onResponderStart,
|
|
152
|
-
onResponderTerminate,
|
|
153
|
-
onResponderTerminationRequest,
|
|
154
|
-
onScrollShouldSetResponder,
|
|
155
|
-
onScrollShouldSetResponderCapture,
|
|
156
|
-
onSelectionChangeShouldSetResponder,
|
|
157
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
158
|
-
onStartShouldSetResponder,
|
|
159
|
-
onStartShouldSetResponderCapture,
|
|
160
|
-
onMouseDown,
|
|
161
|
-
nativeID,
|
|
162
|
-
accessible,
|
|
163
|
-
accessibilityRole,
|
|
164
|
-
collapsable,
|
|
165
|
-
focusable,
|
|
166
|
-
onClick,
|
|
167
|
-
theme: _themeProp,
|
|
168
|
-
defaultVariants,
|
|
169
|
-
onLayout,
|
|
170
|
-
...viewPropsRest
|
|
171
|
-
} = viewPropsIn;
|
|
172
|
-
let viewProps = viewPropsRest;
|
|
173
|
-
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
|
|
174
|
-
Children.toArray(props.children).forEach((item) => {
|
|
175
|
-
if (typeof item === "string") {
|
|
176
|
-
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
|
|
181
|
-
const hostRef = useRef(null);
|
|
182
|
-
const internal = useRef();
|
|
183
|
-
if (!internal.current) {
|
|
184
|
-
internal.current = {
|
|
185
|
-
isMounted: true
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
useIsomorphicLayoutEffect(() => {
|
|
189
|
-
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
190
|
-
setStateShallow({
|
|
191
|
-
mounted: true
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
internal.current.isMounted = true;
|
|
195
|
-
return () => {
|
|
196
|
-
mouseUps.delete(unPress);
|
|
197
|
-
internal.current.isMounted = false;
|
|
198
|
-
};
|
|
199
|
-
}, [hasEnterStyle, props.animation]);
|
|
200
|
-
if (nativeID) {
|
|
201
|
-
viewProps.id = nativeID;
|
|
202
|
-
}
|
|
203
|
-
if (isAndroid) {
|
|
204
|
-
if (collapsable)
|
|
205
|
-
viewProps.collapsable = collapsable;
|
|
206
|
-
if (focusable)
|
|
207
|
-
viewProps.focusable = focusable;
|
|
208
|
-
}
|
|
209
|
-
if (!isWeb) {
|
|
210
|
-
if (accessible)
|
|
211
|
-
viewProps.accessible = accessible;
|
|
212
|
-
if (accessibilityRole)
|
|
213
|
-
viewProps.accessibilityRole = accessibilityRole;
|
|
214
|
-
}
|
|
215
|
-
if (isWeb && !asChild) {
|
|
216
|
-
rnw.useResponderEvents(hostRef, {
|
|
217
|
-
onMoveShouldSetResponder,
|
|
218
|
-
onMoveShouldSetResponderCapture,
|
|
219
|
-
onResponderEnd,
|
|
220
|
-
onResponderGrant,
|
|
221
|
-
onResponderMove,
|
|
222
|
-
onResponderReject,
|
|
223
|
-
onResponderRelease,
|
|
224
|
-
onResponderStart,
|
|
225
|
-
onResponderTerminate,
|
|
226
|
-
onResponderTerminationRequest,
|
|
227
|
-
onScrollShouldSetResponder,
|
|
228
|
-
onScrollShouldSetResponderCapture,
|
|
229
|
-
onSelectionChangeShouldSetResponder,
|
|
230
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
231
|
-
onStartShouldSetResponder,
|
|
232
|
-
onStartShouldSetResponderCapture
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
const isTaggable = !Component || typeof Component === "string";
|
|
236
|
-
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
237
|
-
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
238
|
-
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
239
|
-
let ViewComponent = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
240
|
-
ViewComponent = Component || ViewComponent;
|
|
241
|
-
let styles;
|
|
242
|
-
const isStringElement = typeof ViewComponent === "string";
|
|
243
|
-
const animationStyles = state.animation ? state.animation.style : null;
|
|
244
|
-
if (isStringElement && shouldAvoidClasses) {
|
|
245
|
-
styles = {
|
|
246
|
-
...defaultNativeStyle,
|
|
247
|
-
...animationStyles,
|
|
248
|
-
...medias
|
|
249
|
-
};
|
|
250
|
-
} else {
|
|
251
|
-
styles = [
|
|
252
|
-
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
253
|
-
animationStyles ? animationStyles : style,
|
|
254
|
-
medias
|
|
255
|
-
];
|
|
256
|
-
if (!animationStyles) {
|
|
257
|
-
!state.mounted && addPseudoToStyles(styles, "enterStyle", pseudos);
|
|
258
|
-
state.hover && addPseudoToStyles(styles, "hoverStyle", pseudos);
|
|
259
|
-
state.focus && addPseudoToStyles(styles, "focusStyle", pseudos);
|
|
260
|
-
state.press && addPseudoToStyles(styles, "pressStyle", pseudos);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
if (isWeb) {
|
|
264
|
-
if (!shouldAvoidClasses) {
|
|
265
|
-
const fontFamilyName = isText ? props.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
266
|
-
const fontFamily = fontFamilyName && fontFamilyName[0] === "$" ? fontFamilyName.slice(1) : null;
|
|
267
|
-
const classList = [
|
|
268
|
-
componentName ? componentClassName : "",
|
|
269
|
-
fontFamily ? `font_${fontFamily}` : "",
|
|
270
|
-
theme.className,
|
|
271
|
-
classNames ? Object.values(classNames).join(" ") : ""
|
|
272
|
-
];
|
|
273
|
-
const className = classList.join(" ");
|
|
274
|
-
if (process.env.NODE_ENV === "development") {
|
|
275
|
-
if (props["debug"]) {
|
|
276
|
-
console.log(" \xBB className", { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
viewProps.className = className;
|
|
280
|
-
viewProps.style = animationStyles;
|
|
281
|
-
} else {
|
|
282
|
-
viewProps.style = styles;
|
|
283
|
-
}
|
|
284
|
-
} else {
|
|
285
|
-
viewProps.style = styles;
|
|
286
|
-
}
|
|
287
|
-
if (pointerEvents) {
|
|
288
|
-
viewProps.pointerEvents = pointerEvents;
|
|
289
|
-
}
|
|
290
|
-
if (isWeb) {
|
|
291
|
-
const platformMethodsRef = rnw.usePlatformMethods(viewProps);
|
|
292
|
-
const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
|
|
293
|
-
if (!isAnimated) {
|
|
294
|
-
viewProps.ref = setRef;
|
|
295
|
-
} else {
|
|
296
|
-
if (forwardedRef) {
|
|
297
|
-
viewProps.ref = forwardedRef;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
if (props.href != null && hrefAttrs != null) {
|
|
301
|
-
const { download, rel, target } = hrefAttrs;
|
|
302
|
-
if (download != null) {
|
|
303
|
-
viewProps.download = download;
|
|
304
|
-
}
|
|
305
|
-
if (rel != null) {
|
|
306
|
-
viewProps.rel = rel;
|
|
307
|
-
}
|
|
308
|
-
if (typeof target === "string") {
|
|
309
|
-
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
} else {
|
|
313
|
-
if (forwardedRef) {
|
|
314
|
-
viewProps.ref = forwardedRef;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
const initialPseudos = initialSplitStyles.pseudos;
|
|
318
|
-
const attachPress = !!(pseudos && pseudos.pressStyle || initialPseudos && initialPseudos.pressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
319
|
-
const isTouch = useIsTouchDevice();
|
|
320
|
-
const isHoverable = isWeb && !isTouch;
|
|
321
|
-
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
322
|
-
const handlesPressEvents = !isStringElement && !asChild;
|
|
323
|
-
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
324
|
-
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
325
|
-
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
326
|
-
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
327
|
-
const unPress = useCallback(() => {
|
|
328
|
-
if (!internal.current.isMounted)
|
|
329
|
-
return;
|
|
330
|
-
setStateShallow({
|
|
331
|
-
press: false,
|
|
332
|
-
pressIn: false
|
|
333
|
-
});
|
|
334
|
-
}, []);
|
|
335
|
-
const events = shouldAttach ? {
|
|
336
|
-
[pressOutKey]: attachPress ? (e) => {
|
|
337
|
-
unPress();
|
|
338
|
-
onPressOut == null ? void 0 : onPressOut(e);
|
|
339
|
-
} : void 0,
|
|
340
|
-
...isHoverable && {
|
|
341
|
-
onMouseEnter: attachHover ? (e) => {
|
|
342
|
-
let next = {};
|
|
343
|
-
if (attachHover) {
|
|
344
|
-
next.hover = true;
|
|
345
|
-
}
|
|
346
|
-
if (state.pressIn) {
|
|
347
|
-
next.press = true;
|
|
348
|
-
}
|
|
349
|
-
if (Object.keys(next).length) {
|
|
350
|
-
setStateShallow(next);
|
|
351
|
-
}
|
|
352
|
-
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
353
|
-
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
354
|
-
} : void 0,
|
|
355
|
-
onMouseLeave: attachHover ? (e) => {
|
|
356
|
-
let next = {};
|
|
357
|
-
mouseUps.add(unPress);
|
|
358
|
-
if (attachHover) {
|
|
359
|
-
next.hover = false;
|
|
360
|
-
}
|
|
361
|
-
if (state.pressIn) {
|
|
362
|
-
next.press = false;
|
|
363
|
-
next.pressIn = false;
|
|
364
|
-
}
|
|
365
|
-
if (Object.keys(next).length) {
|
|
366
|
-
setStateShallow(next);
|
|
367
|
-
}
|
|
368
|
-
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
369
|
-
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
370
|
-
} : void 0
|
|
371
|
-
},
|
|
372
|
-
[pressInKey]: attachPress ? (e) => {
|
|
373
|
-
setStateShallow({
|
|
374
|
-
press: true,
|
|
375
|
-
pressIn: true
|
|
376
|
-
});
|
|
377
|
-
onPressIn == null ? void 0 : onPressIn(e);
|
|
378
|
-
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
379
|
-
if (isWeb) {
|
|
380
|
-
mouseUps.add(unPress);
|
|
381
|
-
}
|
|
382
|
-
} : null,
|
|
383
|
-
[pressKey]: attachPress ? (e) => {
|
|
384
|
-
unPress();
|
|
385
|
-
onClick == null ? void 0 : onClick(e);
|
|
386
|
-
onPress == null ? void 0 : onPress(e);
|
|
387
|
-
} : null
|
|
388
|
-
} : null;
|
|
389
|
-
const childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
|
|
390
|
-
children,
|
|
391
|
-
space,
|
|
392
|
-
direction: props.spaceDirection || "both",
|
|
393
|
-
isZStack
|
|
394
|
-
}), getThemeManagerIfChanged(theme));
|
|
395
|
-
let content;
|
|
396
|
-
if (isWeb) {
|
|
397
|
-
if (staticConfig.isReactNativeWeb) {
|
|
398
|
-
viewProps.dataSet = {
|
|
399
|
-
...viewProps.dataSet,
|
|
400
|
-
className: viewProps.className
|
|
401
|
-
};
|
|
402
|
-
} else {
|
|
403
|
-
const rnProps = rnw.createDOMProps(viewProps);
|
|
404
|
-
const className = rnProps.className && rnProps.className !== viewProps.className ? `${rnProps.className} ${viewProps.className}` : viewProps.className;
|
|
405
|
-
Object.assign(viewProps, rnProps);
|
|
406
|
-
if (className) {
|
|
407
|
-
viewProps.className = className;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
if (asChild) {
|
|
412
|
-
ViewComponent = Slot;
|
|
413
|
-
const onlyChild = React.Children.only(children);
|
|
414
|
-
Object.assign(viewProps, onlyChild.props);
|
|
415
|
-
}
|
|
416
|
-
if (isWeb) {
|
|
417
|
-
const [pressableProps] = usePressable(events ? {
|
|
418
|
-
disabled,
|
|
419
|
-
...hitSlop && {
|
|
420
|
-
hitSlop
|
|
421
|
-
},
|
|
422
|
-
onPressOut: events[pressOutKey],
|
|
423
|
-
onPressIn: events[pressInKey],
|
|
424
|
-
onPress: events[pressKey]
|
|
425
|
-
} : {
|
|
426
|
-
disabled: true
|
|
427
|
-
});
|
|
428
|
-
if (events) {
|
|
429
|
-
if (handlesPressEvents) {
|
|
430
|
-
Object.assign(viewProps, pressableProps);
|
|
431
|
-
} else {
|
|
432
|
-
Object.assign(viewProps, events);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
content = createElement(ViewComponent, viewProps, childEls);
|
|
437
|
-
if (!isWeb) {
|
|
438
|
-
if (attachPress && events) {
|
|
439
|
-
content = <Pressable onPressIn={events[pressInKey]} onPress={events[pressKey]}><BaseButton onActiveStateChange={(isActive) => {
|
|
440
|
-
if (!isActive) {
|
|
441
|
-
unPress();
|
|
442
|
-
}
|
|
443
|
-
}}>{content}</BaseButton></Pressable>;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (isWeb && events && attachHover) {
|
|
447
|
-
content = <span className="tui_Hoverable" style={{
|
|
448
|
-
display: "contents"
|
|
449
|
-
}} onMouseEnter={events.onMouseEnter} onMouseLeave={events.onMouseLeave}>{content}</span>;
|
|
450
|
-
}
|
|
451
|
-
if (process.env.NODE_ENV === "development") {
|
|
452
|
-
if (props["debug"]) {
|
|
453
|
-
console.log(" \xBB ", { propsIn: { ...props }, propsOut: { ...viewProps }, state, splitStyles, animationStyles, isStringElement, classNamesIn: (_b = props.className) == null ? void 0 : _b.split(" "), classNamesOut: (_c = viewProps.className) == null ? void 0 : _c.split(" "), events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...typeof window !== "undefined" ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null });
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (features.length) {
|
|
457
|
-
return <>
|
|
458
|
-
{features}
|
|
459
|
-
{content}
|
|
460
|
-
</>;
|
|
461
|
-
}
|
|
462
|
-
return content;
|
|
463
|
-
});
|
|
464
|
-
component.displayName = staticConfig.componentName;
|
|
465
|
-
onConfiguredOnce((conf) => {
|
|
466
|
-
var _a, _b, _c, _d;
|
|
467
|
-
if (process.env.IS_STATIC === "is_static") {
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
tamaguiConfig = conf;
|
|
471
|
-
mergeShorthands(staticConfig, tamaguiConfig);
|
|
472
|
-
avoidClasses = !!((_a = tamaguiConfig.animations) == null ? void 0 : _a.avoidClasses);
|
|
473
|
-
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
474
|
-
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
475
|
-
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
476
|
-
initialSplitStyles = insertSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {
|
|
477
|
-
mounted: true,
|
|
478
|
-
hover: false,
|
|
479
|
-
press: false,
|
|
480
|
-
pressIn: false,
|
|
481
|
-
focus: false,
|
|
482
|
-
resolveVariablesAs: "both",
|
|
483
|
-
keepVariantsAsProps: true
|
|
484
|
-
});
|
|
485
|
-
const defaults = {
|
|
486
|
-
...component.defaultProps,
|
|
487
|
-
...initialSplitStyles.viewProps
|
|
488
|
-
};
|
|
489
|
-
defaultNativeStyle = {};
|
|
490
|
-
const validStyles = staticConfig.validStyles || stylePropsView;
|
|
491
|
-
for (const key in staticConfig.defaultProps) {
|
|
492
|
-
const val = staticConfig.defaultProps[key];
|
|
493
|
-
if (typeof val === "string" && val[0] === "$" || !validStyles[key]) {
|
|
494
|
-
defaults[key] = val;
|
|
495
|
-
} else {
|
|
496
|
-
defaultNativeStyle[key] = val;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
defaultNativeStyleSheet = StyleSheet.create({
|
|
500
|
-
base: defaultNativeStyle
|
|
501
|
-
});
|
|
502
|
-
if (Object.keys(defaults).length) {
|
|
503
|
-
tamaguiDefaultProps = defaults;
|
|
504
|
-
}
|
|
505
|
-
if (process.env.NODE_ENV === "development" && ((_d = staticConfig.defaultProps) == null ? void 0 : _d.debug)) {
|
|
506
|
-
if (process.env.IS_STATIC !== "is_static") {
|
|
507
|
-
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
508
|
-
staticConfig,
|
|
509
|
-
initialSplitStyles,
|
|
510
|
-
tamaguiDefaultProps,
|
|
511
|
-
defaultNativeStyle,
|
|
512
|
-
defaults
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
let res = component;
|
|
518
|
-
if (configIn.memo) {
|
|
519
|
-
res = memo(res);
|
|
520
|
-
}
|
|
521
|
-
res["staticConfig"] = {
|
|
522
|
-
validStyles: staticConfig.validStyles || stylePropsView,
|
|
523
|
-
...staticConfig
|
|
524
|
-
};
|
|
525
|
-
if (process.env.NODE_ENV === "development") {
|
|
526
|
-
res["whyDidYouRender"] = true;
|
|
527
|
-
}
|
|
528
|
-
res["extractable"] = (Component, conf) => {
|
|
529
|
-
Component["staticConfig"] = extendStaticConfig({
|
|
530
|
-
Component,
|
|
531
|
-
...conf,
|
|
532
|
-
neverFlatten: true,
|
|
533
|
-
defaultProps: {
|
|
534
|
-
...Component.defaultProps,
|
|
535
|
-
...conf == null ? void 0 : conf.defaultProps
|
|
536
|
-
}
|
|
537
|
-
}, res);
|
|
538
|
-
return Component;
|
|
539
|
-
};
|
|
540
|
-
return res;
|
|
541
|
-
}
|
|
542
|
-
__name(createComponent, "createComponent");
|
|
543
|
-
const Spacer = createComponent({
|
|
544
|
-
memo: true,
|
|
545
|
-
componentName: "Spacer",
|
|
546
|
-
defaultProps: {
|
|
547
|
-
...stackDefaultStyles,
|
|
548
|
-
size: true
|
|
549
|
-
},
|
|
550
|
-
variants: {
|
|
551
|
-
size: {
|
|
552
|
-
"...size": (size, { tokens }) => {
|
|
553
|
-
var _a;
|
|
554
|
-
size = size == true ? "$true" : size;
|
|
555
|
-
const sizePx = (_a = tokens.size[size]) != null ? _a : size;
|
|
556
|
-
return {
|
|
557
|
-
width: sizePx,
|
|
558
|
-
height: sizePx,
|
|
559
|
-
minWidth: sizePx,
|
|
560
|
-
minHeight: sizePx
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
flex: {
|
|
565
|
-
true: {
|
|
566
|
-
flex: 1
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
direction: {
|
|
570
|
-
horizontal: {
|
|
571
|
-
height: 0,
|
|
572
|
-
minHeight: 0
|
|
573
|
-
},
|
|
574
|
-
vertical: {
|
|
575
|
-
width: 0,
|
|
576
|
-
minWidth: 0
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
defaultVariants: {
|
|
581
|
-
direction: "horizontal"
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
function spacedChildren({
|
|
585
|
-
isZStack,
|
|
586
|
-
children,
|
|
587
|
-
space,
|
|
588
|
-
direction,
|
|
589
|
-
spaceFlex
|
|
590
|
-
}) {
|
|
591
|
-
var _a;
|
|
592
|
-
const childrenList = Array.isArray(children) ? children : Children.toArray(children);
|
|
593
|
-
const len = childrenList.length;
|
|
594
|
-
if (len <= 1) {
|
|
595
|
-
return childrenList;
|
|
596
|
-
}
|
|
597
|
-
const final = [];
|
|
598
|
-
for (const [index, child] of childrenList.entries()) {
|
|
599
|
-
if (child === null || child === void 0 || child === false || Array.isArray(child) && child.length === 0) {
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
602
|
-
if (!child || child["key"] && !isZStack) {
|
|
603
|
-
final.push(child);
|
|
604
|
-
} else {
|
|
605
|
-
final.push(<Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>);
|
|
606
|
-
}
|
|
607
|
-
if ((_a = child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) {
|
|
608
|
-
continue;
|
|
609
|
-
}
|
|
610
|
-
const next = childrenList[index + 1];
|
|
611
|
-
if (next && space) {
|
|
612
|
-
final.push(<Spacer key={`_${index}_spacer`} direction={direction === "both" ? void 0 : direction === "row" || direction === "row-reverse" ? "horizontal" : "vertical"} size={space} {...spaceFlex && {
|
|
613
|
-
flex: spaceFlex
|
|
614
|
-
}} />);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
return final;
|
|
618
|
-
}
|
|
619
|
-
__name(spacedChildren, "spacedChildren");
|
|
620
|
-
function AbsoluteFill(props) {
|
|
621
|
-
return isWeb ? <div style={{
|
|
622
|
-
position: "absolute",
|
|
623
|
-
top: 0,
|
|
624
|
-
left: 0,
|
|
625
|
-
right: 0,
|
|
626
|
-
bottom: 0
|
|
627
|
-
}}>{props.children}</div> : <View style={StyleSheet.absoluteFill}>{props.child}</View>;
|
|
628
|
-
}
|
|
629
|
-
__name(AbsoluteFill, "AbsoluteFill");
|
|
630
|
-
export {
|
|
631
|
-
AbsoluteFill,
|
|
632
|
-
Spacer,
|
|
633
|
-
createComponent,
|
|
634
|
-
mouseUps,
|
|
635
|
-
spacedChildren
|
|
636
|
-
};
|
package/dist/jsx/createFont.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { validateFont } from "./helpers/validate";
|
|
4
|
-
const createFont = /* @__PURE__ */ __name((font) => {
|
|
5
|
-
if (process.env.NODE_ENV === "development") {
|
|
6
|
-
validateFont(font);
|
|
7
|
-
}
|
|
8
|
-
const sizeKeys = Object.keys(font.size);
|
|
9
|
-
for (const key in font) {
|
|
10
|
-
if (key === "size" || key === "family")
|
|
11
|
-
continue;
|
|
12
|
-
const section = font[key];
|
|
13
|
-
const keys = Object.keys(section);
|
|
14
|
-
let fillVal = section[keys[0]];
|
|
15
|
-
for (const sKey of sizeKeys) {
|
|
16
|
-
if (!(sKey in section)) {
|
|
17
|
-
section[sKey] = fillVal;
|
|
18
|
-
} else {
|
|
19
|
-
fillVal = section[sKey];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return Object.freeze(font);
|
|
24
|
-
}, "createFont");
|
|
25
|
-
export {
|
|
26
|
-
createFont
|
|
27
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
function createShorthands(shorthands) {
|
|
4
|
-
return Object.freeze(shorthands);
|
|
5
|
-
}
|
|
6
|
-
__name(createShorthands, "createShorthands");
|
|
7
|
-
export {
|
|
8
|
-
createShorthands
|
|
9
|
-
};
|