@tamagui/core 1.0.1-beta.19 → 1.0.1-beta.190
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 +14 -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} +33 -19
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +11 -23
- 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/{views → contexts}/TextAncestorContext.js +11 -13
- 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 +925 -484
- 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 +1 -1
- package/dist/cjs/createTamagui.js +129 -177
- 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 +52 -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} +54 -52
- 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/calc.js +71 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +17 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +268 -120
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +14 -25
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- 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 +49 -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 +381 -208
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +46 -0
- package/dist/cjs/helpers/getStackSize.js.map +7 -0
- package/dist/cjs/helpers/getStylesAtomic.js +199 -133
- package/dist/cjs/helpers/getStylesAtomic.js.map +3 -3
- 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 +88 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +87 -52
- 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 +93 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +7 -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 +39 -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/useDidFinishSSR.js +60 -0
- package/dist/cjs/hooks/useDidFinishSSR.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/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +11 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +162 -113
- 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 +60 -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 +166 -132
- 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 +59 -21
- package/dist/cjs/index.js.map +2 -2
- 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/static.js +22 -15
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +47 -44
- 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 +63 -65
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +82 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +28 -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 +18 -12
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +8 -11
- 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 +45 -0
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +2 -2
- 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 +17 -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 +891 -389
- 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 +1 -1
- package/dist/esm/createTamagui.js +128 -158
- 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 +47 -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} +53 -53
- 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/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +16 -10
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +263 -121
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +13 -12
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- 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 +35 -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 +364 -188
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +22 -0
- package/dist/esm/helpers/getStackSize.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +187 -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 +63 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +82 -50
- 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 +69 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +6 -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 +14 -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/useDidFinishSSR.js +35 -0
- package/dist/esm/hooks/useDidFinishSSR.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/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +10 -10
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +157 -103
- 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 +36 -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 +159 -109
- 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 +51 -13
- package/dist/esm/index.js.map +2 -2
- 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/static.js +15 -15
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +40 -12
- 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 +50 -32
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +0 -0
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js +52 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +13 -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 +13 -12
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +48 -16
- package/reset.css +25 -4
- package/src/Tamagui.ts +44 -0
- package/src/addTheme.ts +67 -0
- package/src/config.ts +45 -0
- package/src/constants/constants.ts +15 -0
- package/src/constants/isDevTools.ts +6 -0
- package/src/constants/platform.native.ts +14 -0
- package/src/constants/platform.ts +41 -0
- package/src/contexts/ButtonInsideButtonContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +10 -0
- package/src/contexts/ThemeContext.tsx +5 -0
- package/src/createComponent.tsx +1599 -0
- package/src/createFont.ts +29 -0
- package/src/createShorthands.ts +5 -0
- package/src/createTamagui.ts +229 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.ts +85 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.tsx +235 -0
- package/src/helpers/areEqualSets.tsx +9 -0
- package/src/helpers/assignNativePropsToWeb.native.tsx +1 -0
- package/src/helpers/assignNativePropsToWeb.tsx +178 -0
- package/src/helpers/calc.ts +68 -0
- package/src/helpers/createMediaStyle.ts +48 -0
- package/src/helpers/createPropMapper.ts +523 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +76 -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/getFont.tsx +43 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +738 -0
- package/src/helpers/getStackSize.ts +22 -0
- package/src/helpers/getStylesAtomic.native.ts +3 -0
- package/src/helpers/getStylesAtomic.ts +292 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +105 -0
- package/src/helpers/getVariantExtras.tsx +84 -0
- package/src/helpers/insertStyleRule.tsx +150 -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 +16 -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 +80 -0
- package/src/helpers/proxyThemeVariables.tsx +18 -0
- package/src/helpers/pseudoDescriptors.ts +18 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/startTransition.ts +4 -0
- package/src/helpers/themeable.tsx +45 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/useShallowSetState.tsx +20 -0
- package/src/helpers/validate.ts +80 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +8 -0
- package/src/hooks/useConstant.tsx +19 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsMounted.ts +16 -0
- package/src/hooks/useIsTouchDevice.tsx +20 -0
- package/src/hooks/useMedia.tsx +266 -0
- package/src/hooks/usePressable.tsx +9 -0
- package/src/hooks/useSafeRef.ts +49 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +299 -0
- package/src/hooks/useUnmountEffect.ts +5 -0
- package/src/index.ts +83 -0
- package/src/injectStyles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/static.ts +15 -0
- package/src/styled.tsx +198 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1307 -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 +9 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +151 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +56 -0
- package/src/views/Text.tsx +79 -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 +6 -8
- package/types/addTheme.d.ts +11 -0
- package/types/conf.d.ts +4 -5
- package/types/config.d.ts +47 -0
- package/types/constants/constants.d.ts +1 -1
- 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/{views → contexts}/TextAncestorContext.d.ts +0 -0
- package/types/{ThemeContext.d.ts → contexts/ThemeContext.d.ts} +1 -1
- package/types/createComponent.d.ts +32 -15
- package/types/createComponent.server.d.ts +36 -0
- 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 +46 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/calc.d.ts +17 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +6 -3
- package/types/helpers/createShallowUpdate.d.ts +1 -2
- package/types/helpers/cssHash.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 +16 -9
- package/types/helpers/getStackSize.d.ts +8 -0
- package/types/helpers/getStylesAtomic.d.ts +17 -22
- 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 +7 -3
- 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 +6 -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/themes.d.ts +4 -0
- package/types/helpers/useAnimationDriver.d.ts +1 -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/useAnimationDriver.d.ts +1 -0
- package/types/hooks/useDidFinishSSR.d.ts +3 -0
- package/types/hooks/useFeatures.d.ts +10 -5
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsSSR.d.ts +4 -0
- package/types/hooks/useMedia.d.ts +20 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerContext.d.ts +2 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +21 -31
- package/types/index.d.ts +29 -9
- package/types/injectStyles.d.ts +7 -0
- package/types/insertFont.d.ts +9 -0
- package/types/static.d.ts +2 -15
- package/types/styled.d.ts +7 -3
- package/types/types.d.ts +277 -77
- 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/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 +1 -0
- package/types/views/TamaguiProvider.d.ts +4 -0
- 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/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.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/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/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.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.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/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.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.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,39 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
var __export = (target, all) => {
|
|
38
9
|
for (var name in all)
|
|
39
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -46,262 +17,297 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
46
17
|
}
|
|
47
18
|
return to;
|
|
48
19
|
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
50
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
51
25
|
var createComponent_exports = {};
|
|
52
26
|
__export(createComponent_exports, {
|
|
53
|
-
AbsoluteFill: () => AbsoluteFill,
|
|
54
27
|
Spacer: () => Spacer,
|
|
28
|
+
Unspaced: () => Unspaced,
|
|
29
|
+
accessibilityRoleToWebRole: () => accessibilityRoleToWebRole,
|
|
55
30
|
createComponent: () => createComponent,
|
|
56
31
|
mouseUps: () => mouseUps,
|
|
32
|
+
processIDRefList: () => processIDRefList,
|
|
57
33
|
spacedChildren: () => spacedChildren
|
|
58
34
|
});
|
|
59
35
|
module.exports = __toCommonJS(createComponent_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_constants = require("@tamagui/constants");
|
|
60
38
|
var import_helpers = require("@tamagui/helpers");
|
|
39
|
+
var import_rnw = require("@tamagui/rnw");
|
|
61
40
|
var import_use_force_update = require("@tamagui/use-force-update");
|
|
62
41
|
var import_react = __toESM(require("react"));
|
|
63
42
|
var import_react_native = require("react-native");
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
43
|
+
var import_config = require("./config");
|
|
44
|
+
var import_constants2 = require("./constants/constants");
|
|
45
|
+
var import_FontLanguageContext = require("./contexts/FontLanguageContext");
|
|
46
|
+
var import_TextAncestorContext = require("./contexts/TextAncestorContext");
|
|
47
|
+
var import_assignNativePropsToWeb = require("./helpers/assignNativePropsToWeb");
|
|
48
|
+
var import_createPropMapper = require("./helpers/createPropMapper");
|
|
69
49
|
var import_extendStaticConfig = require("./helpers/extendStaticConfig");
|
|
70
50
|
var import_getSplitStyles = require("./helpers/getSplitStyles");
|
|
71
51
|
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
72
|
-
var
|
|
52
|
+
var import_mergeProps = require("./helpers/mergeProps");
|
|
73
53
|
var import_proxyThemeVariables = require("./helpers/proxyThemeVariables");
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var import_useIsTouchDevice = require("./hooks/useIsTouchDevice");
|
|
54
|
+
var import_useShallowSetState = require("./helpers/useShallowSetState");
|
|
55
|
+
var import_useMedia = require("./hooks/useMedia");
|
|
77
56
|
var import_usePressable = require("./hooks/usePressable");
|
|
57
|
+
var import_useServerHooks = require("./hooks/useServerHooks");
|
|
78
58
|
var import_useTheme = require("./hooks/useTheme");
|
|
59
|
+
var import_Pressability = require("./vendor/Pressability");
|
|
79
60
|
var import_Slot = require("./views/Slot");
|
|
80
|
-
var
|
|
61
|
+
var import_Theme = require("./views/Theme");
|
|
81
62
|
import_react.default["keep"];
|
|
82
|
-
|
|
83
|
-
hover: false,
|
|
84
|
-
press: false,
|
|
85
|
-
pressIn: false,
|
|
86
|
-
focus: false,
|
|
87
|
-
mounted: false,
|
|
88
|
-
animation: null
|
|
89
|
-
};
|
|
63
|
+
let defaultComponentState = null;
|
|
90
64
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
91
65
|
if (typeof document !== "undefined") {
|
|
92
|
-
|
|
93
|
-
mouseUps.forEach((x) => x());
|
|
94
|
-
mouseUps.clear();
|
|
95
|
-
});
|
|
96
|
-
document.addEventListener("touchend", () => {
|
|
66
|
+
const cancelTouches = () => {
|
|
97
67
|
mouseUps.forEach((x) => x());
|
|
98
68
|
mouseUps.clear();
|
|
99
|
-
}
|
|
100
|
-
document.addEventListener("
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
69
|
+
};
|
|
70
|
+
document.addEventListener("mouseup", cancelTouches);
|
|
71
|
+
document.addEventListener("touchend", cancelTouches);
|
|
72
|
+
document.addEventListener("touchcancel", cancelTouches);
|
|
104
73
|
}
|
|
105
74
|
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
106
|
-
for (const key
|
|
75
|
+
for (const key of Object.keys(defaultProps)) {
|
|
107
76
|
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
108
77
|
}
|
|
109
78
|
}
|
|
110
|
-
__name(mergeShorthands, "mergeShorthands");
|
|
111
79
|
let initialTheme;
|
|
80
|
+
let config;
|
|
112
81
|
function createComponent(configIn, ParentComponent) {
|
|
113
82
|
const staticConfig = (() => {
|
|
114
|
-
const
|
|
115
|
-
if ("parsed" in
|
|
116
|
-
return
|
|
83
|
+
const next = (0, import_extendStaticConfig.extendStaticConfig)(configIn, ParentComponent);
|
|
84
|
+
if ("parsed" in next) {
|
|
85
|
+
return next;
|
|
117
86
|
} else {
|
|
118
|
-
return (0, import_extendStaticConfig.parseStaticConfig)(
|
|
87
|
+
return (0, import_extendStaticConfig.parseStaticConfig)(next);
|
|
119
88
|
}
|
|
120
89
|
})();
|
|
121
|
-
const
|
|
90
|
+
const defaultComponentClassName = `is_${staticConfig.componentName}`;
|
|
122
91
|
let tamaguiConfig;
|
|
123
92
|
let AnimatedText;
|
|
124
93
|
let AnimatedView;
|
|
125
94
|
let avoidClasses = true;
|
|
126
95
|
let defaultNativeStyle;
|
|
127
|
-
let defaultNativeStyleSheet;
|
|
128
96
|
let tamaguiDefaultProps;
|
|
129
97
|
let initialSplitStyles;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (pseudoStyle) {
|
|
138
|
-
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
98
|
+
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
100
|
+
let props;
|
|
101
|
+
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
102
|
+
props = (0, import_mergeProps.mergeProps)(tamaguiDefaultProps, propsIn)[0];
|
|
103
|
+
} else {
|
|
104
|
+
props = propsIn;
|
|
139
105
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
106
|
+
const debugProp = props["debug"];
|
|
107
|
+
const { Component, isText, isZStack } = staticConfig;
|
|
108
|
+
const componentName = props.componentName || staticConfig.componentName;
|
|
109
|
+
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
110
|
+
const forceUpdate = (0, import_use_force_update.useForceUpdate)();
|
|
111
|
+
config = config || (0, import_config.getConfig)();
|
|
112
|
+
const theme = (0, import_useTheme.useTheme)(props.theme, componentName, props, forceUpdate);
|
|
113
|
+
const states = (0, import_useServerHooks.useServerState)(defaultComponentState);
|
|
114
|
+
const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0];
|
|
115
|
+
const shouldAvoidClasses = !!(props.animation && avoidClasses) || !staticConfig.acceptsClassName;
|
|
116
|
+
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
117
|
+
const hasTextAncestor = !!(import_constants.isWeb && isText ? (0, import_react.useContext)(import_TextAncestorContext.TextAncestorContext) : false);
|
|
118
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? {
|
|
119
|
+
...state,
|
|
120
|
+
hasTextAncestor,
|
|
121
|
+
dynamicStylesInline: true
|
|
122
|
+
} : {
|
|
123
|
+
...state,
|
|
124
|
+
noClassNames: true,
|
|
125
|
+
dynamicStylesInline: true,
|
|
126
|
+
hasTextAncestor,
|
|
127
|
+
resolveVariablesAs: "value"
|
|
128
|
+
};
|
|
129
|
+
const languageContext = import_constants.isRSC ? null : (0, import_react.useContext)(import_FontLanguageContext.FontLanguageContext);
|
|
130
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
131
|
+
props,
|
|
132
|
+
staticConfig,
|
|
133
|
+
theme,
|
|
134
|
+
splitStyleState,
|
|
135
|
+
props.asChild ? null : initialSplitStyles == null ? void 0 : initialSplitStyles.classNames,
|
|
136
|
+
languageContext || void 0,
|
|
137
|
+
debugProp
|
|
138
|
+
);
|
|
139
|
+
const hostRef = (0, import_useServerHooks.useServerRef)(null);
|
|
140
|
+
const setState = states[1];
|
|
141
|
+
const setStateShallow = (0, import_useShallowSetState.useShallowSetState)(setState);
|
|
146
142
|
if (process.env.NODE_ENV === "development") {
|
|
147
|
-
if (
|
|
148
|
-
console.
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
if (!process.env.TAMAGUI_TARGET) {
|
|
144
|
+
console.error(`No process.env.TAMAGUI_TARGET set, please set it to "native" or "web".`);
|
|
145
|
+
}
|
|
146
|
+
if (debugProp) {
|
|
147
|
+
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
148
|
+
const type = staticConfig.isReactNativeWeb ? "rnw" : "tamagui";
|
|
149
|
+
const banner = `${name} ${propsIn["data-is"] || ""} ${type}`;
|
|
150
|
+
console.group(`%c \u{1F41B} ${banner}`, "background: yellow;");
|
|
151
|
+
console.groupCollapsed("initial props/state");
|
|
152
|
+
console.log("props", propsIn);
|
|
153
|
+
console.log("splitStyles", splitStyles);
|
|
154
|
+
console.log("className", Object.values(splitStyles.classNames));
|
|
155
|
+
if (typeof window !== "undefined") {
|
|
156
|
+
console.log("ref", hostRef, "(click to view)");
|
|
157
|
+
}
|
|
158
|
+
console.groupEnd();
|
|
159
|
+
if (debugProp === "break") {
|
|
151
160
|
debugger;
|
|
161
|
+
}
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
const [state, set_] = (0, import_react.useState)(defaultComponentState);
|
|
157
|
-
const setStateShallow = (0, import_createShallowUpdate.createShallowUpdate)(set_);
|
|
158
|
-
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
159
|
-
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, shouldAvoidClasses ? __spreadProps(__spreadValues({}, state), { noClassNames: true, resolveVariablesAs: "value" }) : state, shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames);
|
|
160
|
-
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
161
|
-
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
162
|
-
const isAnimated = !!(useAnimations && props.animation);
|
|
163
|
-
const hasEnterStyle = !!props.enterStyle;
|
|
164
|
-
const features = (0, import_useFeatures.useFeatures)(props, {
|
|
165
|
-
forceUpdate,
|
|
166
|
-
setStateShallow,
|
|
167
|
-
useAnimations,
|
|
168
|
-
state,
|
|
169
|
-
style: props.animation ? __spreadValues(__spreadValues({}, defaultNativeStyle), style) : null,
|
|
164
|
+
const {
|
|
165
|
+
viewProps: viewPropsIn,
|
|
170
166
|
pseudos,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
medias,
|
|
168
|
+
style: splitStylesStyle,
|
|
169
|
+
classNames,
|
|
170
|
+
mediaKeys
|
|
171
|
+
} = splitStyles;
|
|
172
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
173
|
+
if (!mediaKeys.length) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const disposers = [];
|
|
177
|
+
for (const key of mediaKeys) {
|
|
178
|
+
disposers.push(
|
|
179
|
+
(0, import_useMedia.addMediaQueryListener)(key, (next) => {
|
|
180
|
+
setState((prev) => {
|
|
181
|
+
if (prev.mediaState[key] !== next) {
|
|
182
|
+
return {
|
|
183
|
+
...prev,
|
|
184
|
+
mediaState: {
|
|
185
|
+
...prev.mediaState,
|
|
186
|
+
[key]: next
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return prev;
|
|
191
|
+
});
|
|
192
|
+
})
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return () => {
|
|
196
|
+
};
|
|
197
|
+
}, [mediaKeys.join(",")]);
|
|
198
|
+
const useAnimations = (_a = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
199
|
+
const nextIsAnimated = !!(useAnimations && props.animation);
|
|
200
|
+
const isAnimated = nextIsAnimated || state.hasAnimation;
|
|
201
|
+
if (nextIsAnimated && !state.hasAnimation) {
|
|
202
|
+
setStateShallow({ hasAnimation: true });
|
|
203
|
+
}
|
|
204
|
+
const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...splitStylesStyle } : null;
|
|
205
|
+
const propsWithAnimation = props;
|
|
206
|
+
if (!import_constants.isRSC && isAnimated && useAnimations) {
|
|
207
|
+
const animationState = useAnimations(propsWithAnimation, {
|
|
208
|
+
state,
|
|
209
|
+
pseudos,
|
|
210
|
+
onDidAnimate: props.onDidAnimate,
|
|
211
|
+
hostRef,
|
|
212
|
+
staticConfig,
|
|
213
|
+
getStyle({ isExiting, isEntering, exitVariant, enterVariant } = {}) {
|
|
214
|
+
var _a2, _b2, _c2, _d2;
|
|
215
|
+
const style = animationFeatureStylesIn;
|
|
216
|
+
const enterStyle = isEntering ? enterVariant && ((_a2 = staticConfig.variants) == null ? void 0 : _a2[enterVariant]["true"]) ? (0, import_getSplitStyles.getSubStyle)(
|
|
217
|
+
"",
|
|
218
|
+
(_b2 = staticConfig.variants) == null ? void 0 : _b2[enterVariant]["true"],
|
|
219
|
+
staticConfig,
|
|
220
|
+
theme,
|
|
221
|
+
props,
|
|
222
|
+
state,
|
|
223
|
+
tamaguiConfig
|
|
224
|
+
) || pseudos.enterStyle : pseudos.enterStyle : null;
|
|
225
|
+
const exitStyle = isExiting ? exitVariant && ((_c2 = staticConfig.variants) == null ? void 0 : _c2[exitVariant]["true"]) ? (0, import_getSplitStyles.getSubStyle)(
|
|
226
|
+
"",
|
|
227
|
+
(_d2 = staticConfig.variants) == null ? void 0 : _d2[exitVariant]["true"],
|
|
228
|
+
staticConfig,
|
|
229
|
+
theme,
|
|
230
|
+
props,
|
|
231
|
+
state,
|
|
232
|
+
tamaguiConfig
|
|
233
|
+
) || pseudos.exitStyle : pseudos.exitStyle : null;
|
|
234
|
+
ensureBaseHasDefaults(
|
|
235
|
+
style,
|
|
236
|
+
pseudos.hoverStyle,
|
|
237
|
+
pseudos.focusStyle,
|
|
238
|
+
pseudos.pressStyle,
|
|
239
|
+
pseudos.pressStyle
|
|
240
|
+
);
|
|
241
|
+
enterStyle && isEntering && merge(style, enterStyle);
|
|
242
|
+
state.hover && pseudos.hoverStyle && merge(style, pseudos.hoverStyle);
|
|
243
|
+
state.focus && pseudos.focusStyle && merge(style, pseudos.focusStyle);
|
|
244
|
+
state.press && pseudos.pressStyle && merge(style, pseudos.pressStyle);
|
|
245
|
+
exitStyle && isExiting && merge(style, exitStyle);
|
|
246
|
+
if (process.env.NODE_ENV === "development") {
|
|
247
|
+
if (debugProp) {
|
|
248
|
+
console.log("animation style", style);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return style;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
if (animationState !== state.animation) {
|
|
255
|
+
setStateShallow({
|
|
256
|
+
animation: animationState
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const {
|
|
176
261
|
tag,
|
|
177
262
|
hitSlop,
|
|
178
263
|
asChild,
|
|
179
264
|
children,
|
|
180
|
-
pointerEvents,
|
|
181
265
|
onPress,
|
|
182
266
|
onPressIn,
|
|
183
267
|
onPressOut,
|
|
184
268
|
onHoverIn,
|
|
185
269
|
onHoverOut,
|
|
186
|
-
|
|
187
|
-
|
|
270
|
+
themeShallow,
|
|
271
|
+
space: spaceProp,
|
|
272
|
+
spaceDirection: _spaceDirection,
|
|
273
|
+
disabled: disabledProp,
|
|
274
|
+
onMouseUp,
|
|
275
|
+
onMouseDown,
|
|
188
276
|
onMouseEnter,
|
|
189
277
|
onMouseLeave,
|
|
190
278
|
hrefAttrs,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
onResponderEnd,
|
|
194
|
-
onResponderGrant,
|
|
195
|
-
onResponderMove,
|
|
196
|
-
onResponderReject,
|
|
197
|
-
onResponderRelease,
|
|
198
|
-
onResponderStart,
|
|
199
|
-
onResponderTerminate,
|
|
200
|
-
onResponderTerminationRequest,
|
|
201
|
-
onScrollShouldSetResponder,
|
|
202
|
-
onScrollShouldSetResponderCapture,
|
|
203
|
-
onSelectionChangeShouldSetResponder,
|
|
204
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
205
|
-
onStartShouldSetResponder,
|
|
206
|
-
onStartShouldSetResponderCapture,
|
|
207
|
-
onMouseDown,
|
|
208
|
-
nativeID,
|
|
209
|
-
accessible,
|
|
210
|
-
accessibilityRole,
|
|
211
|
-
collapsable,
|
|
212
|
-
focusable,
|
|
279
|
+
separator,
|
|
280
|
+
forceStyle: _forceStyle,
|
|
213
281
|
onClick,
|
|
214
282
|
theme: _themeProp,
|
|
215
283
|
defaultVariants,
|
|
216
|
-
|
|
217
|
-
} =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
"onScrollShouldSetResponder",
|
|
244
|
-
"onScrollShouldSetResponderCapture",
|
|
245
|
-
"onSelectionChangeShouldSetResponder",
|
|
246
|
-
"onSelectionChangeShouldSetResponderCapture",
|
|
247
|
-
"onStartShouldSetResponder",
|
|
248
|
-
"onStartShouldSetResponderCapture",
|
|
249
|
-
"onMouseDown",
|
|
250
|
-
"nativeID",
|
|
251
|
-
"accessible",
|
|
252
|
-
"accessibilityRole",
|
|
253
|
-
"collapsable",
|
|
254
|
-
"focusable",
|
|
255
|
-
"onClick",
|
|
256
|
-
"theme",
|
|
257
|
-
"defaultVariants",
|
|
258
|
-
"onLayout"
|
|
259
|
-
]);
|
|
260
|
-
let viewProps = viewPropsRest;
|
|
261
|
-
if (process.env.NODE_ENV === "development" && !isText && import_platform.isWeb) {
|
|
262
|
-
import_react.Children.toArray(props.children).forEach((item) => {
|
|
263
|
-
if (typeof item === "string") {
|
|
264
|
-
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
const hasTextAncestor = import_platform.isWeb ? (0, import_react.useContext)(import_TextAncestorContext.TextAncestorContext) : false;
|
|
269
|
-
const hostRef = (0, import_react.useRef)(null);
|
|
270
|
-
const internal = (0, import_react.useRef)();
|
|
271
|
-
if (!internal.current) {
|
|
272
|
-
internal.current = {
|
|
273
|
-
isMounted: true
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
277
|
-
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
278
|
-
setStateShallow({
|
|
279
|
-
mounted: true
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
internal.current.isMounted = true;
|
|
283
|
-
return () => {
|
|
284
|
-
mouseUps.delete(unPress);
|
|
285
|
-
internal.current.isMounted = false;
|
|
286
|
-
};
|
|
287
|
-
}, [hasEnterStyle, props.animation]);
|
|
288
|
-
if (nativeID) {
|
|
289
|
-
viewProps.id = nativeID;
|
|
290
|
-
}
|
|
291
|
-
if (import_platform.isAndroid) {
|
|
292
|
-
if (collapsable)
|
|
293
|
-
viewProps.collapsable = collapsable;
|
|
294
|
-
if (focusable)
|
|
295
|
-
viewProps.focusable = focusable;
|
|
296
|
-
}
|
|
297
|
-
if (!import_platform.isWeb) {
|
|
298
|
-
if (accessible)
|
|
299
|
-
viewProps.accessible = accessible;
|
|
300
|
-
if (accessibilityRole)
|
|
301
|
-
viewProps.accessibilityRole = accessibilityRole;
|
|
302
|
-
}
|
|
303
|
-
if (import_platform.isWeb && !asChild) {
|
|
304
|
-
import_rnw.rnw.useResponderEvents(hostRef, {
|
|
284
|
+
...nonTamaguiProps
|
|
285
|
+
} = viewPropsIn;
|
|
286
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
287
|
+
const element = import_constants.isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
288
|
+
const BaseTextComponent = !import_constants.isWeb ? import_react_native.Text : element || "span";
|
|
289
|
+
const BaseViewComponent = !import_constants.isWeb ? import_react_native.View : element || (hasTextAncestor ? "span" : "div");
|
|
290
|
+
let elementType = isText ? (isAnimated ? AnimatedText || import_react_native.Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || import_react_native.View : null) || BaseViewComponent;
|
|
291
|
+
elementType = Component || elementType;
|
|
292
|
+
const isStringElement = typeof elementType === "string";
|
|
293
|
+
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
294
|
+
let viewProps;
|
|
295
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
296
|
+
const shouldSetMounted = Boolean(
|
|
297
|
+
(import_constants.isWeb ? import_constants.isClient : true) && (hasEnterStyle || props.animation) && !state.mounted
|
|
298
|
+
);
|
|
299
|
+
const setMounted = shouldSetMounted ? () => {
|
|
300
|
+
setTimeout(
|
|
301
|
+
() => {
|
|
302
|
+
setStateShallow({
|
|
303
|
+
mounted: true
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
import_constants.isWeb ? 10 : 0
|
|
307
|
+
);
|
|
308
|
+
} : void 0;
|
|
309
|
+
if (process.env.TAMAGUI_TARGET === "web" && !staticConfig.isReactNativeWeb) {
|
|
310
|
+
const {
|
|
305
311
|
onMoveShouldSetResponder,
|
|
306
312
|
onMoveShouldSetResponderCapture,
|
|
307
313
|
onResponderEnd,
|
|
@@ -317,71 +323,89 @@ function createComponent(configIn, ParentComponent) {
|
|
|
317
323
|
onSelectionChangeShouldSetResponder,
|
|
318
324
|
onSelectionChangeShouldSetResponderCapture,
|
|
319
325
|
onStartShouldSetResponder,
|
|
320
|
-
onStartShouldSetResponderCapture
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
326
|
+
onStartShouldSetResponderCapture,
|
|
327
|
+
nativeID,
|
|
328
|
+
accessibilityActiveDescendant,
|
|
329
|
+
accessibilityAtomic,
|
|
330
|
+
accessibilityAutoComplete,
|
|
331
|
+
accessibilityBusy,
|
|
332
|
+
accessibilityChecked,
|
|
333
|
+
accessibilityColumnCount,
|
|
334
|
+
accessibilityColumnIndex,
|
|
335
|
+
accessibilityColumnSpan,
|
|
336
|
+
accessibilityControls,
|
|
337
|
+
accessibilityCurrent,
|
|
338
|
+
accessibilityDescribedBy,
|
|
339
|
+
accessibilityDetails,
|
|
340
|
+
accessibilityDisabled,
|
|
341
|
+
accessibilityErrorMessage,
|
|
342
|
+
accessibilityExpanded,
|
|
343
|
+
accessibilityFlowTo,
|
|
344
|
+
accessibilityHasPopup,
|
|
345
|
+
accessibilityHidden,
|
|
346
|
+
accessibilityInvalid,
|
|
347
|
+
accessibilityKeyShortcuts,
|
|
348
|
+
accessibilityLabel,
|
|
349
|
+
accessibilityLabelledBy,
|
|
350
|
+
accessibilityLevel,
|
|
351
|
+
accessibilityLiveRegion,
|
|
352
|
+
accessibilityModal,
|
|
353
|
+
accessibilityMultiline,
|
|
354
|
+
accessibilityMultiSelectable,
|
|
355
|
+
accessibilityOrientation,
|
|
356
|
+
accessibilityOwns,
|
|
357
|
+
accessibilityPlaceholder,
|
|
358
|
+
accessibilityPosInSet,
|
|
359
|
+
accessibilityPressed,
|
|
360
|
+
accessibilityReadOnly,
|
|
361
|
+
accessibilityRequired,
|
|
362
|
+
accessibilityRole,
|
|
363
|
+
accessibilityRoleDescription,
|
|
364
|
+
accessibilityRowCount,
|
|
365
|
+
accessibilityRowIndex,
|
|
366
|
+
accessibilityRowSpan,
|
|
367
|
+
accessibilitySelected,
|
|
368
|
+
accessibilitySetSize,
|
|
369
|
+
accessibilitySort,
|
|
370
|
+
accessibilityValueMax,
|
|
371
|
+
accessibilityValueMin,
|
|
372
|
+
accessibilityValueNow,
|
|
373
|
+
accessibilityValueText,
|
|
374
|
+
accessible,
|
|
375
|
+
accessibilityState,
|
|
376
|
+
accessibilityValue,
|
|
377
|
+
collapsable,
|
|
378
|
+
focusable,
|
|
379
|
+
onLayout,
|
|
380
|
+
...webProps
|
|
381
|
+
} = nonTamaguiProps;
|
|
382
|
+
viewProps = webProps;
|
|
383
|
+
(0, import_assignNativePropsToWeb.assignNativePropsToWeb)(elementType, viewProps, nonTamaguiProps);
|
|
384
|
+
if (!import_constants.isRSC) {
|
|
385
|
+
(0, import_rnw.useElementLayout)(hostRef, onLayout);
|
|
386
|
+
(0, import_rnw.useResponderEvents)(hostRef, {
|
|
387
|
+
onMoveShouldSetResponder,
|
|
388
|
+
onMoveShouldSetResponderCapture,
|
|
389
|
+
onResponderEnd,
|
|
390
|
+
onResponderGrant,
|
|
391
|
+
onResponderMove,
|
|
392
|
+
onResponderReject,
|
|
393
|
+
onResponderRelease,
|
|
394
|
+
onResponderStart,
|
|
395
|
+
onResponderTerminate,
|
|
396
|
+
onResponderTerminationRequest,
|
|
397
|
+
onScrollShouldSetResponder,
|
|
398
|
+
onScrollShouldSetResponderCapture,
|
|
399
|
+
onSelectionChangeShouldSetResponder,
|
|
400
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
401
|
+
onStartShouldSetResponder,
|
|
402
|
+
onStartShouldSetResponderCapture
|
|
403
|
+
});
|
|
404
|
+
const platformMethodsRef = (0, import_rnw.usePlatformMethods)(viewProps);
|
|
405
|
+
const setRef = (0, import_rnw.useMergeRefs)(hostRef, platformMethodsRef, forwardedRef, setMounted);
|
|
378
406
|
viewProps.ref = setRef;
|
|
379
|
-
} else {
|
|
380
|
-
if (forwardedRef) {
|
|
381
|
-
viewProps.ref = forwardedRef;
|
|
382
|
-
}
|
|
383
407
|
}
|
|
384
|
-
if (props.href !=
|
|
408
|
+
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
385
409
|
const { download, rel, target } = hrefAttrs;
|
|
386
410
|
if (download != null) {
|
|
387
411
|
viewProps.download = download;
|
|
@@ -393,74 +417,206 @@ function createComponent(configIn, ParentComponent) {
|
|
|
393
417
|
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
394
418
|
}
|
|
395
419
|
}
|
|
420
|
+
const _focusable = focusable != void 0 ? focusable : accessible;
|
|
421
|
+
const role = viewProps.role;
|
|
422
|
+
if (_focusable === false) {
|
|
423
|
+
viewProps.tabIndex = "-1";
|
|
424
|
+
}
|
|
425
|
+
if (elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
426
|
+
if (_focusable === false || accessibilityDisabled === true) {
|
|
427
|
+
viewProps.tabIndex = "-1";
|
|
428
|
+
}
|
|
429
|
+
} else if (role === "button" || role === "checkbox" || role === "link" || role === "radio" || role === "textbox" || role === "switch") {
|
|
430
|
+
if (_focusable !== false) {
|
|
431
|
+
viewProps.tabIndex = "0";
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (_focusable === true) {
|
|
435
|
+
viewProps.tabIndex = "0";
|
|
436
|
+
}
|
|
396
437
|
} else {
|
|
438
|
+
viewProps = nonTamaguiProps;
|
|
397
439
|
if (forwardedRef) {
|
|
398
440
|
viewProps.ref = forwardedRef;
|
|
399
441
|
}
|
|
400
442
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
409
|
-
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
410
|
-
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || import_platform.isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
443
|
+
if (process.env.NODE_ENV === "development" && !isText && import_constants.isWeb && !staticConfig.isHOC) {
|
|
444
|
+
import_react.Children.toArray(props.children).forEach((item) => {
|
|
445
|
+
if (typeof item === "string") {
|
|
446
|
+
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
}
|
|
411
450
|
const unPress = (0, import_react.useCallback)(() => {
|
|
412
|
-
if (!internal.current.isMounted)
|
|
413
|
-
return;
|
|
414
451
|
setStateShallow({
|
|
415
452
|
press: false,
|
|
416
453
|
pressIn: false
|
|
417
454
|
});
|
|
418
|
-
}, []);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
455
|
+
}, [setStateShallow]);
|
|
456
|
+
if (!import_constants.isRSC) {
|
|
457
|
+
(0, import_react.useEffect)(() => {
|
|
458
|
+
return () => {
|
|
459
|
+
mouseUps.delete(unPress);
|
|
460
|
+
};
|
|
461
|
+
}, [unPress]);
|
|
462
|
+
}
|
|
463
|
+
let styles;
|
|
464
|
+
const animationStyles = state.animation ? state.animation.style : null;
|
|
465
|
+
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
466
|
+
styles = {
|
|
467
|
+
...defaultNativeStyle,
|
|
468
|
+
...animationStyles ?? splitStylesStyle,
|
|
469
|
+
...medias
|
|
470
|
+
};
|
|
471
|
+
} else {
|
|
472
|
+
styles = [import_constants.isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias];
|
|
473
|
+
if (!animationStyles && initialSplitStyles) {
|
|
474
|
+
const initPseudos = initialSplitStyles.pseudos;
|
|
475
|
+
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
476
|
+
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", shouldForcePseudo);
|
|
477
|
+
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", shouldForcePseudo);
|
|
478
|
+
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", shouldForcePseudo);
|
|
479
|
+
}
|
|
480
|
+
if (shouldForcePseudo) {
|
|
481
|
+
const next = {};
|
|
482
|
+
for (const style of styles) {
|
|
483
|
+
if (style) {
|
|
484
|
+
Object.assign(next, style);
|
|
485
|
+
}
|
|
435
486
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
487
|
+
Object.assign(splitStyles.style, next);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
491
|
+
let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
492
|
+
if (fontFamily && fontFamily[0] === "$") {
|
|
493
|
+
fontFamily = fontFamily.slice(1);
|
|
494
|
+
}
|
|
495
|
+
if (process.env.NODE_ENV === "development") {
|
|
496
|
+
if (fontFamily == null ? void 0 : fontFamily.startsWith(`var(`)) {
|
|
497
|
+
console.warn(
|
|
498
|
+
`Received variable instead of resolved name of font, this is a bug. Please report on Github.`,
|
|
499
|
+
{
|
|
500
|
+
fontFamily,
|
|
501
|
+
props,
|
|
502
|
+
splitStyles,
|
|
503
|
+
staticConfig
|
|
504
|
+
}
|
|
505
|
+
);
|
|
444
506
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
507
|
+
}
|
|
508
|
+
const classList = [
|
|
509
|
+
componentName ? componentClassName : "",
|
|
510
|
+
fontFamily ? `font_${fontFamily}` : "",
|
|
511
|
+
theme.className,
|
|
512
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
513
|
+
];
|
|
514
|
+
const className = classList.join(" ");
|
|
515
|
+
const style = animationStyles ?? splitStyles.style;
|
|
516
|
+
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
517
|
+
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
518
|
+
viewProps.dataSet = {
|
|
519
|
+
...viewProps.dataSet,
|
|
520
|
+
className,
|
|
521
|
+
id: props.id
|
|
522
|
+
};
|
|
523
|
+
if (process.env.NODE_ENV === "development") {
|
|
524
|
+
Object.keys(viewProps).forEach((key) => {
|
|
525
|
+
if (key.startsWith("data-")) {
|
|
526
|
+
viewProps.dataSet[key.replace("data-", "")] = viewProps[key];
|
|
527
|
+
delete viewProps[key];
|
|
528
|
+
}
|
|
529
|
+
});
|
|
448
530
|
}
|
|
449
|
-
|
|
450
|
-
|
|
531
|
+
} else {
|
|
532
|
+
viewProps.className = className;
|
|
533
|
+
}
|
|
534
|
+
viewProps.style = style;
|
|
535
|
+
}
|
|
536
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
537
|
+
const mergedRef = (0, import_rnw.useMergeRefs)(forwardedRef, hostRef, setMounted);
|
|
538
|
+
viewProps.ref = mergedRef;
|
|
539
|
+
if (splitStyles.fontFamily) {
|
|
540
|
+
const faceInfo = (_b = config.fontsParsed[splitStyles.fontFamily]) == null ? void 0 : _b.face;
|
|
541
|
+
if (faceInfo) {
|
|
542
|
+
const [weight, style] = (() => {
|
|
543
|
+
var _a2, _b2;
|
|
544
|
+
let weight2;
|
|
545
|
+
let style2;
|
|
546
|
+
for (let i = styles.length; i >= 0; i--) {
|
|
547
|
+
weight2 ?? (weight2 = (_a2 = styles[i]) == null ? void 0 : _a2.fontWeight);
|
|
548
|
+
style2 ?? (style2 = (_b2 = styles[i]) == null ? void 0 : _b2.fontStyle);
|
|
549
|
+
}
|
|
550
|
+
return [weight2 || "400", style2 || "normal"];
|
|
551
|
+
})();
|
|
552
|
+
const overrideFace = (_d = (_c = faceInfo[weight]) == null ? void 0 : _c[style]) == null ? void 0 : _d.val;
|
|
553
|
+
if (overrideFace) {
|
|
554
|
+
for (const style2 of styles) {
|
|
555
|
+
if (style2 == null ? void 0 : style2.fontFamily) {
|
|
556
|
+
style2.fontFamily = overrideFace;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
451
560
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
561
|
+
}
|
|
562
|
+
viewProps.style = styles;
|
|
563
|
+
}
|
|
564
|
+
const initialPseudos = initialSplitStyles == null ? void 0 : initialSplitStyles.pseudos;
|
|
565
|
+
const attachPress = !!((pseudos == null ? void 0 : pseudos.pressStyle) || (initialPseudos == null ? void 0 : initialPseudos.pressStyle) || onPress || onPressOut || onPressIn || onClick);
|
|
566
|
+
const isHoverable = import_constants.isWeb;
|
|
567
|
+
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
568
|
+
const handlesPressEvents = !isStringElement && !asChild;
|
|
569
|
+
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
570
|
+
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
571
|
+
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
572
|
+
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || import_constants.isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
573
|
+
const events = shouldAttach && !import_constants.isRSC ? {
|
|
574
|
+
[pressOutKey]: attachPress ? (e) => {
|
|
575
|
+
unPress();
|
|
576
|
+
onPressOut == null ? void 0 : onPressOut(e);
|
|
577
|
+
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
578
|
+
} : void 0,
|
|
579
|
+
...isHoverable && {
|
|
580
|
+
onMouseEnter: attachHover ? (e) => {
|
|
581
|
+
const next = {};
|
|
582
|
+
if (attachHover) {
|
|
583
|
+
next.hover = true;
|
|
584
|
+
}
|
|
585
|
+
if (state.pressIn) {
|
|
586
|
+
next.press = true;
|
|
587
|
+
}
|
|
588
|
+
if (Object.keys(next).length) {
|
|
589
|
+
setStateShallow(next);
|
|
590
|
+
}
|
|
591
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
592
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
593
|
+
} : void 0,
|
|
594
|
+
onMouseLeave: attachHover ? (e) => {
|
|
595
|
+
const next = {};
|
|
596
|
+
mouseUps.add(unPress);
|
|
597
|
+
if (attachHover) {
|
|
598
|
+
next.hover = false;
|
|
599
|
+
}
|
|
600
|
+
if (state.pressIn) {
|
|
601
|
+
next.press = false;
|
|
602
|
+
next.pressIn = false;
|
|
603
|
+
}
|
|
604
|
+
if (Object.keys(next).length) {
|
|
605
|
+
setStateShallow(next);
|
|
606
|
+
}
|
|
607
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
608
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
609
|
+
} : void 0
|
|
610
|
+
},
|
|
456
611
|
[pressInKey]: attachPress ? (e) => {
|
|
457
612
|
setStateShallow({
|
|
458
613
|
press: true,
|
|
459
|
-
pressIn: true
|
|
614
|
+
pressIn: true,
|
|
615
|
+
hover: false
|
|
460
616
|
});
|
|
461
617
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
462
618
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
463
|
-
if (
|
|
619
|
+
if (import_constants.isWeb) {
|
|
464
620
|
mouseUps.add(unPress);
|
|
465
621
|
}
|
|
466
622
|
} : null,
|
|
@@ -468,46 +624,68 @@ function createComponent(configIn, ParentComponent) {
|
|
|
468
624
|
unPress();
|
|
469
625
|
onClick == null ? void 0 : onClick(e);
|
|
470
626
|
onPress == null ? void 0 : onPress(e);
|
|
471
|
-
} : null
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
viewProps.className = className;
|
|
627
|
+
} : null,
|
|
628
|
+
...!import_constants.isWeb && {
|
|
629
|
+
cancelable: !props.rejectResponderTermination,
|
|
630
|
+
disabled: props.disabled !== null ? props.disabled : (_e = props.accessibilityState) == null ? void 0 : _e.disabled,
|
|
631
|
+
hitSlop: props.hitSlop,
|
|
632
|
+
delayLongPress: props.delayLongPress,
|
|
633
|
+
delayPressIn: props.delayPressIn,
|
|
634
|
+
delayPressOut: props.delayPressOut,
|
|
635
|
+
focusable: viewProps.focusable ?? true,
|
|
636
|
+
minPressDuration: 0
|
|
637
|
+
}
|
|
638
|
+
} : null;
|
|
639
|
+
let space = spaceProp;
|
|
640
|
+
if (state.mediaState && mediaKeys.length) {
|
|
641
|
+
for (const key in state.mediaState) {
|
|
642
|
+
if (!state.mediaState[key])
|
|
643
|
+
continue;
|
|
644
|
+
if (props[key] && props[key].space !== void 0) {
|
|
645
|
+
space = props[key].space;
|
|
491
646
|
}
|
|
492
647
|
}
|
|
493
648
|
}
|
|
649
|
+
const themeManager = (0, import_useTheme.getThemeManager)(theme);
|
|
650
|
+
const shouldSetChildrenThemeToParent = Boolean(
|
|
651
|
+
themeShallow && themeManager && themeManager.didChangeTheme
|
|
652
|
+
);
|
|
653
|
+
const shouldProvideThemeManager = shouldSetChildrenThemeToParent || themeManager && themeManager.didChangeTheme;
|
|
654
|
+
const childEls = !children || asChild ? children : (0, import_Theme.wrapThemeManagerContext)(
|
|
655
|
+
spacedChildren({
|
|
656
|
+
separator,
|
|
657
|
+
children,
|
|
658
|
+
space,
|
|
659
|
+
direction: props.spaceDirection || "both",
|
|
660
|
+
isZStack
|
|
661
|
+
}),
|
|
662
|
+
shouldProvideThemeManager ? themeManager : void 0,
|
|
663
|
+
shouldSetChildrenThemeToParent
|
|
664
|
+
);
|
|
665
|
+
let content;
|
|
494
666
|
if (asChild) {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
667
|
+
elementType = import_Slot.Slot;
|
|
668
|
+
viewProps = {
|
|
669
|
+
...viewProps,
|
|
670
|
+
onPress,
|
|
671
|
+
onPressIn,
|
|
672
|
+
onPressOut
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
if (!import_constants.isRSC && import_constants.isWeb) {
|
|
676
|
+
const [pressableProps] = (0, import_usePressable.usePressable)(
|
|
677
|
+
events ? {
|
|
678
|
+
disabled,
|
|
679
|
+
...hitSlop && {
|
|
680
|
+
hitSlop
|
|
681
|
+
},
|
|
682
|
+
onPressOut: events[pressOutKey],
|
|
683
|
+
onPressIn: events[pressInKey],
|
|
684
|
+
onPress: events[pressKey]
|
|
685
|
+
} : {
|
|
686
|
+
disabled: true
|
|
687
|
+
}
|
|
688
|
+
);
|
|
511
689
|
if (events) {
|
|
512
690
|
if (handlesPressEvents) {
|
|
513
691
|
Object.assign(viewProps, pressableProps);
|
|
@@ -516,87 +694,171 @@ function createComponent(configIn, ParentComponent) {
|
|
|
516
694
|
}
|
|
517
695
|
}
|
|
518
696
|
}
|
|
519
|
-
|
|
520
|
-
|
|
697
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
698
|
+
const attachFocus = !!(pseudos && pseudos.focusStyle || initialPseudos && initialPseudos.focusStyle);
|
|
699
|
+
if (attachFocus) {
|
|
700
|
+
viewProps.onFocus = (0, import_Slot.mergeEvent)(viewProps.onFocus, () => {
|
|
701
|
+
setStateShallow({ focus: true });
|
|
702
|
+
});
|
|
703
|
+
viewProps.onBlur = (0, import_Slot.mergeEvent)(viewProps.onBlur, () => {
|
|
704
|
+
setStateShallow({ focus: false });
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
const pressability = (0, import_Pressability.usePressability)(events);
|
|
521
708
|
if (attachPress && events) {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
709
|
+
const dontComposePressabilityKeys = {
|
|
710
|
+
onClick: true
|
|
711
|
+
};
|
|
712
|
+
if (hitSlop) {
|
|
713
|
+
viewProps.hitSlop = hitSlop;
|
|
714
|
+
}
|
|
715
|
+
for (const key in pressability) {
|
|
716
|
+
const og = props[key];
|
|
717
|
+
const val = pressability[key];
|
|
718
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_helpers.composeEventHandlers)(og, val) : val;
|
|
719
|
+
}
|
|
532
720
|
}
|
|
533
721
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
722
|
+
content = (0, import_react.createElement)(elementType, viewProps, childEls);
|
|
723
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
724
|
+
const isAnimatedRNWView = isAnimated && typeof elementType !== "string";
|
|
725
|
+
const shouldWrapWithComponentTheme = !!theme.className && isAnimatedRNWView && (0, import_createPropMapper.getReturnVariablesAs)(props, splitStyleState) === "non-color-value";
|
|
726
|
+
const shouldWrapWithHover = Boolean(events || import_constants.isRSC) && attachHover;
|
|
727
|
+
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
728
|
+
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
729
|
+
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
730
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
731
|
+
className: `${hoverClassName} ${themeClassName}`,
|
|
732
|
+
style: {
|
|
733
|
+
display: "contents"
|
|
734
|
+
},
|
|
735
|
+
...events && shouldWrapWithHover && {
|
|
736
|
+
onMouseEnter: events.onMouseEnter,
|
|
737
|
+
onMouseLeave: events.onMouseLeave
|
|
738
|
+
},
|
|
739
|
+
children: content
|
|
740
|
+
});
|
|
741
|
+
}
|
|
543
742
|
}
|
|
544
743
|
if (process.env.NODE_ENV === "development") {
|
|
545
|
-
if (
|
|
546
|
-
|
|
744
|
+
if (debugProp) {
|
|
745
|
+
const element2 = typeof elementType === "string" ? elementType : "Component";
|
|
746
|
+
console.groupCollapsed(`render <${element2} /> with props`, viewProps);
|
|
747
|
+
for (const key in viewProps) {
|
|
748
|
+
console.log(key, viewProps[key]);
|
|
749
|
+
}
|
|
750
|
+
console.log("children", content);
|
|
751
|
+
console.groupEnd();
|
|
752
|
+
if (typeof window !== "undefined") {
|
|
753
|
+
console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: (_f = props.className) == null ? void 0 : _f.split(" "), classNamesOut: (_g = viewProps.className) == null ? void 0 : _g.split(" "), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, initialSplitStyles, ...typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, (0, import_insertStyleRule.getAllSelectors)()[v]])) } : null });
|
|
754
|
+
}
|
|
755
|
+
console.groupEnd();
|
|
547
756
|
}
|
|
548
757
|
}
|
|
549
|
-
if (features.length) {
|
|
550
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, features, content);
|
|
551
|
-
}
|
|
552
758
|
return content;
|
|
553
759
|
});
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
760
|
+
if (staticConfig.componentName) {
|
|
761
|
+
component.displayName = staticConfig.componentName;
|
|
762
|
+
}
|
|
763
|
+
(0, import_config.onConfiguredOnce)((conf) => {
|
|
764
|
+
if (!defaultComponentState) {
|
|
765
|
+
defaultComponentState = Object.freeze({
|
|
766
|
+
hover: false,
|
|
767
|
+
press: false,
|
|
768
|
+
pressIn: false,
|
|
769
|
+
focus: false,
|
|
770
|
+
mounted: false,
|
|
771
|
+
animation: null,
|
|
772
|
+
mediaState: (0, import_useMedia.getInitialMediaState)()
|
|
773
|
+
});
|
|
559
774
|
}
|
|
775
|
+
if (process.env.IS_STATIC === "is_static")
|
|
776
|
+
return;
|
|
560
777
|
tamaguiConfig = conf;
|
|
561
778
|
mergeShorthands(staticConfig, tamaguiConfig);
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
779
|
+
if (tamaguiConfig.animations) {
|
|
780
|
+
avoidClasses = !!tamaguiConfig.animations.avoidClasses;
|
|
781
|
+
AnimatedText = tamaguiConfig.animations.Text;
|
|
782
|
+
AnimatedView = tamaguiConfig.animations.View;
|
|
783
|
+
}
|
|
784
|
+
if (!initialTheme) {
|
|
785
|
+
const next = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]];
|
|
786
|
+
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next);
|
|
787
|
+
if (!initialTheme && process.env.NODE_ENV === "development") {
|
|
788
|
+
console.log(`Warning: Missing theme`);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
config = (0, import_config.getConfig)();
|
|
792
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
793
|
+
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
794
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
795
|
+
defaultPropsIn = mergeConfigDefaultProps(
|
|
796
|
+
staticConfig.componentName,
|
|
797
|
+
defaultPropsIn,
|
|
798
|
+
config.defaultProps,
|
|
799
|
+
parentNames,
|
|
800
|
+
conf
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
const debug = defaultPropsIn["debug"];
|
|
804
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
805
|
+
debugger;
|
|
806
|
+
}
|
|
807
|
+
const [parentProps, parentClassNames] = (0, import_mergeProps.mergeProps)(defaultPropsIn, {}, true);
|
|
808
|
+
initialSplitStyles = (0, import_getSplitStyles.insertSplitStyles)(
|
|
809
|
+
parentProps,
|
|
810
|
+
staticConfig,
|
|
811
|
+
initialTheme,
|
|
812
|
+
{
|
|
813
|
+
mounted: true,
|
|
814
|
+
hover: false,
|
|
815
|
+
press: false,
|
|
816
|
+
pressIn: false,
|
|
817
|
+
focus: false,
|
|
818
|
+
resolveVariablesAs: "both",
|
|
819
|
+
noClassNames: !staticConfig.acceptsClassName,
|
|
820
|
+
keepVariantsAsProps: true
|
|
821
|
+
},
|
|
822
|
+
void 0,
|
|
823
|
+
void 0,
|
|
824
|
+
debug
|
|
825
|
+
);
|
|
826
|
+
const [defaults2, defaultsClassnames] = (0, import_mergeProps.mergeProps)(
|
|
827
|
+
component.defaultProps,
|
|
828
|
+
initialSplitStyles.viewProps,
|
|
829
|
+
true
|
|
830
|
+
);
|
|
831
|
+
initialSplitStyles.classNames = {
|
|
832
|
+
...parentClassNames,
|
|
833
|
+
...defaultsClassnames,
|
|
834
|
+
...initialSplitStyles.classNames
|
|
835
|
+
};
|
|
576
836
|
defaultNativeStyle = {};
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
837
|
+
const validStyles2 = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
838
|
+
if (!import_constants.isWeb) {
|
|
839
|
+
for (const key in staticConfig.defaultProps) {
|
|
840
|
+
const val = staticConfig.defaultProps[key];
|
|
841
|
+
if (import_helpers.validPseudoKeys[key])
|
|
842
|
+
continue;
|
|
843
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
844
|
+
defaults2[key] = val;
|
|
845
|
+
} else {
|
|
846
|
+
defaultNativeStyle[key] = val;
|
|
847
|
+
}
|
|
584
848
|
}
|
|
585
849
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
});
|
|
589
|
-
if (Object.keys(defaults).length) {
|
|
590
|
-
tamaguiDefaultProps = defaults;
|
|
850
|
+
if (Object.keys(defaults2).length) {
|
|
851
|
+
tamaguiDefaultProps = defaults2;
|
|
591
852
|
}
|
|
592
|
-
if (process.env.NODE_ENV === "development" &&
|
|
853
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
593
854
|
if (process.env.IS_STATIC !== "is_static") {
|
|
594
855
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
595
856
|
staticConfig,
|
|
596
857
|
initialSplitStyles,
|
|
597
858
|
tamaguiDefaultProps,
|
|
598
859
|
defaultNativeStyle,
|
|
599
|
-
defaults
|
|
860
|
+
defaults: defaults2,
|
|
861
|
+
defaultPropsIn
|
|
600
862
|
});
|
|
601
863
|
}
|
|
602
864
|
}
|
|
@@ -605,35 +867,46 @@ function createComponent(configIn, ParentComponent) {
|
|
|
605
867
|
if (configIn.memo) {
|
|
606
868
|
res = (0, import_react.memo)(res);
|
|
607
869
|
}
|
|
608
|
-
res
|
|
609
|
-
validStyles: staticConfig.validStyles || import_helpers.stylePropsView
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
870
|
+
res.staticConfig = {
|
|
871
|
+
validStyles: staticConfig.validStyles || import_helpers.stylePropsView,
|
|
872
|
+
...staticConfig
|
|
873
|
+
};
|
|
874
|
+
res.extractable = (Component, conf) => {
|
|
875
|
+
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
876
|
+
{
|
|
877
|
+
Component,
|
|
878
|
+
...conf,
|
|
879
|
+
neverFlatten: true,
|
|
880
|
+
isHOC: true,
|
|
881
|
+
defaultProps: {
|
|
882
|
+
...Component.defaultProps,
|
|
883
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
res
|
|
887
|
+
);
|
|
621
888
|
return Component;
|
|
622
889
|
};
|
|
623
890
|
return res;
|
|
624
891
|
}
|
|
625
|
-
|
|
892
|
+
const Unspaced = (props) => {
|
|
893
|
+
return props.children;
|
|
894
|
+
};
|
|
895
|
+
Unspaced["isUnspaced"] = true;
|
|
626
896
|
const Spacer = createComponent({
|
|
627
897
|
memo: true,
|
|
628
898
|
componentName: "Spacer",
|
|
629
|
-
|
|
899
|
+
validStyles: import_helpers.validStyles,
|
|
900
|
+
defaultProps: {
|
|
901
|
+
...import_constants2.stackDefaultStyles,
|
|
902
|
+
tag: "span",
|
|
630
903
|
size: true
|
|
631
|
-
}
|
|
904
|
+
},
|
|
632
905
|
variants: {
|
|
633
906
|
size: {
|
|
634
907
|
"...size": (size, { tokens }) => {
|
|
635
908
|
size = size == true ? "$true" : size;
|
|
636
|
-
const sizePx = tokens.
|
|
909
|
+
const sizePx = tokens.space[size] ?? size;
|
|
637
910
|
return {
|
|
638
911
|
width: sizePx,
|
|
639
912
|
height: sizePx,
|
|
@@ -644,7 +917,7 @@ const Spacer = createComponent({
|
|
|
644
917
|
},
|
|
645
918
|
flex: {
|
|
646
919
|
true: {
|
|
647
|
-
|
|
920
|
+
flexGrow: 1
|
|
648
921
|
}
|
|
649
922
|
},
|
|
650
923
|
direction: {
|
|
@@ -655,75 +928,243 @@ const Spacer = createComponent({
|
|
|
655
928
|
vertical: {
|
|
656
929
|
width: 0,
|
|
657
930
|
minWidth: 0
|
|
658
|
-
}
|
|
931
|
+
},
|
|
932
|
+
both: {}
|
|
659
933
|
}
|
|
660
934
|
},
|
|
661
935
|
defaultVariants: {
|
|
662
|
-
direction: "
|
|
936
|
+
direction: "both"
|
|
663
937
|
}
|
|
664
938
|
});
|
|
665
939
|
function spacedChildren({
|
|
666
940
|
isZStack,
|
|
667
941
|
children,
|
|
668
942
|
space,
|
|
669
|
-
|
|
670
|
-
spaceFlex
|
|
943
|
+
direction,
|
|
944
|
+
spaceFlex,
|
|
945
|
+
separator
|
|
671
946
|
}) {
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
947
|
+
const hasSpace = !!(space || spaceFlex);
|
|
948
|
+
const hasSeparator = !(separator === void 0 || separator === null);
|
|
949
|
+
if (!hasSpace && !hasSeparator && !isZStack) {
|
|
950
|
+
return children;
|
|
951
|
+
}
|
|
952
|
+
const childrenList = import_react.Children.toArray(children);
|
|
953
|
+
if (childrenList.length <= 1 && !isZStack) {
|
|
676
954
|
return childrenList;
|
|
677
955
|
}
|
|
678
956
|
const final = [];
|
|
679
957
|
for (const [index, child] of childrenList.entries()) {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
if (!child || child["key"] && !isZStack) {
|
|
958
|
+
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
959
|
+
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
684
960
|
final.push(child);
|
|
685
961
|
} else {
|
|
686
|
-
final.push(
|
|
687
|
-
|
|
688
|
-
|
|
962
|
+
final.push(
|
|
963
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, {
|
|
964
|
+
children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, {
|
|
965
|
+
children: child
|
|
966
|
+
}) : child
|
|
967
|
+
}, index)
|
|
968
|
+
);
|
|
689
969
|
}
|
|
690
|
-
if ((
|
|
970
|
+
if (isUnspaced(child) && index === 0) {
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
if (isZStack) {
|
|
691
974
|
continue;
|
|
692
975
|
}
|
|
693
976
|
const next = childrenList[index + 1];
|
|
694
|
-
if (next &&
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
977
|
+
if (next && !isUnspaced(next)) {
|
|
978
|
+
if (separator) {
|
|
979
|
+
if (hasSpace) {
|
|
980
|
+
final.push(
|
|
981
|
+
createSpacer({
|
|
982
|
+
key: `_${index}_before_sep_spacer`,
|
|
983
|
+
direction,
|
|
984
|
+
space,
|
|
985
|
+
spaceFlex
|
|
986
|
+
})
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
final.push(
|
|
990
|
+
import_react.default.isValidElement(separator) ? import_react.default.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
991
|
+
);
|
|
992
|
+
if (hasSpace) {
|
|
993
|
+
final.push(
|
|
994
|
+
createSpacer({
|
|
995
|
+
key: `_${index}_after_sep_spacer`,
|
|
996
|
+
direction,
|
|
997
|
+
space,
|
|
998
|
+
spaceFlex
|
|
999
|
+
})
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
} else {
|
|
1003
|
+
final.push(
|
|
1004
|
+
createSpacer({
|
|
1005
|
+
key: `_${index}_spacer`,
|
|
1006
|
+
direction,
|
|
1007
|
+
space,
|
|
1008
|
+
spaceFlex
|
|
1009
|
+
})
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
702
1012
|
}
|
|
703
1013
|
}
|
|
704
1014
|
return final;
|
|
705
1015
|
}
|
|
706
|
-
|
|
1016
|
+
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {
|
|
1018
|
+
size: space,
|
|
1019
|
+
direction,
|
|
1020
|
+
...spaceFlex && {
|
|
1021
|
+
flex: spaceFlex
|
|
1022
|
+
}
|
|
1023
|
+
}, key);
|
|
1024
|
+
}
|
|
1025
|
+
function isUnspaced(child) {
|
|
1026
|
+
var _a, _b;
|
|
1027
|
+
return ((_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) || ((_b = child == null ? void 0 : child["type"]) == null ? void 0 : _b["isUnspaced"]);
|
|
1028
|
+
}
|
|
707
1029
|
function AbsoluteFill(props) {
|
|
708
|
-
return
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
1031
|
+
pointerEvents: "box-none",
|
|
1032
|
+
style: absoluteFill,
|
|
1033
|
+
children: props.children
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
const absoluteFill = {
|
|
1037
|
+
position: "absolute",
|
|
1038
|
+
top: 0,
|
|
1039
|
+
left: 0,
|
|
1040
|
+
right: 0,
|
|
1041
|
+
bottom: 0
|
|
1042
|
+
};
|
|
1043
|
+
function processIDRefList(idRefList) {
|
|
1044
|
+
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
1045
|
+
}
|
|
1046
|
+
const accessibilityRoleToWebRole = {
|
|
1047
|
+
adjustable: "slider",
|
|
1048
|
+
button: "button",
|
|
1049
|
+
header: "heading",
|
|
1050
|
+
image: "img",
|
|
1051
|
+
imagebutton: null,
|
|
1052
|
+
keyboardkey: null,
|
|
1053
|
+
label: null,
|
|
1054
|
+
link: "link",
|
|
1055
|
+
none: "presentation",
|
|
1056
|
+
search: "search",
|
|
1057
|
+
summary: "region",
|
|
1058
|
+
text: null
|
|
1059
|
+
};
|
|
1060
|
+
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
1061
|
+
const pseudoStyle = pseudos[name];
|
|
1062
|
+
const shouldNestObject = import_constants.isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
1063
|
+
const defaultPseudoStyle = initialPseudos[name];
|
|
1064
|
+
const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle;
|
|
1065
|
+
if (style) {
|
|
1066
|
+
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
1070
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames, conf) {
|
|
1071
|
+
const len = parentNames.length;
|
|
1072
|
+
let prev;
|
|
1073
|
+
for (let i = 0; i < len; i++) {
|
|
1074
|
+
const n = parentNames[i];
|
|
1075
|
+
if (!n)
|
|
1076
|
+
continue;
|
|
1077
|
+
if (DefaultProps.has(n)) {
|
|
1078
|
+
prev = DefaultProps.get(n);
|
|
1079
|
+
continue;
|
|
1080
|
+
}
|
|
1081
|
+
const props2 = configDefaults[n];
|
|
1082
|
+
if (!props2) {
|
|
1083
|
+
if (prev) {
|
|
1084
|
+
DefaultProps.set(n, prev);
|
|
1085
|
+
}
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
prev = (0, import_mergeProps.mergeProps)(prev || {}, props2, false, conf.inverseShorthands)[0];
|
|
1089
|
+
DefaultProps.set(n, prev);
|
|
1090
|
+
}
|
|
1091
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
1092
|
+
if (ourDefaultsMerged) {
|
|
1093
|
+
return (0, import_mergeProps.mergeProps)(props, ourDefaultsMerged, false, conf.inverseShorthands)[0];
|
|
1094
|
+
}
|
|
1095
|
+
return props;
|
|
1096
|
+
}
|
|
1097
|
+
const defaults = {
|
|
1098
|
+
left: 0,
|
|
1099
|
+
right: 0,
|
|
1100
|
+
top: 0,
|
|
1101
|
+
bottom: 0,
|
|
1102
|
+
opacity: 1,
|
|
1103
|
+
translateX: 0,
|
|
1104
|
+
translateY: 0,
|
|
1105
|
+
skew: 0,
|
|
1106
|
+
skewX: 0,
|
|
1107
|
+
skewY: 0,
|
|
1108
|
+
scale: 1,
|
|
1109
|
+
rotate: "0deg",
|
|
1110
|
+
rotateY: "0deg",
|
|
1111
|
+
rotateX: "0deg"
|
|
1112
|
+
};
|
|
1113
|
+
function ensureBaseHasDefaults(base, ...pseudos) {
|
|
1114
|
+
for (const pseudo of pseudos) {
|
|
1115
|
+
if (!pseudo)
|
|
1116
|
+
continue;
|
|
1117
|
+
for (const key in pseudo) {
|
|
1118
|
+
const val = pseudo[key];
|
|
1119
|
+
if (key === "transform") {
|
|
1120
|
+
if (typeof val === "string") {
|
|
1121
|
+
continue;
|
|
1122
|
+
}
|
|
1123
|
+
for (const t of val) {
|
|
1124
|
+
const tkey = Object.keys(t)[0];
|
|
1125
|
+
const defaultVal = defaults[tkey];
|
|
1126
|
+
const tDefaultVal = { [tkey]: defaultVal };
|
|
1127
|
+
if (!base.transform) {
|
|
1128
|
+
base.transform = [tDefaultVal];
|
|
1129
|
+
} else {
|
|
1130
|
+
if (!base.transform.find((x) => x[tkey])) {
|
|
1131
|
+
base.transform.push(tDefaultVal);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
} else {
|
|
1136
|
+
if (!(key in base)) {
|
|
1137
|
+
base[key] = defaults[key];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
function merge(base, next) {
|
|
1144
|
+
if (!next.transform || !base.transform) {
|
|
1145
|
+
Object.assign(base, next);
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
const { transform, ...rest } = next;
|
|
1149
|
+
Object.assign(base, rest);
|
|
1150
|
+
for (const t of transform) {
|
|
1151
|
+
const key = Object.keys(t)[0];
|
|
1152
|
+
const existing = base.transform.find((x) => key in x);
|
|
1153
|
+
if (existing) {
|
|
1154
|
+
existing[key] = t[key];
|
|
1155
|
+
} else {
|
|
1156
|
+
base.transform.push(t);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
719
1159
|
}
|
|
720
|
-
__name(AbsoluteFill, "AbsoluteFill");
|
|
721
1160
|
// Annotate the CommonJS export names for ESM import in node:
|
|
722
1161
|
0 && (module.exports = {
|
|
723
|
-
AbsoluteFill,
|
|
724
1162
|
Spacer,
|
|
1163
|
+
Unspaced,
|
|
1164
|
+
accessibilityRoleToWebRole,
|
|
725
1165
|
createComponent,
|
|
726
1166
|
mouseUps,
|
|
1167
|
+
processIDRefList,
|
|
727
1168
|
spacedChildren
|
|
728
1169
|
});
|
|
729
1170
|
//# sourceMappingURL=createComponent.js.map
|