@tamagui/core 1.0.1-beta.40 → 1.0.1-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +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 +71 -29
- 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 +2 -0
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +0 -0
- package/dist/cjs/createTheme.js.map +0 -0
- package/dist/cjs/createTokens.js +1 -1
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +2 -1
- package/dist/cjs/createVariable.js.map +2 -2
- 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/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 +0 -0
- package/dist/cjs/helpers/createPropMapper.js.map +0 -0
- 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 -1
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +0 -0
- package/dist/cjs/helpers/fixNativeShadow.js.map +0 -0
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -0
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -0
- package/dist/cjs/helpers/generateAtomicStyles.js +0 -0
- package/dist/cjs/helpers/generateAtomicStyles.js.map +0 -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 +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +0 -0
- package/dist/cjs/helpers/getSplitStyles.js.map +0 -0
- package/dist/cjs/helpers/getStackSize.js +1 -1
- package/dist/cjs/helpers/getStackSize.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 +0 -0
- package/dist/cjs/helpers/getTextSize.js.map +0 -0
- package/dist/cjs/helpers/getVariantExtras.js +0 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +0 -0
- package/dist/cjs/helpers/insertStyleRule.js +0 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +0 -0
- 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/mergeTransform.js +0 -0
- package/dist/cjs/helpers/mergeTransform.js.map +0 -0
- package/dist/cjs/helpers/nativeGestureHandler.js +0 -0
- package/dist/cjs/helpers/nativeGestureHandler.js.map +0 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js +0 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -0
- package/dist/cjs/helpers/prefixStyles.js +0 -0
- package/dist/cjs/helpers/prefixStyles.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 +0 -0
- package/dist/cjs/hooks/useId.js.map +0 -0
- package/dist/cjs/hooks/useIsMounted.js +0 -0
- package/dist/cjs/hooks/useIsMounted.js.map +0 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +0 -0
- package/dist/cjs/hooks/useIsTouchDevice.js.map +0 -0
- package/dist/cjs/hooks/useMedia.js +0 -0
- package/dist/cjs/hooks/useMedia.js.map +0 -0
- package/dist/cjs/hooks/usePressable.js +0 -0
- package/dist/cjs/hooks/usePressable.js.map +0 -0
- package/dist/cjs/hooks/usePrevious.js +0 -0
- package/dist/cjs/hooks/usePrevious.js.map +0 -0
- package/dist/cjs/hooks/useTheme.js +0 -0
- package/dist/cjs/hooks/useTheme.js.map +0 -0
- package/dist/cjs/hooks/useUnmountEffect.js +0 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +0 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/nativeGestureHandler.native.js +0 -0
- package/dist/cjs/nativeGestureHandler.native.js.map +0 -0
- package/dist/cjs/static.js +0 -0
- package/dist/cjs/static.js.map +0 -0
- package/dist/cjs/styled.js +0 -0
- 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 +3 -9
- package/dist/cjs/views/Slot.js.map +2 -2
- 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 +71 -30
- 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 +2 -0
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +0 -0
- package/dist/esm/createTheme.js.map +0 -0
- package/dist/esm/createTokens.js +1 -1
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +2 -1
- package/dist/esm/createVariable.js.map +2 -2
- 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/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 +0 -0
- package/dist/esm/helpers/createPropMapper.js.map +0 -0
- 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 -4
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -0
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -0
- package/dist/esm/helpers/generateAtomicStyles.js +0 -0
- package/dist/esm/helpers/generateAtomicStyles.js.map +0 -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 +2 -2
- package/dist/esm/helpers/getSplitStyles.js +0 -0
- package/dist/esm/helpers/getSplitStyles.js.map +0 -0
- package/dist/esm/helpers/getStackSize.js +1 -1
- package/dist/esm/helpers/getStackSize.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 +0 -0
- package/dist/esm/helpers/getTextSize.js.map +0 -0
- package/dist/esm/helpers/getVariantExtras.js +0 -0
- package/dist/esm/helpers/getVariantExtras.js.map +0 -0
- package/dist/esm/helpers/insertStyleRule.js +0 -0
- package/dist/esm/helpers/insertStyleRule.js.map +0 -0
- 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/mergeTransform.js +0 -0
- package/dist/esm/helpers/mergeTransform.js.map +0 -0
- package/dist/esm/helpers/nativeGestureHandler.js +0 -0
- package/dist/esm/helpers/nativeGestureHandler.js.map +0 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js +0 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +0 -0
- package/dist/esm/helpers/prefixStyles.js +0 -0
- package/dist/esm/helpers/prefixStyles.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 +0 -0
- package/dist/esm/hooks/useId.js.map +0 -0
- package/dist/esm/hooks/useIsMounted.js +0 -0
- package/dist/esm/hooks/useIsMounted.js.map +0 -0
- package/dist/esm/hooks/useIsTouchDevice.js +0 -0
- package/dist/esm/hooks/useIsTouchDevice.js.map +0 -0
- package/dist/esm/hooks/useMedia.js +0 -0
- package/dist/esm/hooks/useMedia.js.map +0 -0
- package/dist/esm/hooks/usePressable.js +0 -0
- package/dist/esm/hooks/usePressable.js.map +0 -0
- package/dist/esm/hooks/usePrevious.js +0 -0
- package/dist/esm/hooks/usePrevious.js.map +0 -0
- package/dist/esm/hooks/useTheme.js +0 -0
- package/dist/esm/hooks/useTheme.js.map +0 -0
- package/dist/esm/hooks/useUnmountEffect.js +0 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +0 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/nativeGestureHandler.native.js +0 -0
- package/dist/esm/nativeGestureHandler.native.js.map +0 -0
- package/dist/esm/static.js +0 -0
- package/dist/esm/static.js.map +0 -0
- package/dist/esm/styled.js +0 -0
- 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 +3 -10
- package/dist/esm/views/Slot.js.map +2 -2
- 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 +67 -26
- package/dist/jsx/createFont.js +0 -0
- package/dist/jsx/createShorthands.js +0 -0
- package/dist/jsx/createTamagui.js +2 -0
- package/dist/jsx/createTheme.js +0 -0
- package/dist/jsx/createTokens.js +1 -1
- package/dist/jsx/createVariable.js +2 -1
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -0
- package/dist/jsx/helpers/areEqualSets.js +0 -0
- package/dist/jsx/helpers/createMediaStyle.js +0 -0
- package/dist/jsx/helpers/createPropMapper.js +0 -0
- package/dist/jsx/helpers/createShallowUpdate.js +0 -0
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -0
- package/dist/jsx/helpers/extendStaticConfig.js +0 -4
- package/dist/jsx/helpers/fixNativeShadow.js +0 -0
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -0
- package/dist/jsx/helpers/generateAtomicStyles.js +0 -0
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -0
- package/dist/jsx/helpers/getSize.js +0 -0
- package/dist/jsx/helpers/getSplitStyles.js +0 -0
- package/dist/jsx/helpers/getStackSize.js +1 -1
- package/dist/jsx/helpers/getStylesAtomic.js +0 -0
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -0
- package/dist/jsx/helpers/getTextSize.js +0 -0
- package/dist/jsx/helpers/getVariantExtras.js +0 -0
- package/dist/jsx/helpers/insertStyleRule.js +0 -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/mergeTransform.js +0 -0
- package/dist/jsx/helpers/nativeGestureHandler.js +0 -0
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -0
- package/dist/jsx/helpers/prefixStyles.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 +0 -0
- package/dist/jsx/hooks/useIsMounted.js +0 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -0
- package/dist/jsx/hooks/useMedia.js +0 -0
- 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 +1 -0
- package/dist/jsx/nativeGestureHandler.native.js +0 -0
- package/dist/jsx/static.js +0 -0
- package/dist/jsx/styled.js +0 -0
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +3 -7
- 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 +6 -6
- package/types/createComponent.d.ts +23 -13
- package/types/createComponent.d.ts.map +1 -1
- package/types/createVariable.d.ts +3 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/getSize.d.ts +1 -1
- package/types/helpers/getSize.d.ts.map +1 -1
- package/types/helpers/getStackSize.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/styled.d.ts +2 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +10 -8
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getStackSize.ts"],
|
|
4
|
-
"sourcesContent": ["import { VariantSpreadExtras, getVariableValue, isVariable } from '@tamagui/core'\n\nimport { SizeTokens } from '../types'\n\n// for use in sizable things\n\ntype ScaleProps = { sizeX: number; sizeY: number }\n\nexport type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens' | 'props' | 'fonts'>\n\nexport const getSizeScaledToFont = (\n val: string | number,\n { sizeX = 1, sizeY = 1 }: ScaleProps,\n { tokens, props, fonts }: ScaleVariantExtras\n) => {\n const size = tokens.size[val] ?? val ?? tokens.size['$4'] ?? 14\n const radius = tokens.radius[val] ?? tokens.radius['$4'] ?? size\n const sizePx = +(isVariable(size) ? size.val : size)\n const scaleSize = isVariable(size) ? 2 : 1\n const px = Math.round(sizePx * sizeX)\n const py = Math.round(sizePx * sizeY)\n // keep buttons height aligned to the font used\n const font = fonts[props.fontFamily] || fonts['$body']\n const lineHeights = font.lineHeight\n const lineHeight = lineHeights[val] ?? lineHeights['$4']\n const minHeight = Math.round(getVariableValue(lineHeight) + py * scaleSize)\n return {\n px,\n py,\n radius,\n size,\n lineHeight,\n minHeight,\n }\n}\n\nexport const createGetStackSize =\n (scale: ScaleProps) => (val: SizeTokens | number, extras: VariantSpreadExtras<any>) => {\n const { props } = extras\n const { radius, minHeight, px, py } = getSizeScaledToFont(val, scale, extras)\n return {\n minHeight,\n borderRadius: props.circular ? 100_000 : props.borderRadius ?? radius,\n paddingHorizontal: props.circular ? 0 : px,\n paddingVertical: props.circular ? 0 : py,\n }\n }\n\nexport const buttonScaling = { sizeX: 0.
|
|
5
|
-
"mappings": ";;AAAA;AAUO,MAAM,sBAAsB,wBACjC,KACA,EAAE,QAAQ,GAAG,QAAQ,KACrB,EAAE,QAAQ,OAAO,YACd;AAdL;AAeE,QAAM,OAAO,yBAAO,KAAK,SAAZ,YAAoB,QAApB,YAA2B,OAAO,KAAK,UAAvC,YAAgD;AAC7D,QAAM,SAAS,mBAAO,OAAO,SAAd,YAAsB,OAAO,OAAO,UAApC,YAA6C;AAC5D,QAAM,SAAS,CAAE,YAAW,IAAI,IAAI,KAAK,MAAM;AAC/C,QAAM,YAAY,WAAW,IAAI,IAAI,IAAI;AACzC,QAAM,KAAK,KAAK,MAAM,SAAS,KAAK;AACpC,QAAM,KAAK,KAAK,MAAM,SAAS,KAAK;AAEpC,QAAM,OAAO,MAAM,MAAM,eAAe,MAAM;AAC9C,QAAM,cAAc,KAAK;AACzB,QAAM,aAAa,kBAAY,SAAZ,YAAoB,YAAY;AACnD,QAAM,YAAY,KAAK,MAAM,iBAAiB,UAAU,IAAI,KAAK,SAAS;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF,GAxBmC;AA0B5B,MAAM,qBACX,wBAAC,UAAsB,CAAC,KAA0B,WAAqC;AArCzF;AAsCI,QAAM,EAAE,UAAU;AAClB,QAAM,EAAE,QAAQ,WAAW,IAAI,OAAO,oBAAoB,KAAK,OAAO,MAAM;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,cAAc,MAAM,WAAW,MAAU,YAAM,iBAAN,YAAsB;AAAA,IAC/D,mBAAmB,MAAM,WAAW,IAAI;AAAA,IACxC,iBAAiB,MAAM,WAAW,IAAI;AAAA,EACxC;AACF,GATA;AAWK,MAAM,gBAAgB,EAAE,OAAO,
|
|
4
|
+
"sourcesContent": ["import { VariantSpreadExtras, getVariableValue, isVariable } from '@tamagui/core'\n\nimport { SizeTokens } from '../types'\n\n// for use in sizable things\n\ntype ScaleProps = { sizeX: number; sizeY: number }\n\nexport type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens' | 'props' | 'fonts'>\n\nexport const getSizeScaledToFont = (\n val: string | number,\n { sizeX = 1, sizeY = 1 }: ScaleProps,\n { tokens, props, fonts }: ScaleVariantExtras\n) => {\n const size = tokens.size[val] ?? val ?? tokens.size['$4'] ?? 14\n const radius = tokens.radius[val] ?? tokens.radius['$4'] ?? size\n const sizePx = +(isVariable(size) ? size.val : size)\n const scaleSize = isVariable(size) ? 2 : 1\n const px = Math.round(sizePx * sizeX)\n const py = Math.round(sizePx * sizeY)\n // keep buttons height aligned to the font used\n const font = fonts[props.fontFamily] || fonts['$body']\n const lineHeights = font.lineHeight\n const lineHeight = lineHeights[val] ?? lineHeights['$4']\n const minHeight = Math.round(getVariableValue(lineHeight) + py * scaleSize)\n return {\n px,\n py,\n radius,\n size,\n lineHeight,\n minHeight,\n }\n}\n\nexport const createGetStackSize =\n (scale: ScaleProps) => (val: SizeTokens | number, extras: VariantSpreadExtras<any>) => {\n const { props } = extras\n const { radius, minHeight, px, py } = getSizeScaledToFont(val, scale, extras)\n return {\n minHeight,\n borderRadius: props.circular ? 100_000 : props.borderRadius ?? radius,\n paddingHorizontal: props.circular ? 0 : px,\n paddingVertical: props.circular ? 0 : py,\n }\n }\n\nexport const buttonScaling = { sizeX: 0.75, sizeY: 0.333 }\nexport const getButtonSize = createGetStackSize(buttonScaling)\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAUO,MAAM,sBAAsB,wBACjC,KACA,EAAE,QAAQ,GAAG,QAAQ,KACrB,EAAE,QAAQ,OAAO,YACd;AAdL;AAeE,QAAM,OAAO,yBAAO,KAAK,SAAZ,YAAoB,QAApB,YAA2B,OAAO,KAAK,UAAvC,YAAgD;AAC7D,QAAM,SAAS,mBAAO,OAAO,SAAd,YAAsB,OAAO,OAAO,UAApC,YAA6C;AAC5D,QAAM,SAAS,CAAE,YAAW,IAAI,IAAI,KAAK,MAAM;AAC/C,QAAM,YAAY,WAAW,IAAI,IAAI,IAAI;AACzC,QAAM,KAAK,KAAK,MAAM,SAAS,KAAK;AACpC,QAAM,KAAK,KAAK,MAAM,SAAS,KAAK;AAEpC,QAAM,OAAO,MAAM,MAAM,eAAe,MAAM;AAC9C,QAAM,cAAc,KAAK;AACzB,QAAM,aAAa,kBAAY,SAAZ,YAAoB,YAAY;AACnD,QAAM,YAAY,KAAK,MAAM,iBAAiB,UAAU,IAAI,KAAK,SAAS;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF,GAxBmC;AA0B5B,MAAM,qBACX,wBAAC,UAAsB,CAAC,KAA0B,WAAqC;AArCzF;AAsCI,QAAM,EAAE,UAAU;AAClB,QAAM,EAAE,QAAQ,WAAW,IAAI,OAAO,oBAAoB,KAAK,OAAO,MAAM;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,cAAc,MAAM,WAAW,MAAU,YAAM,iBAAN,YAAsB;AAAA,IAC/D,mBAAmB,MAAM,WAAW,IAAI;AAAA,IACxC,iBAAiB,MAAM,WAAW,IAAI;AAAA,EACxC;AACF,GATA;AAWK,MAAM,gBAAgB,EAAE,OAAO,MAAM,OAAO,MAAM;AAClD,MAAM,gBAAgB,mBAAmB,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/esm/hooks/useId.js
CHANGED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/esm/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export * from "./hooks/useMedia";
|
|
|
35
35
|
export * from "./hooks/usePressable";
|
|
36
36
|
export * from "./hooks/useTheme";
|
|
37
37
|
export * from "./hooks/useUnmountEffect";
|
|
38
|
+
export * from "./views/Slot";
|
|
38
39
|
export * from "./views/Stack";
|
|
39
40
|
export * from "./views/Text";
|
|
40
41
|
export * from "./views/TextAncestorContext";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport { createTokens } from './createTokens'\nexport * from './createVariable'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport * from './constants/rnw'\n\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/getTextSize'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useUnmountEffect'\n\nexport * from './views/Stack'\nexport * from './views/Text'\nexport * from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/helpers'\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;",
|
|
4
|
+
"sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport { createTokens } from './createTokens'\nexport * from './createVariable'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport * from './constants/rnw'\n\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/getTextSize'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport * from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/helpers'\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
File without changes
|
|
File without changes
|
package/dist/esm/static.js
CHANGED
|
File without changes
|
package/dist/esm/static.js.map
CHANGED
|
File without changes
|
package/dist/esm/styled.js
CHANGED
|
File without changes
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> |
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AACA;
|
|
4
|
+
"sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\nimport { Stack } from './views/Stack'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// breaking...\n// TODO see core/types.ts bug\n\n// export const XStack = styled(Stack, {\n// variants: {\n// horizontal: {\n// true: {\n// // flexDirection: 'row',\n// width: 0,\n// },\n// },\n// },\n// })\n\n// const Separator = styled(Stack, {\n// variants: {\n// vertical: {\n// true: {\n// flexDirection: 'row',\n// },\n// },\n// },\n// <--- have to add as const to get working???\n// })\n\n// type props = GetProps<typeof XStack>\n// type variants = typeof XStack extends TamaguiComponent<any, infer Variants> ? Variants : never\n// type variants2 = typeof Separator extends TamaguiComponent<any, infer Variants> ? Variants : never\n\n// const x = <XStack horizontal />\n// const x2 = <Separator vertical />\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AACA;AAqBO,gBAIL,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAtCnC;AAuCI,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,aAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAElF,YAAM,OAA8B;AAAA,WAC/B;AAAA,WACC,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AA7FgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/types-rnw.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/esm/types.js
CHANGED
|
File without changes
|
package/dist/esm/types.js.map
CHANGED
|
File without changes
|
package/dist/esm/views/Slot.js
CHANGED
|
@@ -4,14 +4,6 @@ import { composeRefs } from "@tamagui/compose-refs";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
const Slot = React.forwardRef((props, forwardedRef) => {
|
|
6
6
|
const { children, ...slotProps } = props;
|
|
7
|
-
if (React.Children.toArray(children).some(isSlottable)) {
|
|
8
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, React.Children.map(children, (child) => {
|
|
9
|
-
return isSlottable(child) ? /* @__PURE__ */ React.createElement(SlotClone, {
|
|
10
|
-
...slotProps,
|
|
11
|
-
ref: forwardedRef
|
|
12
|
-
}, child.props.children) : child;
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
7
|
return /* @__PURE__ */ React.createElement(SlotClone, {
|
|
16
8
|
...slotProps,
|
|
17
9
|
ref: forwardedRef
|
|
@@ -21,10 +13,11 @@ Slot.displayName = "Slot";
|
|
|
21
13
|
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
22
14
|
const { children, ...slotProps } = props;
|
|
23
15
|
if (React.isValidElement(children)) {
|
|
24
|
-
|
|
16
|
+
const childProps = {
|
|
25
17
|
...mergeProps(children, slotProps),
|
|
26
18
|
ref: composeRefs(forwardedRef, children.ref)
|
|
27
|
-
}
|
|
19
|
+
};
|
|
20
|
+
return React.cloneElement(children, childProps);
|
|
28
21
|
}
|
|
29
22
|
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
30
23
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Slot.tsx"],
|
|
4
|
-
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n
|
|
5
|
-
"mappings": ";;AAEA;AACA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;
|
|
4
|
+
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child)\n}\n\nconst pressMap = {\n onPress: 'onClick',\n onPressOut: 'onMouseOut',\n onPressIn: 'onMouseIn',\n}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = /^on[A-Z]/.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue?.(...args)\n slotPropValue?.(...args)\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n"],
|
|
5
|
+
"mappings": ";;AAEA;AACA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;AACnC,SACE,oCAAC;AAAA,OAAc;AAAA,IAAW,KAAK;AAAA,KAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAM,EAAE,aAAa,cAAc;AAEnC,MAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,UAAM,aAAa;AAAA,SACd,WAAW,UAAU,SAAS;AAAA,MACjC,KAAK,YAAY,cAAe,SAAiB,GAAG;AAAA,IACtD;AACA,WAAO,MAAM,aAAa,UAAU,UAAU;AAAA,EAChD;AAEA,SAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAC1E,CAAC;AAED,UAAU,cAAc;AAMjB,MAAM,YAAY,wBAAC,EAAE,eAA8C;AACxE,SAAO,0DAAG,QAAS;AACrB,GAFyB;AAQzB,qBAAqB,OAAqD;AACxE,SAAO,MAAM,eAAe,KAAK;AACnC;AAFS;AAIT,MAAM,WAAW;AAAA,EACf,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AACb;AAEA,oBAAoB,OAAY,WAAqB;AACnD,QAAM,aAAa,MAAM;AAGzB,QAAM,gBAAgB,KAAK,WAAW;AAEtC,QAAM,cAAc,OAAO,MAAM,SAAS;AAE1C,MAAI,aAAa;AACf,eAAW,OAAO,UAAU;AAC1B,UAAI,OAAO,WAAW;AACpB,kBAAU,SAAS,QAAQ,UAAU;AACrC,eAAO,UAAU;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEA,WAAS,YAAY,YAAY;AAC/B,UAAM,gBAAgB,UAAU;AAChC,UAAM,iBAAiB,WAAW;AAElC,QAAI,eAAe,SAAS,WAAW;AACrC,iBAAW,SAAS;AACpB,aAAO,cAAc;AAAA,IACvB;AAEA,UAAM,YAAY,WAAW,KAAK,QAAQ;AAE1C,QAAI,WAAW;AACb,oBAAc,YAAY,IAAI,SAAoB;AAChD,yDAAiB,GAAG;AACpB,uDAAgB,GAAG;AAAA,MACrB;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,YAAY,KAAK,kBAAkB,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,KAAK,cAAc,cAAc;AAC1C;AA3CS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/views/Stack.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/esm/views/Text.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/esm/views/Theme.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/jsx/Tamagui.js
CHANGED
|
File without changes
|
package/dist/jsx/ThemeContext.js
CHANGED
|
File without changes
|
package/dist/jsx/ThemeManager.js
CHANGED
|
File without changes
|
package/dist/jsx/conf.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -97,7 +97,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
97
97
|
props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props;
|
|
98
98
|
const { Component, isText, isZStack } = staticConfig;
|
|
99
99
|
const componentName = props.componentName || staticConfig.componentName;
|
|
100
|
-
const componentClassName = props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
100
|
+
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
101
101
|
if (process.env.NODE_ENV === "development") {
|
|
102
102
|
if (props["debug"]) {
|
|
103
103
|
console.log("\u26A0\uFE0F", componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
|
|
@@ -149,6 +149,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
149
149
|
onMouseEnter,
|
|
150
150
|
onMouseLeave,
|
|
151
151
|
hrefAttrs,
|
|
152
|
+
separator,
|
|
152
153
|
onClick,
|
|
153
154
|
theme: _themeProp,
|
|
154
155
|
defaultVariants,
|
|
@@ -526,7 +527,14 @@ function createComponent(configIn, ParentComponent) {
|
|
|
526
527
|
if (process.env.NODE_ENV === "development" && props["debug"]) {
|
|
527
528
|
console.log(" \xBB className", { splitStyles, style: style2, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
|
|
528
529
|
}
|
|
529
|
-
|
|
530
|
+
if (staticConfig.isReactNativeWeb) {
|
|
531
|
+
viewProps.dataSet = {
|
|
532
|
+
...viewProps.dataSet,
|
|
533
|
+
className
|
|
534
|
+
};
|
|
535
|
+
} else {
|
|
536
|
+
viewProps.className = className;
|
|
537
|
+
}
|
|
530
538
|
viewProps.style = style2;
|
|
531
539
|
} else {
|
|
532
540
|
viewProps.style = styles;
|
|
@@ -603,25 +611,22 @@ function createComponent(configIn, ParentComponent) {
|
|
|
603
611
|
onPress == null ? void 0 : onPress(e);
|
|
604
612
|
} : null
|
|
605
613
|
} : null;
|
|
606
|
-
|
|
614
|
+
let childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
|
|
615
|
+
separator,
|
|
607
616
|
children,
|
|
608
617
|
space,
|
|
609
618
|
direction: props.spaceDirection || "both",
|
|
610
619
|
isZStack
|
|
611
620
|
}), getThemeManagerIfChanged(theme));
|
|
612
621
|
let content;
|
|
613
|
-
if (isWeb) {
|
|
614
|
-
if (staticConfig.isReactNativeWeb) {
|
|
615
|
-
viewProps.dataSet = {
|
|
616
|
-
...viewProps.dataSet,
|
|
617
|
-
className: viewProps.className
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
622
|
if (asChild) {
|
|
622
623
|
elementType = Slot;
|
|
623
|
-
|
|
624
|
-
|
|
624
|
+
viewProps = {
|
|
625
|
+
...viewProps,
|
|
626
|
+
onPress,
|
|
627
|
+
onPressIn,
|
|
628
|
+
onPressOut
|
|
629
|
+
};
|
|
625
630
|
}
|
|
626
631
|
if (isWeb) {
|
|
627
632
|
const [pressableProps] = usePressable(events ? {
|
|
@@ -750,6 +755,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
750
755
|
return res;
|
|
751
756
|
}
|
|
752
757
|
__name(createComponent, "createComponent");
|
|
758
|
+
const Unspaced = /* @__PURE__ */ __name((props) => {
|
|
759
|
+
return props.children;
|
|
760
|
+
}, "Unspaced");
|
|
761
|
+
Unspaced["isUnspaced"] = true;
|
|
753
762
|
const Spacer = createComponent({
|
|
754
763
|
memo: true,
|
|
755
764
|
componentName: "Spacer",
|
|
@@ -796,14 +805,16 @@ function spacedChildren({
|
|
|
796
805
|
children,
|
|
797
806
|
space,
|
|
798
807
|
direction,
|
|
799
|
-
spaceFlex
|
|
808
|
+
spaceFlex,
|
|
809
|
+
separator
|
|
800
810
|
}) {
|
|
801
|
-
|
|
811
|
+
const hasSpace = !!(space || spaceFlex);
|
|
812
|
+
const hasSeparator = !(separator === void 0 || separator === null);
|
|
813
|
+
if (!hasSpace && !hasSeparator) {
|
|
802
814
|
return children;
|
|
803
815
|
}
|
|
804
|
-
const childrenList =
|
|
805
|
-
|
|
806
|
-
if (len <= 1) {
|
|
816
|
+
const childrenList = Children.toArray(children);
|
|
817
|
+
if (childrenList.length <= 1) {
|
|
807
818
|
return childrenList;
|
|
808
819
|
}
|
|
809
820
|
const final = [];
|
|
@@ -815,20 +826,49 @@ function spacedChildren({
|
|
|
815
826
|
final.push(<Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>);
|
|
816
827
|
}
|
|
817
828
|
const next = childrenList[index + 1];
|
|
818
|
-
if (next && !
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
829
|
+
if (next && !isUnspaced(next)) {
|
|
830
|
+
if (separator) {
|
|
831
|
+
if (hasSpace) {
|
|
832
|
+
final.push(createSpacer({
|
|
833
|
+
key: `_${index}_before_sep_spacer`,
|
|
834
|
+
direction,
|
|
835
|
+
space,
|
|
836
|
+
spaceFlex
|
|
837
|
+
}));
|
|
838
|
+
}
|
|
839
|
+
final.push(React.isValidElement(separator) ? React.cloneElement(separator, { key: `sep_${index}` }) : separator);
|
|
840
|
+
if (hasSpace) {
|
|
841
|
+
final.push(createSpacer({
|
|
842
|
+
key: `_${index}_after_sep_spacer`,
|
|
843
|
+
direction,
|
|
844
|
+
space,
|
|
845
|
+
spaceFlex
|
|
846
|
+
}));
|
|
847
|
+
}
|
|
848
|
+
} else {
|
|
849
|
+
final.push(createSpacer({
|
|
850
|
+
key: `_${index}_spacer`,
|
|
851
|
+
direction,
|
|
852
|
+
space,
|
|
853
|
+
spaceFlex
|
|
854
|
+
}));
|
|
855
|
+
}
|
|
822
856
|
}
|
|
823
857
|
}
|
|
824
858
|
return final;
|
|
825
859
|
}
|
|
826
860
|
__name(spacedChildren, "spacedChildren");
|
|
827
|
-
function
|
|
828
|
-
|
|
829
|
-
|
|
861
|
+
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
862
|
+
return <Spacer key={key} direction={direction === "both" ? void 0 : direction === "row" || direction === "row-reverse" ? "horizontal" : "vertical"} size={space} {...spaceFlex && {
|
|
863
|
+
flex: spaceFlex
|
|
864
|
+
}} />;
|
|
865
|
+
}
|
|
866
|
+
__name(createSpacer, "createSpacer");
|
|
867
|
+
function isUnspaced(child) {
|
|
868
|
+
var _a, _b;
|
|
869
|
+
return ((_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) || ((_b = child == null ? void 0 : child["type"]) == null ? void 0 : _b["isUnspaced"]);
|
|
830
870
|
}
|
|
831
|
-
__name(
|
|
871
|
+
__name(isUnspaced, "isUnspaced");
|
|
832
872
|
function AbsoluteFill(props) {
|
|
833
873
|
return isWeb ? <div style={{
|
|
834
874
|
position: "absolute",
|
|
@@ -860,6 +900,7 @@ const accessibilityRoleToWebRole = {
|
|
|
860
900
|
export {
|
|
861
901
|
AbsoluteFill,
|
|
862
902
|
Spacer,
|
|
903
|
+
Unspaced,
|
|
863
904
|
createComponent,
|
|
864
905
|
mouseUps,
|
|
865
906
|
spacedChildren
|
package/dist/jsx/createFont.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -189,12 +189,14 @@ function ensureThemeVariable(theme, key) {
|
|
|
189
189
|
const val = theme[key];
|
|
190
190
|
if (!isVariable(val)) {
|
|
191
191
|
theme[key] = createVariable({
|
|
192
|
+
key,
|
|
192
193
|
name: key,
|
|
193
194
|
val
|
|
194
195
|
});
|
|
195
196
|
} else {
|
|
196
197
|
if (val.name !== key) {
|
|
197
198
|
theme[key] = createVariable({
|
|
199
|
+
key,
|
|
198
200
|
name: key,
|
|
199
201
|
val: val.val
|
|
200
202
|
});
|
package/dist/jsx/createTheme.js
CHANGED
|
File without changes
|
package/dist/jsx/createTokens.js
CHANGED
|
@@ -17,7 +17,7 @@ const mapTokensToVariables = /* @__PURE__ */ __name((tokens, parentPath = "") =>
|
|
|
17
17
|
if (val && typeof val === "object") {
|
|
18
18
|
res[key] = mapTokensToVariables(tokens[key], name);
|
|
19
19
|
} else {
|
|
20
|
-
res[key] = createVariable({ val, name });
|
|
20
|
+
res[key] = createVariable({ val, name, key });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
return res;
|
|
@@ -4,10 +4,11 @@ var _a;
|
|
|
4
4
|
import { isWeb } from "./constants/platform";
|
|
5
5
|
const IS_VARIABLE_SYMBOL = "__isVariable__";
|
|
6
6
|
class Variable {
|
|
7
|
-
constructor({ val, name }) {
|
|
7
|
+
constructor({ val, name, key }) {
|
|
8
8
|
this[_a] = true;
|
|
9
9
|
this.val = isVariable(val) ? val.val : val;
|
|
10
10
|
this.name = name;
|
|
11
|
+
this.key = key;
|
|
11
12
|
this.variable = isWeb ? createCSSVariable(name) : this.val;
|
|
12
13
|
}
|
|
13
14
|
toString() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|