@tamagui/core 1.2.3 → 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 -411
- 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 -384
- 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 -1291
- 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 -544
- 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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { GestureResponderHandlers, LayoutChangeEvent } from 'react-native'
|
|
2
|
+
|
|
3
|
+
// The following list is sourced from:
|
|
4
|
+
// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L76
|
|
5
|
+
type RNWCursorValue =
|
|
6
|
+
| 'alias'
|
|
7
|
+
| 'all-scroll'
|
|
8
|
+
| 'auto'
|
|
9
|
+
| 'cell'
|
|
10
|
+
| 'context-menu'
|
|
11
|
+
| 'copy'
|
|
12
|
+
| 'crosshair'
|
|
13
|
+
| 'default'
|
|
14
|
+
| 'grab'
|
|
15
|
+
| 'grabbing'
|
|
16
|
+
| 'help'
|
|
17
|
+
| 'pointer'
|
|
18
|
+
| 'progress'
|
|
19
|
+
| 'wait'
|
|
20
|
+
| 'text'
|
|
21
|
+
| 'vertical-text'
|
|
22
|
+
| 'move'
|
|
23
|
+
| 'none'
|
|
24
|
+
| 'no-drop'
|
|
25
|
+
| 'not-allowed'
|
|
26
|
+
| 'zoom-in'
|
|
27
|
+
| 'zoom-out'
|
|
28
|
+
| 'col-resize'
|
|
29
|
+
| 'e-resize'
|
|
30
|
+
| 'ew-resize'
|
|
31
|
+
| 'n-resize'
|
|
32
|
+
| 'ne-resize'
|
|
33
|
+
| 'ns-resize'
|
|
34
|
+
| 'nw-resize'
|
|
35
|
+
| 'row-resize'
|
|
36
|
+
| 's-resize'
|
|
37
|
+
| 'se-resize'
|
|
38
|
+
| 'sw-resize'
|
|
39
|
+
| 'w-resize'
|
|
40
|
+
| 'nesw-resize'
|
|
41
|
+
| 'nwse-resize'
|
|
42
|
+
|
|
43
|
+
// This list is the combination of the following two lists:
|
|
44
|
+
// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js#L10
|
|
45
|
+
// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L12
|
|
46
|
+
// Plus the single hard-coded value "label" from here:
|
|
47
|
+
// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L36
|
|
48
|
+
type RNWWebAccessibilityRole =
|
|
49
|
+
| 'adjustable'
|
|
50
|
+
| 'article'
|
|
51
|
+
| 'banner'
|
|
52
|
+
| 'blockquote'
|
|
53
|
+
| 'button'
|
|
54
|
+
| 'code'
|
|
55
|
+
| 'complementary'
|
|
56
|
+
| 'contentinfo'
|
|
57
|
+
| 'deletion'
|
|
58
|
+
| 'emphasis'
|
|
59
|
+
| 'figure'
|
|
60
|
+
| 'form'
|
|
61
|
+
| 'header'
|
|
62
|
+
| 'image'
|
|
63
|
+
| 'imagebutton'
|
|
64
|
+
| 'insertion'
|
|
65
|
+
| 'keyboardkey'
|
|
66
|
+
| 'label'
|
|
67
|
+
| 'link'
|
|
68
|
+
| 'list'
|
|
69
|
+
| 'listitem'
|
|
70
|
+
| 'main'
|
|
71
|
+
| 'navigation'
|
|
72
|
+
| 'none'
|
|
73
|
+
| 'region'
|
|
74
|
+
| 'search'
|
|
75
|
+
| 'strong'
|
|
76
|
+
| 'summary'
|
|
77
|
+
| 'text'
|
|
78
|
+
|
|
79
|
+
type OnLayout = ((event: LayoutChangeEvent) => void) | undefined
|
|
80
|
+
|
|
81
|
+
type RNExtraProps = {
|
|
82
|
+
dataSet?: Record<string, string | number | undefined | null>
|
|
83
|
+
onScrollShouldSetResponder?: unknown
|
|
84
|
+
onScrollShouldSetResponderCapture?: unknown
|
|
85
|
+
onSelectionChangeShouldSetResponder?: unknown
|
|
86
|
+
onSelectionChangeShouldSetResponderCapture?: unknown
|
|
87
|
+
onLayout?: OnLayout
|
|
88
|
+
href?: string
|
|
89
|
+
hrefAttrs?: {
|
|
90
|
+
target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'
|
|
91
|
+
rel?: string
|
|
92
|
+
download?: boolean
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface RNViewProps extends GestureResponderHandlers, RNExtraProps {
|
|
97
|
+
rel?: any
|
|
98
|
+
download?: any
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface RNTextProps extends RNExtraProps {
|
|
102
|
+
dir?: 'ltr' | 'rtl' | 'auto'
|
|
103
|
+
focusable?: boolean
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlatformMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/usePlatformMethods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,QAkB7D"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from '
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export * from './createTokens';
|
|
8
|
-
export * from './createVariable';
|
|
9
|
-
export * from './createVariables';
|
|
10
|
-
export * from './insertFont';
|
|
11
|
-
export * from './addTheme';
|
|
12
|
-
export * from './updateTheme';
|
|
13
|
-
export * from './styled';
|
|
14
|
-
export * from './types';
|
|
15
|
-
export * from './setupReactNative';
|
|
16
|
-
export type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
17
|
-
export { getConfig, getThemes, getTokens, onConfiguredOnce } from './config';
|
|
18
|
-
export * from './constants/constants';
|
|
19
|
-
export * from './helpers/useShallowSetState';
|
|
20
|
-
export * from './helpers/getVariantExtras';
|
|
21
|
-
export * from './helpers/getAnimationDriver';
|
|
22
|
-
export * from './helpers/getExpandedShorthands';
|
|
23
|
-
export * from './helpers/getSplitStyles';
|
|
24
|
-
export * from './helpers/getStylesAtomic';
|
|
25
|
-
export * from './helpers/pseudoDescriptors';
|
|
26
|
-
export * from './helpers/mergeProps';
|
|
27
|
-
export * from './helpers/expandStyles';
|
|
28
|
-
export * from './helpers/isTamaguiElement';
|
|
29
|
-
export * from './helpers/isTamaguiComponent';
|
|
30
|
-
export * from './helpers/matchMedia';
|
|
31
|
-
export * from './helpers/themeable';
|
|
32
|
-
export * from './helpers/withStaticProperties';
|
|
33
|
-
export * from './contexts/ButtonNestingContext';
|
|
34
|
-
export * from './hooks/useId';
|
|
35
|
-
export * from './hooks/useIsTouchDevice';
|
|
36
|
-
export { configureMedia, getMedia, mediaState, useMedia, useMediaPropsActive, mediaObjectToString, mediaQueryConfig, } from './hooks/useMedia';
|
|
37
|
-
export * from './hooks/useTheme';
|
|
38
|
-
export * from './hooks/useThemeName';
|
|
39
|
-
export * from './hooks/useSafeRef';
|
|
40
|
-
export * from './hooks/useStyle';
|
|
41
|
-
export * from './views/Slot';
|
|
42
|
-
export * from './views/Stack';
|
|
43
|
-
export * from './views/Text';
|
|
44
|
-
export * from './contexts/TextAncestorContext';
|
|
45
|
-
export * from './views/Theme';
|
|
46
|
-
export * from './views/ThemeProvider';
|
|
47
|
-
export * from './views/FontLanguage';
|
|
48
|
-
export * from './views/TamaguiProvider';
|
|
49
|
-
export * from '@tamagui/use-force-update';
|
|
50
|
-
export * from '@tamagui/use-did-finish-ssr';
|
|
51
|
-
export * from '@tamagui/use-event';
|
|
52
|
-
export * from '@tamagui/compose-refs';
|
|
53
|
-
export * from '@tamagui/helpers';
|
|
54
|
-
export * from '@tamagui/constants';
|
|
1
|
+
import { TamaguiComponent } from '@tamagui/web';
|
|
2
|
+
import type { Text as RNText, View as RNView } from 'react-native';
|
|
3
|
+
import type { RNTextProps, RNViewProps } from './reactNativeTypes';
|
|
4
|
+
export * from '@tamagui/web';
|
|
5
|
+
export declare const Stack: TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendBaseStackProps & import("@tamagui/web").TamaguiComponentPropsBase & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>> & import("@tamagui/web").MediaProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>>> & RNViewProps, RNView, Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendBaseStackProps & import("@tamagui/web").TamaguiComponentPropsBase & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & RNViewProps, {}>;
|
|
6
|
+
export declare const Text: TamaguiComponent<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendsBaseTextProps & import("@tamagui/web").TamaguiComponentPropsBase & import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>>> & import("@tamagui/web").MediaProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>>>> & RNTextProps, RNText, Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendsBaseTextProps & import("@tamagui/web").TamaguiComponentPropsBase & import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & RNTextProps, {}>;
|
|
55
7
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,gBAAgB,EAUjB,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAIlE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIlE,cAAc,cAAc,CAAA;AAI5B,eAAO,MAAM,KAAK,0oDAIjB,CAAA;AAED,eAAO,MAAM,IAAI,wmDAIhB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GestureResponderHandlers, LayoutChangeEvent } from 'react-native';
|
|
2
|
+
type OnLayout = ((event: LayoutChangeEvent) => void) | undefined;
|
|
3
|
+
type RNExtraProps = {
|
|
4
|
+
dataSet?: Record<string, string | number | undefined | null>;
|
|
5
|
+
onScrollShouldSetResponder?: unknown;
|
|
6
|
+
onScrollShouldSetResponderCapture?: unknown;
|
|
7
|
+
onSelectionChangeShouldSetResponder?: unknown;
|
|
8
|
+
onSelectionChangeShouldSetResponderCapture?: unknown;
|
|
9
|
+
onLayout?: OnLayout;
|
|
10
|
+
href?: string;
|
|
11
|
+
hrefAttrs?: {
|
|
12
|
+
target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top';
|
|
13
|
+
rel?: string;
|
|
14
|
+
download?: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export interface RNViewProps extends GestureResponderHandlers, RNExtraProps {
|
|
18
|
+
rel?: any;
|
|
19
|
+
download?: any;
|
|
20
|
+
}
|
|
21
|
+
export interface RNTextProps extends RNExtraProps {
|
|
22
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
23
|
+
focusable?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=reactNativeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactNativeTypes.d.ts","sourceRoot":"","sources":["../src/reactNativeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AA8E/E,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;AAEhE,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,CAAA;IAC5D,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,iCAAiC,CAAC,EAAE,OAAO,CAAA;IAC3C,mCAAmC,CAAC,EAAE,OAAO,CAAA;IAC7C,0CAA0C,CAAC,EAAE,OAAO,CAAA;IACpD,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;QAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,WAAW,WAAY,SAAQ,wBAAwB,EAAE,YAAY;IACzE,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,QAAQ,CAAC,EAAE,GAAG,CAAA;CACf;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/cjs/Tamagui.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var Tamagui_exports = {};
|
|
30
|
-
__export(Tamagui_exports, {
|
|
31
|
-
Tamagui: () => Tamagui,
|
|
32
|
-
getValueFromIdentifier: () => getValueFromIdentifier,
|
|
33
|
-
setIdentifierValue: () => setIdentifierValue
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(Tamagui_exports);
|
|
36
|
-
var Helpers = __toESM(require("@tamagui/helpers"));
|
|
37
|
-
var import_config = require("./config");
|
|
38
|
-
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
39
|
-
var import_useMedia = require("./hooks/useMedia");
|
|
40
|
-
class TamaguiManager {
|
|
41
|
-
constructor() {
|
|
42
|
-
this.Helpers = Helpers;
|
|
43
|
-
}
|
|
44
|
-
get mediaState() {
|
|
45
|
-
return { ...import_useMedia.mediaState };
|
|
46
|
-
}
|
|
47
|
-
get config() {
|
|
48
|
-
return (0, import_config.getConfig)();
|
|
49
|
-
}
|
|
50
|
-
get insertedRules() {
|
|
51
|
-
return (0, import_insertStyleRule.getAllRules)();
|
|
52
|
-
}
|
|
53
|
-
get allSelectors() {
|
|
54
|
-
return (0, import_insertStyleRule.getAllSelectors)();
|
|
55
|
-
}
|
|
56
|
-
get allTransforms() {
|
|
57
|
-
return (0, import_insertStyleRule.getAllTransforms)();
|
|
58
|
-
}
|
|
59
|
-
get identifierToValue() {
|
|
60
|
-
return identifierToValue;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const Tamagui = new TamaguiManager();
|
|
64
|
-
const identifierToValue = /* @__PURE__ */ new Map();
|
|
65
|
-
const getValueFromIdentifier = (identifier) => {
|
|
66
|
-
return identifierToValue.get(identifier);
|
|
67
|
-
};
|
|
68
|
-
const setIdentifierValue = (identifier, value) => {
|
|
69
|
-
identifierToValue.set(identifier, value);
|
|
70
|
-
};
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
Tamagui,
|
|
74
|
-
getValueFromIdentifier,
|
|
75
|
-
setIdentifierValue
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=Tamagui.js.map
|
package/dist/cjs/Tamagui.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Tamagui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as Helpers from '@tamagui/helpers'\n\nimport { getConfig } from './config'\nimport { getAllRules, getAllSelectors, getAllTransforms } from './helpers/insertStyleRule'\nimport { mediaState } from './hooks/useMedia'\n\n// easy introspection\n// only included in dev mode\n\nclass TamaguiManager {\n Helpers = Helpers\n\n get mediaState() {\n return { ...mediaState }\n }\n\n get config() {\n return getConfig()\n }\n\n get insertedRules() {\n return getAllRules()\n }\n\n get allSelectors() {\n return getAllSelectors()\n }\n\n get allTransforms() {\n return getAllTransforms()\n }\n\n get identifierToValue() {\n return identifierToValue\n }\n}\n\nexport const Tamagui = new TamaguiManager()\n\nconst identifierToValue = new Map<string, any>()\n\nexport const getValueFromIdentifier = (identifier: string) => {\n return identifierToValue.get(identifier)\n}\n\nexport const setIdentifierValue = (identifier: string, value: any) => {\n identifierToValue.set(identifier, value)\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAyB;AAEzB,oBAA0B;AAC1B,6BAA+D;AAC/D,sBAA2B;AAK3B,MAAM,eAAe;AAAA,EAArB;AACE,mBAAU;AAAA;AAAA,EAEV,IAAI,aAAa;AACf,WAAO,EAAE,GAAG,2BAAW;AAAA,EACzB;AAAA,EAEA,IAAI,SAAS;AACX,eAAO,yBAAU;AAAA,EACnB;AAAA,EAEA,IAAI,gBAAgB;AAClB,eAAO,oCAAY;AAAA,EACrB;AAAA,EAEA,IAAI,eAAe;AACjB,eAAO,wCAAgB;AAAA,EACzB;AAAA,EAEA,IAAI,gBAAgB;AAClB,eAAO,yCAAiB;AAAA,EAC1B;AAAA,EAEA,IAAI,oBAAoB;AACtB,WAAO;AAAA,EACT;AACF;AAEO,MAAM,UAAU,IAAI,eAAe;AAE1C,MAAM,oBAAoB,oBAAI,IAAiB;AAExC,MAAM,yBAAyB,CAAC,eAAuB;AAC5D,SAAO,kBAAkB,IAAI,UAAU;AACzC;AAEO,MAAM,qBAAqB,CAAC,YAAoB,UAAe;AACpE,oBAAkB,IAAI,YAAY,KAAK;AACzC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/addTheme.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var addTheme_exports = {};
|
|
20
|
-
__export(addTheme_exports, {
|
|
21
|
-
addTheme: () => addTheme
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(addTheme_exports);
|
|
24
|
-
var import_constants = require("@tamagui/constants");
|
|
25
|
-
var import_config = require("./config");
|
|
26
|
-
var import_getThemeCSSRules = require("./helpers/getThemeCSSRules");
|
|
27
|
-
var import_themes = require("./helpers/themes");
|
|
28
|
-
function addTheme(props) {
|
|
29
|
-
var _a;
|
|
30
|
-
const config = (0, import_config.getConfig)();
|
|
31
|
-
if (process.env.NODE_ENV === "development") {
|
|
32
|
-
if (!config) {
|
|
33
|
-
throw new Error("No config");
|
|
34
|
-
}
|
|
35
|
-
const theme2 = config.themes[props.name];
|
|
36
|
-
if (!props.update && theme2) {
|
|
37
|
-
return { theme: theme2 };
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const { name: themeName, theme: themeIn, insertCSS } = props;
|
|
41
|
-
const theme = { ...themeIn };
|
|
42
|
-
for (const key in theme) {
|
|
43
|
-
(0, import_themes.ensureThemeVariable)(theme, key);
|
|
44
|
-
}
|
|
45
|
-
const themeProxied = (0, import_themes.proxyThemeToParents)(themeName, theme, config.themes);
|
|
46
|
-
config.themes[themeName] = themeProxied;
|
|
47
|
-
let cssRules = [];
|
|
48
|
-
if (import_constants.isWeb) {
|
|
49
|
-
if (insertCSS) {
|
|
50
|
-
cssRules = (0, import_getThemeCSSRules.getThemeCSSRules)({
|
|
51
|
-
// @ts-ignore this works but should be fixed types
|
|
52
|
-
config,
|
|
53
|
-
themeName,
|
|
54
|
-
names: [themeName],
|
|
55
|
-
theme
|
|
56
|
-
});
|
|
57
|
-
const id = `t_theme_style_${themeName}`;
|
|
58
|
-
const existing = document.querySelector(`#${id}`);
|
|
59
|
-
const style = document.createElement("style");
|
|
60
|
-
style.id = id;
|
|
61
|
-
style.appendChild(document.createTextNode(cssRules.join("\n")));
|
|
62
|
-
document.head.appendChild(style);
|
|
63
|
-
if (existing) {
|
|
64
|
-
(_a = existing.parentElement) == null ? void 0 : _a.removeChild(existing);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
(0, import_config.updateConfig)("themes", { ...config.themes, [themeName]: themeProxied });
|
|
69
|
-
return {
|
|
70
|
-
theme: themeProxied,
|
|
71
|
-
cssRules
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
addTheme
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=addTheme.js.map
|
package/dist/cjs/addTheme.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes'\nimport { ThemeDefinition, ThemeParsed } from './types'\n\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAAwC;AACxC,8BAAiC;AACjC,oBAAyD;AAGlD,SAAS,SAAS,OAKtB;AAZH;AAaE,QAAM,aAAS,yBAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,2CAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,mBAAe,mCAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,wBAAO;AACT,QAAI,WAAW;AACb,qBAAW,0CAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,kCAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
6
|
-
"names": ["theme"]
|
|
7
|
-
}
|
package/dist/cjs/config.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var config_exports = {};
|
|
20
|
-
__export(config_exports, {
|
|
21
|
-
configListeners: () => configListeners,
|
|
22
|
-
getConfig: () => getConfig,
|
|
23
|
-
getFont: () => getFont,
|
|
24
|
-
getThemes: () => getThemes,
|
|
25
|
-
getTokens: () => getTokens,
|
|
26
|
-
onConfiguredOnce: () => onConfiguredOnce,
|
|
27
|
-
setConfig: () => setConfig,
|
|
28
|
-
setConfigFont: () => setConfigFont,
|
|
29
|
-
updateConfig: () => updateConfig,
|
|
30
|
-
useTokens: () => useTokens
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(config_exports);
|
|
33
|
-
let conf;
|
|
34
|
-
const setConfig = (next) => {
|
|
35
|
-
conf = next;
|
|
36
|
-
configListeners.forEach((cb) => cb(next));
|
|
37
|
-
};
|
|
38
|
-
const setConfigFont = (name, font, fontParsed) => {
|
|
39
|
-
if (process.env.NODE_ENV === "development") {
|
|
40
|
-
if (!conf)
|
|
41
|
-
throw new Error(`Haven't called createTamagui yet`);
|
|
42
|
-
}
|
|
43
|
-
conf.fonts[name] = font;
|
|
44
|
-
conf.fontsParsed[`$${name}`] = fontParsed;
|
|
45
|
-
};
|
|
46
|
-
const getConfig = () => {
|
|
47
|
-
if (!conf) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
process.env.NODE_ENV !== "production" ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.` : "Err0"
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
return conf;
|
|
53
|
-
};
|
|
54
|
-
const getTokens = ({ prefixed = true } = {}) => prefixed ? conf.tokensParsed : conf.tokens;
|
|
55
|
-
const useTokens = () => getTokens();
|
|
56
|
-
const getThemes = () => conf.themes;
|
|
57
|
-
const configListeners = /* @__PURE__ */ new Set();
|
|
58
|
-
const onConfiguredOnce = (cb) => {
|
|
59
|
-
if (conf) {
|
|
60
|
-
cb(conf);
|
|
61
|
-
} else {
|
|
62
|
-
configListeners.add(cb);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const updateConfig = (key, value) => {
|
|
66
|
-
Object.assign(key, value);
|
|
67
|
-
};
|
|
68
|
-
const getFont = (name) => {
|
|
69
|
-
var _a;
|
|
70
|
-
const conf2 = getConfig();
|
|
71
|
-
return conf2.fontsParsed[name] ?? ((_a = Object.entries(conf2.fontsParsed).find(
|
|
72
|
-
([k]) => {
|
|
73
|
-
var _a2, _b;
|
|
74
|
-
return ((_b = (_a2 = conf2.fontsParsed[k]) == null ? void 0 : _a2.family) == null ? void 0 : _b["val"]) === name;
|
|
75
|
-
}
|
|
76
|
-
)) == null ? void 0 : _a[1]);
|
|
77
|
-
};
|
|
78
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
-
0 && (module.exports = {
|
|
80
|
-
configListeners,
|
|
81
|
-
getConfig,
|
|
82
|
-
getFont,
|
|
83
|
-
getThemes,
|
|
84
|
-
getTokens,
|
|
85
|
-
onConfiguredOnce,
|
|
86
|
-
setConfig,
|
|
87
|
-
setConfigFont,
|
|
88
|
-
updateConfig,
|
|
89
|
-
useTokens
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=config.js.map
|
package/dist/cjs/config.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, Tokens } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nexport const getTokens = ({ prefixed = true }: { prefixed?: boolean } = {}): Tokens =>\n prefixed ? conf!.tokensParsed : conf!.tokens\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,YAAY,CAAC,EAAE,WAAW,KAAK,IAA4B,CAAC,MACvE,WAAW,KAAM,eAAe,KAAM;AAKjC,MAAM,YAAY,MAAM,UAAU;AAElC,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAI;AAAA,EACT,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,eAAe,CAAC,KAAa,UAAe;AACvD,SAAO,OAAO,KAAK,KAAK;AAC1B;AAGO,MAAM,UAAU,CAAC,SAAiB;AArDzC;AAsDE,QAAMA,QAAO,UAAU;AACvB,SACEA,MAAK,YAAY,IAAI,OACrB,YAAO,QAAQA,MAAK,WAAW,EAAE;AAAA,IAC/B,CAAC,CAAC,CAAC,MAAG;AA1DZ,UAAAC,KAAA;AA0De,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
|
|
6
|
-
"names": ["conf", "_a"]
|
|
7
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var constants_exports = {};
|
|
20
|
-
__export(constants_exports, {
|
|
21
|
-
THEME_CLASSNAME_PREFIX: () => THEME_CLASSNAME_PREFIX,
|
|
22
|
-
THEME_NAME_SEPARATOR: () => THEME_NAME_SEPARATOR,
|
|
23
|
-
stackDefaultStyles: () => stackDefaultStyles,
|
|
24
|
-
webOnlyDefaultStyles: () => webOnlyDefaultStyles
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(constants_exports);
|
|
27
|
-
const THEME_NAME_SEPARATOR = "_";
|
|
28
|
-
const THEME_CLASSNAME_PREFIX = "t_";
|
|
29
|
-
const webOnlyDefaultStyles = {
|
|
30
|
-
display: "flex",
|
|
31
|
-
flexBasis: "auto",
|
|
32
|
-
boxSizing: "border-box",
|
|
33
|
-
position: "relative",
|
|
34
|
-
minHeight: 0,
|
|
35
|
-
minWidth: 0
|
|
36
|
-
};
|
|
37
|
-
const stackDefaultStyles = {
|
|
38
|
-
alignItems: "stretch",
|
|
39
|
-
flexShrink: 0,
|
|
40
|
-
...webOnlyDefaultStyles
|
|
41
|
-
};
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
THEME_CLASSNAME_PREFIX,
|
|
45
|
-
THEME_NAME_SEPARATOR,
|
|
46
|
-
stackDefaultStyles,
|
|
47
|
-
webOnlyDefaultStyles
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants/constants.ts"],
|
|
4
|
-
"sourcesContent": ["export const THEME_NAME_SEPARATOR = '_'\nexport const THEME_CLASSNAME_PREFIX = 't_'\n\nexport const webOnlyDefaultStyles = {\n display: 'flex',\n flexBasis: 'auto',\n boxSizing: 'border-box',\n position: 'relative',\n minHeight: 0,\n minWidth: 0,\n}\n\nexport const stackDefaultStyles = {\n alignItems: 'stretch',\n flexShrink: 0,\n ...webOnlyDefaultStyles,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAE/B,MAAM,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AACZ;AAEO,MAAM,qBAAqB;AAAA,EAChC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,GAAG;AACL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var isDevTools_exports = {};
|
|
20
|
-
__export(isDevTools_exports, {
|
|
21
|
-
isDevTools: () => isDevTools
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(isDevTools_exports);
|
|
24
|
-
const isDevTools = (() => {
|
|
25
|
-
if (process.env.NODE_ENV === "development") {
|
|
26
|
-
try {
|
|
27
|
-
return new Function("try {return this===window;}catch(e){ return false;}")();
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
})();
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
isDevTools
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=isDevTools.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants/isDevTools.ts"],
|
|
4
|
-
"sourcesContent": ["// for verbose logging outside node/cli\n\nexport const isDevTools = (() => {\n if (process.env.NODE_ENV === 'development') {\n try {\n return new Function('try {return this===window;}catch(e){ return false;}')()\n } catch {\n //\n }\n }\n return false\n})()\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,cAAc,MAAM;AAC/B,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI;AACF,aAAO,IAAI,SAAS,qDAAqD,EAAE;AAAA,IAC7E,QAAE;AAAA,IAEF;AAAA,EACF;AACA,SAAO;AACT,GAAG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var ButtonNestingContext_exports = {};
|
|
20
|
-
__export(ButtonNestingContext_exports, {
|
|
21
|
-
ButtonNestingContext: () => ButtonNestingContext
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(ButtonNestingContext_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
const ButtonNestingContext = (0, import_react.createContext)(false);
|
|
26
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
-
0 && (module.exports = {
|
|
28
|
-
ButtonNestingContext
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=ButtonNestingContext.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/contexts/ButtonNestingContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react'\n\nexport const ButtonNestingContext = createContext(false)\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAEvB,MAAM,2BAAuB,4BAAc,KAAK;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|