@tamagui/core 1.0.1-beta.98 → 1.0.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +12 -6
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +77 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +25 -13
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +16 -23
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/constants/isDevTools.js +37 -0
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +16 -9
- 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/ButtonNestingContext.js +30 -0
- package/dist/cjs/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/contexts/TextAncestorContext.js +30 -0
- package/dist/cjs/contexts/TextAncestorContext.js.map +7 -0
- package/dist/cjs/{ThemeContext.js → contexts/ThemeContext.js} +1 -0
- package/dist/cjs/contexts/ThemeContext.js.map +7 -0
- package/dist/cjs/createComponent.js +583 -644
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +39 -19
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createFont.test.js +125 -0
- package/dist/cjs/createFont.test.js.map +7 -0
- package/dist/cjs/createShorthands.js +1 -0
- package/dist/cjs/createShorthands.js.map +2 -2
- package/dist/cjs/createTamagui.js +98 -193
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +1 -0
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +1 -4
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createTokens.test.js +27 -0
- package/dist/cjs/createTokens.test.js.map +7 -0
- package/dist/cjs/createVariable.js +36 -40
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariable.test.js +7 -0
- package/dist/cjs/createVariable.test.js.map +7 -0
- package/dist/cjs/createVariables.js +15 -19
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +230 -0
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/ThemeManager.test.js +465 -0
- package/dist/cjs/helpers/ThemeManager.test.js.map +7 -0
- package/dist/cjs/helpers/ThemeManagerContext.js +30 -0
- package/dist/cjs/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +1 -0
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/cache.js +43 -0
- package/dist/cjs/helpers/cache.js.map +7 -0
- package/dist/cjs/helpers/calc.js +1 -0
- package/dist/cjs/helpers/calc.js.map +3 -3
- package/dist/cjs/helpers/createMediaStyle.js +23 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +185 -57
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createProxy.js +43 -0
- package/dist/cjs/helpers/createProxy.js.map +7 -0
- package/dist/cjs/helpers/createShallowUpdate.js +13 -23
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +9 -39
- package/dist/cjs/helpers/expandStyle.js.map +3 -3
- package/dist/cjs/helpers/expandStyles.js +33 -44
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +35 -34
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +1 -0
- 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/getBoundingClientRect.js +37 -0
- package/dist/cjs/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -3
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/getFont.js +7 -2
- package/dist/cjs/helpers/getFont.js.map +2 -2
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getRect.js +36 -0
- package/dist/cjs/helpers/getRect.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +3 -2
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +538 -228
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +1 -0
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +57 -66
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.js +107 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js +31 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +50 -7
- package/dist/cjs/helpers/getVariantExtras.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +53 -28
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +1 -0
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/cjs/helpers/isTamaguiElement.js +1 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -5
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +5 -1
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +19 -14
- package/dist/cjs/helpers/mergeProps.js.map +2 -2
- package/dist/cjs/helpers/mergeTransform.js +12 -8
- package/dist/cjs/helpers/mergeTransform.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +6 -2
- package/dist/cjs/helpers/normalizeColor.js.map +3 -3
- package/dist/cjs/helpers/normalizeValueWithProperty.js +48 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/cjs/helpers/proxyThemeVariables.js +3 -1
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +12 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/cjs/helpers/registerCSSVariable.js +8 -8
- package/dist/cjs/helpers/registerCSSVariable.js.map +2 -2
- package/dist/cjs/{constants/rnw.js → helpers/startTransition.js} +13 -9
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -43
- 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/{constants/rnw.native.js → helpers/timer.js} +14 -7
- package/dist/cjs/helpers/timer.js.map +7 -0
- package/dist/cjs/helpers/useShallowSetState.js +49 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -124
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +1 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +37 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -0
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +84 -0
- package/dist/cjs/hooks/useElementLayout.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -32
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +1 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +4 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +165 -120
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +2 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +58 -0
- package/dist/cjs/hooks/useSafeRef.js.map +7 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +182 -163
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useThemeName.js +52 -0
- package/dist/cjs/hooks/useThemeName.js.map +7 -0
- package/dist/cjs/hooks/useUnmountEffect.js +1 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +41 -30
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/inject-styles.js +40 -0
- package/dist/cjs/inject-styles.js.map +7 -0
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +19 -15
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/setupReactNative.js +50 -0
- package/dist/cjs/setupReactNative.js.map +7 -0
- package/dist/cjs/static.js +2 -17
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +30 -49
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- 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/{Pressability.js → vendor/Pressability.js} +6 -2
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/{Pressability.native.js → vendor/Pressability.native.js} +6 -2
- 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 +49 -52
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +83 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +32 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +55 -23
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +22 -20
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +14 -27
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +11 -5
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +7 -5
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +53 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/{conf.js → config.js} +18 -8
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +13 -24
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +13 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +11 -7
- 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/ButtonNestingContext.js +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +6 -0
- package/dist/esm/contexts/TextAncestorContext.js.map +7 -0
- package/dist/esm/{ThemeContext.js → contexts/ThemeContext.js} +0 -0
- package/dist/esm/contexts/ThemeContext.js.map +7 -0
- package/dist/esm/createComponent.js +583 -648
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +38 -19
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createFont.test.js +124 -0
- package/dist/esm/createFont.test.js.map +7 -0
- package/dist/esm/createShorthands.js +0 -0
- package/dist/esm/createShorthands.js.map +2 -2
- package/dist/esm/createTamagui.js +95 -192
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +0 -0
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +0 -4
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createTokens.test.js +26 -0
- package/dist/esm/createTokens.test.js.map +7 -0
- package/dist/esm/createVariable.js +32 -38
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariable.test.js +6 -0
- package/dist/esm/createVariable.test.js.map +7 -0
- package/dist/esm/createVariables.js +14 -19
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +186 -0
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/ThemeManager.test.js +464 -0
- package/dist/esm/helpers/ThemeManager.test.js.map +7 -0
- package/dist/esm/helpers/ThemeManagerContext.js +6 -0
- package/dist/esm/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +0 -0
- package/dist/esm/helpers/areEqualSets.js.map +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/esm/helpers/cache.js +18 -0
- package/dist/esm/helpers/cache.js.map +7 -0
- package/dist/esm/helpers/calc.js +0 -0
- package/dist/esm/helpers/calc.js.map +3 -3
- package/dist/esm/helpers/createMediaStyle.js +22 -9
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +180 -55
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createProxy.js +19 -0
- package/dist/esm/helpers/createProxy.js.map +7 -0
- package/dist/esm/helpers/createShallowUpdate.js +12 -25
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +8 -41
- package/dist/esm/helpers/expandStyle.js.map +3 -3
- package/dist/esm/helpers/expandStyles.js +32 -46
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js +34 -36
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -0
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getBoundingClientRect.js +13 -0
- package/dist/esm/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/getFont.js +6 -2
- package/dist/esm/helpers/getFont.js.map +2 -2
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getRect.js +12 -0
- package/dist/esm/helpers/getRect.js.map +7 -0
- package/dist/esm/helpers/getSize.js +2 -2
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +551 -229
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +0 -0
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +53 -60
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -0
- package/dist/esm/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/getThemeCSSRules.js +83 -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 +47 -6
- package/dist/esm/helpers/getVariantExtras.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +48 -25
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +0 -0
- package/dist/esm/helpers/isObj.js.map +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/esm/helpers/isTamaguiElement.js +0 -0
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -5
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +0 -0
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +18 -14
- package/dist/esm/helpers/mergeProps.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +8 -6
- package/dist/esm/helpers/mergeTransform.js.map +2 -2
- package/dist/esm/helpers/normalizeColor.js +1 -1
- package/dist/esm/helpers/normalizeColor.js.map +2 -2
- package/dist/esm/helpers/normalizeValueWithProperty.js +45 -5
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/helpers/proxyThemeVariables.js +2 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +11 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/esm/helpers/registerCSSVariable.js +5 -6
- package/dist/esm/helpers/registerCSSVariable.js.map +2 -2
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +12 -44
- 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/timer.js +11 -0
- package/dist/esm/helpers/timer.js.map +7 -0
- package/dist/esm/helpers/useShallowSetState.js +25 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -98
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +0 -0
- package/dist/esm/helpers/withStaticProperties.js.map +0 -0
- package/dist/esm/hooks/getThemeUnwrapped.js +12 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -1
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +59 -0
- package/dist/esm/hooks/useElementLayout.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -28
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +0 -0
- package/dist/esm/hooks/useIsMounted.js.map +1 -1
- package/dist/esm/hooks/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +3 -9
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +159 -122
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +1 -16
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +34 -0
- package/dist/esm/hooks/useSafeRef.js.map +7 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +178 -162
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useThemeName.js +28 -0
- package/dist/esm/hooks/useThemeName.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js +0 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +37 -22
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/inject-styles.js +16 -0
- package/dist/esm/inject-styles.js.map +7 -0
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +18 -15
- package/dist/esm/insertFont.js.map +2 -2
- package/dist/esm/setupReactNative.js +24 -0
- package/dist/esm/setupReactNative.js.map +7 -0
- package/dist/esm/static.js +1 -17
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +29 -51
- 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/{Pressability.js → vendor/Pressability.js} +3 -1
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/{Pressability.native.js → vendor/Pressability.native.js} +3 -1
- 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 +47 -50
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +3 -21
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +53 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +29 -29
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +48 -21
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +20 -15
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +11 -22
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +6 -4
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +51 -19
- package/reset.css +1 -9
- package/src/Tamagui.ts +48 -0
- package/src/__snapshots__/createTokens.test.ts.snap +877 -0
- package/src/addTheme.ts +65 -0
- package/src/config.ts +52 -0
- package/src/constants/constants.ts +19 -0
- package/src/constants/isDevTools.ts +12 -0
- package/src/contexts/ButtonNestingContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +3 -0
- package/src/createComponent.tsx +1280 -0
- package/src/createFont.test.ts +129 -0
- package/src/createFont.ts +52 -0
- package/src/createShorthands.ts +7 -0
- package/src/createTamagui.ts +230 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.test.ts +29 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.test.ts +7 -0
- package/src/createVariable.ts +79 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.test.tsx +497 -0
- package/src/helpers/ThemeManager.tsx +252 -0
- package/src/helpers/ThemeManagerContext.tsx +5 -0
- package/src/helpers/cache.ts +18 -0
- package/src/helpers/createMediaStyle.ts +55 -0
- package/src/helpers/createPropMapper.ts +526 -0
- package/src/helpers/createProxy.ts +16 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +75 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getBoundingClientRect.tsx +7 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getRect.tsx +8 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +980 -0
- package/src/helpers/getStylesAtomic.native.ts +4 -0
- package/src/helpers/getStylesAtomic.ts +275 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +112 -0
- package/src/helpers/getVariantExtras.tsx +85 -0
- package/src/helpers/insertStyleRule.tsx +163 -0
- package/src/helpers/isObj.ts +1 -0
- package/src/helpers/isTamaguiComponent.tsx +15 -0
- package/src/helpers/isTamaguiElement.tsx +12 -0
- package/src/helpers/matchMedia.native.ts +6 -0
- package/src/helpers/matchMedia.ts +17 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +23 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +123 -0
- package/src/helpers/proxyThemeVariables.tsx +15 -0
- package/src/helpers/pseudoDescriptors.ts +40 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/themeable.tsx +44 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/timer.ts +9 -0
- package/src/helpers/useShallowSetState.tsx +29 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +7 -0
- package/src/hooks/useElementLayout.tsx +85 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsTouchDevice.tsx +6 -0
- package/src/hooks/useMedia.tsx +265 -0
- package/src/hooks/useSafeRef.ts +48 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +243 -0
- package/src/hooks/useThemeName.tsx +27 -0
- package/src/index.ts +73 -0
- package/src/inject-styles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/setupReactNative.ts +20 -0
- package/src/static.ts +5 -0
- package/src/styled.tsx +172 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1350 -0
- package/src/updateTheme.ts +26 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +10 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +147 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +59 -0
- package/src/views/Text.tsx +87 -0
- package/src/views/Theme.tsx +77 -0
- package/src/views/ThemeProvider.tsx +41 -0
- package/types/Tamagui.d.ts +9 -7
- package/types/addTheme.d.ts +32 -0
- package/types/config.d.ts +46 -0
- package/types/constants/constants.d.ts +14 -3
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/contexts/ButtonNestingContext.d.ts +3 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/contexts/TextAncestorContext.d.ts +3 -0
- package/types/createComponent.d.ts +4 -27
- package/types/createFont.d.ts +0 -0
- package/types/createFont.test.d.ts +2 -0
- package/types/createShorthands.d.ts +2 -1
- package/types/createTamagui.d.ts +2 -25
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -5
- package/types/createTokens.test.d.ts +2 -0
- package/types/createVariable.d.ts +15 -10
- package/types/createVariable.test.d.ts +2 -0
- package/types/createVariables.d.ts +1 -1
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +36 -0
- package/types/helpers/ThemeManager.test.d.ts +2 -0
- package/types/helpers/ThemeManagerContext.d.ts +4 -0
- package/types/helpers/cache.d.ts +12 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +3 -1
- package/types/helpers/createProxy.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +4 -0
- package/types/helpers/expandStyles.d.ts +20 -1
- package/types/helpers/extendStaticConfig.d.ts +0 -0
- package/types/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getBoundingClientRect.d.ts +2 -0
- package/types/helpers/getExpandedShorthands.d.ts +0 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getRect.d.ts +9 -0
- package/types/helpers/getSize.d.ts +0 -0
- package/types/helpers/getSplitStyles.d.ts +32 -16
- package/types/helpers/getStylesAtomic.d.ts +11 -10
- package/types/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +4 -6
- package/types/helpers/insertStyleRule.d.ts +8 -4
- package/types/helpers/isObj.d.ts +0 -0
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/mergeProps.d.ts +16 -1
- package/types/helpers/mergeTransform.d.ts +6 -4
- package/types/helpers/normalizeColor.d.ts +0 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +5 -0
- package/types/helpers/proxyThemeVariables.d.ts +0 -0
- package/types/helpers/pseudoDescriptors.d.ts +8 -14
- package/types/helpers/registerCSSVariable.d.ts +3 -3
- package/types/helpers/themeable.d.ts +7 -7
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/timer.d.ts +2 -0
- package/types/helpers/useShallowSetState.d.ts +4 -0
- package/types/helpers/withStaticProperties.d.ts +0 -0
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useElementLayout.d.ts +19 -0
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsTouchDevice.d.ts +0 -0
- package/types/hooks/useMedia.d.ts +22 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +11 -41
- package/types/hooks/useThemeName.d.ts +5 -0
- package/types/index.d.ts +17 -17
- package/types/inject-styles.d.ts +7 -0
- package/types/insertFont.d.ts +4 -1
- package/types/setupReactNative.d.ts +5 -0
- package/types/static.d.ts +1 -17
- package/types/styled.d.ts +6 -2
- package/types/types-rnw.d.ts +0 -0
- package/types/types.d.ts +299 -90
- package/types/updateTheme.d.ts +30 -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 +4 -4
- package/types/views/Stack.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Text.d.ts +1 -1
- package/types/views/Theme.d.ts +4 -3
- package/types/views/ThemeProvider.d.ts +0 -1
- package/dist/cjs/Pressability.js.map +0 -7
- package/dist/cjs/Pressability.native.js.map +0 -7
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js +0 -204
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -91
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js +0 -55
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -37
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -230
- 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/views/TextAncestorContext.js +0 -43
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/Pressability.js.map +0 -7
- package/dist/esm/Pressability.native.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js +0 -179
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -6
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -67
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js +0 -32
- package/dist/esm/helpers/getTextSize.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 -11
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -206
- 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/views/TextAncestorContext.js +0 -15
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/types/Pressability.d.ts +0 -2
- package/types/Pressability.native.d.ts +0 -2
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts +0 -7
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -52
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts +0 -26
- package/types/conf.d.ts.map +0 -1
- package/types/constants/platform.d.ts +0 -12
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/constants/rnw.native.d.ts +0 -2
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -3
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/helpers/areEqualSets.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts.map +0 -1
- package/types/helpers/assignNativePropsToWeb.native.d.ts +0 -2
- package/types/helpers/calc.d.ts +0 -12
- package/types/helpers/calc.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts +0 -3
- package/types/helpers/createTamaguiProvider.d.ts +0 -4
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/expandStyles.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getFont.d.ts +0 -3
- package/types/helpers/getFont.d.ts.map +0 -1
- package/types/helpers/getSize.d.ts.map +0 -1
- package/types/helpers/getSplitStyles.d.ts.map +0 -1
- package/types/helpers/getStackSize.d.ts +0 -8
- package/types/helpers/getStackSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts +0 -4
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts +0 -2
- package/types/hooks/useFeatures.d.ts +0 -24
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts +0 -3
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts +0 -3
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts +0 -2
- package/types/index.d.ts.map +0 -1
- package/types/insertFont.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/views/Stack.d.ts.map +0 -1
- package/types/views/Text.d.ts.map +0 -1
- package/types/views/TextAncestorContext.d.ts +0 -5
- package/types/views/TextAncestorContext.d.ts.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts +0 -10
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts +0 -4
- package/types/views/ThemeReset.d.ts.map +0 -1
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { composeEventHandlers, stylePropsView, validStyles } from "@tamagui/helpers";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
+
import { isClient, isRSC, isServer, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
33
4
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} from "@tamagui/
|
|
39
|
-
import {
|
|
5
|
+
composeEventHandlers,
|
|
6
|
+
stylePropsView,
|
|
7
|
+
validPseudoKeys,
|
|
8
|
+
validStyles
|
|
9
|
+
} from "@tamagui/helpers";
|
|
10
|
+
import { useResponderEvents } from "@tamagui/react-native-use-responder-events";
|
|
40
11
|
import React, {
|
|
41
12
|
Children,
|
|
42
13
|
Fragment,
|
|
@@ -45,145 +16,250 @@ import React, {
|
|
|
45
16
|
memo,
|
|
46
17
|
useCallback,
|
|
47
18
|
useContext,
|
|
48
|
-
|
|
49
|
-
useRef
|
|
50
|
-
useState
|
|
19
|
+
useEffect,
|
|
20
|
+
useRef
|
|
51
21
|
} from "react";
|
|
52
|
-
import {
|
|
53
|
-
import { getConfig, onConfiguredOnce } from "./conf";
|
|
22
|
+
import { onConfiguredOnce } from "./config";
|
|
54
23
|
import { stackDefaultStyles } from "./constants/constants";
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import { getReturnVariablesAs } from "./helpers/createPropMapper";
|
|
58
|
-
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
24
|
+
import { FontLanguageContext } from "./contexts/FontLanguageContext";
|
|
25
|
+
import { TextAncestorContext } from "./contexts/TextAncestorContext";
|
|
59
26
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
60
|
-
import {
|
|
27
|
+
import { getRect } from "./helpers/getRect";
|
|
28
|
+
import { useSplitStyles } from "./helpers/getSplitStyles";
|
|
61
29
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
62
30
|
import { mergeProps } from "./helpers/mergeProps";
|
|
63
31
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import { Pressability } from "./Pressability";
|
|
32
|
+
import { useShallowSetState } from "./helpers/useShallowSetState";
|
|
33
|
+
import { measureLayout, useElementLayout } from "./hooks/useElementLayout";
|
|
34
|
+
import { addMediaQueryListener, getInitialMediaState } from "./hooks/useMedia";
|
|
35
|
+
import { useServerRef, useServerState } from "./hooks/useServerHooks";
|
|
36
|
+
import { getThemeIsNewTheme, getThemeManager, useTheme } from "./hooks/useTheme";
|
|
37
|
+
import { usePressability } from "./vendor/Pressability";
|
|
71
38
|
import { Slot, mergeEvent } from "./views/Slot";
|
|
72
|
-
import {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
animation: null
|
|
81
|
-
});
|
|
39
|
+
import { wrapThemeManagerContext } from "./views/Theme";
|
|
40
|
+
process.env.TAMAGUI_TARGET;
|
|
41
|
+
let defaultComponentState = null;
|
|
42
|
+
let defaultComponentStateMounted = null;
|
|
43
|
+
let tamaguiConfig;
|
|
44
|
+
let AnimatedText;
|
|
45
|
+
let AnimatedView;
|
|
46
|
+
let initialTheme;
|
|
82
47
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
83
48
|
if (typeof document !== "undefined") {
|
|
84
|
-
|
|
85
|
-
mouseUps.forEach((x) => x());
|
|
86
|
-
mouseUps.clear();
|
|
87
|
-
});
|
|
88
|
-
document.addEventListener("touchend", () => {
|
|
89
|
-
mouseUps.forEach((x) => x());
|
|
90
|
-
mouseUps.clear();
|
|
91
|
-
});
|
|
92
|
-
document.addEventListener("touchcancel", () => {
|
|
49
|
+
const cancelTouches = () => {
|
|
93
50
|
mouseUps.forEach((x) => x());
|
|
94
51
|
mouseUps.clear();
|
|
95
|
-
}
|
|
52
|
+
};
|
|
53
|
+
addEventListener("mouseup", cancelTouches);
|
|
54
|
+
addEventListener("touchend", cancelTouches);
|
|
55
|
+
addEventListener("touchcancel", cancelTouches);
|
|
96
56
|
}
|
|
97
57
|
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
98
|
-
for (const key
|
|
58
|
+
for (const key of Object.keys(defaultProps)) {
|
|
99
59
|
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
100
60
|
}
|
|
101
61
|
}
|
|
102
|
-
let
|
|
62
|
+
let BaseText;
|
|
63
|
+
let BaseView;
|
|
64
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
65
|
+
const native = require("react-native");
|
|
66
|
+
BaseText = native.Text || native.default.Text;
|
|
67
|
+
BaseView = native.View || native.default.View;
|
|
68
|
+
}
|
|
103
69
|
function createComponent(configIn, ParentComponent) {
|
|
104
70
|
const staticConfig = (() => {
|
|
105
|
-
const
|
|
106
|
-
if ("parsed" in
|
|
107
|
-
return
|
|
71
|
+
const next = extendStaticConfig(configIn, ParentComponent);
|
|
72
|
+
if ("parsed" in next) {
|
|
73
|
+
return next;
|
|
108
74
|
} else {
|
|
109
|
-
return parseStaticConfig(
|
|
75
|
+
return parseStaticConfig(next);
|
|
110
76
|
}
|
|
111
77
|
})();
|
|
112
78
|
const defaultComponentClassName = `is_${staticConfig.componentName}`;
|
|
113
|
-
let tamaguiConfig;
|
|
114
|
-
let AnimatedText;
|
|
115
|
-
let AnimatedView;
|
|
116
|
-
let avoidClasses = true;
|
|
117
79
|
let defaultNativeStyle;
|
|
118
|
-
let defaultNativeStyleSheet;
|
|
119
80
|
let tamaguiDefaultProps;
|
|
120
|
-
let
|
|
81
|
+
let defaultTag;
|
|
121
82
|
const component = forwardRef((propsIn, forwardedRef) => {
|
|
122
|
-
var _a, _d, _e, _f;
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
123
84
|
let props;
|
|
124
85
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
125
86
|
props = mergeProps(tamaguiDefaultProps, propsIn)[0];
|
|
126
87
|
} else {
|
|
127
88
|
props = propsIn;
|
|
128
89
|
}
|
|
129
|
-
const
|
|
90
|
+
const debugProp = props["debug"];
|
|
130
91
|
const { Component, isText, isZStack } = staticConfig;
|
|
131
92
|
const componentName = props.componentName || staticConfig.componentName;
|
|
132
93
|
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
94
|
+
const animationsConfig = tamaguiConfig.animations;
|
|
95
|
+
const useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations;
|
|
96
|
+
const avoidClassesWhileAnimating = animationsConfig.isReactNative;
|
|
97
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
98
|
+
const needsMount = Boolean((isWeb ? isClient : true) && (hasEnterStyle || props.animation));
|
|
99
|
+
const states = useServerState(
|
|
100
|
+
needsMount ? defaultComponentState : defaultComponentStateMounted
|
|
101
|
+
);
|
|
102
|
+
const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0];
|
|
103
|
+
const setState = states[1];
|
|
104
|
+
const setStateShallow = useShallowSetState(setState, debugProp, componentName);
|
|
105
|
+
const stateRef = useRef(
|
|
106
|
+
void 0
|
|
107
|
+
);
|
|
108
|
+
stateRef.current ??= {};
|
|
109
|
+
const isAnimated = (() => {
|
|
110
|
+
const next = !!(useAnimations && props.animation);
|
|
111
|
+
if (next && !stateRef.current.hasAnimated) {
|
|
112
|
+
stateRef.current.hasAnimated = true;
|
|
113
|
+
}
|
|
114
|
+
return next || stateRef.current.hasAnimated;
|
|
115
|
+
})();
|
|
116
|
+
const usePresence = (_a = tamaguiConfig.animations) == null ? void 0 : _a.usePresence;
|
|
117
|
+
const presence = !isRSC && isAnimated ? usePresence() : null;
|
|
118
|
+
if (isAnimated && presence) {
|
|
119
|
+
const presenceState = presence[2];
|
|
120
|
+
if (presenceState) {
|
|
121
|
+
if (state.unmounted && presenceState.enterVariant) {
|
|
122
|
+
props[presenceState.enterVariant] = true;
|
|
123
|
+
}
|
|
124
|
+
if (!presenceState.isPresent && presenceState.exitVariant) {
|
|
125
|
+
props[presenceState.exitVariant] = true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const isReactNative = Boolean(
|
|
130
|
+
staticConfig.isReactNative || isAnimated && tamaguiConfig.animations.isReactNative
|
|
131
|
+
);
|
|
133
132
|
if (process.env.NODE_ENV === "development") {
|
|
134
|
-
if (
|
|
133
|
+
if (debugProp) {
|
|
135
134
|
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
console.
|
|
140
|
-
if (
|
|
141
|
-
|
|
135
|
+
const type = isReactNative ? "(rnw)" : "";
|
|
136
|
+
const dataIs = propsIn["data-is"] || "";
|
|
137
|
+
const banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
138
|
+
console.group(`%c ${banner}`, "background: yellow;");
|
|
139
|
+
if (!isServer) {
|
|
140
|
+
console.log(`state`, state);
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
|
-
const
|
|
146
|
-
const theme = useTheme(props.theme, componentName, props, forceUpdate);
|
|
147
|
-
const statesUsed = useState(defaultComponentState);
|
|
148
|
-
const setStateShallow = createShallowUpdate(statesUsed[1]);
|
|
149
|
-
let state = statesUsed[0];
|
|
150
|
-
if (propsIn.forceStyle) {
|
|
151
|
-
state = __spreadProps(__spreadValues({}, state), {
|
|
152
|
-
[propsIn.forceStyle]: true
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
144
|
+
const shouldAvoidClasses = !isWeb || !!(props.animation && avoidClassesWhileAnimating) || !staticConfig.acceptsClassName;
|
|
156
145
|
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
resolveVariablesAs: "value"
|
|
146
|
+
const noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
147
|
+
const theme = useTheme({
|
|
148
|
+
name: props.theme,
|
|
149
|
+
componentName,
|
|
150
|
+
reset: props.reset,
|
|
151
|
+
inverse: props.themeInverse,
|
|
152
|
+
disable: props["data-themeable"],
|
|
153
|
+
debug: props.debug
|
|
166
154
|
});
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
155
|
+
const themeManager = getThemeManager(theme);
|
|
156
|
+
const themeIsNew = getThemeIsNewTheme(theme);
|
|
157
|
+
const shouldSetMounted = needsMount && state.unmounted;
|
|
158
|
+
const setMounted = shouldSetMounted ? () => {
|
|
159
|
+
setTimeout(
|
|
160
|
+
() => {
|
|
161
|
+
setStateShallow({
|
|
162
|
+
unmounted: false
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
isWeb ? 10 : 0
|
|
166
|
+
);
|
|
167
|
+
} : void 0;
|
|
168
|
+
const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false);
|
|
169
|
+
const languageContext = isRSC ? null : useContext(FontLanguageContext);
|
|
170
|
+
const isDisabled = props.disabled ?? ((_b = props.accessibilityState) == null ? void 0 : _b.disabled);
|
|
171
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
172
|
+
const element = isWeb ? isTaggable ? props.tag || defaultTag || Component : Component : Component;
|
|
173
|
+
const BaseTextComponent = BaseText || element || "span";
|
|
174
|
+
const BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
175
|
+
let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
|
|
176
|
+
elementType = Component || elementType;
|
|
177
|
+
const isStringElement = typeof elementType === "string";
|
|
178
|
+
const isExiting = (presence == null ? void 0 : presence[0]) === false;
|
|
179
|
+
const splitStyles = useSplitStyles(
|
|
180
|
+
props,
|
|
180
181
|
staticConfig,
|
|
181
182
|
theme,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
{
|
|
184
|
+
...state,
|
|
185
|
+
noClassNames,
|
|
186
|
+
dynamicStylesInline: noClassNames,
|
|
187
|
+
hasTextAncestor,
|
|
188
|
+
resolveVariablesAs: "value",
|
|
189
|
+
isExiting
|
|
190
|
+
},
|
|
191
|
+
null,
|
|
192
|
+
languageContext || void 0,
|
|
193
|
+
elementType,
|
|
194
|
+
debugProp
|
|
195
|
+
);
|
|
196
|
+
const hostRef = useServerRef(null);
|
|
197
|
+
const isAnimatedReactNativeWeb = isAnimated && avoidClassesWhileAnimating;
|
|
198
|
+
if (process.env.NODE_ENV === "development") {
|
|
199
|
+
if (!process.env.TAMAGUI_TARGET) {
|
|
200
|
+
console.error(`No process.env.TAMAGUI_TARGET set, please set it to "native" or "web".`);
|
|
201
|
+
}
|
|
202
|
+
if (debugProp) {
|
|
203
|
+
console.groupCollapsed("props");
|
|
204
|
+
console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props));
|
|
205
|
+
console.log("splitStyles", splitStyles);
|
|
206
|
+
console.log("className", Object.values(splitStyles.classNames));
|
|
207
|
+
if (isClient) {
|
|
208
|
+
console.log("ref", hostRef, "(click to view)");
|
|
209
|
+
}
|
|
210
|
+
console.groupEnd();
|
|
211
|
+
if (debugProp === "break") {
|
|
212
|
+
debugger;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const {
|
|
217
|
+
viewProps: viewPropsIn,
|
|
218
|
+
pseudos,
|
|
219
|
+
medias,
|
|
220
|
+
style: splitStylesStyle,
|
|
221
|
+
classNames,
|
|
222
|
+
mediaKeys
|
|
223
|
+
} = splitStyles;
|
|
224
|
+
const propsWithAnimation = props;
|
|
225
|
+
let animationStyles;
|
|
226
|
+
if (!isRSC && isAnimated && useAnimations) {
|
|
227
|
+
const animations = useAnimations({
|
|
228
|
+
props: propsWithAnimation,
|
|
229
|
+
style: splitStylesStyle,
|
|
230
|
+
presence,
|
|
231
|
+
state,
|
|
232
|
+
pseudos,
|
|
233
|
+
onDidAnimate: props.onDidAnimate,
|
|
234
|
+
hostRef,
|
|
235
|
+
staticConfig
|
|
236
|
+
});
|
|
237
|
+
if (animations) {
|
|
238
|
+
animationStyles = animations.style;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
useIsomorphicLayoutEffect(() => {
|
|
242
|
+
const disposers = mediaKeys.map((key) => {
|
|
243
|
+
return addMediaQueryListener(key, (next) => {
|
|
244
|
+
setState((prev) => {
|
|
245
|
+
if (prev.mediaState[key] !== next) {
|
|
246
|
+
return {
|
|
247
|
+
...prev,
|
|
248
|
+
mediaState: getMediaStateObject({
|
|
249
|
+
...prev.mediaState,
|
|
250
|
+
[key]: next
|
|
251
|
+
})
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return prev;
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
return () => {
|
|
259
|
+
disposers.forEach((d) => d());
|
|
260
|
+
};
|
|
261
|
+
}, [mediaKeys.join(",")]);
|
|
262
|
+
const {
|
|
187
263
|
hitSlop,
|
|
188
264
|
asChild,
|
|
189
265
|
children,
|
|
@@ -192,6 +268,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
192
268
|
onPressOut,
|
|
193
269
|
onHoverIn,
|
|
194
270
|
onHoverOut,
|
|
271
|
+
themeShallow,
|
|
195
272
|
space: spaceProp,
|
|
196
273
|
spaceDirection: _spaceDirection,
|
|
197
274
|
disabled: disabledProp,
|
|
@@ -204,42 +281,13 @@ function createComponent(configIn, ParentComponent) {
|
|
|
204
281
|
forceStyle: _forceStyle,
|
|
205
282
|
onClick,
|
|
206
283
|
theme: _themeProp,
|
|
207
|
-
defaultVariants
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"hitSlop",
|
|
211
|
-
"asChild",
|
|
212
|
-
"children",
|
|
213
|
-
"onPress",
|
|
214
|
-
"onPressIn",
|
|
215
|
-
"onPressOut",
|
|
216
|
-
"onHoverIn",
|
|
217
|
-
"onHoverOut",
|
|
218
|
-
"space",
|
|
219
|
-
"spaceDirection",
|
|
220
|
-
"disabled",
|
|
221
|
-
"onMouseUp",
|
|
222
|
-
"onMouseDown",
|
|
223
|
-
"onMouseEnter",
|
|
224
|
-
"onMouseLeave",
|
|
225
|
-
"hrefAttrs",
|
|
226
|
-
"separator",
|
|
227
|
-
"forceStyle",
|
|
228
|
-
"onClick",
|
|
229
|
-
"theme",
|
|
230
|
-
"defaultVariants"
|
|
231
|
-
]);
|
|
232
|
-
const isTaggable = !Component || typeof Component === "string";
|
|
233
|
-
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
234
|
-
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
235
|
-
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
236
|
-
let elementType = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
237
|
-
elementType = Component || elementType;
|
|
238
|
-
const isStringElement = typeof elementType === "string";
|
|
284
|
+
defaultVariants,
|
|
285
|
+
...nonTamaguiProps
|
|
286
|
+
} = viewPropsIn;
|
|
239
287
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
240
288
|
let viewProps;
|
|
241
|
-
if (process.env.TAMAGUI_TARGET === "web" && !
|
|
242
|
-
const
|
|
289
|
+
if (process.env.TAMAGUI_TARGET === "web" && !isReactNative) {
|
|
290
|
+
const {
|
|
243
291
|
onMoveShouldSetResponder,
|
|
244
292
|
onMoveShouldSetResponderCapture,
|
|
245
293
|
onResponderEnd,
|
|
@@ -256,154 +304,36 @@ function createComponent(configIn, ParentComponent) {
|
|
|
256
304
|
onSelectionChangeShouldSetResponderCapture,
|
|
257
305
|
onStartShouldSetResponder,
|
|
258
306
|
onStartShouldSetResponderCapture,
|
|
259
|
-
nativeID,
|
|
260
|
-
accessibilityActiveDescendant,
|
|
261
|
-
accessibilityAtomic,
|
|
262
|
-
accessibilityAutoComplete,
|
|
263
|
-
accessibilityBusy,
|
|
264
|
-
accessibilityChecked,
|
|
265
|
-
accessibilityColumnCount,
|
|
266
|
-
accessibilityColumnIndex,
|
|
267
|
-
accessibilityColumnSpan,
|
|
268
|
-
accessibilityControls,
|
|
269
|
-
accessibilityCurrent,
|
|
270
|
-
accessibilityDescribedBy,
|
|
271
|
-
accessibilityDetails,
|
|
272
|
-
accessibilityDisabled,
|
|
273
|
-
accessibilityErrorMessage,
|
|
274
|
-
accessibilityExpanded,
|
|
275
|
-
accessibilityFlowTo,
|
|
276
|
-
accessibilityHasPopup,
|
|
277
|
-
accessibilityHidden,
|
|
278
|
-
accessibilityInvalid,
|
|
279
|
-
accessibilityKeyShortcuts,
|
|
280
|
-
accessibilityLabel,
|
|
281
|
-
accessibilityLabelledBy,
|
|
282
|
-
accessibilityLevel,
|
|
283
|
-
accessibilityLiveRegion,
|
|
284
|
-
accessibilityModal,
|
|
285
|
-
accessibilityMultiline,
|
|
286
|
-
accessibilityMultiSelectable,
|
|
287
|
-
accessibilityOrientation,
|
|
288
|
-
accessibilityOwns,
|
|
289
|
-
accessibilityPlaceholder,
|
|
290
|
-
accessibilityPosInSet,
|
|
291
|
-
accessibilityPressed,
|
|
292
|
-
accessibilityReadOnly,
|
|
293
|
-
accessibilityRequired,
|
|
294
|
-
accessibilityRole,
|
|
295
|
-
accessibilityRoleDescription,
|
|
296
|
-
accessibilityRowCount,
|
|
297
|
-
accessibilityRowIndex,
|
|
298
|
-
accessibilityRowSpan,
|
|
299
|
-
accessibilitySelected,
|
|
300
|
-
accessibilitySetSize,
|
|
301
|
-
accessibilitySort,
|
|
302
|
-
accessibilityValueMax,
|
|
303
|
-
accessibilityValueMin,
|
|
304
|
-
accessibilityValueNow,
|
|
305
|
-
accessibilityValueText,
|
|
306
|
-
accessible,
|
|
307
|
-
accessibilityState,
|
|
308
|
-
accessibilityValue,
|
|
309
307
|
collapsable,
|
|
310
308
|
focusable,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"onResponderGrant",
|
|
317
|
-
"onResponderMove",
|
|
318
|
-
"onResponderReject",
|
|
319
|
-
"onResponderRelease",
|
|
320
|
-
"onResponderStart",
|
|
321
|
-
"onResponderTerminate",
|
|
322
|
-
"onResponderTerminationRequest",
|
|
323
|
-
"onScrollShouldSetResponder",
|
|
324
|
-
"onScrollShouldSetResponderCapture",
|
|
325
|
-
"onSelectionChangeShouldSetResponder",
|
|
326
|
-
"onSelectionChangeShouldSetResponderCapture",
|
|
327
|
-
"onStartShouldSetResponder",
|
|
328
|
-
"onStartShouldSetResponderCapture",
|
|
329
|
-
"nativeID",
|
|
330
|
-
"accessibilityActiveDescendant",
|
|
331
|
-
"accessibilityAtomic",
|
|
332
|
-
"accessibilityAutoComplete",
|
|
333
|
-
"accessibilityBusy",
|
|
334
|
-
"accessibilityChecked",
|
|
335
|
-
"accessibilityColumnCount",
|
|
336
|
-
"accessibilityColumnIndex",
|
|
337
|
-
"accessibilityColumnSpan",
|
|
338
|
-
"accessibilityControls",
|
|
339
|
-
"accessibilityCurrent",
|
|
340
|
-
"accessibilityDescribedBy",
|
|
341
|
-
"accessibilityDetails",
|
|
342
|
-
"accessibilityDisabled",
|
|
343
|
-
"accessibilityErrorMessage",
|
|
344
|
-
"accessibilityExpanded",
|
|
345
|
-
"accessibilityFlowTo",
|
|
346
|
-
"accessibilityHasPopup",
|
|
347
|
-
"accessibilityHidden",
|
|
348
|
-
"accessibilityInvalid",
|
|
349
|
-
"accessibilityKeyShortcuts",
|
|
350
|
-
"accessibilityLabel",
|
|
351
|
-
"accessibilityLabelledBy",
|
|
352
|
-
"accessibilityLevel",
|
|
353
|
-
"accessibilityLiveRegion",
|
|
354
|
-
"accessibilityModal",
|
|
355
|
-
"accessibilityMultiline",
|
|
356
|
-
"accessibilityMultiSelectable",
|
|
357
|
-
"accessibilityOrientation",
|
|
358
|
-
"accessibilityOwns",
|
|
359
|
-
"accessibilityPlaceholder",
|
|
360
|
-
"accessibilityPosInSet",
|
|
361
|
-
"accessibilityPressed",
|
|
362
|
-
"accessibilityReadOnly",
|
|
363
|
-
"accessibilityRequired",
|
|
364
|
-
"accessibilityRole",
|
|
365
|
-
"accessibilityRoleDescription",
|
|
366
|
-
"accessibilityRowCount",
|
|
367
|
-
"accessibilityRowIndex",
|
|
368
|
-
"accessibilityRowSpan",
|
|
369
|
-
"accessibilitySelected",
|
|
370
|
-
"accessibilitySetSize",
|
|
371
|
-
"accessibilitySort",
|
|
372
|
-
"accessibilityValueMax",
|
|
373
|
-
"accessibilityValueMin",
|
|
374
|
-
"accessibilityValueNow",
|
|
375
|
-
"accessibilityValueText",
|
|
376
|
-
"accessible",
|
|
377
|
-
"accessibilityState",
|
|
378
|
-
"accessibilityValue",
|
|
379
|
-
"collapsable",
|
|
380
|
-
"focusable",
|
|
381
|
-
"onLayout"
|
|
382
|
-
]);
|
|
309
|
+
accessible,
|
|
310
|
+
accessibilityDisabled,
|
|
311
|
+
onLayout,
|
|
312
|
+
...webProps
|
|
313
|
+
} = nonTamaguiProps;
|
|
383
314
|
viewProps = webProps;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
viewProps.ref = setRef;
|
|
315
|
+
if (!isRSC) {
|
|
316
|
+
usePlatformMethods(hostRef);
|
|
317
|
+
useElementLayout(hostRef, onLayout);
|
|
318
|
+
useResponderEvents(hostRef, {
|
|
319
|
+
onMoveShouldSetResponder,
|
|
320
|
+
onMoveShouldSetResponderCapture,
|
|
321
|
+
onResponderEnd,
|
|
322
|
+
onResponderGrant,
|
|
323
|
+
onResponderMove,
|
|
324
|
+
onResponderReject,
|
|
325
|
+
onResponderRelease,
|
|
326
|
+
onResponderStart,
|
|
327
|
+
onResponderTerminate,
|
|
328
|
+
onResponderTerminationRequest,
|
|
329
|
+
onScrollShouldSetResponder,
|
|
330
|
+
onScrollShouldSetResponderCapture,
|
|
331
|
+
onSelectionChangeShouldSetResponder,
|
|
332
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
333
|
+
onStartShouldSetResponder,
|
|
334
|
+
onStartShouldSetResponderCapture
|
|
335
|
+
});
|
|
336
|
+
}
|
|
407
337
|
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
408
338
|
const { download, rel, target } = hrefAttrs;
|
|
409
339
|
if (download != null) {
|
|
@@ -435,10 +365,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
435
365
|
}
|
|
436
366
|
} else {
|
|
437
367
|
viewProps = nonTamaguiProps;
|
|
438
|
-
if (forwardedRef) {
|
|
439
|
-
viewProps.ref = forwardedRef;
|
|
440
|
-
}
|
|
441
368
|
}
|
|
369
|
+
viewProps.ref = useComposedRefs(hostRef, forwardedRef, setMounted);
|
|
442
370
|
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
|
|
443
371
|
Children.toArray(props.children).forEach((item) => {
|
|
444
372
|
if (typeof item === "string") {
|
|
@@ -446,211 +374,211 @@ function createComponent(configIn, ParentComponent) {
|
|
|
446
374
|
}
|
|
447
375
|
});
|
|
448
376
|
}
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
};
|
|
377
|
+
const unPress = useCallback(() => {
|
|
378
|
+
setStateShallow({
|
|
379
|
+
press: false,
|
|
380
|
+
pressIn: false
|
|
381
|
+
});
|
|
382
|
+
}, [setStateShallow]);
|
|
383
|
+
if (!isRSC) {
|
|
384
|
+
useEffect(() => {
|
|
385
|
+
return () => {
|
|
386
|
+
mouseUps.delete(unPress);
|
|
387
|
+
};
|
|
388
|
+
}, [unPress]);
|
|
454
389
|
}
|
|
455
|
-
useIsomorphicLayoutEffect(() => {
|
|
456
|
-
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
457
|
-
setStateShallow({
|
|
458
|
-
mounted: true
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
internal.current.isMounted = true;
|
|
462
|
-
return () => {
|
|
463
|
-
var _a2;
|
|
464
|
-
mouseUps.delete(unPress);
|
|
465
|
-
internal.current.isMounted = false;
|
|
466
|
-
(_a2 = internal.current.unmountEffects) == null ? void 0 : _a2.forEach((cb) => cb());
|
|
467
|
-
};
|
|
468
|
-
}, [hasEnterStyle, props.animation]);
|
|
469
390
|
let styles;
|
|
470
|
-
const animationStyles = state.animation ? state.animation.style : null;
|
|
471
391
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
472
|
-
styles =
|
|
392
|
+
styles = {
|
|
393
|
+
...defaultNativeStyle,
|
|
394
|
+
...animationStyles ?? splitStylesStyle,
|
|
395
|
+
...medias
|
|
396
|
+
};
|
|
473
397
|
} else {
|
|
474
|
-
styles = [
|
|
475
|
-
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
476
|
-
animationStyles ?? style,
|
|
477
|
-
medias
|
|
478
|
-
];
|
|
479
|
-
if (!animationStyles) {
|
|
480
|
-
const initPseudos = initialSplitStyles.pseudos;
|
|
481
|
-
const force = shouldForcePseudo;
|
|
482
|
-
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
483
|
-
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", force);
|
|
484
|
-
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", force);
|
|
485
|
-
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", force);
|
|
486
|
-
}
|
|
398
|
+
styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias];
|
|
487
399
|
if (shouldForcePseudo) {
|
|
488
400
|
const next = {};
|
|
489
|
-
|
|
490
|
-
if (style2) {
|
|
491
|
-
Object.assign(next, style2);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
401
|
+
styles.forEach((style) => Object.assign(next, style));
|
|
494
402
|
Object.assign(splitStyles.style, next);
|
|
495
403
|
}
|
|
496
404
|
}
|
|
405
|
+
let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
406
|
+
if (fontFamily && fontFamily[0] === "$") {
|
|
407
|
+
fontFamily = fontFamily.slice(1);
|
|
408
|
+
}
|
|
409
|
+
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "";
|
|
410
|
+
const classList = [
|
|
411
|
+
componentName ? componentClassName : "",
|
|
412
|
+
fontFamilyClassName,
|
|
413
|
+
themeIsNew ? theme.className : "",
|
|
414
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
415
|
+
];
|
|
416
|
+
const className = classList.join(" ");
|
|
497
417
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
viewProps.dataSet.is = props["data-is"];
|
|
418
|
+
const style = animationStyles ?? splitStyles.style;
|
|
419
|
+
if (isAnimatedReactNativeWeb) {
|
|
420
|
+
viewProps.style = style;
|
|
421
|
+
} else if (isReactNative) {
|
|
422
|
+
const rnwStyle = { $$css: true };
|
|
423
|
+
for (const name of className.split(" ")) {
|
|
424
|
+
rnwStyle[name] = name;
|
|
425
|
+
}
|
|
426
|
+
viewProps.style = [rnwStyle, ...Array.isArray(style) ? style : [style]];
|
|
427
|
+
if (process.env.NODE_ENV === "development") {
|
|
428
|
+
Object.keys(viewProps).forEach((key) => {
|
|
429
|
+
if (key.startsWith("data-")) {
|
|
430
|
+
viewProps.dataSet ??= {};
|
|
431
|
+
viewProps.dataSet[key.replace("data-", "")] = viewProps[key];
|
|
432
|
+
delete viewProps[key];
|
|
433
|
+
}
|
|
434
|
+
});
|
|
516
435
|
}
|
|
517
436
|
} else {
|
|
518
437
|
viewProps.className = className;
|
|
438
|
+
viewProps.style = style;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
442
|
+
if (splitStyles.fontFamily) {
|
|
443
|
+
const faceInfo = (_c = tamaguiConfig.fontsParsed[splitStyles.fontFamily]) == null ? void 0 : _c.face;
|
|
444
|
+
if (faceInfo) {
|
|
445
|
+
const [weight, style] = (() => {
|
|
446
|
+
var _a2, _b2;
|
|
447
|
+
let weight2;
|
|
448
|
+
let style2;
|
|
449
|
+
for (let i = styles.length; i >= 0; i--) {
|
|
450
|
+
weight2 ??= (_a2 = styles[i]) == null ? void 0 : _a2.fontWeight;
|
|
451
|
+
style2 ??= (_b2 = styles[i]) == null ? void 0 : _b2.fontStyle;
|
|
452
|
+
}
|
|
453
|
+
return [weight2 || "400", style2 || "normal"];
|
|
454
|
+
})();
|
|
455
|
+
const overrideFace = (_e = (_d = faceInfo[weight]) == null ? void 0 : _d[style]) == null ? void 0 : _e.val;
|
|
456
|
+
if (overrideFace) {
|
|
457
|
+
for (const style2 of styles) {
|
|
458
|
+
if (style2 == null ? void 0 : style2.fontFamily) {
|
|
459
|
+
style2.fontFamily = overrideFace;
|
|
460
|
+
delete style2.fontWeight;
|
|
461
|
+
delete style2.fontStyle;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
519
466
|
}
|
|
520
|
-
viewProps.style = style2;
|
|
521
|
-
} else {
|
|
522
467
|
viewProps.style = styles;
|
|
523
468
|
}
|
|
524
|
-
const
|
|
525
|
-
const attachPress = !!(
|
|
526
|
-
const
|
|
527
|
-
const isHoverable = isWeb &&
|
|
528
|
-
const
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
const unPress = useCallback(() => {
|
|
535
|
-
if (!internal.current.isMounted)
|
|
536
|
-
return;
|
|
537
|
-
setStateShallow({
|
|
538
|
-
press: false,
|
|
539
|
-
pressIn: false
|
|
540
|
-
});
|
|
541
|
-
}, []);
|
|
542
|
-
const events = shouldAttach ? __spreadValues(__spreadProps(__spreadValues({
|
|
543
|
-
[pressOutKey]: attachPress ? (e) => {
|
|
469
|
+
const runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle);
|
|
470
|
+
const attachPress = !!(runtimePressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
471
|
+
const runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle);
|
|
472
|
+
const isHoverable = isWeb && !!(runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
473
|
+
const handlesPressEvents = !isWeb && !asChild;
|
|
474
|
+
const shouldAttach = asChild ? false : Boolean(
|
|
475
|
+
attachPress || isHoverable || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props)
|
|
476
|
+
);
|
|
477
|
+
const events = shouldAttach && !isRSC && !isDisabled ? {
|
|
478
|
+
onPressOut: attachPress ? (e) => {
|
|
544
479
|
unPress();
|
|
545
480
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
546
481
|
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
547
|
-
} : void 0
|
|
548
|
-
}, isHoverable && {
|
|
549
|
-
onMouseEnter: attachHover ? (e) => {
|
|
550
|
-
const next = {};
|
|
551
|
-
if (attachHover) {
|
|
552
|
-
next.hover = true;
|
|
553
|
-
}
|
|
554
|
-
if (state.pressIn) {
|
|
555
|
-
next.press = true;
|
|
556
|
-
}
|
|
557
|
-
if (Object.keys(next).length) {
|
|
558
|
-
setStateShallow(next);
|
|
559
|
-
}
|
|
560
|
-
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
561
|
-
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
562
482
|
} : void 0,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
483
|
+
...isHoverable && {
|
|
484
|
+
onMouseEnter: isHoverable ? (e) => {
|
|
485
|
+
const next = {};
|
|
486
|
+
if (isHoverable) {
|
|
487
|
+
next.hover = true;
|
|
488
|
+
}
|
|
489
|
+
if (state.pressIn) {
|
|
490
|
+
next.press = true;
|
|
491
|
+
}
|
|
492
|
+
if (isHoverable || state.pressIn) {
|
|
493
|
+
setStateShallow(next);
|
|
494
|
+
}
|
|
495
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
496
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
497
|
+
} : void 0,
|
|
498
|
+
onMouseLeave: isHoverable ? (e) => {
|
|
499
|
+
const next = {};
|
|
500
|
+
mouseUps.add(unPress);
|
|
501
|
+
if (isHoverable) {
|
|
502
|
+
next.hover = false;
|
|
503
|
+
}
|
|
504
|
+
if (state.pressIn) {
|
|
505
|
+
next.press = false;
|
|
506
|
+
next.pressIn = false;
|
|
507
|
+
}
|
|
508
|
+
if (Object.keys(next).length) {
|
|
509
|
+
setStateShallow(next);
|
|
510
|
+
}
|
|
511
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
512
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
513
|
+
} : void 0
|
|
514
|
+
},
|
|
515
|
+
onPressIn: attachPress ? (e) => {
|
|
581
516
|
setStateShallow({
|
|
582
517
|
press: true,
|
|
583
|
-
pressIn: true
|
|
518
|
+
pressIn: true,
|
|
519
|
+
hover: false
|
|
584
520
|
});
|
|
585
521
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
586
522
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
587
523
|
if (isWeb) {
|
|
588
524
|
mouseUps.add(unPress);
|
|
589
525
|
}
|
|
590
|
-
} :
|
|
591
|
-
|
|
526
|
+
} : void 0,
|
|
527
|
+
onPress: attachPress ? (e) => {
|
|
592
528
|
unPress();
|
|
593
529
|
onClick == null ? void 0 : onClick(e);
|
|
594
530
|
onPress == null ? void 0 : onPress(e);
|
|
595
|
-
} :
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
531
|
+
} : void 0,
|
|
532
|
+
...!isWeb && {
|
|
533
|
+
cancelable: !props.rejectResponderTermination,
|
|
534
|
+
disabled: isDisabled,
|
|
535
|
+
hitSlop: props.hitSlop,
|
|
536
|
+
delayLongPress: props.delayLongPress,
|
|
537
|
+
delayPressIn: props.delayPressIn,
|
|
538
|
+
delayPressOut: props.delayPressOut,
|
|
539
|
+
focusable: viewProps.focusable ?? true,
|
|
540
|
+
minPressDuration: 0
|
|
541
|
+
}
|
|
542
|
+
} : null;
|
|
606
543
|
let space = spaceProp;
|
|
607
|
-
if (
|
|
608
|
-
for (const key in mediaState) {
|
|
609
|
-
if (
|
|
610
|
-
continue;
|
|
611
|
-
if (props[key] && props[key].space !== void 0) {
|
|
544
|
+
if (state.mediaState && mediaKeys.length) {
|
|
545
|
+
for (const key in state.mediaState) {
|
|
546
|
+
if (key in state.mediaState && key in props && props[key].space !== void 0) {
|
|
612
547
|
space = props[key].space;
|
|
613
548
|
}
|
|
614
549
|
}
|
|
615
550
|
}
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
551
|
+
const themeShouldReset = Boolean(themeShallow && themeManager && themeIsNew);
|
|
552
|
+
const shouldProvideThemeManager = themeShouldReset || themeManager && themeIsNew;
|
|
553
|
+
if (shouldProvideThemeManager) {
|
|
554
|
+
stateRef.current.hasProvidedThemeManager = true;
|
|
555
|
+
}
|
|
556
|
+
if (themeShouldReset) {
|
|
557
|
+
stateRef.current.themeShouldReset = true;
|
|
558
|
+
}
|
|
559
|
+
const childEls = !children || asChild ? children : wrapThemeManagerContext(
|
|
560
|
+
spacedChildren({
|
|
561
|
+
separator,
|
|
562
|
+
children,
|
|
563
|
+
space,
|
|
564
|
+
direction: props.spaceDirection || "both",
|
|
565
|
+
isZStack
|
|
566
|
+
}),
|
|
567
|
+
stateRef.current.hasProvidedThemeManager ? themeManager : void 0,
|
|
568
|
+
stateRef.current.themeShouldReset
|
|
569
|
+
);
|
|
623
570
|
let content;
|
|
624
571
|
if (asChild) {
|
|
625
572
|
elementType = Slot;
|
|
626
|
-
viewProps =
|
|
573
|
+
viewProps = {
|
|
574
|
+
...viewProps,
|
|
627
575
|
onPress,
|
|
628
576
|
onPressIn,
|
|
629
577
|
onPressOut
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (isWeb) {
|
|
633
|
-
const [pressableProps] = usePressable(events ? __spreadProps(__spreadValues({
|
|
634
|
-
disabled
|
|
635
|
-
}, hitSlop && {
|
|
636
|
-
hitSlop
|
|
637
|
-
}), {
|
|
638
|
-
onPressOut: events[pressOutKey],
|
|
639
|
-
onPressIn: events[pressInKey],
|
|
640
|
-
onPress: events[pressKey]
|
|
641
|
-
}) : {
|
|
642
|
-
disabled: true
|
|
643
|
-
});
|
|
644
|
-
if (events) {
|
|
645
|
-
if (handlesPressEvents) {
|
|
646
|
-
Object.assign(viewProps, pressableProps);
|
|
647
|
-
} else {
|
|
648
|
-
Object.assign(viewProps, events);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
578
|
+
};
|
|
651
579
|
}
|
|
652
580
|
if (process.env.TAMAGUI_TARGET === "native") {
|
|
653
|
-
const attachFocus = !!
|
|
581
|
+
const attachFocus = !!pseudos.focusStyle;
|
|
654
582
|
if (attachFocus) {
|
|
655
583
|
viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {
|
|
656
584
|
setStateShallow({ focus: true });
|
|
@@ -659,110 +587,114 @@ function createComponent(configIn, ParentComponent) {
|
|
|
659
587
|
setStateShallow({ focus: false });
|
|
660
588
|
});
|
|
661
589
|
}
|
|
662
|
-
|
|
663
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
664
|
-
const pressability = useMemo(() => {
|
|
665
|
-
if (attachPress && events) {
|
|
666
|
-
const pressability2 = new Pressability(events);
|
|
667
|
-
internal.current.unmountEffects = [
|
|
668
|
-
() => {
|
|
669
|
-
pressability2.reset();
|
|
670
|
-
}
|
|
671
|
-
];
|
|
672
|
-
return pressability2;
|
|
673
|
-
}
|
|
674
|
-
}, []);
|
|
590
|
+
const pressability = usePressability(events ? { ...events, hitSlop } : {});
|
|
675
591
|
if (attachPress && events) {
|
|
676
|
-
pressability
|
|
677
|
-
const eventHandlers = pressability.getEventHandlers();
|
|
678
|
-
for (const key in eventHandlers) {
|
|
679
|
-
if (key === "onBlur" || key === "onFocus") {
|
|
680
|
-
continue;
|
|
681
|
-
}
|
|
592
|
+
for (const key in pressability) {
|
|
682
593
|
const og = props[key];
|
|
683
|
-
const val =
|
|
684
|
-
viewProps[key] = og ? composeEventHandlers(og, val) : val;
|
|
594
|
+
const val = pressability[key];
|
|
595
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? composeEventHandlers(og, val) : val;
|
|
685
596
|
}
|
|
686
597
|
}
|
|
687
598
|
}
|
|
688
599
|
content = createElement(elementType, viewProps, childEls);
|
|
689
600
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}), content);
|
|
601
|
+
if (events || isAnimatedReactNativeWeb) {
|
|
602
|
+
content = /* @__PURE__ */ jsx("span", {
|
|
603
|
+
className: (isAnimatedReactNativeWeb ? className : "") + ` _dsp_contents`,
|
|
604
|
+
...events && {
|
|
605
|
+
onMouseEnter: events.onMouseEnter,
|
|
606
|
+
onMouseLeave: events.onMouseLeave,
|
|
607
|
+
onClick: events.onPress,
|
|
608
|
+
onMouseDown: events.onPressIn,
|
|
609
|
+
onMouseUp: events.onPressOut,
|
|
610
|
+
onTouchStart: events.onPressIn,
|
|
611
|
+
onTouchEnd: events.onPressOut
|
|
612
|
+
},
|
|
613
|
+
children: content
|
|
614
|
+
});
|
|
705
615
|
}
|
|
706
616
|
}
|
|
707
|
-
if (process.env.NODE_ENV === "development") {
|
|
708
|
-
if (
|
|
709
|
-
|
|
617
|
+
if (process.env.NODE_ENV === "development" && process.env.DEBUG !== "tamagui") {
|
|
618
|
+
if (debugProp) {
|
|
619
|
+
const element2 = typeof elementType === "string" ? elementType : "Component";
|
|
620
|
+
console.groupCollapsed(`render <${element2} /> with props`, viewProps);
|
|
710
621
|
for (const key in viewProps) {
|
|
711
622
|
console.log(key, viewProps[key]);
|
|
712
623
|
}
|
|
624
|
+
console.log("children", content);
|
|
713
625
|
console.groupEnd();
|
|
714
626
|
if (typeof window !== "undefined") {
|
|
715
|
-
console.log(
|
|
627
|
+
console.log({ state, shouldProvideThemeManager, isAnimated, isAnimatedReactNativeWeb, 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: avoidClassesWhileAnimating, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, ...typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null });
|
|
716
628
|
}
|
|
717
629
|
console.groupEnd();
|
|
718
630
|
}
|
|
719
631
|
}
|
|
720
|
-
if (features.elements.length) {
|
|
721
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, features.elements, content);
|
|
722
|
-
}
|
|
723
632
|
return content;
|
|
724
633
|
});
|
|
725
634
|
if (staticConfig.componentName) {
|
|
726
635
|
component.displayName = staticConfig.componentName;
|
|
727
636
|
}
|
|
728
637
|
onConfiguredOnce((conf) => {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
638
|
+
if (!tamaguiConfig) {
|
|
639
|
+
tamaguiConfig = conf;
|
|
640
|
+
if (!defaultComponentState) {
|
|
641
|
+
defaultComponentState = {
|
|
642
|
+
hover: false,
|
|
643
|
+
press: false,
|
|
644
|
+
pressIn: false,
|
|
645
|
+
focus: false,
|
|
646
|
+
unmounted: true,
|
|
647
|
+
mediaState: getMediaStateObject(getInitialMediaState())
|
|
648
|
+
};
|
|
649
|
+
defaultComponentStateMounted = {
|
|
650
|
+
...defaultComponentState,
|
|
651
|
+
unmounted: false
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
if (tamaguiConfig.animations) {
|
|
655
|
+
AnimatedText = tamaguiConfig.animations.Text;
|
|
656
|
+
AnimatedView = tamaguiConfig.animations.View;
|
|
657
|
+
}
|
|
658
|
+
if (!initialTheme) {
|
|
659
|
+
const next = conf.themes[Object.keys(conf.themes)[0]];
|
|
660
|
+
initialTheme = proxyThemeVariables(next);
|
|
661
|
+
if (process.env.NODE_ENV === "development") {
|
|
662
|
+
if (!initialTheme) {
|
|
663
|
+
console.log(`Warning: Missing theme`);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
732
667
|
}
|
|
733
|
-
tamaguiConfig = conf;
|
|
734
668
|
mergeShorthands(staticConfig, tamaguiConfig);
|
|
735
|
-
avoidClasses = !!((_a = tamaguiConfig.animations) == null ? void 0 : _a.avoidClasses);
|
|
736
|
-
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
737
|
-
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
738
|
-
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
739
|
-
const config = getConfig();
|
|
740
669
|
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
741
670
|
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
742
|
-
if (
|
|
743
|
-
defaultPropsIn = mergeConfigDefaultProps(
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
671
|
+
if (tamaguiConfig.defaultProps && parentNames && staticConfig.componentName) {
|
|
672
|
+
defaultPropsIn = mergeConfigDefaultProps(
|
|
673
|
+
staticConfig.componentName,
|
|
674
|
+
defaultPropsIn,
|
|
675
|
+
tamaguiConfig.defaultProps,
|
|
676
|
+
parentNames,
|
|
677
|
+
tamaguiConfig
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
const debug = defaultPropsIn["debug"];
|
|
681
|
+
const [ourProps, ourClassNames] = mergeProps(defaultPropsIn, {});
|
|
682
|
+
if (ourProps.tag) {
|
|
683
|
+
defaultTag = ourProps.tag;
|
|
684
|
+
}
|
|
685
|
+
const noClassNames = !staticConfig.acceptsClassName;
|
|
686
|
+
const { name, variants, defaultVariants, ...restProps } = ourProps;
|
|
687
|
+
const [defaults, defaultsClassnames] = mergeProps(component.defaultProps, {
|
|
688
|
+
...defaultVariants,
|
|
689
|
+
...restProps
|
|
690
|
+
});
|
|
761
691
|
defaultNativeStyle = {};
|
|
762
692
|
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
763
693
|
if (!isWeb) {
|
|
764
694
|
for (const key in staticConfig.defaultProps) {
|
|
765
695
|
const val = staticConfig.defaultProps[key];
|
|
696
|
+
if (validPseudoKeys[key])
|
|
697
|
+
continue;
|
|
766
698
|
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
767
699
|
defaults[key] = val;
|
|
768
700
|
} else {
|
|
@@ -770,22 +702,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
770
702
|
}
|
|
771
703
|
}
|
|
772
704
|
}
|
|
773
|
-
|
|
774
|
-
base: defaultNativeStyle
|
|
775
|
-
});
|
|
776
|
-
if (Object.keys(defaults).length) {
|
|
777
|
-
tamaguiDefaultProps = defaults;
|
|
778
|
-
}
|
|
705
|
+
tamaguiDefaultProps = defaults;
|
|
779
706
|
if (process.env.NODE_ENV === "development" && debug) {
|
|
780
707
|
if (process.env.IS_STATIC !== "is_static") {
|
|
781
|
-
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
782
|
-
staticConfig,
|
|
783
|
-
initialSplitStyles,
|
|
784
|
-
tamaguiDefaultProps,
|
|
785
|
-
defaultNativeStyle,
|
|
786
|
-
defaults,
|
|
787
|
-
defaultPropsIn
|
|
788
|
-
});
|
|
708
|
+
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, { staticConfig, tamaguiDefaultProps, defaultNativeStyle, defaults, defaultPropsIn, defaultPropsKeyOrder: Object.keys(staticConfig.defaultProps), defaultPropsInKeyOrder: Object.keys(defaultPropsIn).map((k) => [k, defaultPropsIn[k]]), ourProps, ourClassNames, defaultsClassnames, defaultTag, noClassNames });
|
|
789
709
|
}
|
|
790
710
|
}
|
|
791
711
|
});
|
|
@@ -793,17 +713,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
793
713
|
if (configIn.memo) {
|
|
794
714
|
res = memo(res);
|
|
795
715
|
}
|
|
796
|
-
res.staticConfig =
|
|
797
|
-
validStyles: staticConfig.validStyles || stylePropsView
|
|
798
|
-
|
|
716
|
+
res.staticConfig = {
|
|
717
|
+
validStyles: staticConfig.validStyles || stylePropsView,
|
|
718
|
+
...staticConfig
|
|
719
|
+
};
|
|
799
720
|
res.extractable = (Component, conf) => {
|
|
800
|
-
Component.staticConfig = extendStaticConfig(
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
721
|
+
Component.staticConfig = extendStaticConfig(
|
|
722
|
+
{
|
|
723
|
+
Component,
|
|
724
|
+
...conf,
|
|
725
|
+
neverFlatten: true,
|
|
726
|
+
defaultProps: {
|
|
727
|
+
...Component.defaultProps,
|
|
728
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
res
|
|
732
|
+
);
|
|
807
733
|
return Component;
|
|
808
734
|
};
|
|
809
735
|
return res;
|
|
@@ -816,9 +742,11 @@ const Spacer = createComponent({
|
|
|
816
742
|
memo: true,
|
|
817
743
|
componentName: "Spacer",
|
|
818
744
|
validStyles,
|
|
819
|
-
defaultProps:
|
|
745
|
+
defaultProps: {
|
|
746
|
+
...stackDefaultStyles,
|
|
747
|
+
tag: "span",
|
|
820
748
|
size: true
|
|
821
|
-
}
|
|
749
|
+
},
|
|
822
750
|
variants: {
|
|
823
751
|
size: {
|
|
824
752
|
"...size": (size, { tokens }) => {
|
|
@@ -848,9 +776,6 @@ const Spacer = createComponent({
|
|
|
848
776
|
},
|
|
849
777
|
both: {}
|
|
850
778
|
}
|
|
851
|
-
},
|
|
852
|
-
defaultVariants: {
|
|
853
|
-
direction: "both"
|
|
854
779
|
}
|
|
855
780
|
});
|
|
856
781
|
function spacedChildren({
|
|
@@ -876,95 +801,73 @@ function spacedChildren({
|
|
|
876
801
|
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
877
802
|
final.push(child);
|
|
878
803
|
} else {
|
|
879
|
-
final.push(
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
804
|
+
final.push(
|
|
805
|
+
/* @__PURE__ */ jsx(Fragment, {
|
|
806
|
+
children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, {
|
|
807
|
+
children: child
|
|
808
|
+
}) : child
|
|
809
|
+
}, index)
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
if (isUnspaced(child) && index === 0)
|
|
884
813
|
continue;
|
|
885
|
-
|
|
886
|
-
if (isZStack) {
|
|
814
|
+
if (isZStack)
|
|
887
815
|
continue;
|
|
888
|
-
}
|
|
889
816
|
const next = childrenList[index + 1];
|
|
890
817
|
if (next && !isUnspaced(next)) {
|
|
891
818
|
if (separator) {
|
|
892
819
|
if (hasSpace) {
|
|
893
|
-
final.push(
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
820
|
+
final.push(
|
|
821
|
+
createSpacer({
|
|
822
|
+
key: `_${index}_00tmgui`,
|
|
823
|
+
direction,
|
|
824
|
+
space,
|
|
825
|
+
spaceFlex
|
|
826
|
+
})
|
|
827
|
+
);
|
|
899
828
|
}
|
|
900
|
-
final.push(
|
|
829
|
+
final.push(
|
|
830
|
+
React.isValidElement(separator) ? React.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
831
|
+
);
|
|
901
832
|
if (hasSpace) {
|
|
902
|
-
final.push(
|
|
903
|
-
|
|
833
|
+
final.push(
|
|
834
|
+
createSpacer({
|
|
835
|
+
key: `_${index}01tmgui`,
|
|
836
|
+
direction,
|
|
837
|
+
space,
|
|
838
|
+
spaceFlex
|
|
839
|
+
})
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
} else {
|
|
843
|
+
final.push(
|
|
844
|
+
createSpacer({
|
|
845
|
+
key: `_${index}02tmgui`,
|
|
904
846
|
direction,
|
|
905
847
|
space,
|
|
906
848
|
spaceFlex
|
|
907
|
-
})
|
|
908
|
-
|
|
909
|
-
} else {
|
|
910
|
-
final.push(createSpacer({
|
|
911
|
-
key: `_${index}_spacer`,
|
|
912
|
-
direction,
|
|
913
|
-
space,
|
|
914
|
-
spaceFlex
|
|
915
|
-
}));
|
|
849
|
+
})
|
|
850
|
+
);
|
|
916
851
|
}
|
|
917
852
|
}
|
|
918
853
|
}
|
|
919
854
|
return final;
|
|
920
855
|
}
|
|
921
856
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
key,
|
|
857
|
+
return /* @__PURE__ */ jsx(Spacer, {
|
|
924
858
|
size: space,
|
|
925
|
-
direction
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
859
|
+
direction,
|
|
860
|
+
...typeof spaceFlex !== "undefined" && {
|
|
861
|
+
flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex
|
|
862
|
+
}
|
|
863
|
+
}, key);
|
|
929
864
|
}
|
|
930
865
|
function isUnspaced(child) {
|
|
931
866
|
var _a, _b;
|
|
932
867
|
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"]);
|
|
933
868
|
}
|
|
934
|
-
function AbsoluteFill(props) {
|
|
935
|
-
return /* @__PURE__ */ React.createElement(View, {
|
|
936
|
-
pointerEvents: "box-none",
|
|
937
|
-
style: StyleSheet.absoluteFill
|
|
938
|
-
}, props.children);
|
|
939
|
-
}
|
|
940
|
-
function processIDRefList(idRefList) {
|
|
941
|
-
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
942
|
-
}
|
|
943
|
-
const accessibilityRoleToWebRole = {
|
|
944
|
-
adjustable: "slider",
|
|
945
|
-
button: "button",
|
|
946
|
-
header: "heading",
|
|
947
|
-
image: "img",
|
|
948
|
-
imagebutton: null,
|
|
949
|
-
keyboardkey: null,
|
|
950
|
-
label: null,
|
|
951
|
-
link: "link",
|
|
952
|
-
none: "presentation",
|
|
953
|
-
search: "search",
|
|
954
|
-
summary: "region",
|
|
955
|
-
text: null
|
|
956
|
-
};
|
|
957
|
-
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
958
|
-
const pseudoStyle = pseudos[name];
|
|
959
|
-
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
960
|
-
const defaultPseudoStyle = initialPseudos[name];
|
|
961
|
-
const style = defaultPseudoStyle ? __spreadValues(__spreadValues({}, defaultPseudoStyle), pseudoStyle) : pseudoStyle;
|
|
962
|
-
if (style) {
|
|
963
|
-
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
869
|
const DefaultProps = /* @__PURE__ */ new Map();
|
|
967
|
-
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
870
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames, conf) {
|
|
968
871
|
const len = parentNames.length;
|
|
969
872
|
let prev;
|
|
970
873
|
for (let i = 0; i < len; i++) {
|
|
@@ -982,24 +885,56 @@ function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
|
982
885
|
}
|
|
983
886
|
continue;
|
|
984
887
|
}
|
|
985
|
-
prev = mergeProps(prev || {}, props2)[0];
|
|
986
|
-
console.log("set prev", prev);
|
|
888
|
+
prev = mergeProps(prev || {}, props2, false, conf.inverseShorthands)[0];
|
|
987
889
|
DefaultProps.set(n, prev);
|
|
988
890
|
}
|
|
989
891
|
const ourDefaultsMerged = DefaultProps.get(name);
|
|
990
892
|
if (ourDefaultsMerged) {
|
|
991
|
-
return mergeProps(props, ourDefaultsMerged)[0];
|
|
893
|
+
return mergeProps(props, ourDefaultsMerged, false, conf.inverseShorthands)[0];
|
|
992
894
|
}
|
|
993
895
|
return props;
|
|
994
896
|
}
|
|
897
|
+
function usePlatformMethods(hostRef) {
|
|
898
|
+
useIsomorphicLayoutEffect(() => {
|
|
899
|
+
const node = hostRef.current;
|
|
900
|
+
if (!node)
|
|
901
|
+
return;
|
|
902
|
+
node.measure = (callback) => measureLayout(node, null, callback);
|
|
903
|
+
node.measureLayout = (relativeToNode, success) => measureLayout(node, relativeToNode, success);
|
|
904
|
+
node.measureInWindow = (callback) => {
|
|
905
|
+
if (!node)
|
|
906
|
+
return;
|
|
907
|
+
setTimeout(() => {
|
|
908
|
+
const { height, left, top, width } = getRect(node);
|
|
909
|
+
callback(left, top, width, height);
|
|
910
|
+
}, 0);
|
|
911
|
+
};
|
|
912
|
+
}, [hostRef]);
|
|
913
|
+
}
|
|
914
|
+
const AbsoluteFill = createComponent({
|
|
915
|
+
componentName: "AbsoluteFill",
|
|
916
|
+
defaultProps: {
|
|
917
|
+
...stackDefaultStyles,
|
|
918
|
+
flexDirection: "column",
|
|
919
|
+
position: "absolute",
|
|
920
|
+
top: 0,
|
|
921
|
+
right: 0,
|
|
922
|
+
bottom: 0,
|
|
923
|
+
left: 0,
|
|
924
|
+
pointerEvents: "box-none"
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
const dontComposePressabilityKeys = {
|
|
928
|
+
onClick: true
|
|
929
|
+
};
|
|
930
|
+
function getMediaStateObject(obj) {
|
|
931
|
+
return Object.fromEntries(Object.entries(obj).flatMap(([k, v]) => v ? [[`$${k}`, v]] : []));
|
|
932
|
+
}
|
|
995
933
|
export {
|
|
996
|
-
AbsoluteFill,
|
|
997
934
|
Spacer,
|
|
998
935
|
Unspaced,
|
|
999
|
-
accessibilityRoleToWebRole,
|
|
1000
936
|
createComponent,
|
|
1001
937
|
mouseUps,
|
|
1002
|
-
processIDRefList,
|
|
1003
938
|
spacedChildren
|
|
1004
939
|
};
|
|
1005
940
|
//# sourceMappingURL=createComponent.js.map
|