@tamagui/core 1.2.4 → 1.2.5
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/README.md +4 -0
- package/dist/cjs/hooks/usePlatformMethods.js +48 -0
- package/dist/cjs/hooks/usePlatformMethods.js.map +7 -0
- package/dist/cjs/index.js +152 -75
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/{types.js → reactNativeTypes.js} +3 -3
- package/dist/cjs/reactNativeTypes.js.map +7 -0
- package/dist/esm/hooks/usePlatformMethods.js +24 -0
- package/dist/esm/hooks/usePlatformMethods.js.map +7 -0
- package/dist/esm/index.js +157 -71
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/reactNativeTypes.js +1 -0
- package/dist/esm/{types-rnw.js.map → reactNativeTypes.js.map} +0 -0
- package/package.json +5 -11
- package/src/hooks/usePlatformMethods.ts +26 -0
- package/src/index.ts +214 -71
- package/src/reactNativeTypes.ts +104 -0
- package/types/hooks/usePlatformMethods.d.ts +3 -0
- package/types/hooks/usePlatformMethods.d.ts.map +1 -0
- package/types/index.d.ts +6 -54
- package/types/index.d.ts.map +1 -1
- package/types/reactNativeTypes.d.ts +26 -0
- package/types/reactNativeTypes.d.ts.map +1 -0
- package/dist/cjs/Tamagui.js +0 -77
- package/dist/cjs/Tamagui.js.map +0 -7
- package/dist/cjs/addTheme.js +0 -78
- package/dist/cjs/addTheme.js.map +0 -7
- package/dist/cjs/config.js +0 -91
- package/dist/cjs/config.js.map +0 -7
- package/dist/cjs/constants/constants.js +0 -49
- package/dist/cjs/constants/constants.js.map +0 -7
- package/dist/cjs/constants/isDevTools.js +0 -37
- package/dist/cjs/constants/isDevTools.js.map +0 -7
- package/dist/cjs/contexts/ButtonNestingContext.js +0 -30
- package/dist/cjs/contexts/ButtonNestingContext.js.map +0 -7
- package/dist/cjs/contexts/FontLanguageContext.js +0 -30
- package/dist/cjs/contexts/FontLanguageContext.js.map +0 -7
- package/dist/cjs/contexts/TextAncestorContext.js +0 -30
- package/dist/cjs/contexts/TextAncestorContext.js.map +0 -7
- package/dist/cjs/createComponent.js +0 -993
- package/dist/cjs/createComponent.js.map +0 -7
- package/dist/cjs/createFont.js +0 -69
- package/dist/cjs/createFont.js.map +0 -7
- package/dist/cjs/createFont.web.test.js +0 -125
- package/dist/cjs/createFont.web.test.js.map +0 -7
- package/dist/cjs/createShorthands.js +0 -31
- package/dist/cjs/createShorthands.js.map +0 -7
- package/dist/cjs/createTamagui.js +0 -206
- package/dist/cjs/createTamagui.js.map +0 -7
- package/dist/cjs/createTheme.js +0 -31
- package/dist/cjs/createTheme.js.map +0 -7
- package/dist/cjs/createTokens.js +0 -39
- package/dist/cjs/createTokens.js.map +0 -7
- package/dist/cjs/createTokens.web.test.js +0 -28
- package/dist/cjs/createTokens.web.test.js.map +0 -7
- package/dist/cjs/createVariable.js +0 -111
- package/dist/cjs/createVariable.js.map +0 -7
- package/dist/cjs/createVariable.web.test.js +0 -7
- package/dist/cjs/createVariable.web.test.js.map +0 -7
- package/dist/cjs/createVariables.js +0 -60
- package/dist/cjs/createVariables.js.map +0 -7
- package/dist/cjs/helpers/RNComponents.js +0 -40
- package/dist/cjs/helpers/RNComponents.js.map +0 -7
- package/dist/cjs/helpers/ThemeManager.js +0 -234
- package/dist/cjs/helpers/ThemeManager.js.map +0 -7
- package/dist/cjs/helpers/ThemeManager.test.js +0 -465
- package/dist/cjs/helpers/ThemeManager.test.js.map +0 -7
- package/dist/cjs/helpers/ThemeManagerContext.js +0 -30
- package/dist/cjs/helpers/ThemeManagerContext.js.map +0 -7
- package/dist/cjs/helpers/createMediaStyle.js +0 -67
- package/dist/cjs/helpers/createMediaStyle.js.map +0 -7
- package/dist/cjs/helpers/createPropMapper.js +0 -423
- package/dist/cjs/helpers/createPropMapper.js.map +0 -7
- package/dist/cjs/helpers/createProxy.js +0 -43
- package/dist/cjs/helpers/createProxy.js.map +0 -7
- package/dist/cjs/helpers/expandStyle.js +0 -95
- package/dist/cjs/helpers/expandStyle.js.map +0 -7
- package/dist/cjs/helpers/expandStyles.js +0 -116
- package/dist/cjs/helpers/expandStyles.js.map +0 -7
- package/dist/cjs/helpers/extendStaticConfig.js +0 -91
- package/dist/cjs/helpers/extendStaticConfig.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.js +0 -30
- package/dist/cjs/helpers/fixNativeShadow.js.map +0 -7
- package/dist/cjs/helpers/getAnimationDriver.js +0 -32
- package/dist/cjs/helpers/getAnimationDriver.js.map +0 -7
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -40
- package/dist/cjs/helpers/getExpandedShorthands.js.map +0 -7
- package/dist/cjs/helpers/getFontLanguage.js +0 -29
- package/dist/cjs/helpers/getFontLanguage.js.map +0 -7
- package/dist/cjs/helpers/getSplitStyles.js +0 -848
- package/dist/cjs/helpers/getSplitStyles.js.map +0 -7
- package/dist/cjs/helpers/getStylesAtomic.js +0 -226
- package/dist/cjs/helpers/getStylesAtomic.js.map +0 -7
- package/dist/cjs/helpers/getStylesAtomic.native.js +0 -38
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +0 -7
- package/dist/cjs/helpers/getThemeCSSRules.js +0 -110
- package/dist/cjs/helpers/getThemeCSSRules.js.map +0 -7
- package/dist/cjs/helpers/getThemeCSSRules.native.js +0 -31
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +0 -7
- package/dist/cjs/helpers/getVariantExtras.js +0 -92
- package/dist/cjs/helpers/getVariantExtras.js.map +0 -7
- package/dist/cjs/helpers/insertStyleRule.js +0 -218
- package/dist/cjs/helpers/insertStyleRule.js.map +0 -7
- package/dist/cjs/helpers/isObj.js +0 -29
- package/dist/cjs/helpers/isObj.js.map +0 -7
- package/dist/cjs/helpers/isTamaguiComponent.js +0 -32
- package/dist/cjs/helpers/isTamaguiComponent.js.map +0 -7
- package/dist/cjs/helpers/isTamaguiElement.js +0 -33
- package/dist/cjs/helpers/isTamaguiElement.js.map +0 -7
- package/dist/cjs/helpers/matchMedia.js +0 -42
- package/dist/cjs/helpers/matchMedia.js.map +0 -7
- package/dist/cjs/helpers/matchMedia.native.js +0 -48
- package/dist/cjs/helpers/matchMedia.native.js.map +0 -7
- package/dist/cjs/helpers/mergeProps.js +0 -54
- package/dist/cjs/helpers/mergeProps.js.map +0 -7
- package/dist/cjs/helpers/mergeTransform.js +0 -47
- package/dist/cjs/helpers/mergeTransform.js.map +0 -7
- package/dist/cjs/helpers/normalizeColor.js +0 -71
- package/dist/cjs/helpers/normalizeColor.js.map +0 -7
- package/dist/cjs/helpers/normalizeValueWithProperty.js +0 -138
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +0 -7
- package/dist/cjs/helpers/proxyThemeVariables.js +0 -40
- package/dist/cjs/helpers/proxyThemeVariables.js.map +0 -7
- package/dist/cjs/helpers/pseudoDescriptors.js +0 -53
- package/dist/cjs/helpers/pseudoDescriptors.js.map +0 -7
- package/dist/cjs/helpers/registerCSSVariable.js +0 -40
- package/dist/cjs/helpers/registerCSSVariable.js.map +0 -7
- package/dist/cjs/helpers/themeable.js +0 -62
- package/dist/cjs/helpers/themeable.js.map +0 -7
- package/dist/cjs/helpers/themes.js +0 -78
- package/dist/cjs/helpers/themes.js.map +0 -7
- package/dist/cjs/helpers/timer.js +0 -35
- package/dist/cjs/helpers/timer.js.map +0 -7
- package/dist/cjs/helpers/useShallowSetState.js +0 -59
- package/dist/cjs/helpers/useShallowSetState.js.map +0 -7
- package/dist/cjs/helpers/warnOnce.js +0 -38
- package/dist/cjs/helpers/warnOnce.js.map +0 -7
- package/dist/cjs/helpers/withStaticProperties.js +0 -32
- package/dist/cjs/helpers/withStaticProperties.js.map +0 -7
- package/dist/cjs/hooks/getThemeUnwrapped.js +0 -34
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +0 -7
- package/dist/cjs/hooks/useId.js +0 -29
- package/dist/cjs/hooks/useId.js.map +0 -7
- package/dist/cjs/hooks/useIsTouchDevice.js +0 -33
- package/dist/cjs/hooks/useIsTouchDevice.js.map +0 -7
- package/dist/cjs/hooks/useMedia.js +0 -263
- package/dist/cjs/hooks/useMedia.js.map +0 -7
- package/dist/cjs/hooks/useSafeRef.js +0 -59
- package/dist/cjs/hooks/useSafeRef.js.map +0 -7
- package/dist/cjs/hooks/useServerHooks.js +0 -36
- package/dist/cjs/hooks/useServerHooks.js.map +0 -7
- package/dist/cjs/hooks/useStyle.js +0 -61
- package/dist/cjs/hooks/useStyle.js.map +0 -7
- package/dist/cjs/hooks/useTheme.js +0 -230
- package/dist/cjs/hooks/useTheme.js.map +0 -7
- package/dist/cjs/hooks/useThemeName.js +0 -52
- package/dist/cjs/hooks/useThemeName.js.map +0 -7
- package/dist/cjs/insertFont.js +0 -93
- package/dist/cjs/insertFont.js.map +0 -7
- package/dist/cjs/setupReactNative.js +0 -51
- package/dist/cjs/setupReactNative.js.map +0 -7
- package/dist/cjs/static.js +0 -20
- package/dist/cjs/static.js.map +0 -7
- package/dist/cjs/styled.js +0 -95
- package/dist/cjs/styled.js.map +0 -7
- package/dist/cjs/types-rnw.js +0 -17
- package/dist/cjs/types-rnw.js.map +0 -7
- package/dist/cjs/types.js.map +0 -7
- package/dist/cjs/updateTheme.js +0 -47
- package/dist/cjs/updateTheme.js.map +0 -7
- package/dist/cjs/views/FontLanguage.js +0 -41
- package/dist/cjs/views/FontLanguage.js.map +0 -7
- package/dist/cjs/views/FontLanguage.native.js +0 -35
- package/dist/cjs/views/FontLanguage.native.js.map +0 -7
- package/dist/cjs/views/FontLanguage.types.js +0 -17
- package/dist/cjs/views/FontLanguage.types.js.map +0 -7
- package/dist/cjs/views/Slot.js +0 -92
- package/dist/cjs/views/Slot.js.map +0 -7
- package/dist/cjs/views/Stack.js +0 -38
- package/dist/cjs/views/Stack.js.map +0 -7
- package/dist/cjs/views/Stack.web.test.js +0 -22
- package/dist/cjs/views/Stack.web.test.js.map +0 -7
- package/dist/cjs/views/TamaguiProvider.js +0 -90
- package/dist/cjs/views/TamaguiProvider.js.map +0 -7
- package/dist/cjs/views/Text.js +0 -94
- package/dist/cjs/views/Text.js.map +0 -7
- package/dist/cjs/views/Theme.js +0 -88
- package/dist/cjs/views/Theme.js.map +0 -7
- package/dist/cjs/views/ThemeProvider.js +0 -70
- package/dist/cjs/views/ThemeProvider.js.map +0 -7
- package/dist/esm/Tamagui.js +0 -41
- package/dist/esm/Tamagui.js.map +0 -7
- package/dist/esm/addTheme.js +0 -54
- package/dist/esm/addTheme.js.map +0 -7
- package/dist/esm/config.js +0 -58
- package/dist/esm/config.js.map +0 -7
- package/dist/esm/constants/constants.js +0 -22
- package/dist/esm/constants/constants.js.map +0 -7
- package/dist/esm/constants/isDevTools.js +0 -13
- package/dist/esm/constants/isDevTools.js.map +0 -7
- package/dist/esm/contexts/ButtonNestingContext.js +0 -6
- package/dist/esm/contexts/ButtonNestingContext.js.map +0 -7
- package/dist/esm/contexts/FontLanguageContext.js +0 -6
- package/dist/esm/contexts/FontLanguageContext.js.map +0 -7
- package/dist/esm/contexts/TextAncestorContext.js +0 -6
- package/dist/esm/contexts/TextAncestorContext.js.map +0 -7
- package/dist/esm/createComponent.js +0 -975
- package/dist/esm/createComponent.js.map +0 -7
- package/dist/esm/createFont.js +0 -45
- package/dist/esm/createFont.js.map +0 -7
- package/dist/esm/createFont.web.test.js +0 -124
- package/dist/esm/createFont.web.test.js.map +0 -7
- package/dist/esm/createShorthands.js +0 -7
- package/dist/esm/createShorthands.js.map +0 -7
- package/dist/esm/createTamagui.js +0 -190
- package/dist/esm/createTamagui.js.map +0 -7
- package/dist/esm/createTheme.js +0 -7
- package/dist/esm/createTheme.js.map +0 -7
- package/dist/esm/createTokens.js +0 -15
- package/dist/esm/createTokens.js.map +0 -7
- package/dist/esm/createTokens.web.test.js +0 -27
- package/dist/esm/createTokens.web.test.js.map +0 -7
- package/dist/esm/createVariable.js +0 -78
- package/dist/esm/createVariable.js.map +0 -7
- package/dist/esm/createVariable.web.test.js +0 -6
- package/dist/esm/createVariable.web.test.js.map +0 -7
- package/dist/esm/createVariables.js +0 -35
- package/dist/esm/createVariables.js.map +0 -7
- package/dist/esm/helpers/RNComponents.js +0 -16
- package/dist/esm/helpers/RNComponents.js.map +0 -7
- package/dist/esm/helpers/ThemeManager.js +0 -209
- package/dist/esm/helpers/ThemeManager.js.map +0 -7
- package/dist/esm/helpers/ThemeManager.test.js +0 -464
- package/dist/esm/helpers/ThemeManager.test.js.map +0 -7
- package/dist/esm/helpers/ThemeManagerContext.js +0 -6
- package/dist/esm/helpers/ThemeManagerContext.js.map +0 -7
- package/dist/esm/helpers/createMediaStyle.js +0 -42
- package/dist/esm/helpers/createMediaStyle.js.map +0 -7
- package/dist/esm/helpers/createPropMapper.js +0 -396
- package/dist/esm/helpers/createPropMapper.js.map +0 -7
- package/dist/esm/helpers/createProxy.js +0 -19
- package/dist/esm/helpers/createProxy.js.map +0 -7
- package/dist/esm/helpers/expandStyle.js +0 -71
- package/dist/esm/helpers/expandStyle.js.map +0 -7
- package/dist/esm/helpers/expandStyles.js +0 -90
- package/dist/esm/helpers/expandStyles.js.map +0 -7
- package/dist/esm/helpers/extendStaticConfig.js +0 -66
- package/dist/esm/helpers/extendStaticConfig.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.js +0 -6
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -7
- package/dist/esm/helpers/getAnimationDriver.js +0 -8
- package/dist/esm/helpers/getAnimationDriver.js.map +0 -7
- package/dist/esm/helpers/getExpandedShorthands.js +0 -16
- package/dist/esm/helpers/getExpandedShorthands.js.map +0 -7
- package/dist/esm/helpers/getFontLanguage.js +0 -5
- package/dist/esm/helpers/getFontLanguage.js.map +0 -7
- package/dist/esm/helpers/getSplitStyles.js +0 -847
- package/dist/esm/helpers/getSplitStyles.js.map +0 -7
- package/dist/esm/helpers/getStylesAtomic.js +0 -200
- package/dist/esm/helpers/getStylesAtomic.js.map +0 -7
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -12
- package/dist/esm/helpers/getStylesAtomic.native.js.map +0 -7
- package/dist/esm/helpers/getThemeCSSRules.js +0 -86
- package/dist/esm/helpers/getThemeCSSRules.js.map +0 -7
- package/dist/esm/helpers/getThemeCSSRules.native.js +0 -7
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +0 -7
- package/dist/esm/helpers/getVariantExtras.js +0 -67
- package/dist/esm/helpers/getVariantExtras.js.map +0 -7
- package/dist/esm/helpers/insertStyleRule.js +0 -186
- package/dist/esm/helpers/insertStyleRule.js.map +0 -7
- package/dist/esm/helpers/isObj.js +0 -5
- package/dist/esm/helpers/isObj.js.map +0 -7
- package/dist/esm/helpers/isTamaguiComponent.js +0 -8
- package/dist/esm/helpers/isTamaguiComponent.js.map +0 -7
- package/dist/esm/helpers/isTamaguiElement.js +0 -9
- package/dist/esm/helpers/isTamaguiElement.js.map +0 -7
- package/dist/esm/helpers/matchMedia.js +0 -17
- package/dist/esm/helpers/matchMedia.js.map +0 -7
- package/dist/esm/helpers/matchMedia.native.js +0 -23
- package/dist/esm/helpers/matchMedia.native.js.map +0 -7
- package/dist/esm/helpers/mergeProps.js +0 -30
- package/dist/esm/helpers/mergeProps.js.map +0 -7
- package/dist/esm/helpers/mergeTransform.js +0 -21
- package/dist/esm/helpers/mergeTransform.js.map +0 -7
- package/dist/esm/helpers/normalizeColor.js +0 -36
- package/dist/esm/helpers/normalizeColor.js.map +0 -7
- package/dist/esm/helpers/normalizeValueWithProperty.js +0 -113
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +0 -7
- package/dist/esm/helpers/proxyThemeVariables.js +0 -16
- package/dist/esm/helpers/proxyThemeVariables.js.map +0 -7
- package/dist/esm/helpers/pseudoDescriptors.js +0 -29
- package/dist/esm/helpers/pseudoDescriptors.js.map +0 -7
- package/dist/esm/helpers/registerCSSVariable.js +0 -14
- package/dist/esm/helpers/registerCSSVariable.js.map +0 -7
- package/dist/esm/helpers/themeable.js +0 -28
- package/dist/esm/helpers/themeable.js.map +0 -7
- package/dist/esm/helpers/themes.js +0 -53
- package/dist/esm/helpers/themes.js.map +0 -7
- package/dist/esm/helpers/timer.js +0 -11
- package/dist/esm/helpers/timer.js.map +0 -7
- package/dist/esm/helpers/useShallowSetState.js +0 -35
- package/dist/esm/helpers/useShallowSetState.js.map +0 -7
- package/dist/esm/helpers/warnOnce.js +0 -14
- package/dist/esm/helpers/warnOnce.js.map +0 -7
- package/dist/esm/helpers/withStaticProperties.js +0 -8
- package/dist/esm/helpers/withStaticProperties.js.map +0 -7
- package/dist/esm/hooks/getThemeUnwrapped.js +0 -9
- package/dist/esm/hooks/getThemeUnwrapped.js.map +0 -7
- package/dist/esm/hooks/useId.js +0 -5
- package/dist/esm/hooks/useId.js.map +0 -7
- package/dist/esm/hooks/useIsTouchDevice.js +0 -9
- package/dist/esm/hooks/useIsTouchDevice.js.map +0 -7
- package/dist/esm/hooks/useMedia.js +0 -225
- package/dist/esm/hooks/useMedia.js.map +0 -7
- package/dist/esm/hooks/useSafeRef.js +0 -35
- package/dist/esm/hooks/useSafeRef.js.map +0 -7
- package/dist/esm/hooks/useServerHooks.js +0 -11
- package/dist/esm/hooks/useServerHooks.js.map +0 -7
- package/dist/esm/hooks/useStyle.js +0 -37
- package/dist/esm/hooks/useStyle.js.map +0 -7
- package/dist/esm/hooks/useTheme.js +0 -205
- package/dist/esm/hooks/useTheme.js.map +0 -7
- package/dist/esm/hooks/useThemeName.js +0 -28
- package/dist/esm/hooks/useThemeName.js.map +0 -7
- package/dist/esm/insertFont.js +0 -67
- package/dist/esm/insertFont.js.map +0 -7
- package/dist/esm/setupReactNative.js +0 -25
- package/dist/esm/setupReactNative.js.map +0 -7
- package/dist/esm/static.js +0 -3
- package/dist/esm/static.js.map +0 -7
- package/dist/esm/styled.js +0 -71
- package/dist/esm/styled.js.map +0 -7
- package/dist/esm/types-rnw.js +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -7
- package/dist/esm/updateTheme.js +0 -23
- package/dist/esm/updateTheme.js.map +0 -7
- package/dist/esm/views/FontLanguage.js +0 -17
- package/dist/esm/views/FontLanguage.js.map +0 -7
- package/dist/esm/views/FontLanguage.native.js +0 -11
- package/dist/esm/views/FontLanguage.native.js.map +0 -7
- package/dist/esm/views/FontLanguage.types.js +0 -1
- package/dist/esm/views/FontLanguage.types.js.map +0 -7
- package/dist/esm/views/Slot.js +0 -71
- package/dist/esm/views/Slot.js.map +0 -7
- package/dist/esm/views/Stack.js +0 -14
- package/dist/esm/views/Stack.js.map +0 -7
- package/dist/esm/views/Stack.web.test.js +0 -21
- package/dist/esm/views/Stack.web.test.js.map +0 -7
- package/dist/esm/views/TamaguiProvider.js +0 -56
- package/dist/esm/views/TamaguiProvider.js.map +0 -7
- package/dist/esm/views/Text.js +0 -70
- package/dist/esm/views/Text.js.map +0 -7
- package/dist/esm/views/Theme.js +0 -63
- package/dist/esm/views/Theme.js.map +0 -7
- package/dist/esm/views/ThemeProvider.js +0 -45
- package/dist/esm/views/ThemeProvider.js.map +0 -7
- package/src/Tamagui.ts +0 -48
- package/src/__snapshots__/createTokens.test.ts.snap +0 -772
- package/src/__snapshots__/createTokens.web.test.tsx.snap +0 -772
- package/src/addTheme.ts +0 -65
- package/src/config.ts +0 -62
- package/src/constants/constants.ts +0 -17
- package/src/constants/isDevTools.ts +0 -12
- package/src/contexts/ButtonNestingContext.tsx +0 -3
- package/src/contexts/FontLanguageContext.tsx +0 -5
- package/src/contexts/TextAncestorContext.tsx +0 -3
- package/src/createComponent.tsx +0 -1293
- package/src/createFont.ts +0 -50
- package/src/createShorthands.ts +0 -7
- package/src/createTamagui.ts +0 -253
- package/src/createTheme.ts +0 -13
- package/src/createTokens.ts +0 -46
- package/src/createVariable.ts +0 -93
- package/src/createVariables.ts +0 -55
- package/src/helpers/RNComponents.tsx +0 -14
- package/src/helpers/ThemeManager.tsx +0 -285
- package/src/helpers/ThemeManagerContext.tsx +0 -5
- package/src/helpers/createMediaStyle.ts +0 -56
- package/src/helpers/createPropMapper.ts +0 -562
- package/src/helpers/createProxy.ts +0 -16
- package/src/helpers/expandStyle.ts +0 -82
- package/src/helpers/expandStyles.ts +0 -107
- package/src/helpers/extendStaticConfig.ts +0 -78
- package/src/helpers/fixNativeShadow.tsx +0 -2
- package/src/helpers/getAnimationDriver.tsx +0 -5
- package/src/helpers/getExpandedShorthands.ts +0 -17
- package/src/helpers/getFontLanguage.ts +0 -2
- package/src/helpers/getSplitStyles.tsx +0 -1137
- package/src/helpers/getStylesAtomic.native.ts +0 -8
- package/src/helpers/getStylesAtomic.ts +0 -274
- package/src/helpers/getThemeCSSRules.native.ts +0 -3
- package/src/helpers/getThemeCSSRules.ts +0 -120
- package/src/helpers/getVariantExtras.tsx +0 -85
- package/src/helpers/insertStyleRule.tsx +0 -220
- package/src/helpers/isObj.ts +0 -1
- package/src/helpers/isTamaguiComponent.tsx +0 -11
- package/src/helpers/isTamaguiElement.tsx +0 -15
- package/src/helpers/matchMedia.native.ts +0 -23
- package/src/helpers/matchMedia.ts +0 -16
- package/src/helpers/mergeProps.ts +0 -56
- package/src/helpers/mergeTransform.ts +0 -30
- package/src/helpers/normalizeColor.ts +0 -38
- package/src/helpers/normalizeValueWithProperty.ts +0 -129
- package/src/helpers/proxyThemeVariables.tsx +0 -15
- package/src/helpers/pseudoDescriptors.ts +0 -40
- package/src/helpers/registerCSSVariable.ts +0 -13
- package/src/helpers/themeable.tsx +0 -44
- package/src/helpers/themes.ts +0 -67
- package/src/helpers/timer.ts +0 -9
- package/src/helpers/useShallowSetState.tsx +0 -41
- package/src/helpers/warnOnce.tsx +0 -11
- package/src/helpers/withStaticProperties.tsx +0 -7
- package/src/hooks/getThemeUnwrapped.tsx +0 -5
- package/src/hooks/useId.tsx +0 -1
- package/src/hooks/useIsTouchDevice.tsx +0 -6
- package/src/hooks/useMedia.tsx +0 -298
- package/src/hooks/useSafeRef.ts +0 -45
- package/src/hooks/useServerHooks.tsx +0 -12
- package/src/hooks/useStyle.tsx +0 -49
- package/src/hooks/useTheme.tsx +0 -274
- package/src/hooks/useThemeName.tsx +0 -27
- package/src/insertFont.ts +0 -73
- package/src/setupReactNative.ts +0 -22
- package/src/static.ts +0 -5
- package/src/styled.tsx +0 -195
- package/src/types-rnw.tsx +0 -162
- package/src/types.tsx +0 -1405
- package/src/updateTheme.ts +0 -26
- package/src/views/FontLanguage.native.tsx +0 -12
- package/src/views/FontLanguage.tsx +0 -16
- package/src/views/FontLanguage.types.ts +0 -13
- package/src/views/Slot.tsx +0 -102
- package/src/views/Stack.tsx +0 -25
- package/src/views/TamaguiProvider.tsx +0 -65
- package/src/views/Text.tsx +0 -88
- package/src/views/Theme.tsx +0 -83
- package/src/views/ThemeProvider.tsx +0 -55
- package/types/Tamagui.d.ts +0 -30
- package/types/Tamagui.d.ts.map +0 -1
- package/types/addTheme.d.ts +0 -32
- package/types/addTheme.d.ts.map +0 -1
- package/types/config.d.ts +0 -49
- package/types/config.d.ts.map +0 -1
- package/types/constants/constants.d.ts +0 -21
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/isDevTools.d.ts +0 -2
- package/types/constants/isDevTools.d.ts.map +0 -1
- package/types/contexts/ButtonNestingContext.d.ts +0 -3
- package/types/contexts/ButtonNestingContext.d.ts.map +0 -1
- package/types/contexts/FontLanguageContext.d.ts +0 -5
- package/types/contexts/FontLanguageContext.d.ts.map +0 -1
- package/types/contexts/TextAncestorContext.d.ts +0 -3
- package/types/contexts/TextAncestorContext.d.ts.map +0 -1
- package/types/createComponent.d.ts +0 -23
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts +0 -3
- package/types/createFont.d.ts.map +0 -1
- package/types/createFont.web.test.d.ts +0 -2
- package/types/createFont.web.test.d.ts.map +0 -1
- package/types/createShorthands.d.ts +0 -3
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTamagui.d.ts +0 -3
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTheme.d.ts +0 -7
- package/types/createTheme.d.ts.map +0 -1
- package/types/createTokens.d.ts +0 -28
- package/types/createTokens.d.ts.map +0 -1
- package/types/createTokens.web.test.d.ts +0 -2
- package/types/createTokens.web.test.d.ts.map +0 -1
- package/types/createVariable.d.ts +0 -26
- package/types/createVariable.d.ts.map +0 -1
- package/types/createVariable.web.test.d.ts +0 -2
- package/types/createVariable.web.test.d.ts.map +0 -1
- package/types/createVariables.d.ts +0 -11
- package/types/createVariables.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts +0 -2
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/ThemeManager.d.ts +0 -36
- package/types/helpers/ThemeManager.d.ts.map +0 -1
- package/types/helpers/ThemeManager.test.d.ts +0 -2
- package/types/helpers/ThemeManager.test.d.ts.map +0 -1
- package/types/helpers/ThemeManagerContext.d.ts +0 -4
- package/types/helpers/ThemeManagerContext.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts +0 -6
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts +0 -7
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createProxy.d.ts +0 -2
- package/types/helpers/createProxy.d.ts.map +0 -1
- package/types/helpers/expandStyle.d.ts +0 -6
- package/types/helpers/expandStyle.d.ts.map +0 -1
- package/types/helpers/expandStyles.d.ts +0 -26
- package/types/helpers/expandStyles.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts +0 -4
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts +0 -2
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/getAnimationDriver.d.ts +0 -6
- package/types/helpers/getAnimationDriver.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts +0 -3
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getFontLanguage.d.ts +0 -2
- package/types/helpers/getFontLanguage.d.ts.map +0 -1
- package/types/helpers/getSplitStyles.d.ts +0 -43
- package/types/helpers/getSplitStyles.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts +0 -18
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts +0 -4
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getThemeCSSRules.d.ts +0 -8
- package/types/helpers/getThemeCSSRules.d.ts.map +0 -1
- package/types/helpers/getThemeCSSRules.native.d.ts +0 -2
- package/types/helpers/getThemeCSSRules.native.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -5
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts +0 -13
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts +0 -2
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/isTamaguiComponent.d.ts +0 -5
- package/types/helpers/isTamaguiComponent.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts +0 -7
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts +0 -6
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts +0 -4
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/mergeProps.d.ts +0 -17
- package/types/helpers/mergeProps.d.ts.map +0 -1
- package/types/helpers/mergeTransform.d.ts +0 -9
- package/types/helpers/mergeTransform.d.ts.map +0 -1
- package/types/helpers/normalizeColor.d.ts +0 -4
- package/types/helpers/normalizeColor.d.ts.map +0 -1
- package/types/helpers/normalizeValueWithProperty.d.ts +0 -7
- package/types/helpers/normalizeValueWithProperty.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts +0 -2
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/pseudoDescriptors.d.ts +0 -10
- package/types/helpers/pseudoDescriptors.d.ts.map +0 -1
- package/types/helpers/registerCSSVariable.d.ts +0 -5
- package/types/helpers/registerCSSVariable.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -12
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/themes.d.ts +0 -4
- package/types/helpers/themes.d.ts.map +0 -1
- package/types/helpers/timer.d.ts +0 -2
- package/types/helpers/timer.d.ts.map +0 -1
- package/types/helpers/useShallowSetState.d.ts +0 -5
- package/types/helpers/useShallowSetState.d.ts.map +0 -1
- package/types/helpers/warnOnce.d.ts +0 -2
- package/types/helpers/warnOnce.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts +0 -2
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/hooks/getThemeUnwrapped.d.ts +0 -3
- package/types/hooks/getThemeUnwrapped.d.ts.map +0 -1
- package/types/hooks/useId.d.ts +0 -2
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts +0 -2
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/useMedia.d.ts +0 -33
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/useSafeRef.d.ts +0 -4
- package/types/hooks/useSafeRef.d.ts.map +0 -1
- package/types/hooks/useServerHooks.d.ts +0 -4
- package/types/hooks/useServerHooks.d.ts.map +0 -1
- package/types/hooks/useStyle.d.ts +0 -8
- package/types/hooks/useStyle.d.ts.map +0 -1
- package/types/hooks/useTheme.d.ts +0 -25
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useThemeName.d.ts +0 -5
- package/types/hooks/useThemeName.d.ts.map +0 -1
- package/types/insertFont.d.ts +0 -9
- package/types/insertFont.d.ts.map +0 -1
- package/types/setupReactNative.d.ts +0 -5
- package/types/setupReactNative.d.ts.map +0 -1
- package/types/static.d.ts +0 -3
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts +0 -20
- package/types/styled.d.ts.map +0 -1
- package/types/types-rnw.d.ts +0 -74
- package/types/types-rnw.d.ts.map +0 -1
- package/types/types.d.ts +0 -673
- package/types/types.d.ts.map +0 -1
- package/types/updateTheme.d.ts +0 -30
- package/types/updateTheme.d.ts.map +0 -1
- package/types/views/FontLanguage.d.ts +0 -4
- package/types/views/FontLanguage.d.ts.map +0 -1
- package/types/views/FontLanguage.native.d.ts +0 -4
- package/types/views/FontLanguage.native.d.ts.map +0 -1
- package/types/views/FontLanguage.types.d.ts +0 -11
- package/types/views/FontLanguage.types.d.ts.map +0 -1
- package/types/views/Slot.d.ts +0 -11
- package/types/views/Slot.d.ts.map +0 -1
- package/types/views/Stack.d.ts +0 -4
- package/types/views/Stack.d.ts.map +0 -1
- package/types/views/Stack.web.test.d.ts +0 -2
- package/types/views/Stack.web.test.d.ts.map +0 -1
- package/types/views/TamaguiProvider.d.ts +0 -4
- package/types/views/TamaguiProvider.d.ts.map +0 -1
- package/types/views/Text.d.ts +0 -4
- package/types/views/Text.d.ts.map +0 -1
- package/types/views/Theme.d.ts +0 -8
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts +0 -12
- package/types/views/ThemeProvider.d.ts.map +0 -1
package/types/types.d.ts
DELETED
|
@@ -1,673 +0,0 @@
|
|
|
1
|
-
import type { Properties } from 'csstype';
|
|
2
|
-
import type { ComponentType, ForwardRefExoticComponent, FunctionComponent, HTMLAttributes, ReactNode, RefAttributes, RefObject } from 'react';
|
|
3
|
-
import type { Image, PressableProps, TextProps as ReactTextProps, Text, TextInput, TextStyle, View, ViewProps, ViewStyle } from 'react-native';
|
|
4
|
-
import type { Variable } from './createVariable';
|
|
5
|
-
import type { ResolveVariableTypes } from './helpers/createPropMapper';
|
|
6
|
-
import type { TamaguiReactElement } from './static';
|
|
7
|
-
import type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
8
|
-
import type { FontLanguageProps } from './views/FontLanguage.types';
|
|
9
|
-
import type { ThemeProviderProps } from './views/ThemeProvider';
|
|
10
|
-
export type SpaceDirection = 'vertical' | 'horizontal' | 'both';
|
|
11
|
-
export type TamaguiElement = HTMLElement | View;
|
|
12
|
-
export type DebugProp = boolean | 'break' | 'verbose';
|
|
13
|
-
type DivAttributes = HTMLAttributes<HTMLDivElement>;
|
|
14
|
-
export type TamaguiComponentPropsBase = {
|
|
15
|
-
hitSlop?: PressableProps['hitSlop'];
|
|
16
|
-
asChild?: boolean;
|
|
17
|
-
space?: SpaceTokens | null;
|
|
18
|
-
spaceDirection?: SpaceDirection;
|
|
19
|
-
separator?: ReactNode;
|
|
20
|
-
dangerouslySetInnerHTML?: {
|
|
21
|
-
__html: string;
|
|
22
|
-
};
|
|
23
|
-
animation?: AnimationProp | null;
|
|
24
|
-
animateOnly?: string[];
|
|
25
|
-
children?: any | any[];
|
|
26
|
-
debug?: DebugProp;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
className?: string;
|
|
29
|
-
themeShallow?: boolean;
|
|
30
|
-
id?: string;
|
|
31
|
-
tag?: string;
|
|
32
|
-
theme?: ThemeName | null;
|
|
33
|
-
componentName?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Forces the pseudo style state to be on
|
|
36
|
-
*/
|
|
37
|
-
forceStyle?: 'hover' | 'press' | 'focus';
|
|
38
|
-
onHoverIn?: DivAttributes['onMouseEnter'];
|
|
39
|
-
onHoverOut?: DivAttributes['onMouseLeave'];
|
|
40
|
-
onPress?: PressableProps['onPress'];
|
|
41
|
-
onPressIn?: PressableProps['onPress'];
|
|
42
|
-
onPressOut?: PressableProps['onPress'];
|
|
43
|
-
onMouseEnter?: DivAttributes['onMouseEnter'];
|
|
44
|
-
onMouseLeave?: DivAttributes['onMouseLeave'];
|
|
45
|
-
onMouseDown?: DivAttributes['onMouseDown'];
|
|
46
|
-
};
|
|
47
|
-
export type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<Props & RefAttributes<Ref>>;
|
|
48
|
-
export type ConfigListener = (conf: TamaguiInternalConfig) => void;
|
|
49
|
-
export type VariableVal = number | string | Variable;
|
|
50
|
-
export type VariableColorVal = string | Variable;
|
|
51
|
-
type GenericKey = string | number | symbol;
|
|
52
|
-
export interface CreateTokens<Val extends VariableVal = VariableVal> {
|
|
53
|
-
color: {
|
|
54
|
-
[key: GenericKey]: Val;
|
|
55
|
-
};
|
|
56
|
-
space: {
|
|
57
|
-
[key: GenericKey]: Val;
|
|
58
|
-
};
|
|
59
|
-
size: {
|
|
60
|
-
[key: GenericKey]: Val;
|
|
61
|
-
};
|
|
62
|
-
radius: {
|
|
63
|
-
[key: GenericKey]: Val;
|
|
64
|
-
};
|
|
65
|
-
zIndex: {
|
|
66
|
-
[key: GenericKey]: Val;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
type Tokenify<A extends GenericTokens> = {
|
|
70
|
-
color: TokenifyRecord<A['color']>;
|
|
71
|
-
space: TokenifyRecord<A['space']>;
|
|
72
|
-
size: TokenifyRecord<A['size']>;
|
|
73
|
-
radius: TokenifyRecord<A['radius']>;
|
|
74
|
-
zIndex: TokenifyRecord<A['zIndex']>;
|
|
75
|
-
};
|
|
76
|
-
type TokenifyRecord<A extends CreateTokens[keyof CreateTokens]> = {
|
|
77
|
-
[Key in keyof A]: A[Key] extends Variable ? A[Key] : Variable<A[Key]>;
|
|
78
|
-
};
|
|
79
|
-
export type TamaguiBaseTheme = {
|
|
80
|
-
background: VariableColorVal;
|
|
81
|
-
backgroundHover: VariableColorVal;
|
|
82
|
-
backgroundPress: VariableColorVal;
|
|
83
|
-
backgroundFocus: VariableColorVal;
|
|
84
|
-
color: VariableColorVal;
|
|
85
|
-
colorHover: VariableColorVal;
|
|
86
|
-
colorPress: VariableColorVal;
|
|
87
|
-
colorFocus: VariableColorVal;
|
|
88
|
-
borderColor: VariableColorVal;
|
|
89
|
-
borderColorHover: VariableColorVal;
|
|
90
|
-
borderColorPress: VariableColorVal;
|
|
91
|
-
borderColorFocus: VariableColorVal;
|
|
92
|
-
shadowColor: VariableColorVal;
|
|
93
|
-
shadowColorHover: VariableColorVal;
|
|
94
|
-
shadowColorPress: VariableColorVal;
|
|
95
|
-
shadowColorFocus: VariableColorVal;
|
|
96
|
-
};
|
|
97
|
-
type GenericTokens = CreateTokens;
|
|
98
|
-
type GenericThemes = {
|
|
99
|
-
[key: string]: (Partial<TamaguiBaseTheme> & {
|
|
100
|
-
[key: string]: VariableVal;
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
type AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase;
|
|
104
|
-
export type CreateShorthands = {
|
|
105
|
-
[key: string]: AllStyleKeys;
|
|
106
|
-
};
|
|
107
|
-
export type GenericShorthands = {};
|
|
108
|
-
type GenericMedia = {
|
|
109
|
-
[key: string]: {
|
|
110
|
-
[key: string]: number | string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
export type GenericFonts = Record<string, GenericFont>;
|
|
114
|
-
type GenericAnimations = {
|
|
115
|
-
[key: string]: string | {
|
|
116
|
-
[key: string]: any;
|
|
117
|
-
} | any[];
|
|
118
|
-
};
|
|
119
|
-
export interface TamaguiCustomConfig {
|
|
120
|
-
}
|
|
121
|
-
export interface TamaguiConfig extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>, TamaguiCustomConfig {
|
|
122
|
-
}
|
|
123
|
-
export type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = {
|
|
124
|
-
fonts: RemoveLanguagePostfixes<F>;
|
|
125
|
-
fontLanguages: GetLanguagePostfixes<F> extends never ? string[] : GetLanguagePostfixes<F>[];
|
|
126
|
-
tokens: A;
|
|
127
|
-
themes: {
|
|
128
|
-
[Name in keyof B]: {
|
|
129
|
-
[Key in keyof B[Name]]: Variable;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
shorthands: C;
|
|
133
|
-
media: D;
|
|
134
|
-
animations: AnimationDriver<E>;
|
|
135
|
-
};
|
|
136
|
-
type GetLanguagePostfix<Set> = Set extends string ? Set extends `${string}_${infer Postfix}` ? Postfix : never : never;
|
|
137
|
-
type OmitLanguagePostfix<Set> = Set extends string ? Set extends `${infer Prefix}_${string}` ? Prefix : Set : never;
|
|
138
|
-
type RemoveLanguagePostfixes<F extends GenericFonts> = {
|
|
139
|
-
[Key in OmitLanguagePostfix<keyof F>]: F[Key];
|
|
140
|
-
};
|
|
141
|
-
type GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>;
|
|
142
|
-
type ConfProps<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = {
|
|
143
|
-
tokens: A;
|
|
144
|
-
themes: B;
|
|
145
|
-
shorthands?: C;
|
|
146
|
-
media?: D;
|
|
147
|
-
animations?: AnimationDriver<E>;
|
|
148
|
-
fonts: F;
|
|
149
|
-
};
|
|
150
|
-
export type InferTamaguiConfig<Conf> = Conf extends ConfProps<infer A, infer B, infer C, infer D, infer E, infer F> ? TamaguiInternalConfig<A, B, C, D, E, F> : unknown;
|
|
151
|
-
export type GenericTamaguiConfig = CreateTamaguiConfig<GenericTokens, GenericThemes, GenericShorthands, GenericMedia, GenericAnimations, GenericFonts>;
|
|
152
|
-
export type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']];
|
|
153
|
-
export type ThemeKeys = keyof ThemeDefinition;
|
|
154
|
-
export type ThemeParsed = {
|
|
155
|
-
[key in ThemeKeys]: Variable<any>;
|
|
156
|
-
};
|
|
157
|
-
export type Tokens = TamaguiConfig['tokens'];
|
|
158
|
-
export type Shorthands = TamaguiConfig['shorthands'];
|
|
159
|
-
export type Media = TamaguiConfig['media'];
|
|
160
|
-
export type Themes = TamaguiConfig['themes'];
|
|
161
|
-
export type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>;
|
|
162
|
-
export type ThemeTokens = `$${ThemeKeys}`;
|
|
163
|
-
export type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<infer Config> ? keyof Config : string;
|
|
164
|
-
export type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>;
|
|
165
|
-
export interface ThemeProps {
|
|
166
|
-
className?: string;
|
|
167
|
-
name?: Exclude<ThemeName, number> | null;
|
|
168
|
-
componentName?: string;
|
|
169
|
-
children?: any;
|
|
170
|
-
reset?: boolean;
|
|
171
|
-
debug?: boolean | 'verbose';
|
|
172
|
-
inverse?: boolean;
|
|
173
|
-
forceClassName?: boolean;
|
|
174
|
-
shouldUpdate?: () => boolean;
|
|
175
|
-
}
|
|
176
|
-
type ArrayIntersection<A extends any[]> = A[keyof A];
|
|
177
|
-
type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
|
|
178
|
-
type SpacerPropsBase = {
|
|
179
|
-
size?: number | SpaceTokens | null;
|
|
180
|
-
flex?: boolean | number;
|
|
181
|
-
direction?: SpaceDirection;
|
|
182
|
-
};
|
|
183
|
-
type SpacerOwnProps = SpacerPropsBase & WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>;
|
|
184
|
-
export type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> & SpacerOwnProps;
|
|
185
|
-
export type CreateTamaguiProps = {
|
|
186
|
-
reactNative?: any;
|
|
187
|
-
shorthands?: CreateShorthands;
|
|
188
|
-
media?: GenericTamaguiConfig['media'];
|
|
189
|
-
animations?: AnimationDriver<any>;
|
|
190
|
-
fonts: GenericTamaguiConfig['fonts'];
|
|
191
|
-
tokens: GenericTamaguiConfig['tokens'];
|
|
192
|
-
themes: {
|
|
193
|
-
[key: string]: {
|
|
194
|
-
[key: string]: string | number | Variable;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* *Advanced use case* For all CSS extracted views, this has no effect.
|
|
199
|
-
*
|
|
200
|
-
* For SSR compatibility on the web, Tamagui will render once with the settings
|
|
201
|
-
* from `mediaQueryDefaultActive` set for all media queries. Then, it will render
|
|
202
|
-
* again after the initial render using the proper media query values. This is so that
|
|
203
|
-
* hydration will match perfectly with the server.
|
|
204
|
-
*
|
|
205
|
-
* Setting disableSSR will avoid this second render by setting the media query state
|
|
206
|
-
* to the actual browser dimensions on initial load. This is only useful for client-only
|
|
207
|
-
* apps.
|
|
208
|
-
*
|
|
209
|
-
*/
|
|
210
|
-
disableSSR?: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.
|
|
213
|
-
* For custom use cases like integration with next-theme.
|
|
214
|
-
*/
|
|
215
|
-
disableRootThemeClass?: boolean;
|
|
216
|
-
defaultProps?: Record<string, any> & {
|
|
217
|
-
Stack?: StackProps;
|
|
218
|
-
Text?: TextProps;
|
|
219
|
-
Spacer?: SpacerProps;
|
|
220
|
-
};
|
|
221
|
-
mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>;
|
|
222
|
-
cssStyleSeparator?: string;
|
|
223
|
-
maxDarkLightNesting?: number;
|
|
224
|
-
shouldAddPrefersColorThemes?: boolean;
|
|
225
|
-
themeClassNameOnRoot?: boolean;
|
|
226
|
-
};
|
|
227
|
-
export type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B extends GenericThemes = GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> & Omit<CreateTamaguiConfig<A, B, C, D, E, F>, 'tokens'> & {
|
|
228
|
-
tokens: Tokenify<A>;
|
|
229
|
-
tokensParsed: Tokenify<A>;
|
|
230
|
-
themeConfig: any;
|
|
231
|
-
fontsParsed: GenericFonts;
|
|
232
|
-
getCSS: () => string;
|
|
233
|
-
parsed: boolean;
|
|
234
|
-
inverseShorthands: Record<string, string>;
|
|
235
|
-
reactNative?: any;
|
|
236
|
-
};
|
|
237
|
-
export type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations'];
|
|
238
|
-
export type UnionableString = string & {};
|
|
239
|
-
export type UnionableNumber = number & {};
|
|
240
|
-
export type PropTypes<A extends TamaguiComponent> = A extends FunctionComponent<infer Props> ? Props : unknown;
|
|
241
|
-
export type GenericFont<Key extends number | string = number | string> = {
|
|
242
|
-
size: {
|
|
243
|
-
[key in Key]: number | Variable;
|
|
244
|
-
};
|
|
245
|
-
lineHeight: Partial<{
|
|
246
|
-
[key in Key]: number | Variable;
|
|
247
|
-
}>;
|
|
248
|
-
letterSpacing: Partial<{
|
|
249
|
-
[key in Key]: number | Variable;
|
|
250
|
-
}>;
|
|
251
|
-
weight: Partial<{
|
|
252
|
-
[key in Key]: number | string | Variable;
|
|
253
|
-
}>;
|
|
254
|
-
family: string | Variable;
|
|
255
|
-
style?: Partial<{
|
|
256
|
-
[key in Key]: TextStyle['fontStyle'] | Variable;
|
|
257
|
-
}>;
|
|
258
|
-
transform?: Partial<{
|
|
259
|
-
[key in Key]: TextStyle['textTransform'] | Variable;
|
|
260
|
-
}>;
|
|
261
|
-
color?: Partial<{
|
|
262
|
-
[key in Key]: string | Variable;
|
|
263
|
-
}>;
|
|
264
|
-
face?: Partial<{
|
|
265
|
-
[key in FontWeightSteps]: {
|
|
266
|
-
normal?: string;
|
|
267
|
-
italic?: string;
|
|
268
|
-
};
|
|
269
|
-
}>;
|
|
270
|
-
};
|
|
271
|
-
export type MediaQueryObject = {
|
|
272
|
-
[key: string]: string | number | string;
|
|
273
|
-
};
|
|
274
|
-
export type MediaQueryKey = keyof Media;
|
|
275
|
-
export type MediaPropKeys = `$${MediaQueryKey}`;
|
|
276
|
-
export type MediaQueryState = {
|
|
277
|
-
[key in MediaQueryKey]: boolean;
|
|
278
|
-
};
|
|
279
|
-
export type MediaProps<A> = {
|
|
280
|
-
[key in MediaPropKeys]?: A;
|
|
281
|
-
};
|
|
282
|
-
export type MediaQueries = {
|
|
283
|
-
[key in MediaQueryKey]: MediaQueryObject;
|
|
284
|
-
};
|
|
285
|
-
export interface MediaQueryList {
|
|
286
|
-
addListener(listener?: any): void;
|
|
287
|
-
removeListener(listener?: any): void;
|
|
288
|
-
matches: boolean;
|
|
289
|
-
}
|
|
290
|
-
export type MatchMedia = (query: string) => MediaQueryList;
|
|
291
|
-
export type TransformStyleProps = {
|
|
292
|
-
x?: number;
|
|
293
|
-
y?: number;
|
|
294
|
-
perspective?: number;
|
|
295
|
-
scale?: number;
|
|
296
|
-
scaleX?: number;
|
|
297
|
-
scaleY?: number;
|
|
298
|
-
skewX?: string;
|
|
299
|
-
skewY?: string;
|
|
300
|
-
matrix?: number[];
|
|
301
|
-
rotate?: string;
|
|
302
|
-
rotateY?: string;
|
|
303
|
-
rotateX?: string;
|
|
304
|
-
rotateZ?: string;
|
|
305
|
-
};
|
|
306
|
-
export type AnimationConfigType = any;
|
|
307
|
-
export type AnimationProp = AnimationKeys | {
|
|
308
|
-
[key: string]: AnimationKeys | {
|
|
309
|
-
type: AnimationKeys;
|
|
310
|
-
[key: string]: any;
|
|
311
|
-
};
|
|
312
|
-
} | [
|
|
313
|
-
AnimationKeys,
|
|
314
|
-
{
|
|
315
|
-
[key: string]: AnimationKeys | {
|
|
316
|
-
type?: AnimationKeys;
|
|
317
|
-
[key: string]: any;
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
];
|
|
321
|
-
type GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight' | 'transform' | 'style' | 'color'> = keyof TamaguiConfig['fonts']['body'][A];
|
|
322
|
-
type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`;
|
|
323
|
-
export type SizeTokens = GetTokenString<keyof Tokens['size']> | number;
|
|
324
|
-
export type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean;
|
|
325
|
-
export type ColorTokens = GetTokenString<keyof Tokens['color']> | GetTokenString<keyof ThemeParsed> | CSSColorNames;
|
|
326
|
-
export type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number;
|
|
327
|
-
export type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number;
|
|
328
|
-
export type FontTokens = GetTokenString<keyof TamaguiConfig['fonts']>;
|
|
329
|
-
export type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number;
|
|
330
|
-
export type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number;
|
|
331
|
-
export type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`;
|
|
332
|
-
export type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps;
|
|
333
|
-
export type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number;
|
|
334
|
-
export type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number;
|
|
335
|
-
export type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | TextStyle['fontStyle'];
|
|
336
|
-
export type FontTransformTokens = `$${GetTokenFontKeysFor<'transform'>}` | TextStyle['textTransform'];
|
|
337
|
-
export type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme' ? ThemeTokens : K extends 'size' ? SizeTokens : K extends 'font' ? FontTokens : K extends 'fontSize' ? FontSizeTokens : K extends 'space' ? SpaceTokens : K extends 'color' ? ColorTokens : K extends 'zIndex' ? ZIndexTokens : K extends 'lineHeight' ? FontLineHeightTokens : K extends 'fontWeight' ? FontWeightTokens : K extends 'letterSpacing' ? FontLetterSpacingTokens : {};
|
|
338
|
-
type FontKeys = 'fontFamily';
|
|
339
|
-
type FontSizeKeys = 'fontSize';
|
|
340
|
-
type FontWeightKeys = 'fontWeight';
|
|
341
|
-
type FontLetterSpacingKeys = 'letterSpacing';
|
|
342
|
-
type LineHeightKeys = 'lineHeight';
|
|
343
|
-
type ZIndexKeys = 'zIndex';
|
|
344
|
-
export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme' ? ThemeTokens : K extends SizeKeys ? SizeTokens : K extends FontKeys ? FontTokens : K extends FontSizeKeys ? FontSizeTokens : K extends `${`border${string | ''}Radius`}` ? RadiusTokens : K extends SpaceKeys ? K extends 'shadowOffset' ? {
|
|
345
|
-
width: SpaceTokens;
|
|
346
|
-
height: SpaceTokens;
|
|
347
|
-
} : SpaceTokens : K extends ColorKeys ? ColorTokens : K extends ZIndexKeys ? ZIndexTokens : K extends LineHeightKeys ? FontLineHeightTokens : K extends FontWeightKeys ? FontWeightTokens : K extends FontLetterSpacingKeys ? FontLetterSpacingTokens : never;
|
|
348
|
-
export type ThemeValueFallback = UnionableString | Variable;
|
|
349
|
-
export type WithThemeValues<T extends object> = {
|
|
350
|
-
[K in keyof T]: ThemeValueGet<K> extends never ? T[K] : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback;
|
|
351
|
-
};
|
|
352
|
-
export type WithShorthands<StyleProps> = {
|
|
353
|
-
[Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps ? StyleProps[Shorthands[Key]] | null : undefined;
|
|
354
|
-
};
|
|
355
|
-
export type PseudoProps<A> = {
|
|
356
|
-
hoverStyle?: A | null;
|
|
357
|
-
pressStyle?: A | null;
|
|
358
|
-
focusStyle?: A | null;
|
|
359
|
-
exitStyle?: A | null;
|
|
360
|
-
enterStyle?: A | null;
|
|
361
|
-
};
|
|
362
|
-
export type PseudoPropKeys = keyof PseudoProps<any>;
|
|
363
|
-
export type PseudoStyles = {
|
|
364
|
-
hoverStyle?: ViewStyle;
|
|
365
|
-
pressStyle?: ViewStyle;
|
|
366
|
-
focusStyle?: ViewStyle;
|
|
367
|
-
enterStyle?: ViewStyle;
|
|
368
|
-
exitStyle?: ViewStyle;
|
|
369
|
-
};
|
|
370
|
-
type WithThemeAndShorthands<A extends object> = WithThemeValues<A> & WithShorthands<WithThemeValues<A>>;
|
|
371
|
-
type WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>;
|
|
372
|
-
type WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>;
|
|
373
|
-
/**
|
|
374
|
-
* Base style-only props (no media, pseudo):
|
|
375
|
-
*/
|
|
376
|
-
type PropsWebOnly = {
|
|
377
|
-
pointerEvents?: ViewProps['pointerEvents'];
|
|
378
|
-
cursor?: Properties['cursor'];
|
|
379
|
-
contain?: Properties['contain'];
|
|
380
|
-
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex';
|
|
381
|
-
userSelect?: Properties['userSelect'];
|
|
382
|
-
outlineColor?: Properties['outlineColor'];
|
|
383
|
-
outlineStyle?: Properties['outlineStyle'];
|
|
384
|
-
outlineOffset?: Properties['outlineOffset'];
|
|
385
|
-
outlineWidth?: Properties['outlineWidth'];
|
|
386
|
-
tabIndex?: string | number;
|
|
387
|
-
role?: string;
|
|
388
|
-
};
|
|
389
|
-
export type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> & TransformStyleProps & PropsWebOnly;
|
|
390
|
-
export type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & PropsWebOnly & {
|
|
391
|
-
ellipse?: boolean;
|
|
392
|
-
textDecorationDistance?: number;
|
|
393
|
-
textOverflow?: Properties['textOverflow'];
|
|
394
|
-
whiteSpace?: Properties['whiteSpace'];
|
|
395
|
-
wordWrap?: Properties['wordWrap'];
|
|
396
|
-
};
|
|
397
|
-
export type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> & RNWViewProps & TamaguiComponentPropsBase;
|
|
398
|
-
export type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
|
|
399
|
-
export type StackPropsBase = StackNonStyleProps & WithThemeAndShorthands<StackStylePropsBase>;
|
|
400
|
-
export type StackProps = StackNonStyleProps & StackStyleProps;
|
|
401
|
-
export type TextNonStyleProps = Omit<ReactTextProps, 'children'> & RNWTextProps & TamaguiComponentPropsBase;
|
|
402
|
-
export type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>;
|
|
403
|
-
export type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>;
|
|
404
|
-
export type TextProps = TextNonStyleProps & TextStyleProps;
|
|
405
|
-
export type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase>;
|
|
406
|
-
export type TamaguiComponent<Props = any, Ref = any, BaseProps = {}, VariantProps = {}> = ReactComponentWithRef<Props, Ref> & StaticComponentObject;
|
|
407
|
-
type StaticComponentObject = {
|
|
408
|
-
staticConfig: StaticConfigParsed;
|
|
409
|
-
extractable: <X>(a: X, opts?: Partial<StaticConfig>) => X;
|
|
410
|
-
};
|
|
411
|
-
export type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {
|
|
412
|
-
config: TamaguiInternalConfig;
|
|
413
|
-
disableInjectCSS?: boolean;
|
|
414
|
-
children?: ReactNode;
|
|
415
|
-
};
|
|
416
|
-
export type PropMapper = (key: string, value: any, theme: ThemeParsed, props: Record<string, any>, state: Partial<SplitStyleState>, languageContext?: FontLanguageProps, avoidDefaultProps?: boolean, debug?: DebugProp) => undefined | [string, any][];
|
|
417
|
-
export type StaticConfigParsed = StaticConfig & {
|
|
418
|
-
parsed: true;
|
|
419
|
-
propMapper: PropMapper;
|
|
420
|
-
variantsParsed?: {
|
|
421
|
-
[key: string]: {
|
|
422
|
-
[key: string]: any;
|
|
423
|
-
};
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
export type GenericVariantDefinitions = {
|
|
427
|
-
[key: string]: {
|
|
428
|
-
[key: string]: ((a: any, b: any) => any) | {
|
|
429
|
-
[key: string]: any;
|
|
430
|
-
};
|
|
431
|
-
};
|
|
432
|
-
};
|
|
433
|
-
export type StaticConfigPublic = {
|
|
434
|
-
/**
|
|
435
|
-
* (compiler) If you need to pass context or something, prevents from ever
|
|
436
|
-
* flattening. The 'jsx' option means it will never flatten. if you
|
|
437
|
-
* pass JSX as a children (if its purely string, it will still flatten).
|
|
438
|
-
*/
|
|
439
|
-
neverFlatten?: boolean | 'jsx';
|
|
440
|
-
/**
|
|
441
|
-
* Determines ultimate output tag (Text vs View)
|
|
442
|
-
*/
|
|
443
|
-
isText?: boolean;
|
|
444
|
-
/**
|
|
445
|
-
* Which style keys are allowed to be extracted.
|
|
446
|
-
*/
|
|
447
|
-
validStyles?: {
|
|
448
|
-
[key: string]: boolean;
|
|
449
|
-
};
|
|
450
|
-
/**
|
|
451
|
-
* (compiler) If these props are encountered, bail on all optimization.
|
|
452
|
-
*/
|
|
453
|
-
deoptProps?: Set<string>;
|
|
454
|
-
/**
|
|
455
|
-
* (compiler) If these props are encountered, leave them un-extracted.
|
|
456
|
-
*/
|
|
457
|
-
inlineProps?: Set<string>;
|
|
458
|
-
/**
|
|
459
|
-
* (compiler) If not flattening, leave this prop as original value.
|
|
460
|
-
* Only applies to style attributes
|
|
461
|
-
*/
|
|
462
|
-
inlineWhenUnflattened?: Set<string>;
|
|
463
|
-
/**
|
|
464
|
-
* (compiler) A bit odd, only for more advanced heirarchies.
|
|
465
|
-
* Indicates that the component will set this prop so the
|
|
466
|
-
* static extraction can ensure it sets them to ={undefined}
|
|
467
|
-
* so they get overriddent. In the future, this can be smarter.
|
|
468
|
-
*/
|
|
469
|
-
ensureOverriddenProp?: {
|
|
470
|
-
[key: string]: boolean;
|
|
471
|
-
};
|
|
472
|
-
/**
|
|
473
|
-
* Auto-detected, but can ovverride. Wraps children to space them on top
|
|
474
|
-
*/
|
|
475
|
-
isZStack?: boolean;
|
|
476
|
-
/**
|
|
477
|
-
* Auto-detect, but can override, passes styles properly to react-native-web
|
|
478
|
-
*/
|
|
479
|
-
isReactNative?: boolean;
|
|
480
|
-
/**
|
|
481
|
-
* By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
|
|
482
|
-
* it will assume the passed in component only accepts style={} for react-native compatibility.
|
|
483
|
-
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
484
|
-
*/
|
|
485
|
-
acceptsClassName?: boolean;
|
|
486
|
-
};
|
|
487
|
-
export type StaticConfig = StaticConfigPublic & {
|
|
488
|
-
Component?: FunctionComponent<any> & StaticComponentObject;
|
|
489
|
-
variants?: GenericVariantDefinitions;
|
|
490
|
-
/**
|
|
491
|
-
* Used for applying sub theme style
|
|
492
|
-
*/
|
|
493
|
-
componentName?: string;
|
|
494
|
-
/**
|
|
495
|
-
* Same as React.defaultProps, be sure to sync
|
|
496
|
-
*/
|
|
497
|
-
defaultProps: Record<string, any>;
|
|
498
|
-
/**
|
|
499
|
-
* Merges into defaultProps later on, used internally yonly
|
|
500
|
-
*/
|
|
501
|
-
defaultVariants?: {
|
|
502
|
-
[key: string]: any;
|
|
503
|
-
};
|
|
504
|
-
/**
|
|
505
|
-
* Memoize the component
|
|
506
|
-
*/
|
|
507
|
-
memo?: boolean;
|
|
508
|
-
/**
|
|
509
|
-
* Used insternally to attach default props to names
|
|
510
|
-
*/
|
|
511
|
-
parentNames?: string[];
|
|
512
|
-
/**
|
|
513
|
-
* By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
|
|
514
|
-
* it will assume the passed in component only accepts style={} for react-native compatibility.
|
|
515
|
-
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
516
|
-
*/
|
|
517
|
-
acceptsClassName?: boolean;
|
|
518
|
-
/**
|
|
519
|
-
* Used internally for handling focus
|
|
520
|
-
*/
|
|
521
|
-
isInput?: boolean;
|
|
522
|
-
};
|
|
523
|
-
/**
|
|
524
|
-
* --------------------------------------------
|
|
525
|
-
* variants
|
|
526
|
-
* --------------------------------------------
|
|
527
|
-
*/
|
|
528
|
-
export type StylableComponent = TamaguiComponent | ComponentType<any> | ForwardRefExoticComponent<any> | ReactComponentWithRef<any, any> | (new (props: any) => any) | typeof View | typeof Text | typeof TextInput | typeof Image;
|
|
529
|
-
export type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<any, any, any, infer Variants> ? Variants : never;
|
|
530
|
-
export type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<any, any, infer BaseProps> ? BaseProps : never;
|
|
531
|
-
export type GetProps<A extends StylableComponent> = A extends TamaguiComponent<infer Props> ? Props : A extends TamaguiReactElement<infer Props> ? Props : A extends ComponentType<infer Props> ? GetGenericComponentTamaguiProps<Props> : A extends new (props: infer Props) => any ? GetGenericComponentTamaguiProps<Props> : {};
|
|
532
|
-
type GetGenericComponentTamaguiProps<P> = P & Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>;
|
|
533
|
-
export type SpreadKeys = '...fontSize' | '...fontStyle' | '...fontTransform' | '...lineHeight' | '...letterSpacing' | '...size' | '...space' | '...color' | '...zIndex' | '...theme' | '...radius';
|
|
534
|
-
export type VariantDefinitions<Parent extends StylableComponent = TamaguiComponent, MyProps extends Object = GetProps<Parent>, Val = any> = VariantDefinitionFromProps<MyProps, Val>;
|
|
535
|
-
export type VariantDefinitionFromProps<MyProps, Val> = MyProps extends Object ? {
|
|
536
|
-
[propName: string]: VariantSpreadFunction<MyProps, Val> | ({
|
|
537
|
-
[Key in SpreadKeys]?: Key extends '...fontSize' ? FontSizeVariantSpreadFunction<MyProps> : Key extends '...size' ? SizeVariantSpreadFunction<MyProps> : Key extends '...space' ? SpaceVariantSpreadFunction<MyProps> : Key extends '...color' ? ColorVariantSpreadFunction<MyProps> : Key extends '...lineHeight' ? FontLineHeightVariantSpreadFunction<MyProps> : Key extends '...fontTransform' ? FontTransformVariantSpreadFunction<MyProps> : Key extends '...fontStyle' ? FontStyleVariantSpreadFunction<MyProps> : Key extends '...letterSpacing' ? FontLetterSpacingVariantSpreadFunction<MyProps> : Key extends '...zIndex' ? ZIndexVariantSpreadFunction<MyProps> : Key extends '...radius' ? RadiusVariantSpreadFunction<MyProps> : Key extends '...theme' ? ThemeVariantSpreadFunction<MyProps> : never;
|
|
538
|
-
} & {
|
|
539
|
-
[Key in string | number | 'true' | 'false']?: MyProps | VariantSpreadFunction<MyProps, Val>;
|
|
540
|
-
} & {
|
|
541
|
-
[Key in VariantTypeKeys]?: Key extends ':number' ? VariantSpreadFunction<MyProps, number> : Key extends ':boolean' ? VariantSpreadFunction<MyProps, boolean> : Key extends ':string' ? VariantSpreadFunction<MyProps, string> : never;
|
|
542
|
-
});
|
|
543
|
-
} : never;
|
|
544
|
-
export type GenericStackVariants = VariantDefinitionFromProps<StackProps, any>;
|
|
545
|
-
export type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>;
|
|
546
|
-
export type GetVariantProps<Variants> = {
|
|
547
|
-
[Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>;
|
|
548
|
-
};
|
|
549
|
-
export type VariantSpreadExtras<Props> = {
|
|
550
|
-
fonts: TamaguiConfig['fonts'];
|
|
551
|
-
tokens: TamaguiConfig['tokens'];
|
|
552
|
-
theme: Themes extends {
|
|
553
|
-
[key: string]: infer B;
|
|
554
|
-
} ? B : unknown;
|
|
555
|
-
props: Props;
|
|
556
|
-
};
|
|
557
|
-
type PropLike = {
|
|
558
|
-
[key: string]: any;
|
|
559
|
-
};
|
|
560
|
-
export type VariantSpreadFunction<Props extends PropLike, Val = any> = (val: Val, config: VariantSpreadExtras<Props>) => {
|
|
561
|
-
[Key in keyof Props]: Props[Key] | Variable;
|
|
562
|
-
} | null | undefined;
|
|
563
|
-
export type VariantTypeKeys = ':string' | ':boolean' | ':number';
|
|
564
|
-
export type GetVariantValues<Key> = Key extends `...${infer VariantSpread}` ? ThemeValueByCategory<VariantSpread> : Key extends 'true' | 'false' ? boolean : Key extends ':string' ? string : Key extends ':boolean' ? boolean : Key extends ':number' ? number : Key;
|
|
565
|
-
export type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontSizeTokens>;
|
|
566
|
-
export type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SizeTokens>;
|
|
567
|
-
export type SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SpaceTokens>;
|
|
568
|
-
export type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>;
|
|
569
|
-
export type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontLineHeightTokens>;
|
|
570
|
-
export type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontLetterSpacingTokens>;
|
|
571
|
-
export type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontStyleTokens>;
|
|
572
|
-
export type FontTransformVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, FontTransformTokens>;
|
|
573
|
-
export type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>;
|
|
574
|
-
export type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>;
|
|
575
|
-
export type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>;
|
|
576
|
-
/**
|
|
577
|
-
* --------------------------------------------
|
|
578
|
-
* end variants
|
|
579
|
-
* --------------------------------------------
|
|
580
|
-
*/
|
|
581
|
-
type SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'shadowRadius';
|
|
582
|
-
type ColorKeys = 'color' | 'backgroundColor' | 'borderColor' | 'borderBottomColor' | 'borderTopColor' | 'borderLeftColor' | 'borderRightColor' | 'shadowColor' | 'textShadowColor';
|
|
583
|
-
type SpaceKeys = 'space' | 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingLeft' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingEnd' | 'paddingStart' | 'margin' | 'marginHorizontal' | 'marginVertical' | 'marginLeft' | 'marginTop' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginEnd' | 'marginStart' | 'x' | 'y' | 'scale' | 'scaleX' | 'scaleY' | 'borderTopEndRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStartRadius' | 'borderBottomEndRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStartRadius' | 'borderBottomWidth' | 'borderLeftWidth' | 'borderRadius' | 'borderRightWidth' | 'borderTopEndRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderEndWidth' | 'borderStartWidth' | 'borderTopStartRadius' | 'borderTopWidth' | 'borderWidth' | 'left' | 'top' | 'right' | 'bottom' | 'shadowOffset';
|
|
584
|
-
type CSSColorNames = 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkkhaki' | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' | 'darkslateblue' | 'darkslategray' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' | 'dimgray' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'honeydew' | 'hotpink' | 'indianred ' | 'indigo ' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgrey' | 'lightgreen' | 'lightpink' | 'lightsalmon' | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightsteelblue' | 'lightyellow' | 'lime' | 'limegreen' | 'linen' | 'magenta' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'orangered' | 'orchid' | 'palegoldenrod' | 'palegreen' | 'paleturquoise' | 'palevioletred' | 'papayawhip' | 'peachpuff' | 'peru' | 'pink' | 'plum' | 'powderblue' | 'purple' | 'red' | 'rosybrown' | 'royalblue' | 'saddlebrown' | 'salmon' | 'sandybrown' | 'seagreen' | 'seashell' | 'sienna' | 'silver' | 'skyblue' | 'slateblue' | 'slategray' | 'snow' | 'springgreen' | 'steelblue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whitesmoke' | 'yellow' | 'yellowgreen';
|
|
585
|
-
export type TamaguiComponentState = {
|
|
586
|
-
hover: boolean;
|
|
587
|
-
press: boolean;
|
|
588
|
-
pressIn: boolean;
|
|
589
|
-
focus: boolean;
|
|
590
|
-
unmounted: boolean;
|
|
591
|
-
animation?: null | {
|
|
592
|
-
style?: any;
|
|
593
|
-
avoidClasses?: boolean;
|
|
594
|
-
};
|
|
595
|
-
};
|
|
596
|
-
export type SplitStyleState = TamaguiComponentState & {
|
|
597
|
-
mediaState?: Record<string, boolean>;
|
|
598
|
-
noClassNames?: boolean;
|
|
599
|
-
dynamicStylesInline?: boolean;
|
|
600
|
-
resolveVariablesAs?: ResolveVariableTypes;
|
|
601
|
-
fallbackProps?: Record<string, any>;
|
|
602
|
-
keepVariantsAsProps?: boolean;
|
|
603
|
-
hasTextAncestor?: boolean;
|
|
604
|
-
isExiting?: boolean;
|
|
605
|
-
exitVariant?: string;
|
|
606
|
-
enterVariant?: string;
|
|
607
|
-
};
|
|
608
|
-
export interface PresenceContextProps {
|
|
609
|
-
id: string;
|
|
610
|
-
isPresent: boolean;
|
|
611
|
-
register: (id: string) => () => void;
|
|
612
|
-
onExitComplete?: (id: string) => void;
|
|
613
|
-
initial?: false | string | string[];
|
|
614
|
-
custom?: any;
|
|
615
|
-
exitVariant?: string | null;
|
|
616
|
-
enterVariant?: string | null;
|
|
617
|
-
}
|
|
618
|
-
type SafeToRemoveCallback = () => void;
|
|
619
|
-
type AlwaysPresent = [true, null, null];
|
|
620
|
-
type Present = [true, undefined, PresenceContextProps];
|
|
621
|
-
type NotPresent = [false, SafeToRemoveCallback, PresenceContextProps];
|
|
622
|
-
export type UsePresenceResult = AlwaysPresent | Present | NotPresent;
|
|
623
|
-
type AnimationConfig = {
|
|
624
|
-
[key: string]: any;
|
|
625
|
-
};
|
|
626
|
-
export type AnimatedNumberStrategy = {
|
|
627
|
-
type: 'spring';
|
|
628
|
-
stiffness?: number;
|
|
629
|
-
damping?: number;
|
|
630
|
-
mass?: number;
|
|
631
|
-
overshootClamping?: boolean;
|
|
632
|
-
restSpeedThreshold?: number;
|
|
633
|
-
restDisplacementThreshold?: number;
|
|
634
|
-
} | {
|
|
635
|
-
type: 'timing';
|
|
636
|
-
duration: number;
|
|
637
|
-
} | {
|
|
638
|
-
type: 'direct';
|
|
639
|
-
};
|
|
640
|
-
export type UniversalAnimatedNumber<A> = {
|
|
641
|
-
getInstance(): A;
|
|
642
|
-
getValue(): number;
|
|
643
|
-
setValue(next: number, config?: AnimatedNumberStrategy): void;
|
|
644
|
-
stop(): void;
|
|
645
|
-
};
|
|
646
|
-
export type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
647
|
-
isReactNative?: boolean;
|
|
648
|
-
useAnimations: UseAnimationHook;
|
|
649
|
-
usePresence: () => UsePresenceResult;
|
|
650
|
-
useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>;
|
|
651
|
-
useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(val: V, getStyle: (current: any) => any) => any;
|
|
652
|
-
useAnimatedNumberReaction: (val: UniversalAnimatedNumber<any>, onValue: (current: number) => void) => void;
|
|
653
|
-
animations: A;
|
|
654
|
-
View?: any;
|
|
655
|
-
Text?: any;
|
|
656
|
-
};
|
|
657
|
-
export type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
|
|
658
|
-
export type UseAnimationHook = (props: {
|
|
659
|
-
style: Record<string, any>;
|
|
660
|
-
props: Record<string, any>;
|
|
661
|
-
presence?: UsePresenceResult | null;
|
|
662
|
-
hostRef: RefObject<HTMLElement | View>;
|
|
663
|
-
staticConfig: StaticConfigParsed;
|
|
664
|
-
state: SplitStyleState;
|
|
665
|
-
pseudos: PseudoProps<ViewStyle> | null;
|
|
666
|
-
onDidAnimate?: any;
|
|
667
|
-
delay?: number;
|
|
668
|
-
}) => null | {
|
|
669
|
-
style?: StackStylePropsBase | StackStylePropsBase[];
|
|
670
|
-
};
|
|
671
|
-
export type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
|
|
672
|
-
export {};
|
|
673
|
-
//# sourceMappingURL=types.d.ts.map
|