@tamagui/core 1.0.0-beta.1 → 1.0.0-beta.12
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 +1 -0
- package/dist/cjs/Tamagui.js +0 -0
- package/dist/cjs/Tamagui.js.map +0 -0
- package/dist/cjs/ThemeContext.js +0 -0
- package/dist/cjs/ThemeContext.js.map +0 -0
- package/dist/cjs/ThemeManager.js +0 -0
- package/dist/cjs/ThemeManager.js.map +0 -0
- package/dist/cjs/conf.js +0 -0
- package/dist/cjs/conf.js.map +0 -0
- package/dist/cjs/constants/constants.js +0 -0
- package/dist/cjs/constants/constants.js.map +0 -0
- package/dist/cjs/constants/platform.js +0 -0
- package/dist/cjs/constants/platform.js.map +0 -0
- package/dist/cjs/constants/rnw.js +0 -0
- package/dist/cjs/constants/rnw.js.map +0 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +0 -0
- package/dist/cjs/createComponent.js +46 -15
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +0 -0
- package/dist/cjs/createFont.js.map +0 -0
- package/dist/cjs/createShorthands.js +0 -0
- package/dist/cjs/createShorthands.js.map +0 -0
- package/dist/cjs/createTamagui.js +0 -0
- package/dist/cjs/createTamagui.js.map +0 -0
- package/dist/cjs/createTheme.js +0 -0
- package/dist/cjs/createTheme.js.map +0 -0
- package/dist/cjs/createTokens.js +0 -0
- package/dist/cjs/createTokens.js.map +0 -0
- package/dist/cjs/createVariable.js +0 -0
- package/dist/cjs/createVariable.js.map +0 -0
- package/dist/cjs/defaultComponentState.js +0 -0
- package/dist/cjs/defaultComponentState.js.map +0 -0
- package/dist/cjs/helpers/RNComponents.js +0 -0
- package/dist/cjs/helpers/RNComponents.js.map +0 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +17 -12
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/cjs/helpers/areEqualSets.js +0 -0
- package/dist/cjs/helpers/areEqualSets.js.map +0 -0
- package/dist/cjs/helpers/createMediaStyle.js +0 -0
- package/dist/cjs/helpers/createMediaStyle.js.map +0 -0
- package/dist/cjs/helpers/createPropMapper.js +34 -3
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +0 -0
- package/dist/cjs/helpers/createShallowUpdate.js.map +0 -0
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -0
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -0
- package/dist/cjs/helpers/extendStaticConfig.js +0 -0
- package/dist/cjs/helpers/extendStaticConfig.js.map +0 -0
- package/dist/cjs/helpers/fixNativeShadow.js +0 -0
- package/dist/cjs/helpers/fixNativeShadow.js.map +0 -0
- package/dist/cjs/helpers/fixNativeShadow.native.js +4 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/cjs/helpers/getButtonSize.js +45 -0
- package/dist/cjs/helpers/getButtonSize.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -0
- package/dist/cjs/helpers/getExpandedShorthands.js.map +0 -0
- package/dist/cjs/helpers/getSize.js +0 -0
- package/dist/cjs/helpers/getSize.js.map +0 -0
- package/dist/cjs/helpers/getSplitStyles.js +0 -6
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +0 -0
- package/dist/cjs/helpers/getStylesAtomic.js.map +0 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js +0 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +0 -0
- package/dist/cjs/helpers/getTextSize.js +56 -0
- package/dist/cjs/helpers/getTextSize.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +1 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +0 -0
- package/dist/cjs/helpers/isObj.js.map +0 -0
- package/dist/cjs/helpers/isTamaguiElement.js +0 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +0 -0
- package/dist/cjs/helpers/matchMedia.js +0 -0
- package/dist/cjs/helpers/matchMedia.js.map +0 -0
- package/dist/cjs/helpers/matchMedia.native.js +0 -0
- package/dist/cjs/helpers/matchMedia.native.js.map +0 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +0 -0
- package/dist/cjs/helpers/proxyThemeVariables.js.map +0 -0
- package/dist/cjs/helpers/themeable.js +0 -0
- package/dist/cjs/helpers/themeable.js.map +0 -0
- package/dist/cjs/helpers/validate.js +0 -0
- package/dist/cjs/helpers/validate.js.map +0 -0
- package/dist/cjs/helpers/withStaticProperties.js +0 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +0 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -0
- package/dist/cjs/hooks/useConstant.js +0 -0
- package/dist/cjs/hooks/useConstant.js.map +0 -0
- package/dist/cjs/hooks/useFeatures.js +0 -0
- package/dist/cjs/hooks/useFeatures.js.map +0 -0
- package/dist/cjs/hooks/useId.js +59 -0
- package/dist/cjs/hooks/useId.js.map +7 -0
- package/dist/cjs/hooks/useIsMounted.js +0 -0
- package/dist/cjs/hooks/useIsMounted.js.map +0 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +4 -4
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +0 -1
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js +0 -0
- package/dist/cjs/hooks/usePressable.js.map +0 -0
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/hooks/usePrevious.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +0 -0
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +0 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +0 -0
- package/dist/cjs/index.js +9 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/static.js +0 -0
- package/dist/cjs/static.js.map +0 -0
- package/dist/cjs/styled.js +4 -1
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +0 -0
- package/dist/cjs/types-rnw.js.map +0 -0
- package/dist/cjs/types.js +0 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +115 -0
- package/dist/cjs/views/Slot.js.map +7 -0
- package/dist/cjs/views/Stack.js +0 -0
- package/dist/cjs/views/Stack.js.map +0 -0
- package/dist/cjs/views/Text.js +0 -0
- package/dist/cjs/views/Text.js.map +0 -0
- package/dist/cjs/views/TextAncestorContext.js +0 -0
- package/dist/cjs/views/TextAncestorContext.js.map +0 -0
- package/dist/cjs/views/Theme.js +0 -0
- package/dist/cjs/views/Theme.js.map +0 -0
- package/dist/cjs/views/ThemeInverse.js +0 -0
- package/dist/cjs/views/ThemeInverse.js.map +0 -0
- package/dist/cjs/views/ThemeProvider.js +0 -0
- package/dist/cjs/views/ThemeProvider.js.map +0 -0
- package/dist/cjs/views/ThemeReset.js +0 -0
- package/dist/cjs/views/ThemeReset.js.map +0 -0
- package/dist/esm/Tamagui.js +0 -0
- package/dist/esm/Tamagui.js.map +0 -0
- package/dist/esm/ThemeContext.js +0 -0
- package/dist/esm/ThemeContext.js.map +0 -0
- package/dist/esm/ThemeManager.js +0 -0
- package/dist/esm/ThemeManager.js.map +0 -0
- package/dist/esm/conf.js +0 -0
- package/dist/esm/conf.js.map +0 -0
- package/dist/esm/constants/constants.js +0 -0
- package/dist/esm/constants/constants.js.map +0 -0
- package/dist/esm/constants/platform.js +0 -0
- package/dist/esm/constants/platform.js.map +0 -0
- package/dist/esm/constants/rnw.js +0 -0
- package/dist/esm/constants/rnw.js.map +0 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +0 -0
- package/dist/esm/createComponent.js +50 -23
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js +0 -0
- package/dist/esm/createFont.js.map +0 -0
- package/dist/esm/createShorthands.js +0 -0
- package/dist/esm/createShorthands.js.map +0 -0
- package/dist/esm/createTamagui.js +0 -0
- package/dist/esm/createTamagui.js.map +0 -0
- package/dist/esm/createTheme.js +0 -0
- package/dist/esm/createTheme.js.map +0 -0
- package/dist/esm/createTokens.js +0 -0
- package/dist/esm/createTokens.js.map +0 -0
- package/dist/esm/createVariable.js +0 -0
- package/dist/esm/createVariable.js.map +0 -0
- package/dist/esm/defaultComponentState.js +0 -0
- package/dist/esm/defaultComponentState.js.map +0 -0
- package/dist/esm/helpers/RNComponents.js +0 -0
- package/dist/esm/helpers/RNComponents.js.map +0 -0
- package/dist/esm/helpers/addStylesUsingClassname.js +18 -13
- package/dist/esm/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/esm/helpers/areEqualSets.js +0 -0
- package/dist/esm/helpers/areEqualSets.js.map +0 -0
- package/dist/esm/helpers/createMediaStyle.js +0 -0
- package/dist/esm/helpers/createMediaStyle.js.map +0 -0
- package/dist/esm/helpers/createPropMapper.js +35 -3
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +0 -0
- package/dist/esm/helpers/createShallowUpdate.js.map +0 -0
- package/dist/esm/helpers/createTamaguiProvider.js +0 -0
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -0
- package/dist/esm/helpers/extendStaticConfig.js +0 -0
- package/dist/esm/helpers/extendStaticConfig.js.map +0 -0
- package/dist/esm/helpers/fixNativeShadow.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -0
- package/dist/esm/helpers/fixNativeShadow.native.js +5 -7
- package/dist/esm/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/esm/helpers/getButtonSize.js +24 -0
- package/dist/esm/helpers/getButtonSize.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +0 -0
- package/dist/esm/helpers/getExpandedShorthands.js.map +0 -0
- package/dist/esm/helpers/getSize.js +0 -0
- package/dist/esm/helpers/getSize.js.map +0 -0
- package/dist/esm/helpers/getSplitStyles.js +0 -7
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +0 -0
- package/dist/esm/helpers/getStylesAtomic.js.map +0 -0
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -0
- package/dist/esm/helpers/getStylesAtomic.native.js.map +0 -0
- package/dist/esm/helpers/getTextSize.js +34 -0
- package/dist/esm/helpers/getTextSize.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +1 -0
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/isObj.js +0 -0
- package/dist/esm/helpers/isObj.js.map +0 -0
- package/dist/esm/helpers/isTamaguiElement.js +0 -0
- package/dist/esm/helpers/isTamaguiElement.js.map +0 -0
- package/dist/esm/helpers/matchMedia.js +0 -0
- package/dist/esm/helpers/matchMedia.js.map +0 -0
- package/dist/esm/helpers/matchMedia.native.js +0 -0
- package/dist/esm/helpers/matchMedia.native.js.map +0 -0
- package/dist/esm/helpers/proxyThemeVariables.js +0 -0
- package/dist/esm/helpers/proxyThemeVariables.js.map +0 -0
- package/dist/esm/helpers/themeable.js +0 -0
- package/dist/esm/helpers/themeable.js.map +0 -0
- package/dist/esm/helpers/validate.js +0 -0
- package/dist/esm/helpers/validate.js.map +0 -0
- package/dist/esm/helpers/withStaticProperties.js +0 -0
- package/dist/esm/helpers/withStaticProperties.js.map +0 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -0
- package/dist/esm/hooks/useConstant.js +0 -0
- package/dist/esm/hooks/useConstant.js.map +0 -0
- package/dist/esm/hooks/useFeatures.js +0 -0
- package/dist/esm/hooks/useFeatures.js.map +0 -0
- package/dist/esm/hooks/useId.js +35 -0
- package/dist/esm/hooks/useId.js.map +7 -0
- package/dist/esm/hooks/useIsMounted.js +0 -0
- package/dist/esm/hooks/useIsMounted.js.map +0 -0
- package/dist/esm/hooks/useIsTouchDevice.js +6 -6
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +0 -1
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/usePressable.js +0 -0
- package/dist/esm/hooks/usePressable.js.map +0 -0
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/hooks/usePrevious.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +0 -0
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useUnmountEffect.js +0 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +0 -0
- package/dist/esm/index.js +9 -6
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/static.js +0 -0
- package/dist/esm/static.js.map +0 -0
- package/dist/esm/styled.js +4 -1
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types-rnw.js +0 -0
- package/dist/esm/types-rnw.js.map +0 -0
- package/dist/esm/types.js +0 -0
- package/dist/esm/types.js.map +0 -0
- package/dist/esm/views/Slot.js +63 -0
- package/dist/esm/views/Slot.js.map +7 -0
- package/dist/esm/views/Stack.js +0 -0
- package/dist/esm/views/Stack.js.map +0 -0
- package/dist/esm/views/Text.js +0 -0
- package/dist/esm/views/Text.js.map +0 -0
- package/dist/esm/views/TextAncestorContext.js +0 -0
- package/dist/esm/views/TextAncestorContext.js.map +0 -0
- package/dist/esm/views/Theme.js +0 -0
- package/dist/esm/views/Theme.js.map +0 -0
- package/dist/esm/views/ThemeInverse.js +0 -0
- package/dist/esm/views/ThemeInverse.js.map +0 -0
- package/dist/esm/views/ThemeProvider.js +0 -0
- package/dist/esm/views/ThemeProvider.js.map +0 -0
- package/dist/esm/views/ThemeReset.js +0 -0
- package/dist/esm/views/ThemeReset.js.map +0 -0
- package/dist/jsx/Tamagui.js +0 -0
- package/dist/jsx/ThemeContext.js +0 -0
- package/dist/jsx/ThemeManager.js +0 -0
- package/dist/jsx/conf.js +0 -0
- package/dist/jsx/constants/constants.js +0 -0
- package/dist/jsx/constants/platform.js +0 -0
- package/dist/jsx/constants/rnw.js +0 -0
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/jsx/createComponent.js +50 -23
- package/dist/jsx/createFont.js +0 -0
- package/dist/jsx/createShorthands.js +0 -0
- package/dist/jsx/createTamagui.js +0 -0
- package/dist/jsx/createTheme.js +0 -0
- package/dist/jsx/createTokens.js +0 -0
- package/dist/jsx/createVariable.js +0 -0
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -0
- package/dist/jsx/helpers/addStylesUsingClassname.js +18 -13
- package/dist/jsx/helpers/areEqualSets.js +0 -0
- package/dist/jsx/helpers/createMediaStyle.js +0 -0
- package/dist/jsx/helpers/createPropMapper.js +35 -3
- package/dist/jsx/helpers/createShallowUpdate.js +0 -0
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -0
- package/dist/jsx/helpers/extendStaticConfig.js +0 -0
- package/dist/jsx/helpers/fixNativeShadow.js +0 -0
- package/dist/jsx/helpers/fixNativeShadow.native.js +5 -7
- package/dist/jsx/helpers/getButtonSize.js +23 -0
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -0
- package/dist/jsx/helpers/getSize.js +0 -0
- package/dist/jsx/helpers/getSplitStyles.js +0 -7
- package/dist/jsx/helpers/getStylesAtomic.js +0 -0
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -0
- package/dist/jsx/helpers/getTextSize.js +33 -0
- package/dist/jsx/helpers/insertStyleRule.js +1 -0
- package/dist/jsx/helpers/isObj.js +0 -0
- package/dist/jsx/helpers/isTamaguiElement.js +0 -0
- package/dist/jsx/helpers/matchMedia.js +0 -0
- package/dist/jsx/helpers/matchMedia.native.js +0 -0
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -0
- package/dist/jsx/helpers/themeable.js +0 -0
- package/dist/jsx/helpers/validate.js +0 -0
- package/dist/jsx/helpers/withStaticProperties.js +0 -0
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -0
- package/dist/jsx/hooks/useConstant.js +0 -0
- package/dist/jsx/hooks/useFeatures.js +0 -0
- package/dist/jsx/hooks/useId.js +34 -0
- package/dist/jsx/hooks/useIsMounted.js +0 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +6 -6
- package/dist/jsx/hooks/useMedia.js +0 -1
- package/dist/jsx/hooks/usePressable.js +0 -0
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -0
- package/dist/jsx/hooks/useUnmountEffect.js +0 -0
- package/dist/jsx/index.js +9 -6
- package/dist/jsx/static.js +0 -0
- package/dist/jsx/styled.js +4 -1
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +56 -0
- package/dist/jsx/views/Stack.js +0 -0
- package/dist/jsx/views/Text.js +0 -0
- package/dist/jsx/views/TextAncestorContext.js +0 -0
- package/dist/jsx/views/Theme.js +0 -0
- package/dist/jsx/views/ThemeInverse.js +0 -0
- package/dist/jsx/views/ThemeProvider.js +0 -0
- package/dist/jsx/views/ThemeReset.js +0 -0
- package/package.json +7 -5
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/addStylesUsingClassname.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/fixNativeShadow.native.d.ts +2 -1
- package/types/helpers/fixNativeShadow.native.d.ts.map +1 -1
- package/types/helpers/getButtonSize.d.ts +8 -0
- package/types/helpers/getButtonSize.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getTextSize.d.ts +3 -0
- package/types/helpers/getTextSize.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/hooks/useId.d.ts +9 -0
- package/types/hooks/useId.d.ts.map +1 -0
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/usePrevious.d.ts +1 -0
- package/types/hooks/usePrevious.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/index.d.ts +9 -6
- package/types/index.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +20 -5
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +9 -0
- package/types/views/Slot.d.ts.map +1 -0
|
@@ -16,21 +16,19 @@ import React, {
|
|
|
16
16
|
import { StyleSheet, Text, View } from "react-native";
|
|
17
17
|
import { onConfiguredOnce } from "./conf";
|
|
18
18
|
import { stackDefaultStyles } from "./constants/constants";
|
|
19
|
-
import { isAndroid,
|
|
19
|
+
import { isAndroid, isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
20
20
|
import { rnw } from "./constants/rnw";
|
|
21
|
-
import { isVariable } from "./createVariable";
|
|
22
21
|
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
23
22
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
24
|
-
import {
|
|
25
|
-
insertSplitStyles,
|
|
26
|
-
useSplitStyles
|
|
27
|
-
} from "./helpers/getSplitStyles";
|
|
23
|
+
import { insertSplitStyles, useSplitStyles } from "./helpers/getSplitStyles";
|
|
28
24
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
29
25
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
30
26
|
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
31
27
|
import { useFeatures } from "./hooks/useFeatures";
|
|
28
|
+
import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
32
29
|
import { usePressable } from "./hooks/usePressable";
|
|
33
30
|
import { getThemeManagerIfChanged, useTheme } from "./hooks/useTheme";
|
|
31
|
+
import { Slot } from "./views/Slot";
|
|
34
32
|
import { TextAncestorContext } from "./views/TextAncestorContext";
|
|
35
33
|
React["keep"];
|
|
36
34
|
const defaultComponentState = {
|
|
@@ -47,6 +45,14 @@ if (typeof document !== "undefined") {
|
|
|
47
45
|
mouseUps.forEach((x) => x());
|
|
48
46
|
mouseUps.clear();
|
|
49
47
|
});
|
|
48
|
+
document.addEventListener("touchend", () => {
|
|
49
|
+
mouseUps.forEach((x) => x());
|
|
50
|
+
mouseUps.clear();
|
|
51
|
+
});
|
|
52
|
+
document.addEventListener("touchcancel", () => {
|
|
53
|
+
mouseUps.forEach((x) => x());
|
|
54
|
+
mouseUps.clear();
|
|
55
|
+
});
|
|
50
56
|
}
|
|
51
57
|
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
52
58
|
for (const key in defaultProps) {
|
|
@@ -71,6 +77,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
71
77
|
let avoidClasses = true;
|
|
72
78
|
let defaultNativeStyle;
|
|
73
79
|
let defaultNativeStyleSheet;
|
|
80
|
+
let tamaguiDefaultProps;
|
|
74
81
|
let initialSplitStyles;
|
|
75
82
|
function addPseudoToStyles(styles, name, pseudos) {
|
|
76
83
|
const pseudoStyle = pseudos[name];
|
|
@@ -86,11 +93,12 @@ function createComponent(configIn, ParentComponent) {
|
|
|
86
93
|
__name(addPseudoToStyles, "addPseudoToStyles");
|
|
87
94
|
const component = forwardRef((props, forwardedRef) => {
|
|
88
95
|
var _a, _b, _c, _d;
|
|
96
|
+
props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props;
|
|
89
97
|
const { Component, componentName, isText, isZStack } = staticConfig;
|
|
90
98
|
if (process.env.NODE_ENV === "development") {
|
|
91
99
|
if (props["debug"]) {
|
|
92
|
-
console.
|
|
93
|
-
console.log("props in:", props);
|
|
100
|
+
console.log("\u26A0\uFE0F", staticConfig.componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
|
|
101
|
+
console.log("props in:", props, Object.keys(props));
|
|
94
102
|
if (props["debug"] === "break")
|
|
95
103
|
debugger;
|
|
96
104
|
}
|
|
@@ -100,7 +108,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
100
108
|
const [state, set_] = useState(defaultComponentState);
|
|
101
109
|
const setStateShallow = createShallowUpdate(set_);
|
|
102
110
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
103
|
-
const splitStyles = useSplitStyles(props, staticConfig, theme, shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: "value" } : state, shouldAvoidClasses ? null : initialSplitStyles.classNames);
|
|
111
|
+
const splitStyles = useSplitStyles(props, staticConfig, theme, shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: "value" } : state, shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames);
|
|
104
112
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
105
113
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
106
114
|
const isAnimated = !!(useAnimations && props.animation);
|
|
@@ -119,6 +127,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
119
127
|
const {
|
|
120
128
|
tag,
|
|
121
129
|
hitSlop,
|
|
130
|
+
asChild,
|
|
122
131
|
children,
|
|
123
132
|
pointerEvents,
|
|
124
133
|
onPress,
|
|
@@ -202,7 +211,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
202
211
|
if (accessibilityRole)
|
|
203
212
|
viewProps.accessibilityRole = accessibilityRole;
|
|
204
213
|
}
|
|
205
|
-
if (isWeb) {
|
|
214
|
+
if (isWeb && !asChild) {
|
|
206
215
|
rnw.useResponderEvents(hostRef, {
|
|
207
216
|
onMoveShouldSetResponder,
|
|
208
217
|
onMoveShouldSetResponderCapture,
|
|
@@ -306,10 +315,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
306
315
|
}
|
|
307
316
|
const initialPseudos = initialSplitStyles.pseudos;
|
|
308
317
|
const attachPress = !!(pseudos && pseudos.pressStyle || initialPseudos && initialPseudos.pressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
309
|
-
const
|
|
318
|
+
const isTouch = useIsTouchDevice();
|
|
319
|
+
const isHoverable = isWeb && !isTouch;
|
|
310
320
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
311
321
|
const pressEventKey = isStringElement ? "onClick" : "onPress";
|
|
312
|
-
const shouldAttach = attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props);
|
|
322
|
+
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
313
323
|
const unPress = useCallback(() => {
|
|
314
324
|
if (!internal.current.isMounted)
|
|
315
325
|
return;
|
|
@@ -364,15 +374,18 @@ function createComponent(configIn, ParentComponent) {
|
|
|
364
374
|
});
|
|
365
375
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
366
376
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
377
|
+
if (isWeb) {
|
|
378
|
+
mouseUps.add(unPress);
|
|
379
|
+
}
|
|
367
380
|
} : null,
|
|
368
381
|
[pressEventKey]: attachPress ? (e) => {
|
|
382
|
+
onClick == null ? void 0 : onClick(e);
|
|
369
383
|
onPress == null ? void 0 : onPress(e);
|
|
370
384
|
unPress();
|
|
371
385
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
372
|
-
onClick == null ? void 0 : onClick(e);
|
|
373
386
|
} : null
|
|
374
387
|
} : null;
|
|
375
|
-
|
|
388
|
+
const childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
|
|
376
389
|
children,
|
|
377
390
|
space,
|
|
378
391
|
flexDirection: props.flexDirection || ((_b = staticConfig.defaultProps) == null ? void 0 : _b.flexDirection),
|
|
@@ -412,6 +425,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
412
425
|
Object.assign(viewProps, events);
|
|
413
426
|
}
|
|
414
427
|
}
|
|
428
|
+
if (asChild) {
|
|
429
|
+
ViewComponent = Slot;
|
|
430
|
+
const onlyChild = React.Children.only(children);
|
|
431
|
+
Object.assign(viewProps, onlyChild.props);
|
|
432
|
+
}
|
|
415
433
|
content = createElement(ViewComponent, viewProps, childEls);
|
|
416
434
|
if (isWeb && events && attachHover) {
|
|
417
435
|
content = <span className="tui_Hoverable" style={{
|
|
@@ -453,24 +471,33 @@ function createComponent(configIn, ParentComponent) {
|
|
|
453
471
|
resolveVariablesAs: "both",
|
|
454
472
|
keepVariantsAsProps: true
|
|
455
473
|
});
|
|
456
|
-
const
|
|
474
|
+
const defaults = {
|
|
475
|
+
...component.defaultProps,
|
|
476
|
+
...initialSplitStyles.viewProps
|
|
477
|
+
};
|
|
457
478
|
defaultNativeStyle = {};
|
|
458
|
-
for (const key in
|
|
459
|
-
const
|
|
460
|
-
|
|
479
|
+
for (const key in staticConfig.defaultProps) {
|
|
480
|
+
const val = staticConfig.defaultProps[key];
|
|
481
|
+
if (typeof val === "string" && val[0] === "$") {
|
|
482
|
+
defaults[key] = val;
|
|
483
|
+
} else {
|
|
484
|
+
defaultNativeStyle[key] = val;
|
|
485
|
+
}
|
|
461
486
|
}
|
|
462
487
|
defaultNativeStyleSheet = StyleSheet.create({
|
|
463
488
|
base: defaultNativeStyle
|
|
464
489
|
});
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
};
|
|
490
|
+
if (Object.keys(defaults).length) {
|
|
491
|
+
tamaguiDefaultProps = defaults;
|
|
492
|
+
}
|
|
469
493
|
if (process.env.NODE_ENV === "development" && ((_d = staticConfig.defaultProps) == null ? void 0 : _d.debug)) {
|
|
470
494
|
if (process.env.IS_STATIC !== "is_static") {
|
|
471
495
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
472
496
|
staticConfig,
|
|
473
|
-
initialSplitStyles
|
|
497
|
+
initialSplitStyles,
|
|
498
|
+
tamaguiDefaultProps,
|
|
499
|
+
defaultNativeStyle,
|
|
500
|
+
defaults
|
|
474
501
|
});
|
|
475
502
|
}
|
|
476
503
|
}
|
package/dist/jsx/createFont.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/jsx/createTheme.js
CHANGED
|
File without changes
|
package/dist/jsx/createTokens.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { useInsertionEffect
|
|
3
|
+
import { useInsertionEffect } from "react";
|
|
4
4
|
import { getStylesAtomic } from "./getStylesAtomic";
|
|
5
5
|
import { insertStyleRule, updateInsertedCache } from "./insertStyleRule";
|
|
6
6
|
let added = /* @__PURE__ */ new Set();
|
|
7
|
-
const effect = useInsertionEffect || useLayoutEffect;
|
|
8
7
|
function useStylesAsClassname(styles, disable = false, debug = false) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
if (!useInsertionEffect) {
|
|
9
|
+
return addStylesUsingClassname(disable ? styles : [], debug);
|
|
10
|
+
} else {
|
|
11
|
+
const insertions = [];
|
|
12
|
+
const className = addStylesUsingClassname(disable ? [] : styles, debug, (identifier, rules) => {
|
|
13
|
+
for (const rule of rules) {
|
|
14
|
+
insertions.push({ identifier, rule });
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
17
|
for (const { identifier, rule } of insertions) {
|
|
18
|
-
|
|
18
|
+
updateInsertedCache(identifier, rule);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
useInsertionEffect(() => {
|
|
21
|
+
for (const { identifier, rule } of insertions) {
|
|
22
|
+
insertStyleRule(identifier, rule);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return className;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
__name(useStylesAsClassname, "useStylesAsClassname");
|
|
24
29
|
function addStylesUsingClassname(styles, debug = false, onAdd) {
|
|
File without changes
|
|
File without changes
|
|
@@ -63,7 +63,7 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
63
63
|
if (isObj(variantValue)) {
|
|
64
64
|
variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
|
|
65
65
|
}
|
|
66
|
-
return variantValue;
|
|
66
|
+
return expansions(variantValue);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
let shouldReturn = false;
|
|
@@ -80,9 +80,9 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
if (shouldReturn) {
|
|
83
|
-
return {
|
|
83
|
+
return expansions({
|
|
84
84
|
[key]: value
|
|
85
|
-
};
|
|
85
|
+
});
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}, "createPropMapper");
|
|
@@ -200,6 +200,38 @@ const tokenCategories = {
|
|
|
200
200
|
borderRightColor: true
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
+
const sidesX = ["Left", "Right"];
|
|
204
|
+
const sidesY = ["Top", "Bottom"];
|
|
205
|
+
const sidesXY = [...sidesX, ...sidesY];
|
|
206
|
+
const expand = {
|
|
207
|
+
padding: sidesXY.map((x) => `padding${x}`),
|
|
208
|
+
paddingHorizontal: sidesX.map((x) => `padding${x}`),
|
|
209
|
+
paddingVertical: sidesY.map((x) => `padding${x}`),
|
|
210
|
+
margin: sidesXY.map((x) => `margin${x}`),
|
|
211
|
+
marginHorizontal: sidesX.map((x) => `margin${x}`),
|
|
212
|
+
marginVertical: sidesY.map((x) => `margin${x}`),
|
|
213
|
+
borderWidth: sidesXY.map((x) => `border${x}Width`)
|
|
214
|
+
};
|
|
215
|
+
function expansions(styleObj) {
|
|
216
|
+
var _a, _b;
|
|
217
|
+
for (const key in expand) {
|
|
218
|
+
if (key in styleObj) {
|
|
219
|
+
for (const expandKey of expand[key]) {
|
|
220
|
+
styleObj[expandKey] = styleObj[key];
|
|
221
|
+
}
|
|
222
|
+
delete styleObj[key];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if ("flex" in styleObj) {
|
|
226
|
+
if (typeof styleObj.flex === "number") {
|
|
227
|
+
styleObj.flexGrow = (_a = styleObj.flexGrow) != null ? _a : styleObj.flex;
|
|
228
|
+
styleObj.flexShrink = (_b = styleObj.flexShrink) != null ? _b : 1;
|
|
229
|
+
delete styleObj.flex;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return styleObj;
|
|
233
|
+
}
|
|
234
|
+
__name(expansions, "expansions");
|
|
203
235
|
export {
|
|
204
236
|
createPropMapper
|
|
205
237
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,8 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
const matchRgbaHsla = /(rgba|hsla)\(\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,})\s*\)$/;
|
|
4
4
|
function fixNativeShadow(props) {
|
|
5
|
-
|
|
5
|
+
var _a, _b;
|
|
6
|
+
if (!props.shadowColor || props.shadowColor === "transparent") {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
9
|
if (!props.shadowOffset) {
|
|
@@ -11,10 +12,7 @@ function fixNativeShadow(props) {
|
|
|
11
12
|
height: 0
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const c = `${props.shadowColor}`;
|
|
15
|
+
const c = String(props.shadowColor);
|
|
18
16
|
if ((c[0] === "r" || c[0] === "h") && c[3] === "a") {
|
|
19
17
|
const [_, type, _1, _2, _3, a] = c.match(matchRgbaHsla) || [];
|
|
20
18
|
if (typeof a !== "string") {
|
|
@@ -22,9 +20,9 @@ function fixNativeShadow(props) {
|
|
|
22
20
|
throw new Error(`invalid style`);
|
|
23
21
|
}
|
|
24
22
|
props.shadowColor = `${type.replace("a", "")}(${_1},${_2},${_3})`;
|
|
25
|
-
props.shadowOpacity = +a;
|
|
23
|
+
props.shadowOpacity = (_a = props.shadowOpacity) != null ? _a : +a;
|
|
26
24
|
} else {
|
|
27
|
-
props.shadowOpacity = 1;
|
|
25
|
+
props.shadowOpacity = (_b = props.shadowOpacity) != null ? _b : 1;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
__name(fixNativeShadow, "fixNativeShadow");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { getVariableValue, isVariable } from "@tamagui/core";
|
|
4
|
+
const getButtonSize = /* @__PURE__ */ __name((sizeX = 0.9, sizeY = 0.333) => (val, { tokens, props, fonts }) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6
|
+
const size = (_c = (_b = (_a = tokens.size[val]) != null ? _a : tokens.size["$4"]) != null ? _b : val) != null ? _c : 14;
|
|
7
|
+
const radius = (_e = (_d = tokens.radius[val]) != null ? _d : tokens.radius["$4"]) != null ? _e : size;
|
|
8
|
+
const px = Math.round(+(isVariable(size) ? size.val : size) * sizeX);
|
|
9
|
+
const py = Math.round(+(isVariable(size) ? size.val : size) * sizeY);
|
|
10
|
+
const font = fonts[props.fontFamily] || fonts["$body"];
|
|
11
|
+
const lineHeights = font.lineHeight;
|
|
12
|
+
const lineHeight = (_f = lineHeights[val]) != null ? _f : lineHeights["$4"];
|
|
13
|
+
const minHeight = Math.round(getVariableValue(lineHeight) + py * 2);
|
|
14
|
+
return {
|
|
15
|
+
minHeight,
|
|
16
|
+
paddingHorizontal: props.circular ? 0 : px,
|
|
17
|
+
paddingVertical: props.circular ? 0 : py,
|
|
18
|
+
borderRadius: props.circular ? 1e5 : (_g = props.borderRadius) != null ? _g : radius
|
|
19
|
+
};
|
|
20
|
+
}, "getButtonSize");
|
|
21
|
+
export {
|
|
22
|
+
getButtonSize
|
|
23
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -288,13 +288,6 @@ const getSubStyle = /* @__PURE__ */ __name((styleIn, staticConfig, theme, props,
|
|
|
288
288
|
return styleOut;
|
|
289
289
|
}, "getSubStyle");
|
|
290
290
|
function normalizeStyleObject(style) {
|
|
291
|
-
var _a, _b;
|
|
292
|
-
if (typeof style.flex === "number") {
|
|
293
|
-
const val = style.flex;
|
|
294
|
-
delete style.flex;
|
|
295
|
-
style.flexGrow = (_a = style.flexGrow) != null ? _a : val;
|
|
296
|
-
style.flexShrink = (_b = style.flexShrink) != null ? _b : 1;
|
|
297
|
-
}
|
|
298
291
|
if (!isWeb) {
|
|
299
292
|
fixNativeShadow(style);
|
|
300
293
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { getVariableValue } from "../createVariable";
|
|
4
|
+
const getTextSize = /* @__PURE__ */ __name((val = "$4", { fonts, theme, props }) => {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
const family = getVariableValue(props.fontFamily) || "$body";
|
|
7
|
+
const font = fonts[family] || fonts["$body"];
|
|
8
|
+
if (!font) {
|
|
9
|
+
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const fontFamily = font.family;
|
|
13
|
+
const fontSize = props.fontSize || font.size[val];
|
|
14
|
+
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
15
|
+
const fontWeight = props.fontWeight || font.weight[val];
|
|
16
|
+
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
17
|
+
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
18
|
+
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
19
|
+
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
20
|
+
return {
|
|
21
|
+
color,
|
|
22
|
+
fontStyle,
|
|
23
|
+
textTransform,
|
|
24
|
+
fontFamily,
|
|
25
|
+
fontWeight,
|
|
26
|
+
letterSpacing,
|
|
27
|
+
fontSize,
|
|
28
|
+
lineHeight
|
|
29
|
+
};
|
|
30
|
+
}, "getTextSize");
|
|
31
|
+
export {
|
|
32
|
+
getTextSize
|
|
33
|
+
};
|
|
@@ -79,6 +79,7 @@ function insertStyleRule(identifier, rule) {
|
|
|
79
79
|
return;
|
|
80
80
|
hasInsertedSinceUpdate = true;
|
|
81
81
|
updateInsertedCache(identifier, rule);
|
|
82
|
+
allSelectors[identifier] = process.env.NODE_ENV === "development" ? rule : true;
|
|
82
83
|
sheet == null ? void 0 : sheet.insertRule(rule, sheet.cssRules.length);
|
|
83
84
|
}
|
|
84
85
|
__name(insertStyleRule, "insertStyleRule");
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
5
|
+
let serverHandoffComplete = false;
|
|
6
|
+
let id = 0;
|
|
7
|
+
function genId() {
|
|
8
|
+
return ++id;
|
|
9
|
+
}
|
|
10
|
+
__name(genId, "genId");
|
|
11
|
+
function useId(providedId) {
|
|
12
|
+
var _a;
|
|
13
|
+
if (typeof React.useId === "function") {
|
|
14
|
+
let id3 = React.useId(providedId);
|
|
15
|
+
return providedId != null ? providedId : id3;
|
|
16
|
+
}
|
|
17
|
+
let initialId = providedId != null ? providedId : serverHandoffComplete ? genId() : null;
|
|
18
|
+
let [id2, setId] = React.useState(initialId);
|
|
19
|
+
useIsomorphicLayoutEffect(() => {
|
|
20
|
+
if (id2 === null) {
|
|
21
|
+
setId(genId());
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (serverHandoffComplete === false) {
|
|
26
|
+
serverHandoffComplete = true;
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
return (_a = providedId != null ? providedId : id2) != null ? _a : void 0;
|
|
30
|
+
}
|
|
31
|
+
__name(useId, "useId");
|
|
32
|
+
export {
|
|
33
|
+
useId
|
|
34
|
+
};
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import {
|
|
4
|
-
import { isTouchDevice } from "../constants/platform";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { isTouchDevice, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
5
5
|
const useIsTouchDevice = /* @__PURE__ */ __name(() => {
|
|
6
6
|
const [touchOnly, setTouchOnly] = useState(false);
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
useIsomorphicLayoutEffect(() => {
|
|
8
|
+
if (isTouchDevice) {
|
|
9
9
|
setTouchOnly(true);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
10
|
+
}
|
|
11
|
+
}, []);
|
|
12
12
|
return touchOnly;
|
|
13
13
|
}, "useIsTouchDevice");
|
|
14
14
|
export {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/jsx/index.js
CHANGED
|
@@ -13,31 +13,34 @@ import { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } f
|
|
|
13
13
|
export * from "./constants/constants";
|
|
14
14
|
export * from "./constants/platform";
|
|
15
15
|
export * from "./constants/rnw";
|
|
16
|
+
export * from "./helpers/getButtonSize";
|
|
16
17
|
export * from "./helpers/getExpandedShorthands";
|
|
17
18
|
export * from "./helpers/getSize";
|
|
18
19
|
export * from "./helpers/getSplitStyles";
|
|
19
20
|
export * from "./helpers/getStylesAtomic";
|
|
21
|
+
export * from "./helpers/getTextSize";
|
|
20
22
|
export * from "./helpers/isObj";
|
|
21
23
|
export * from "./helpers/isTamaguiElement";
|
|
22
24
|
export * from "./helpers/matchMedia";
|
|
23
25
|
export * from "./helpers/themeable";
|
|
24
26
|
export * from "./helpers/withStaticProperties";
|
|
25
27
|
export * from "./contexts/ButtonInsideButtonContext";
|
|
26
|
-
export * from "./hooks/useIsTouchDevice";
|
|
27
28
|
export * from "./hooks/useConstant";
|
|
28
|
-
export * from "./hooks/
|
|
29
|
+
export * from "./hooks/useId";
|
|
30
|
+
export * from "./hooks/useIsMounted";
|
|
31
|
+
export * from "./hooks/useIsTouchDevice";
|
|
29
32
|
export * from "./hooks/useMedia";
|
|
33
|
+
export * from "./hooks/usePressable";
|
|
30
34
|
export * from "./hooks/useTheme";
|
|
31
|
-
export * from "./hooks/useIsMounted";
|
|
32
35
|
export * from "./hooks/useUnmountEffect";
|
|
33
|
-
export * from "@tamagui/use-force-update";
|
|
34
36
|
export * from "./views/Stack";
|
|
35
37
|
export * from "./views/Text";
|
|
38
|
+
export * from "./views/TextAncestorContext";
|
|
36
39
|
export * from "./views/Theme";
|
|
37
|
-
export * from "./views/ThemeReset";
|
|
38
40
|
export * from "./views/ThemeInverse";
|
|
39
41
|
export * from "./views/ThemeProvider";
|
|
40
|
-
export * from "./views/
|
|
42
|
+
export * from "./views/ThemeReset";
|
|
43
|
+
export * from "@tamagui/use-force-update";
|
|
41
44
|
export * from "@tamagui/helpers";
|
|
42
45
|
export {
|
|
43
46
|
RNWTextProps,
|
package/dist/jsx/static.js
CHANGED
|
File without changes
|
package/dist/jsx/styled.js
CHANGED
|
@@ -5,14 +5,16 @@ import { createComponent } from "./createComponent";
|
|
|
5
5
|
import { RNComponents } from "./helpers/RNComponents";
|
|
6
6
|
function styled(Component, options, staticExtractionOptions) {
|
|
7
7
|
const staticConfigProps = (() => {
|
|
8
|
+
var _a;
|
|
8
9
|
if (options) {
|
|
9
10
|
const { variants, name, defaultVariants, ...defaultProps } = options;
|
|
10
11
|
if (defaultVariants) {
|
|
11
12
|
Object.assign(defaultProps, defaultVariants);
|
|
12
13
|
}
|
|
13
14
|
const isReactNativeWeb = "staticConfig" in Component ? Component.staticConfig.isReactNativeWeb : RNComponents.has(Component);
|
|
15
|
+
const reactNativeWebComponent = isReactNativeWeb ? ((_a = Component["staticConfig"]) == null ? void 0 : _a.reactNativeWebComponent) || Component : null;
|
|
14
16
|
const isTamagui = !isReactNativeWeb && "staticConfig" in Component;
|
|
15
|
-
const Comp = Component;
|
|
17
|
+
const Comp = reactNativeWebComponent || Component;
|
|
16
18
|
const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false));
|
|
17
19
|
const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false));
|
|
18
20
|
const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false));
|
|
@@ -27,6 +29,7 @@ function styled(Component, options, staticExtractionOptions) {
|
|
|
27
29
|
defaultVariants,
|
|
28
30
|
componentName: name,
|
|
29
31
|
isReactNativeWeb,
|
|
32
|
+
reactNativeWebComponent,
|
|
30
33
|
isInput,
|
|
31
34
|
isText,
|
|
32
35
|
isImage
|
package/dist/jsx/types-rnw.js
CHANGED
|
File without changes
|
package/dist/jsx/types.js
CHANGED
|
File without changes
|