@tamagui/core 1.0.0-alpha.9 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +69 -0
- package/dist/cjs/Tamagui.js.map +7 -0
- package/dist/cjs/ThemeContext.js +29 -0
- package/dist/cjs/ThemeContext.js.map +7 -0
- package/dist/cjs/ThemeManager.js +211 -0
- package/dist/cjs/ThemeManager.js.map +7 -0
- package/dist/cjs/conf.js +64 -0
- package/dist/cjs/conf.js.map +7 -0
- package/dist/cjs/constants/constants.js +21 -15
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/constants/platform.js +33 -18
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/pseudos.js +19 -3
- package/dist/cjs/constants/pseudos.js.map +1 -1
- package/dist/cjs/constants/rnw.js +21 -3
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +29 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +7 -0
- package/dist/cjs/createComponent.js +371 -225
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +15 -15
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createShorthands.js +19 -3
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +156 -122
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +15 -28
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +19 -22
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +49 -19
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/defaultComponentState.js +1 -0
- package/dist/{helpers/pseudos.js.map → cjs/defaultComponentState.js.map} +0 -0
- package/dist/cjs/helpers/RNComponents.js +38 -0
- package/dist/cjs/helpers/RNComponents.js.map +7 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +37 -29
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/cjs/helpers/areEqualSets.js +38 -0
- package/dist/cjs/helpers/areEqualSets.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +19 -21
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +157 -119
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +55 -0
- package/dist/cjs/helpers/createShallowUpdate.js.map +7 -0
- package/dist/cjs/helpers/createTamaguiProvider.js +45 -26
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +27 -27
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +19 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/fixNativeShadow.native.js +42 -22
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/cjs/helpers/getExpandedShorthands.js +41 -0
- package/dist/cjs/helpers/getExpandedShorthands.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +35 -0
- package/dist/cjs/helpers/getSize.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +225 -98
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +116 -56
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +19 -3
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeParentClassName.js +33 -0
- package/dist/cjs/helpers/getThemeParentClassName.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +101 -25
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +19 -3
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +15 -15
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.js +19 -3
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +16 -13
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.js +40 -0
- package/dist/cjs/helpers/proxyThemeVariables.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +29 -24
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/validate.js +88 -47
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/helpers/withStaticProperties.js +32 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +7 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js +39 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +15 -15
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +146 -18
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +41 -0
- package/dist/cjs/hooks/useIsMounted.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +39 -0
- package/dist/cjs/hooks/useIsTouchDevice.js.map +7 -0
- package/dist/cjs/hooks/useMedia.js +54 -59
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js +15 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +175 -67
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +33 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +7 -0
- package/dist/cjs/index.js +71 -43
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/static/postProcessStyles.js +15 -15
- package/dist/cjs/static/postProcessStyles.js.map +1 -1
- package/dist/cjs/static.js +26 -27
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +42 -20
- package/dist/cjs/styled.js.map +3 -3
- package/dist/cjs/tamagui-base.css +11 -0
- package/dist/cjs/tamagui-base.css.map +7 -0
- package/dist/cjs/types-rnw.js +16 -0
- package/dist/cjs/types-rnw.js.map +7 -0
- package/dist/cjs/types.js +14 -2
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/views/Animated.js +20 -17
- package/dist/cjs/views/Animated.js.map +1 -1
- package/dist/cjs/views/Stack.js +17 -16
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/Text.js +23 -21
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +25 -21
- package/dist/cjs/views/TextAncestorContext.js.map +2 -2
- package/dist/cjs/views/Theme.js +36 -64
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeContext.js +15 -15
- package/dist/cjs/views/ThemeContext.js.map +1 -1
- package/dist/cjs/views/ThemeInverse.js +20 -16
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeManagerContext.js +19 -18
- package/dist/cjs/views/ThemeManagerContext.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +37 -37
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +63 -0
- package/dist/cjs/views/ThemeReset.js.map +7 -0
- package/dist/esm/Tamagui.js +42 -0
- package/dist/esm/Tamagui.js.map +7 -0
- package/dist/{views → esm}/ThemeContext.js +0 -0
- package/dist/esm/ThemeContext.js.map +7 -0
- package/dist/esm/ThemeManager.js +187 -0
- package/dist/esm/ThemeManager.js.map +7 -0
- package/dist/esm/conf.js +36 -0
- package/dist/esm/conf.js.map +7 -0
- package/dist/{constants → esm/constants}/constants.js +4 -0
- package/dist/esm/constants/constants.js.map +7 -0
- package/dist/{constants → esm/constants}/platform.js +8 -1
- package/dist/esm/constants/platform.js.map +7 -0
- package/dist/{constants → esm/constants}/pseudos.js +0 -0
- package/dist/{constants → esm/constants}/pseudos.js.map +2 -2
- package/dist/{constants → esm/constants}/rnw.js +2 -0
- package/dist/esm/constants/rnw.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +6 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +7 -0
- package/dist/esm/createComponent.js +606 -0
- package/dist/esm/createComponent.js.map +7 -0
- package/dist/{createFont.js → esm/createFont.js} +0 -0
- package/dist/{createFont.js.map → esm/createFont.js.map} +2 -2
- package/dist/{createShorthands.js → esm/createShorthands.js} +0 -0
- package/dist/{createShorthands.js.map → esm/createShorthands.js.map} +2 -2
- package/dist/esm/createTamagui.js +202 -0
- package/dist/esm/createTamagui.js.map +7 -0
- package/dist/esm/createTheme.js +7 -0
- package/dist/esm/createTheme.js.map +7 -0
- package/dist/{createTokens.js → esm/createTokens.js} +2 -6
- package/dist/esm/createTokens.js.map +7 -0
- package/dist/esm/createVariable.js +49 -0
- package/dist/esm/createVariable.js.map +7 -0
- package/dist/esm/defaultComponentState.js +1 -0
- package/dist/{types.js.map → esm/defaultComponentState.js.map} +0 -0
- package/dist/esm/helpers/RNComponents.js +12 -0
- package/dist/esm/helpers/RNComponents.js.map +7 -0
- package/dist/{helpers → esm/helpers}/addStylesUsingClassname.js +20 -13
- package/dist/esm/helpers/addStylesUsingClassname.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +16 -0
- package/dist/esm/helpers/areEqualSets.js.map +7 -0
- package/dist/{helpers → esm/helpers}/createMediaStyle.js +3 -6
- package/dist/esm/helpers/createMediaStyle.js.map +7 -0
- package/dist/esm/helpers/createPropMapper.js +206 -0
- package/dist/esm/helpers/createPropMapper.js.map +7 -0
- package/dist/esm/helpers/createShallowUpdate.js +19 -0
- package/dist/esm/helpers/createShallowUpdate.js.map +7 -0
- package/dist/esm/helpers/createTamaguiProvider.js +40 -0
- package/dist/esm/helpers/createTamaguiProvider.js.map +7 -0
- package/dist/{helpers → esm/helpers}/extendStaticConfig.js +17 -14
- package/dist/esm/helpers/extendStaticConfig.js.map +7 -0
- package/dist/{helpers → esm/helpers}/fixNativeShadow.js +0 -0
- package/dist/{helpers → esm/helpers}/fixNativeShadow.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.native.js +34 -0
- package/dist/esm/helpers/fixNativeShadow.native.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +19 -0
- package/dist/esm/helpers/getExpandedShorthands.js.map +7 -0
- package/dist/esm/helpers/getSize.js +13 -0
- package/dist/esm/helpers/getSize.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +278 -0
- package/dist/esm/helpers/getSplitStyles.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +131 -0
- package/dist/esm/helpers/getStylesAtomic.js.map +7 -0
- package/dist/{helpers → esm/helpers}/getStylesAtomic.native.js +0 -0
- package/dist/{helpers → esm/helpers}/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/getThemeParentClassName.js +11 -0
- package/dist/esm/helpers/getThemeParentClassName.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +94 -0
- package/dist/esm/helpers/insertStyleRule.js.map +7 -0
- package/dist/{helpers → esm/helpers}/isObj.js +0 -0
- package/dist/{helpers → esm/helpers}/isObj.js.map +2 -2
- package/dist/{helpers → esm/helpers}/isTamaguiElement.js +2 -1
- package/dist/{helpers → esm/helpers}/isTamaguiElement.js.map +2 -2
- package/dist/{helpers → esm/helpers}/matchMedia.js +0 -0
- package/dist/{helpers → esm/helpers}/matchMedia.js.map +2 -2
- package/dist/{helpers → esm/helpers}/matchMedia.native.js +0 -0
- package/dist/{helpers → esm/helpers}/matchMedia.native.js.map +2 -2
- package/dist/esm/helpers/proxyThemeVariables.js +18 -0
- package/dist/esm/helpers/proxyThemeVariables.js.map +7 -0
- package/dist/{helpers → esm/helpers}/themeable.js +12 -10
- package/dist/esm/helpers/themeable.js.map +7 -0
- package/dist/esm/helpers/validate.js +76 -0
- package/dist/esm/helpers/validate.js.map +7 -0
- package/dist/esm/helpers/withStaticProperties.js +10 -0
- package/dist/esm/helpers/withStaticProperties.js.map +7 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js +14 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/{hooks → esm/hooks}/useConstant.js +0 -0
- package/dist/{hooks → esm/hooks}/useConstant.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +173 -0
- package/dist/esm/hooks/useFeatures.js.map +7 -0
- package/dist/esm/hooks/useIsMounted.js +19 -0
- package/dist/esm/hooks/useIsMounted.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +17 -0
- package/dist/esm/hooks/useIsTouchDevice.js.map +7 -0
- package/dist/{hooks → esm/hooks}/useMedia.js +31 -42
- package/dist/esm/hooks/useMedia.js.map +7 -0
- package/dist/{hooks → esm/hooks}/usePressable.js +2 -1
- package/dist/{hooks → esm/hooks}/usePressable.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +178 -0
- package/dist/esm/hooks/useTheme.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js +11 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +7 -0
- package/dist/{index.js → esm/index.js} +25 -5
- package/dist/esm/index.js.map +7 -0
- package/dist/{static → esm/static}/postProcessStyles.js +0 -0
- package/dist/{static → esm/static}/postProcessStyles.js.map +2 -2
- package/dist/{static.js → esm/static.js} +4 -2
- package/dist/esm/static.js.map +7 -0
- package/dist/esm/styled.js +45 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/esm/tamagui-base.css +11 -0
- package/dist/esm/tamagui-base.css.map +7 -0
- package/dist/esm/types-rnw.js +1 -0
- package/dist/esm/types-rnw.js.map +7 -0
- package/dist/{types.js → esm/types.js} +0 -0
- package/dist/esm/types.js.map +7 -0
- package/dist/{views → esm/views}/Animated.js +0 -0
- package/dist/{views → esm/views}/Animated.js.map +2 -2
- package/dist/{views → esm/views}/Stack.js +1 -0
- package/dist/esm/views/Stack.js.map +7 -0
- package/dist/{views → esm/views}/Text.js +6 -4
- package/dist/esm/views/Text.js.map +7 -0
- package/dist/esm/views/TextAncestorContext.js +18 -0
- package/dist/esm/views/TextAncestorContext.js.map +7 -0
- package/dist/esm/views/Theme.js +35 -0
- package/dist/esm/views/Theme.js.map +7 -0
- package/dist/esm/views/ThemeContext.js +6 -0
- package/dist/{views → esm/views}/ThemeContext.js.map +2 -2
- package/dist/{views → esm/views}/ThemeInverse.js +1 -1
- package/dist/{views → esm/views}/ThemeInverse.js.map +3 -3
- package/dist/{views → esm/views}/ThemeManagerContext.js +5 -4
- package/dist/{views → esm/views}/ThemeManagerContext.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +42 -0
- package/dist/esm/views/ThemeProvider.js.map +7 -0
- package/dist/esm/views/ThemeReset.js +38 -0
- package/dist/esm/views/ThemeReset.js.map +7 -0
- package/dist/jsx/Tamagui.js +41 -0
- package/dist/jsx/ThemeContext.js +5 -0
- package/dist/jsx/ThemeManager.js +186 -0
- package/dist/jsx/conf.js +35 -0
- package/dist/jsx/constants/constants.js +17 -0
- package/dist/jsx/constants/platform.js +25 -0
- package/dist/jsx/constants/pseudos.js +17 -0
- package/dist/jsx/constants/rnw.js +23 -0
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +5 -0
- package/dist/jsx/createComponent.js +592 -0
- package/dist/jsx/createFont.js +27 -0
- package/dist/jsx/createShorthands.js +9 -0
- package/dist/jsx/createTamagui.js +201 -0
- package/dist/jsx/createTheme.js +6 -0
- package/dist/jsx/createTokens.js +28 -0
- package/dist/jsx/createVariable.js +48 -0
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +11 -0
- package/dist/jsx/helpers/addStylesUsingClassname.js +63 -0
- package/dist/jsx/helpers/areEqualSets.js +15 -0
- package/dist/jsx/helpers/createMediaStyle.js +30 -0
- package/dist/jsx/helpers/createPropMapper.js +205 -0
- package/dist/jsx/helpers/createShallowUpdate.js +18 -0
- package/dist/jsx/helpers/createTamaguiProvider.js +34 -0
- package/dist/jsx/helpers/extendStaticConfig.js +61 -0
- package/dist/jsx/helpers/fixNativeShadow.js +7 -0
- package/dist/jsx/helpers/fixNativeShadow.native.js +33 -0
- package/dist/jsx/helpers/getExpandedShorthands.js +18 -0
- package/dist/jsx/helpers/getSize.js +12 -0
- package/dist/jsx/helpers/getSplitStyles.js +277 -0
- package/dist/jsx/helpers/getStylesAtomic.js +130 -0
- package/dist/jsx/helpers/getStylesAtomic.native.js +9 -0
- package/dist/jsx/helpers/getThemeParentClassName.js +10 -0
- package/dist/jsx/helpers/insertStyleRule.js +93 -0
- package/dist/jsx/helpers/isObj.js +6 -0
- package/dist/jsx/helpers/isTamaguiElement.js +10 -0
- package/dist/jsx/helpers/matchMedia.js +17 -0
- package/dist/jsx/helpers/matchMedia.native.js +8 -0
- package/dist/jsx/helpers/proxyThemeVariables.js +17 -0
- package/dist/jsx/helpers/themeable.js +24 -0
- package/dist/jsx/helpers/validate.js +75 -0
- package/dist/jsx/helpers/withStaticProperties.js +9 -0
- package/dist/jsx/helpers/wrapThemeManagerContext.js +10 -0
- package/dist/jsx/hooks/useConstant.js +14 -0
- package/dist/jsx/hooks/useFeatures.js +167 -0
- package/dist/jsx/hooks/useIsMounted.js +18 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +16 -0
- package/dist/jsx/hooks/useMedia.js +159 -0
- package/dist/jsx/hooks/usePressable.js +13 -0
- package/dist/jsx/hooks/useTheme.js +177 -0
- package/dist/jsx/hooks/useUnmountEffect.js +10 -0
- package/dist/jsx/index.js +51 -0
- package/dist/jsx/static/postProcessStyles.js +17 -0
- package/dist/jsx/static.js +16 -0
- package/dist/jsx/styled.js +44 -0
- package/dist/jsx/tamagui-base.css +10 -0
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Animated.js +74 -0
- package/dist/jsx/views/Stack.js +12 -0
- package/dist/jsx/views/Text.js +61 -0
- package/dist/jsx/views/TextAncestorContext.js +15 -0
- package/dist/jsx/views/Theme.js +31 -0
- package/dist/jsx/views/ThemeContext.js +5 -0
- package/dist/jsx/views/ThemeInverse.js +22 -0
- package/dist/jsx/views/ThemeManagerContext.js +61 -0
- package/dist/jsx/views/ThemeProvider.js +35 -0
- package/dist/jsx/views/ThemeReset.js +34 -0
- package/package.json +22 -20
- package/types/Tamagui.d.ts +30 -0
- package/types/Tamagui.d.ts.map +1 -0
- package/types/ThemeContext.d.ts +7 -0
- package/types/ThemeContext.d.ts.map +1 -0
- package/types/ThemeManager.d.ts +49 -0
- package/types/ThemeManager.d.ts.map +1 -0
- package/types/conf.d.ts +27 -0
- package/types/conf.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/constants.d.ts +2 -0
- package/types/constants/constants.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/platform.d.ts +3 -0
- package/types/constants/platform.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/rnw.d.ts +0 -0
- package/types/constants/rnw.d.ts.map +1 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts +3 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +1 -0
- package/types/createComponent.d.ts +19 -0
- package/types/createComponent.d.ts.map +1 -0
- package/types/createFont.d.ts +3 -0
- package/types/createFont.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/createShorthands.d.ts +0 -0
- package/types/createShorthands.d.ts.map +1 -0
- package/types/createTamagui.d.ts +18 -0
- package/types/createTamagui.d.ts.map +1 -0
- package/types/createTheme.d.ts +7 -0
- package/types/createTheme.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/createTokens.d.ts +0 -16
- package/types/createTokens.d.ts.map +1 -0
- package/types/createVariable.d.ts +20 -0
- package/types/createVariable.d.ts.map +1 -0
- package/types/defaultComponentState.d.ts +1 -0
- package/types/defaultComponentState.d.ts.map +1 -0
- package/types/helpers/RNComponents.d.ts +2 -0
- package/types/helpers/RNComponents.d.ts.map +1 -0
- package/types/helpers/addStylesUsingClassname.d.ts +3 -0
- package/types/helpers/addStylesUsingClassname.d.ts.map +1 -0
- package/types/helpers/areEqualSets.d.ts +2 -0
- package/types/helpers/areEqualSets.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -0
- package/types/helpers/createPropMapper.d.ts +4 -0
- package/types/helpers/createPropMapper.d.ts.map +1 -0
- package/types/helpers/createShallowUpdate.d.ts +4 -0
- package/types/helpers/createShallowUpdate.d.ts.map +1 -0
- package/types/helpers/createTamaguiProvider.d.ts +7 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -0
- package/types/helpers/extendStaticConfig.d.ts +4 -0
- package/types/helpers/extendStaticConfig.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/fixNativeShadow.d.ts.map +1 -0
- package/types/helpers/fixNativeShadow.native.d.ts +2 -0
- package/types/helpers/fixNativeShadow.native.d.ts.map +1 -0
- package/types/helpers/getExpandedShorthands.d.ts +3 -0
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -0
- package/types/helpers/getSize.d.ts +3 -0
- package/types/helpers/getSize.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +19 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -0
- package/types/helpers/getStylesAtomic.d.ts +27 -0
- package/types/helpers/getStylesAtomic.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getStylesAtomic.native.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +8 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -0
- package/types/helpers/isObj.d.ts +2 -0
- package/types/helpers/isObj.d.ts.map +1 -0
- package/types/helpers/isTamaguiElement.d.ts +3 -0
- package/types/helpers/isTamaguiElement.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/matchMedia.d.ts +0 -0
- package/types/helpers/matchMedia.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/matchMedia.native.d.ts.map +1 -0
- package/types/helpers/proxyThemeVariables.d.ts +2 -0
- package/types/helpers/proxyThemeVariables.d.ts.map +1 -0
- package/types/helpers/themeable.d.ts +12 -0
- package/types/helpers/themeable.d.ts.map +1 -0
- package/types/helpers/validate.d.ts +4 -0
- package/types/helpers/validate.d.ts.map +1 -0
- package/types/helpers/withStaticProperties.d.ts +2 -0
- package/types/helpers/withStaticProperties.d.ts.map +1 -0
- package/types/helpers/wrapThemeManagerContext.d.ts +3 -0
- package/types/helpers/wrapThemeManagerContext.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/useConstant.d.ts +0 -0
- package/types/hooks/useConstant.d.ts.map +1 -0
- package/types/hooks/useFeatures.d.ts +18 -0
- package/types/hooks/useFeatures.d.ts.map +1 -0
- package/types/hooks/useIsMounted.d.ts +3 -0
- package/types/hooks/useIsMounted.d.ts.map +1 -0
- package/types/hooks/useIsTouchDevice.d.ts +2 -0
- package/types/hooks/useIsTouchDevice.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/useMedia.d.ts +2 -6
- package/types/hooks/useMedia.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/usePressable.d.ts +0 -0
- package/types/hooks/usePressable.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts +36 -0
- package/types/hooks/useTheme.d.ts.map +1 -0
- package/types/hooks/useUnmountEffect.d.ts +2 -0
- package/types/hooks/useUnmountEffect.d.ts.map +1 -0
- package/types/index.d.ts +42 -0
- package/types/index.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/static.d.ts +7 -2
- package/types/static.d.ts.map +1 -0
- package/types/styled.d.ts +16 -0
- package/types/styled.d.ts.map +1 -0
- package/types/types-rnw.d.ts +74 -0
- package/types/types-rnw.d.ts.map +1 -0
- package/types/types.d.ts +406 -0
- package/types/types.d.ts.map +1 -0
- package/types/views/Stack.d.ts +4 -0
- package/types/views/Stack.d.ts.map +1 -0
- package/types/views/Text.d.ts +4 -0
- package/types/views/Text.d.ts.map +1 -0
- package/types/views/TextAncestorContext.d.ts +5 -0
- package/types/views/TextAncestorContext.d.ts.map +1 -0
- package/types/views/Theme.d.ts +12 -0
- package/types/views/Theme.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/views/ThemeInverse.d.ts +0 -0
- package/types/views/ThemeInverse.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -0
- package/types/views/ThemeReset.d.ts +4 -0
- package/types/views/ThemeReset.d.ts.map +1 -0
- package/LICENSE +0 -21
- package/dist/constants/constants.js.map +0 -7
- package/dist/constants/platform.js.map +0 -7
- package/dist/constants/rnw.js.map +0 -7
- package/dist/constants/styleConstants.js +0 -46
- package/dist/constants/styleConstants.js.map +0 -7
- package/dist/createComponent.js +0 -463
- package/dist/createComponent.js.map +0 -7
- package/dist/createTamagui.js +0 -168
- package/dist/createTamagui.js.map +0 -7
- package/dist/createTheme.js +0 -20
- package/dist/createTheme.js.map +0 -7
- package/dist/createTokens.js.map +0 -7
- package/dist/createVariable.js +0 -25
- package/dist/createVariable.js.map +0 -7
- package/dist/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/helpers/createMediaStyle.js.map +0 -7
- package/dist/helpers/createPropMapper.js +0 -153
- package/dist/helpers/createPropMapper.js.map +0 -7
- package/dist/helpers/createTamaguiProvider.js +0 -25
- package/dist/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/helpers/extendStaticConfig.js.map +0 -7
- package/dist/helpers/fixNativeShadow.native.js +0 -30
- package/dist/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/helpers/getSplitStyles.js +0 -150
- package/dist/helpers/getSplitStyles.js.map +0 -7
- package/dist/helpers/getStylesAtomic.js +0 -83
- package/dist/helpers/getStylesAtomic.js.map +0 -7
- package/dist/helpers/insertStyleRule.js +0 -24
- package/dist/helpers/insertStyleRule.js.map +0 -7
- package/dist/helpers/isComponent.js +0 -10
- package/dist/helpers/isComponent.js.map +0 -7
- package/dist/helpers/isTamaguiComponent.js +0 -10
- package/dist/helpers/isTamaguiComponent.js.map +0 -7
- package/dist/helpers/pseudos.js +0 -1
- package/dist/helpers/themeable.js.map +0 -7
- package/dist/helpers/validate.js +0 -60
- package/dist/helpers/validate.js.map +0 -7
- package/dist/helpers/validateConfig.js +0 -46
- package/dist/helpers/validateConfig.js.map +0 -7
- package/dist/helpers/validateTokens.js +0 -29
- package/dist/helpers/validateTokens.js.map +0 -7
- package/dist/hooks/useFeatures.js +0 -63
- package/dist/hooks/useFeatures.js.map +0 -7
- package/dist/hooks/useForceUpdate.js +0 -28
- package/dist/hooks/useForceUpdate.js.map +0 -7
- package/dist/hooks/useMedia.js.map +0 -7
- package/dist/hooks/useTheme.js +0 -89
- package/dist/hooks/useTheme.js.map +0 -7
- package/dist/index.cjs +0 -2202
- package/dist/index.cjs.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/packages/core/src/constants/constants.d.ts.map +0 -1
- package/dist/packages/core/src/constants/platform.d.ts.map +0 -1
- package/dist/packages/core/src/constants/pseudos.d.ts +0 -15
- package/dist/packages/core/src/constants/pseudos.d.ts.map +0 -1
- package/dist/packages/core/src/constants/rnw.d.ts.map +0 -1
- package/dist/packages/core/src/createComponent.d.ts +0 -16
- package/dist/packages/core/src/createComponent.d.ts.map +0 -1
- package/dist/packages/core/src/createShorthands.d.ts.map +0 -1
- package/dist/packages/core/src/createTamagui.d.ts +0 -37
- package/dist/packages/core/src/createTamagui.d.ts.map +0 -1
- package/dist/packages/core/src/createTheme.d.ts +0 -5
- package/dist/packages/core/src/createTheme.d.ts.map +0 -1
- package/dist/packages/core/src/createTokens.d.ts.map +0 -1
- package/dist/packages/core/src/createVariable.d.ts +0 -14
- package/dist/packages/core/src/createVariable.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts +0 -2
- package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/createMediaStyle.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts +0 -5
- package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/extendStaticConfig.d.ts +0 -5
- package/dist/packages/core/src/helpers/extendStaticConfig.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/fixNativeShadow.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts +0 -2
- package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getSplitStyles.d.ts +0 -15
- package/dist/packages/core/src/helpers/getSplitStyles.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getStylesAtomic.d.ts +0 -3
- package/dist/packages/core/src/helpers/getStylesAtomic.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/insertStyleRule.d.ts +0 -2
- package/dist/packages/core/src/helpers/insertStyleRule.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/matchMedia.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/matchMedia.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/themeable.d.ts +0 -10
- package/dist/packages/core/src/helpers/themeable.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useConstant.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useFeatures.d.ts +0 -5
- package/dist/packages/core/src/hooks/useFeatures.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useForceUpdate.d.ts +0 -2
- package/dist/packages/core/src/hooks/useForceUpdate.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useMedia.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/usePressable.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useTheme.d.ts +0 -18
- package/dist/packages/core/src/hooks/useTheme.d.ts.map +0 -1
- package/dist/packages/core/src/index.d.ts +0 -27
- package/dist/packages/core/src/index.d.ts.map +0 -1
- package/dist/packages/core/src/static/postProcessStyles.d.ts +0 -7
- package/dist/packages/core/src/static/postProcessStyles.d.ts.map +0 -1
- package/dist/packages/core/src/static.d.ts.map +0 -1
- package/dist/packages/core/src/styled.d.ts +0 -16
- package/dist/packages/core/src/styled.d.ts.map +0 -1
- package/dist/packages/core/src/types.d.ts +0 -305
- package/dist/packages/core/src/types.d.ts.map +0 -1
- package/dist/packages/core/src/views/Animated.d.ts +0 -15
- package/dist/packages/core/src/views/Animated.d.ts.map +0 -1
- package/dist/packages/core/src/views/Stack.d.ts +0 -3
- package/dist/packages/core/src/views/Stack.d.ts.map +0 -1
- package/dist/packages/core/src/views/Text.d.ts +0 -3
- package/dist/packages/core/src/views/Text.d.ts.map +0 -1
- package/dist/packages/core/src/views/TextAncestorContext.d.ts +0 -3
- package/dist/packages/core/src/views/TextAncestorContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/Theme.d.ts +0 -8
- package/dist/packages/core/src/views/Theme.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeContext.d.ts +0 -18
- package/dist/packages/core/src/views/ThemeContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeInverse.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeManagerContext.d.ts +0 -15
- package/dist/packages/core/src/views/ThemeManagerContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeProvider.d.ts.map +0 -1
- package/dist/packages/helpers/src/AllRules.d.ts +0 -3
- package/dist/packages/helpers/src/AllRules.d.ts.map +0 -1
- package/dist/packages/helpers/src/concatClassName.d.ts +0 -2
- package/dist/packages/helpers/src/concatClassName.d.ts.map +0 -1
- package/dist/packages/helpers/src/index.d.ts +0 -5
- package/dist/packages/helpers/src/index.d.ts.map +0 -1
- package/dist/packages/helpers/src/types.d.ts +0 -8
- package/dist/packages/helpers/src/types.d.ts.map +0 -1
- package/dist/packages/helpers/src/validStyleProps.d.ts +0 -475
- package/dist/packages/helpers/src/validStyleProps.d.ts.map +0 -1
- package/dist/static.js.map +0 -7
- package/dist/styled.js +0 -21
- package/dist/styled.js.map +0 -7
- package/dist/views/SafeAreaProvider.js +0 -30
- package/dist/views/SafeAreaProvider.js.map +0 -7
- package/dist/views/Stack.js.map +0 -7
- package/dist/views/Text.js.map +0 -7
- package/dist/views/TextAncestorContext.js +0 -18
- package/dist/views/TextAncestorContext.js.map +0 -7
- package/dist/views/Theme.js +0 -65
- package/dist/views/Theme.js.map +0 -7
- package/dist/views/ThemeProvider.js +0 -45
- package/dist/views/ThemeProvider.js.map +0 -7
- package/src/constants/constants.ts +0 -12
- package/src/constants/platform.ts +0 -15
- package/src/constants/pseudos.ts +0 -14
- package/src/constants/rnw.tsx +0 -20
- package/src/createComponent.tsx +0 -612
- package/src/createFont.ts +0 -31
- package/src/createShorthands.ts +0 -5
- package/src/createTamagui.ts +0 -217
- package/src/createTheme.ts +0 -19
- package/src/createTokens.ts +0 -88
- package/src/createVariable.ts +0 -26
- package/src/helpers/addStylesUsingClassname.tsx +0 -60
- package/src/helpers/createMediaStyle.ts +0 -46
- package/src/helpers/createPropMapper.ts +0 -184
- package/src/helpers/createTamaguiProvider.tsx +0 -22
- package/src/helpers/extendStaticConfig.ts +0 -68
- package/src/helpers/fixNativeShadow.native.tsx +0 -27
- package/src/helpers/fixNativeShadow.tsx +0 -2
- package/src/helpers/getSplitStyles.tsx +0 -200
- package/src/helpers/getStylesAtomic.native.ts +0 -3
- package/src/helpers/getStylesAtomic.ts +0 -103
- package/src/helpers/insertStyleRule.tsx +0 -18
- package/src/helpers/isObj.ts +0 -1
- package/src/helpers/isTamaguiElement.tsx +0 -5
- package/src/helpers/matchMedia.native.ts +0 -6
- package/src/helpers/matchMedia.ts +0 -17
- package/src/helpers/themeable.tsx +0 -42
- package/src/helpers/validate.ts +0 -59
- package/src/hooks/useConstant.tsx +0 -10
- package/src/hooks/useFeatures.tsx +0 -79
- package/src/hooks/useMedia.tsx +0 -194
- package/src/hooks/usePressable.tsx +0 -9
- package/src/hooks/useTheme.tsx +0 -106
- package/src/index.ts +0 -32
- package/src/static/postProcessStyles.tsx +0 -20
- package/src/static.ts +0 -22
- package/src/styled.ts +0 -82
- package/src/types.tsx +0 -562
- package/src/views/Animated.tsx +0 -121
- package/src/views/Stack.tsx +0 -21
- package/src/views/Text.tsx +0 -66
- package/src/views/TextAncestorContext.tsx +0 -12
- package/src/views/Theme.tsx +0 -90
- package/src/views/ThemeContext.tsx +0 -5
- package/src/views/ThemeInverse.tsx +0 -22
- package/src/views/ThemeManagerContext.tsx +0 -62
- package/src/views/ThemeProvider.tsx +0 -52
- package/types.d.ts +0 -559
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { stylePropsView } from "@tamagui/helpers";
|
|
4
|
+
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
5
|
+
import React, {
|
|
6
|
+
Children,
|
|
7
|
+
Fragment,
|
|
8
|
+
createElement,
|
|
9
|
+
forwardRef,
|
|
10
|
+
memo,
|
|
11
|
+
useCallback,
|
|
12
|
+
useContext,
|
|
13
|
+
useRef,
|
|
14
|
+
useState
|
|
15
|
+
} from "react";
|
|
16
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
17
|
+
import { onConfiguredOnce } from "./conf";
|
|
18
|
+
import { stackDefaultStyles } from "./constants/constants";
|
|
19
|
+
import { isAndroid, isTouchDevice, isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
20
|
+
import { rnw } from "./constants/rnw";
|
|
21
|
+
import { isVariable } from "./createVariable";
|
|
22
|
+
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
23
|
+
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
24
|
+
import { getSplitStyles } from "./helpers/getSplitStyles";
|
|
25
|
+
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
26
|
+
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
27
|
+
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
28
|
+
import { useFeatures } from "./hooks/useFeatures";
|
|
29
|
+
import { usePressable } from "./hooks/usePressable";
|
|
30
|
+
import { getThemeManagerIfChanged, useTheme } from "./hooks/useTheme";
|
|
31
|
+
import { TextAncestorContext } from "./views/TextAncestorContext";
|
|
32
|
+
React["keep"];
|
|
33
|
+
const defaultComponentState = {
|
|
34
|
+
hover: false,
|
|
35
|
+
press: false,
|
|
36
|
+
pressIn: false,
|
|
37
|
+
focus: false,
|
|
38
|
+
mounted: false,
|
|
39
|
+
animation: null
|
|
40
|
+
};
|
|
41
|
+
const mouseUps = /* @__PURE__ */ new Set();
|
|
42
|
+
if (typeof document !== "undefined") {
|
|
43
|
+
document.addEventListener("mouseup", () => {
|
|
44
|
+
mouseUps.forEach((x) => x());
|
|
45
|
+
mouseUps.clear();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
49
|
+
for (const key in defaultProps) {
|
|
50
|
+
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
__name(mergeShorthands, "mergeShorthands");
|
|
54
|
+
let initialTheme;
|
|
55
|
+
function createComponent(configIn, ParentComponent) {
|
|
56
|
+
const staticConfig = (() => {
|
|
57
|
+
const config = extendStaticConfig(configIn, ParentComponent);
|
|
58
|
+
if ("parsed" in config) {
|
|
59
|
+
return config;
|
|
60
|
+
} else {
|
|
61
|
+
return parseStaticConfig(config);
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
const componentClassName = `is_${staticConfig.componentName}`;
|
|
65
|
+
let tamaguiConfig;
|
|
66
|
+
let AnimatedText;
|
|
67
|
+
let AnimatedView;
|
|
68
|
+
let avoidClasses = true;
|
|
69
|
+
let defaultNativeStyle;
|
|
70
|
+
let defaultNativeStyleSheet;
|
|
71
|
+
let initialSplitStyles;
|
|
72
|
+
function addPseudoToStyles(styles, name, pseudos) {
|
|
73
|
+
const pseudoStyle = pseudos[name];
|
|
74
|
+
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
75
|
+
if (pseudoStyle) {
|
|
76
|
+
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
77
|
+
}
|
|
78
|
+
const defaultPseudoStyle = initialSplitStyles.pseudos[name];
|
|
79
|
+
if (defaultPseudoStyle) {
|
|
80
|
+
styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
__name(addPseudoToStyles, "addPseudoToStyles");
|
|
84
|
+
const component = forwardRef((props, forwardedRef) => {
|
|
85
|
+
var _a, _b, _c, _d;
|
|
86
|
+
const { Component, componentName, isText, isZStack } = staticConfig;
|
|
87
|
+
if (process.env.NODE_ENV === "development") {
|
|
88
|
+
if (props["debug"]) {
|
|
89
|
+
console.warn(staticConfig.componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
|
|
90
|
+
console.log("props in:", props);
|
|
91
|
+
if (props["debug"] === "break")
|
|
92
|
+
debugger;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const forceUpdate = useForceUpdate();
|
|
96
|
+
const theme = useTheme(props.theme, staticConfig.componentName, props, forceUpdate);
|
|
97
|
+
const [state, set_] = useState(defaultComponentState);
|
|
98
|
+
const setStateShallow = createShallowUpdate(set_);
|
|
99
|
+
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
100
|
+
const splitStyles = getSplitStyles(props, staticConfig, theme, shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: "value" } : state, shouldAvoidClasses ? null : initialSplitStyles.classNames);
|
|
101
|
+
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
102
|
+
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
103
|
+
const isAnimated = !!(useAnimations && props.animation);
|
|
104
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
105
|
+
const features = useFeatures(props, {
|
|
106
|
+
forceUpdate,
|
|
107
|
+
setStateShallow,
|
|
108
|
+
useAnimations,
|
|
109
|
+
state,
|
|
110
|
+
style: props.animation ? { ...defaultNativeStyle, ...style } : null,
|
|
111
|
+
pseudos,
|
|
112
|
+
staticConfig,
|
|
113
|
+
theme,
|
|
114
|
+
onDidAnimate: props.onDidAnimate
|
|
115
|
+
});
|
|
116
|
+
const {
|
|
117
|
+
tag,
|
|
118
|
+
hitSlop,
|
|
119
|
+
children,
|
|
120
|
+
pointerEvents,
|
|
121
|
+
onPress,
|
|
122
|
+
onPressIn,
|
|
123
|
+
onPressOut,
|
|
124
|
+
onHoverIn,
|
|
125
|
+
onHoverOut,
|
|
126
|
+
space,
|
|
127
|
+
disabled,
|
|
128
|
+
onMouseEnter,
|
|
129
|
+
onMouseLeave,
|
|
130
|
+
hrefAttrs,
|
|
131
|
+
onMoveShouldSetResponder,
|
|
132
|
+
onMoveShouldSetResponderCapture,
|
|
133
|
+
onResponderEnd,
|
|
134
|
+
onResponderGrant,
|
|
135
|
+
onResponderMove,
|
|
136
|
+
onResponderReject,
|
|
137
|
+
onResponderRelease,
|
|
138
|
+
onResponderStart,
|
|
139
|
+
onResponderTerminate,
|
|
140
|
+
onResponderTerminationRequest,
|
|
141
|
+
onScrollShouldSetResponder,
|
|
142
|
+
onScrollShouldSetResponderCapture,
|
|
143
|
+
onSelectionChangeShouldSetResponder,
|
|
144
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
145
|
+
onStartShouldSetResponder,
|
|
146
|
+
onStartShouldSetResponderCapture,
|
|
147
|
+
onMouseDown,
|
|
148
|
+
nativeID,
|
|
149
|
+
accessible,
|
|
150
|
+
accessibilityRole,
|
|
151
|
+
collapsable,
|
|
152
|
+
focusable,
|
|
153
|
+
onClick,
|
|
154
|
+
theme: _themeProp,
|
|
155
|
+
defaultVariants,
|
|
156
|
+
onLayout,
|
|
157
|
+
...viewPropsRest
|
|
158
|
+
} = viewPropsIn;
|
|
159
|
+
let viewProps = viewPropsRest;
|
|
160
|
+
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
|
|
161
|
+
Children.toArray(props.children).forEach((item) => {
|
|
162
|
+
if (typeof item === "string") {
|
|
163
|
+
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
|
|
168
|
+
const hostRef = useRef(null);
|
|
169
|
+
const internal = useRef();
|
|
170
|
+
if (!internal.current) {
|
|
171
|
+
internal.current = {
|
|
172
|
+
isMounted: true
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
useIsomorphicLayoutEffect(() => {
|
|
176
|
+
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
177
|
+
setStateShallow({
|
|
178
|
+
mounted: true
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
internal.current.isMounted = true;
|
|
182
|
+
return () => {
|
|
183
|
+
mouseUps.delete(unPress);
|
|
184
|
+
internal.current.isMounted = false;
|
|
185
|
+
};
|
|
186
|
+
}, [hasEnterStyle, props.animation]);
|
|
187
|
+
if (nativeID) {
|
|
188
|
+
viewProps.id = nativeID;
|
|
189
|
+
}
|
|
190
|
+
if (isAndroid) {
|
|
191
|
+
if (collapsable)
|
|
192
|
+
viewProps.collapsable = collapsable;
|
|
193
|
+
if (focusable)
|
|
194
|
+
viewProps.focusable = focusable;
|
|
195
|
+
}
|
|
196
|
+
if (!isWeb) {
|
|
197
|
+
if (accessible)
|
|
198
|
+
viewProps.accessible = accessible;
|
|
199
|
+
if (accessibilityRole)
|
|
200
|
+
viewProps.accessibilityRole = accessibilityRole;
|
|
201
|
+
}
|
|
202
|
+
if (isWeb) {
|
|
203
|
+
rnw.useResponderEvents(hostRef, {
|
|
204
|
+
onMoveShouldSetResponder,
|
|
205
|
+
onMoveShouldSetResponderCapture,
|
|
206
|
+
onResponderEnd,
|
|
207
|
+
onResponderGrant,
|
|
208
|
+
onResponderMove,
|
|
209
|
+
onResponderReject,
|
|
210
|
+
onResponderRelease,
|
|
211
|
+
onResponderStart,
|
|
212
|
+
onResponderTerminate,
|
|
213
|
+
onResponderTerminationRequest,
|
|
214
|
+
onScrollShouldSetResponder,
|
|
215
|
+
onScrollShouldSetResponderCapture,
|
|
216
|
+
onSelectionChangeShouldSetResponder,
|
|
217
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
218
|
+
onStartShouldSetResponder,
|
|
219
|
+
onStartShouldSetResponderCapture
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
223
|
+
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
224
|
+
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
225
|
+
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
226
|
+
let ViewComponent = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
227
|
+
ViewComponent = Component || ViewComponent;
|
|
228
|
+
let styles;
|
|
229
|
+
const isStringElement = typeof ViewComponent === "string";
|
|
230
|
+
const animationStyles = state.animation ? state.animation.style : null;
|
|
231
|
+
if (isStringElement && shouldAvoidClasses) {
|
|
232
|
+
styles = {
|
|
233
|
+
...defaultNativeStyle,
|
|
234
|
+
...animationStyles,
|
|
235
|
+
...medias
|
|
236
|
+
};
|
|
237
|
+
} else {
|
|
238
|
+
styles = [
|
|
239
|
+
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
240
|
+
animationStyles ? animationStyles : style,
|
|
241
|
+
medias
|
|
242
|
+
];
|
|
243
|
+
if (!animationStyles) {
|
|
244
|
+
!state.mounted && addPseudoToStyles(styles, "enterStyle", pseudos);
|
|
245
|
+
state.hover && addPseudoToStyles(styles, "hoverStyle", pseudos);
|
|
246
|
+
state.focus && addPseudoToStyles(styles, "focusStyle", pseudos);
|
|
247
|
+
state.press && addPseudoToStyles(styles, "pressStyle", pseudos);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (isWeb) {
|
|
251
|
+
if (!shouldAvoidClasses) {
|
|
252
|
+
const fontFamilyName = isText ? props.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
253
|
+
const fontFamily = fontFamilyName && fontFamilyName[0] === "$" ? fontFamilyName.slice(1) : null;
|
|
254
|
+
const classList = [
|
|
255
|
+
componentName ? componentClassName : "",
|
|
256
|
+
fontFamily ? `font_${fontFamily}` : "",
|
|
257
|
+
theme.className,
|
|
258
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
259
|
+
];
|
|
260
|
+
const className = classList.join(" ");
|
|
261
|
+
if (process.env.NODE_ENV === "development") {
|
|
262
|
+
if (props["debug"]) {
|
|
263
|
+
console.log(" \xBB className", { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
viewProps.className = className;
|
|
267
|
+
viewProps.style = animationStyles;
|
|
268
|
+
} else {
|
|
269
|
+
viewProps.style = styles;
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
viewProps.style = styles;
|
|
273
|
+
}
|
|
274
|
+
if (pointerEvents) {
|
|
275
|
+
viewProps.pointerEvents = pointerEvents;
|
|
276
|
+
}
|
|
277
|
+
if (isWeb) {
|
|
278
|
+
const platformMethodsRef = rnw.usePlatformMethods(viewProps);
|
|
279
|
+
const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
|
|
280
|
+
if (!isAnimated) {
|
|
281
|
+
viewProps.ref = setRef;
|
|
282
|
+
} else {
|
|
283
|
+
if (forwardedRef) {
|
|
284
|
+
viewProps.ref = forwardedRef;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (props.href != null && hrefAttrs != null) {
|
|
288
|
+
const { download, rel, target } = hrefAttrs;
|
|
289
|
+
if (download != null) {
|
|
290
|
+
viewProps.download = download;
|
|
291
|
+
}
|
|
292
|
+
if (rel != null) {
|
|
293
|
+
viewProps.rel = rel;
|
|
294
|
+
}
|
|
295
|
+
if (typeof target === "string") {
|
|
296
|
+
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
if (forwardedRef) {
|
|
301
|
+
viewProps.ref = forwardedRef;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
const initialPseudos = initialSplitStyles.pseudos;
|
|
305
|
+
const attachPress = !!(pseudos && pseudos.pressStyle || initialPseudos && initialPseudos.pressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
306
|
+
const isHoverable = isWeb && !isTouchDevice;
|
|
307
|
+
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
308
|
+
const pressEventKey = isStringElement ? "onClick" : "onPress";
|
|
309
|
+
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);
|
|
310
|
+
const unPress = useCallback(() => {
|
|
311
|
+
if (!internal.current.isMounted)
|
|
312
|
+
return;
|
|
313
|
+
setStateShallow({
|
|
314
|
+
press: false,
|
|
315
|
+
pressIn: false
|
|
316
|
+
});
|
|
317
|
+
}, []);
|
|
318
|
+
const events = shouldAttach ? {
|
|
319
|
+
...!isWeb && {
|
|
320
|
+
onPressOut: (e) => {
|
|
321
|
+
unPress();
|
|
322
|
+
onPressOut == null ? void 0 : onPressOut(e);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
...isHoverable && {
|
|
326
|
+
onMouseEnter: attachHover ? (e) => {
|
|
327
|
+
let next = {};
|
|
328
|
+
if (attachHover) {
|
|
329
|
+
next.hover = true;
|
|
330
|
+
}
|
|
331
|
+
if (state.pressIn) {
|
|
332
|
+
next.press = true;
|
|
333
|
+
}
|
|
334
|
+
if (Object.keys(next).length) {
|
|
335
|
+
setStateShallow(next);
|
|
336
|
+
}
|
|
337
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
338
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
339
|
+
} : void 0,
|
|
340
|
+
onMouseLeave: attachHover ? (e) => {
|
|
341
|
+
let next = {};
|
|
342
|
+
mouseUps.add(unPress);
|
|
343
|
+
if (attachHover) {
|
|
344
|
+
next.hover = false;
|
|
345
|
+
}
|
|
346
|
+
if (state.pressIn) {
|
|
347
|
+
next.press = false;
|
|
348
|
+
next.pressIn = false;
|
|
349
|
+
}
|
|
350
|
+
if (Object.keys(next).length) {
|
|
351
|
+
setStateShallow(next);
|
|
352
|
+
}
|
|
353
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
354
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
355
|
+
} : void 0
|
|
356
|
+
},
|
|
357
|
+
onMouseDown: attachPress ? (e) => {
|
|
358
|
+
setStateShallow({
|
|
359
|
+
press: true,
|
|
360
|
+
pressIn: true
|
|
361
|
+
});
|
|
362
|
+
onPressIn == null ? void 0 : onPressIn(e);
|
|
363
|
+
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
364
|
+
} : null,
|
|
365
|
+
[pressEventKey]: attachPress ? (e) => {
|
|
366
|
+
onPress == null ? void 0 : onPress(e);
|
|
367
|
+
unPress();
|
|
368
|
+
onPressOut == null ? void 0 : onPressOut(e);
|
|
369
|
+
onClick == null ? void 0 : onClick(e);
|
|
370
|
+
} : null
|
|
371
|
+
} : null;
|
|
372
|
+
let childEls = !children ? children : wrapThemeManagerContext(spacedChildren({
|
|
373
|
+
children,
|
|
374
|
+
space,
|
|
375
|
+
flexDirection: props.flexDirection || ((_b = staticConfig.defaultProps) == null ? void 0 : _b.flexDirection),
|
|
376
|
+
isZStack
|
|
377
|
+
}), getThemeManagerIfChanged(theme));
|
|
378
|
+
const [pressProps] = usePressable(events ? {
|
|
379
|
+
disabled,
|
|
380
|
+
...hitSlop && {
|
|
381
|
+
hitSlop
|
|
382
|
+
},
|
|
383
|
+
onPressIn: events.onMouseDown,
|
|
384
|
+
onPressOut: events.onPressOut,
|
|
385
|
+
onPress: events[pressEventKey]
|
|
386
|
+
} : {
|
|
387
|
+
disabled: true
|
|
388
|
+
});
|
|
389
|
+
let content;
|
|
390
|
+
if (isWeb) {
|
|
391
|
+
if (staticConfig.isReactNativeWeb) {
|
|
392
|
+
viewProps.dataSet = {
|
|
393
|
+
...viewProps.dataSet,
|
|
394
|
+
className: viewProps.className
|
|
395
|
+
};
|
|
396
|
+
} else {
|
|
397
|
+
const rnProps = rnw.createDOMProps(viewProps);
|
|
398
|
+
const className = rnProps.className && rnProps.className !== viewProps.className ? `${rnProps.className} ${viewProps.className}` : viewProps.className;
|
|
399
|
+
Object.assign(viewProps, rnProps);
|
|
400
|
+
if (className) {
|
|
401
|
+
viewProps.className = className;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (events) {
|
|
406
|
+
if (!isStringElement) {
|
|
407
|
+
Object.assign(viewProps, pressProps);
|
|
408
|
+
} else {
|
|
409
|
+
Object.assign(viewProps, events);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
content = createElement(ViewComponent, viewProps, childEls);
|
|
413
|
+
if (isWeb && events && attachHover) {
|
|
414
|
+
content = <span className="tui_Hoverable" style={{
|
|
415
|
+
display: "contents"
|
|
416
|
+
}} onMouseEnter={events.onMouseEnter} onMouseLeave={events.onMouseLeave}>{content}</span>;
|
|
417
|
+
}
|
|
418
|
+
if (process.env.NODE_ENV === "development") {
|
|
419
|
+
if (props["debug"]) {
|
|
420
|
+
viewProps["debug"] = true;
|
|
421
|
+
console.log(" \xBB ", { propsIn: { ...props }, propsOut: { ...viewProps }, state, splitStyles, animationStyles, isStringElement, classNamesIn: (_c = props.className) == null ? void 0 : _c.split(" "), classNamesOut: (_d = viewProps.className) == null ? void 0 : _d.split(" "), pressProps, events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...typeof window !== "undefined" ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null });
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (features.length) {
|
|
425
|
+
return <>
|
|
426
|
+
{features}
|
|
427
|
+
{content}
|
|
428
|
+
</>;
|
|
429
|
+
}
|
|
430
|
+
return content;
|
|
431
|
+
});
|
|
432
|
+
component.displayName = staticConfig.componentName;
|
|
433
|
+
onConfiguredOnce((conf) => {
|
|
434
|
+
var _a, _b, _c, _d;
|
|
435
|
+
if (process.env.IS_STATIC === "is_static") {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
tamaguiConfig = conf;
|
|
439
|
+
mergeShorthands(staticConfig, tamaguiConfig);
|
|
440
|
+
avoidClasses = !!((_a = tamaguiConfig.animations) == null ? void 0 : _a.avoidClasses);
|
|
441
|
+
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
442
|
+
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
443
|
+
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
444
|
+
initialSplitStyles = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {
|
|
445
|
+
mounted: true,
|
|
446
|
+
hover: false,
|
|
447
|
+
press: false,
|
|
448
|
+
pressIn: false,
|
|
449
|
+
focus: false,
|
|
450
|
+
resolveVariablesAs: "both",
|
|
451
|
+
keepVariantsAsProps: true
|
|
452
|
+
});
|
|
453
|
+
const { style, viewProps } = initialSplitStyles;
|
|
454
|
+
defaultNativeStyle = {};
|
|
455
|
+
for (const key in style) {
|
|
456
|
+
const v = style[key];
|
|
457
|
+
defaultNativeStyle[key] = isVariable(v) ? v.val : v;
|
|
458
|
+
}
|
|
459
|
+
defaultNativeStyleSheet = StyleSheet.create({
|
|
460
|
+
base: defaultNativeStyle
|
|
461
|
+
});
|
|
462
|
+
component.defaultProps = {
|
|
463
|
+
...viewProps,
|
|
464
|
+
...component.defaultProps
|
|
465
|
+
};
|
|
466
|
+
if (process.env.NODE_ENV === "development" && ((_d = staticConfig.defaultProps) == null ? void 0 : _d.debug)) {
|
|
467
|
+
if (process.env.IS_STATIC !== "is_static") {
|
|
468
|
+
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
469
|
+
staticConfig,
|
|
470
|
+
initialSplitStyles
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
let res = component;
|
|
476
|
+
if (configIn.memo) {
|
|
477
|
+
res = memo(res);
|
|
478
|
+
}
|
|
479
|
+
res["staticConfig"] = {
|
|
480
|
+
validStyles: staticConfig.validStyles || stylePropsView,
|
|
481
|
+
...staticConfig
|
|
482
|
+
};
|
|
483
|
+
if (process.env.NODE_ENV === "development") {
|
|
484
|
+
res["whyDidYouRender"] = true;
|
|
485
|
+
}
|
|
486
|
+
res["extractable"] = (Component, conf) => {
|
|
487
|
+
Component["staticConfig"] = extendStaticConfig({
|
|
488
|
+
Component,
|
|
489
|
+
...conf,
|
|
490
|
+
neverFlatten: true,
|
|
491
|
+
defaultProps: {
|
|
492
|
+
...Component.defaultProps,
|
|
493
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
494
|
+
}
|
|
495
|
+
}, res);
|
|
496
|
+
return Component;
|
|
497
|
+
};
|
|
498
|
+
return res;
|
|
499
|
+
}
|
|
500
|
+
__name(createComponent, "createComponent");
|
|
501
|
+
const Spacer = createComponent({
|
|
502
|
+
memo: true,
|
|
503
|
+
componentName: "Spacer",
|
|
504
|
+
defaultProps: {
|
|
505
|
+
...stackDefaultStyles,
|
|
506
|
+
size: true
|
|
507
|
+
},
|
|
508
|
+
variants: {
|
|
509
|
+
size: {
|
|
510
|
+
"...size": (size, { tokens }) => {
|
|
511
|
+
var _a;
|
|
512
|
+
size = size == true ? "$true" : size;
|
|
513
|
+
const sizePx = (_a = tokens.size[size]) != null ? _a : size;
|
|
514
|
+
return {
|
|
515
|
+
width: sizePx,
|
|
516
|
+
height: sizePx,
|
|
517
|
+
minWidth: sizePx,
|
|
518
|
+
minHeight: sizePx
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
flex: {
|
|
523
|
+
true: {
|
|
524
|
+
flex: 1
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
direction: {
|
|
528
|
+
horizontal: {
|
|
529
|
+
height: 0,
|
|
530
|
+
minHeight: 0
|
|
531
|
+
},
|
|
532
|
+
vertical: {
|
|
533
|
+
width: 0,
|
|
534
|
+
minWidth: 0
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
function spacedChildren({
|
|
540
|
+
isZStack,
|
|
541
|
+
children,
|
|
542
|
+
space,
|
|
543
|
+
flexDirection,
|
|
544
|
+
spaceFlex
|
|
545
|
+
}) {
|
|
546
|
+
var _a;
|
|
547
|
+
const childrenList = Children.toArray(children);
|
|
548
|
+
const len = childrenList.length;
|
|
549
|
+
if (len === 1) {
|
|
550
|
+
return childrenList;
|
|
551
|
+
}
|
|
552
|
+
const next = [];
|
|
553
|
+
for (const [index, child] of childrenList.entries()) {
|
|
554
|
+
if (child === null || child === void 0) {
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
557
|
+
if (!child || child["key"] && !isZStack) {
|
|
558
|
+
next.push(child);
|
|
559
|
+
} else {
|
|
560
|
+
next.push(<Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>);
|
|
561
|
+
}
|
|
562
|
+
if ((_a = child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) {
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
if (index !== len - 1) {
|
|
566
|
+
if (space) {
|
|
567
|
+
next.push(<Spacer key={`_${index}_spacer`} direction={flexDirection === "row" || flexDirection === "row-reverse" ? "horizontal" : "vertical"} size={space} {...spaceFlex && {
|
|
568
|
+
flex: spaceFlex
|
|
569
|
+
}} />);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return next;
|
|
574
|
+
}
|
|
575
|
+
__name(spacedChildren, "spacedChildren");
|
|
576
|
+
function AbsoluteFill(props) {
|
|
577
|
+
return isWeb ? <div style={{
|
|
578
|
+
position: "absolute",
|
|
579
|
+
top: 0,
|
|
580
|
+
left: 0,
|
|
581
|
+
right: 0,
|
|
582
|
+
bottom: 0
|
|
583
|
+
}}>{props.children}</div> : <View style={StyleSheet.absoluteFill}>{props.child}</View>;
|
|
584
|
+
}
|
|
585
|
+
__name(AbsoluteFill, "AbsoluteFill");
|
|
586
|
+
export {
|
|
587
|
+
AbsoluteFill,
|
|
588
|
+
Spacer,
|
|
589
|
+
createComponent,
|
|
590
|
+
mouseUps,
|
|
591
|
+
spacedChildren
|
|
592
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { validateFont } from "./helpers/validate";
|
|
4
|
+
const createFont = /* @__PURE__ */ __name((font) => {
|
|
5
|
+
if (process.env.NODE_ENV === "development") {
|
|
6
|
+
validateFont(font);
|
|
7
|
+
}
|
|
8
|
+
const sizeKeys = Object.keys(font.size);
|
|
9
|
+
for (const key in font) {
|
|
10
|
+
if (key === "size" || key === "family")
|
|
11
|
+
continue;
|
|
12
|
+
const section = font[key];
|
|
13
|
+
const keys = Object.keys(section);
|
|
14
|
+
let fillVal = section[keys[0]];
|
|
15
|
+
for (const sKey of sizeKeys) {
|
|
16
|
+
if (!(sKey in section)) {
|
|
17
|
+
section[sKey] = fillVal;
|
|
18
|
+
} else {
|
|
19
|
+
fillVal = section[sKey];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze(font);
|
|
24
|
+
}, "createFont");
|
|
25
|
+
export {
|
|
26
|
+
createFont
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function createShorthands(shorthands) {
|
|
4
|
+
return Object.freeze(shorthands);
|
|
5
|
+
}
|
|
6
|
+
__name(createShorthands, "createShorthands");
|
|
7
|
+
export {
|
|
8
|
+
createShorthands
|
|
9
|
+
};
|