@tamagui/core 1.0.0-beta.8 → 1.0.1-beta.100
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/Pressability.js +28 -0
- package/dist/cjs/Pressability.js.map +7 -0
- package/dist/cjs/Pressability.native.js +28 -0
- package/dist/cjs/Pressability.native.js.map +7 -0
- package/dist/cjs/Tamagui.js +6 -8
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/ThemeManager.js +25 -32
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/conf.js +20 -15
- package/dist/cjs/conf.js.map +2 -2
- package/dist/cjs/constants/constants.js +1 -1
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/platform.js +8 -8
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/rnw.js +5 -19
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/constants/rnw.native.js +28 -0
- package/dist/cjs/constants/rnw.native.js.map +7 -0
- package/dist/cjs/createComponent.js +612 -295
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +2 -3
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js +0 -2
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +147 -100
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +3 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +4 -21
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +39 -14
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +55 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +2 -3
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +187 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +29 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/calc.js +70 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +4 -4
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +133 -113
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +3 -4
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/createTamaguiProvider.js +16 -18
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/cssHash.js +50 -0
- package/dist/cjs/helpers/cssHash.js.map +7 -0
- package/dist/cjs/helpers/expandStyle.js +111 -0
- package/dist/cjs/helpers/expandStyle.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +126 -0
- package/dist/cjs/helpers/expandStyles.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +25 -17
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +2 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -2
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getFont.js +61 -0
- package/dist/cjs/helpers/getFont.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +17 -9
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +268 -168
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStackSize.js +45 -0
- package/dist/cjs/helpers/getStackSize.js.map +7 -0
- package/dist/cjs/helpers/getStylesAtomic.js +178 -118
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +0 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getTextSize.js +3 -4
- package/dist/cjs/helpers/getTextSize.js.map +2 -2
- package/dist/cjs/helpers/getVariantExtras.js +46 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +55 -37
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +1 -2
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +36 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/cjs/helpers/isTamaguiElement.js +4 -5
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +2 -3
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +1 -2
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +49 -0
- package/dist/cjs/helpers/mergeProps.js.map +7 -0
- package/dist/cjs/helpers/mergeTransform.js +41 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js +18 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/cjs/helpers/normalizeColor.js +76 -0
- package/dist/cjs/helpers/normalizeColor.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +90 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -3
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.js +41 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/helpers/registerCSSVariable.js +40 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +3 -5
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/validate.js +39 -37
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/helpers/withStaticProperties.js +2 -3
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -2
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/cjs/hooks/useConstant.js +0 -2
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +22 -20
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useId.js +5 -6
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +2 -4
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsTouchDevice.js +3 -4
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +11 -15
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/usePressable.js +2 -3
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/hooks/usePrevious.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +21 -33
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +0 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +21 -12
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/insertFont.js +89 -0
- package/dist/cjs/insertFont.js.map +7 -0
- package/dist/cjs/static.js +3 -1
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +0 -3
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +40 -26
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Text.js +11 -15
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +4 -6
- package/dist/cjs/views/TextAncestorContext.js.map +2 -2
- package/dist/cjs/views/Theme.js +6 -9
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +7 -5
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +6 -6
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +3 -3
- package/dist/cjs/views/ThemeReset.js.map +2 -2
- package/dist/esm/Pressability.js +5 -0
- package/dist/esm/Pressability.js.map +7 -0
- package/dist/esm/Pressability.native.js +5 -0
- package/dist/esm/Pressability.native.js.map +7 -0
- package/dist/esm/Tamagui.js +5 -8
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/ThemeManager.js +25 -33
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/conf.js +18 -15
- package/dist/esm/conf.js.map +2 -2
- package/dist/esm/constants/constants.js +24 -9
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/platform.js +6 -6
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/rnw.js +2 -20
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/constants/rnw.native.js +5 -0
- package/dist/esm/constants/rnw.native.js.map +7 -0
- package/dist/esm/createComponent.js +705 -331
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js +2 -4
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js +0 -3
- package/dist/esm/createShorthands.js.map +1 -1
- package/dist/esm/createTamagui.js +172 -105
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +3 -3
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +3 -20
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +38 -14
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +32 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +2 -4
- package/dist/esm/helpers/areEqualSets.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +4 -5
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +131 -114
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +19 -5
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/createTamaguiProvider.js +46 -19
- package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/esm/helpers/cssHash.js +27 -0
- package/dist/esm/helpers/cssHash.js.map +7 -0
- package/dist/esm/helpers/expandStyle.js +90 -0
- package/dist/esm/helpers/expandStyle.js.map +7 -0
- package/dist/esm/helpers/expandStyles.js +103 -0
- package/dist/esm/helpers/expandStyles.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +46 -40
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +2 -4
- package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +0 -3
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/{jsx/helpers/getTextSize.js → esm/helpers/getFont.js} +12 -7
- package/dist/esm/helpers/getFont.js.map +7 -0
- package/dist/esm/helpers/getSize.js +15 -9
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +282 -176
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStackSize.js +22 -0
- package/dist/esm/helpers/getStackSize.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +188 -110
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getTextSize.js +3 -5
- package/dist/esm/helpers/getTextSize.js.map +2 -2
- package/dist/esm/helpers/getVariantExtras.js +23 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +55 -38
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/isObj.js +1 -3
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +13 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/esm/helpers/isTamaguiElement.js +4 -6
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +2 -4
- package/dist/esm/helpers/matchMedia.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +1 -3
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +26 -0
- package/dist/esm/helpers/mergeProps.js.map +7 -0
- package/dist/esm/helpers/mergeTransform.js +17 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js +2 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/esm/helpers/normalizeColor.js +49 -0
- package/dist/esm/helpers/normalizeColor.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +67 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +1 -4
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +18 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/registerCSSVariable.js +15 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
- package/dist/esm/helpers/themeable.js +34 -5
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/validate.js +42 -19
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/helpers/withStaticProperties.js +2 -4
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -3
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/esm/hooks/useConstant.js +0 -3
- package/dist/esm/hooks/useConstant.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +59 -26
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useId.js +8 -11
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -4
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsTouchDevice.js +4 -6
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +28 -21
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/usePressable.js +18 -5
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/hooks/usePrevious.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +45 -41
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useUnmountEffect.js +0 -3
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +18 -9
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/insertFont.js +64 -0
- package/dist/esm/insertFont.js.map +7 -0
- package/dist/esm/static.js +3 -1
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +37 -12
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/Slot.js +74 -34
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +21 -3
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Text.js +27 -19
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/TextAncestorContext.js +4 -7
- package/dist/esm/views/TextAncestorContext.js.map +2 -2
- package/dist/esm/views/Theme.js +6 -10
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +8 -7
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +6 -7
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +3 -4
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +18 -11
- package/reset.css +41 -0
- package/types/Pressability.d.ts +2 -0
- package/types/Pressability.native.d.ts +2 -0
- package/types/Tamagui.d.ts +4 -6
- package/types/Tamagui.d.ts.map +1 -1
- package/types/ThemeContext.d.ts +0 -0
- package/types/ThemeContext.d.ts.map +0 -0
- package/types/ThemeManager.d.ts +10 -7
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/conf.d.ts +3 -4
- package/types/conf.d.ts.map +1 -1
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/platform.d.ts +2 -2
- package/types/constants/rnw.d.ts +1 -1
- package/types/constants/rnw.d.ts.map +1 -1
- package/types/constants/rnw.native.d.ts +2 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -0
- package/types/createComponent.d.ts +40 -15
- package/types/createComponent.d.ts.map +1 -1
- package/types/createFont.d.ts +0 -0
- package/types/createFont.d.ts.map +0 -0
- package/types/createShorthands.d.ts +0 -0
- package/types/createTamagui.d.ts +10 -2
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +0 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts +16 -11
- package/types/createVariables.d.ts +10 -0
- package/types/defaultComponentState.d.ts +0 -0
- package/types/helpers/RNComponents.d.ts +0 -0
- package/types/helpers/areEqualSets.d.ts +0 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.d.ts.map +1 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/calc.d.ts +12 -0
- package/types/helpers/calc.d.ts.map +1 -0
- package/types/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +4 -3
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/createShallowUpdate.d.ts +1 -2
- package/types/helpers/createTamaguiProvider.d.ts +2 -6
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/cssHash.d.ts +2 -0
- package/types/helpers/cssHash.d.ts.map +1 -0
- package/types/helpers/expandStyle.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts.map +1 -0
- package/types/helpers/expandStyles.d.ts +7 -0
- package/types/helpers/expandStyles.d.ts.map +1 -0
- package/types/helpers/extendStaticConfig.d.ts +0 -0
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/getExpandedShorthands.d.ts +0 -0
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -0
- package/types/helpers/getFont.d.ts +3 -0
- package/types/helpers/getFont.d.ts.map +1 -0
- package/types/helpers/getSize.d.ts +3 -2
- package/types/helpers/getSize.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +10 -7
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStackSize.d.ts +8 -0
- package/types/helpers/getStackSize.d.ts.map +1 -0
- package/types/helpers/getStylesAtomic.d.ts +7 -17
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getVariantExtras.d.ts +7 -0
- package/types/helpers/getVariantExtras.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/helpers/isObj.d.ts +0 -0
- package/types/helpers/isTamaguiComponent.d.ts +5 -0
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -0
- package/types/helpers/isTamaguiElement.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +0 -0
- package/types/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/mergeProps.d.ts +2 -0
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/nativeGestureHandler.native.d.ts +2 -0
- package/types/helpers/normalizeColor.d.ts +3 -0
- package/types/helpers/normalizeColor.d.ts.map +1 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +2 -0
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -0
- package/types/helpers/proxyThemeVariables.d.ts +0 -0
- package/types/helpers/pseudoDescriptors.d.ts +16 -0
- package/types/helpers/registerCSSVariable.d.ts +5 -0
- package/types/helpers/themeable.d.ts +0 -0
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/helpers/validate.d.ts +0 -0
- package/types/helpers/withStaticProperties.d.ts +0 -0
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -0
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -0
- package/types/hooks/useConstant.d.ts +0 -0
- package/types/hooks/useFeatures.d.ts +11 -5
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/hooks/useId.d.ts +0 -0
- package/types/hooks/useIsMounted.d.ts +0 -0
- package/types/hooks/useIsTouchDevice.d.ts +0 -0
- package/types/hooks/useMedia.d.ts +0 -0
- package/types/hooks/useMedia.d.ts.map +0 -0
- package/types/hooks/usePressable.d.ts +0 -0
- package/types/hooks/usePrevious.d.ts +1 -0
- package/types/hooks/useTheme.d.ts +15 -6
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useUnmountEffect.d.ts +0 -0
- package/types/index.d.ts +16 -6
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts +6 -0
- package/types/insertFont.d.ts.map +1 -0
- package/types/static.d.ts +3 -1
- package/types/static.d.ts.map +1 -1
- package/types/styled.d.ts +2 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types-rnw.d.ts +0 -0
- package/types/types.d.ts +71 -51
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -0
- package/types/views/Stack.d.ts +0 -0
- package/types/views/Stack.d.ts.map +0 -0
- package/types/views/Text.d.ts +0 -0
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/TextAncestorContext.d.ts +0 -0
- package/types/views/TextAncestorContext.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -9
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts +0 -0
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +2 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/ThemeReset.d.ts +0 -0
- package/types/views/ThemeReset.d.ts.map +0 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -63
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/cjs/helpers/getButtonSize.js +0 -45
- package/dist/cjs/helpers/getButtonSize.js.map +0 -7
- package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
- package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -41
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/esm/helpers/getButtonSize.js +0 -24
- package/dist/esm/helpers/getButtonSize.js.map +0 -7
- package/dist/jsx/Tamagui.js +0 -41
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -186
- package/dist/jsx/conf.js +0 -35
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -23
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -617
- package/dist/jsx/createFont.js +0 -27
- package/dist/jsx/createShorthands.js +0 -9
- package/dist/jsx/createTamagui.js +0 -201
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -28
- package/dist/jsx/createVariable.js +0 -48
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
- package/dist/jsx/helpers/areEqualSets.js +0 -15
- package/dist/jsx/helpers/createMediaStyle.js +0 -30
- package/dist/jsx/helpers/createPropMapper.js +0 -237
- package/dist/jsx/helpers/createShallowUpdate.js +0 -18
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
- package/dist/jsx/helpers/extendStaticConfig.js +0 -61
- package/dist/jsx/helpers/fixNativeShadow.js +0 -7
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -40
- package/dist/jsx/helpers/getButtonSize.js +0 -23
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
- package/dist/jsx/helpers/getSize.js +0 -12
- package/dist/jsx/helpers/getSplitStyles.js +0 -302
- package/dist/jsx/helpers/getStylesAtomic.js +0 -130
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
- package/dist/jsx/helpers/insertStyleRule.js +0 -94
- package/dist/jsx/helpers/isObj.js +0 -6
- package/dist/jsx/helpers/isTamaguiElement.js +0 -10
- package/dist/jsx/helpers/matchMedia.js +0 -17
- package/dist/jsx/helpers/matchMedia.native.js +0 -8
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
- package/dist/jsx/helpers/themeable.js +0 -24
- package/dist/jsx/helpers/validate.js +0 -75
- package/dist/jsx/helpers/withStaticProperties.js +0 -9
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
- package/dist/jsx/hooks/useConstant.js +0 -14
- package/dist/jsx/hooks/useFeatures.js +0 -167
- package/dist/jsx/hooks/useId.js +0 -34
- package/dist/jsx/hooks/useIsMounted.js +0 -18
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
- package/dist/jsx/hooks/useMedia.js +0 -158
- package/dist/jsx/hooks/usePressable.js +0 -13
- package/dist/jsx/hooks/useTheme.js +0 -177
- package/dist/jsx/hooks/useUnmountEffect.js +0 -10
- package/dist/jsx/index.js +0 -54
- package/dist/jsx/static.js +0 -16
- package/dist/jsx/styled.js +0 -48
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -56
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -61
- package/dist/jsx/views/TextAncestorContext.js +0 -15
- package/dist/jsx/views/Theme.js +0 -31
- package/dist/jsx/views/ThemeInverse.js +0 -22
- package/dist/jsx/views/ThemeProvider.js +0 -35
- package/dist/jsx/views/ThemeReset.js +0 -34
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/platform.d.ts.map +0 -1
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTheme.d.ts.map +0 -1
- package/types/createVariable.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/addStylesUsingClassname.d.ts +0 -3
- package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/types/helpers/areEqualSets.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.native.d.ts +0 -2
- package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/types/helpers/getButtonSize.d.ts +0 -8
- package/types/helpers/getButtonSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getTextSize.d.ts +0 -3
- package/types/helpers/getTextSize.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/validate.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts.map +0 -1
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts.map +0 -1
- package/types/types-rnw.d.ts.map +0 -1
- package/types/views/Slot.d.ts.map +0 -1
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { composeEventHandlers, stylePropsView, validStyles } from "@tamagui/helpers";
|
|
33
|
+
import {
|
|
34
|
+
useElementLayout,
|
|
35
|
+
useMergeRefs,
|
|
36
|
+
usePlatformMethods,
|
|
37
|
+
useResponderEvents
|
|
38
|
+
} from "@tamagui/rnw";
|
|
4
39
|
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
5
40
|
import React, {
|
|
6
41
|
Children,
|
|
@@ -10,36 +45,40 @@ import React, {
|
|
|
10
45
|
memo,
|
|
11
46
|
useCallback,
|
|
12
47
|
useContext,
|
|
48
|
+
useMemo,
|
|
13
49
|
useRef,
|
|
14
50
|
useState
|
|
15
51
|
} from "react";
|
|
16
52
|
import { StyleSheet, Text, View } from "react-native";
|
|
17
|
-
import { onConfiguredOnce } from "./conf";
|
|
53
|
+
import { getConfig, onConfiguredOnce } from "./conf";
|
|
18
54
|
import { stackDefaultStyles } from "./constants/constants";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
55
|
+
import { isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
56
|
+
import { assignNativePropsToWeb } from "./helpers/assignNativePropsToWeb";
|
|
57
|
+
import { getReturnVariablesAs } from "./helpers/createPropMapper";
|
|
22
58
|
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
23
59
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
24
60
|
import { insertSplitStyles, useSplitStyles } from "./helpers/getSplitStyles";
|
|
25
61
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
62
|
+
import { mergeProps } from "./helpers/mergeProps";
|
|
26
63
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
27
64
|
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
28
65
|
import { useFeatures } from "./hooks/useFeatures";
|
|
29
66
|
import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
67
|
+
import { mediaState } from "./hooks/useMedia";
|
|
30
68
|
import { usePressable } from "./hooks/usePressable";
|
|
31
69
|
import { getThemeManagerIfChanged, useTheme } from "./hooks/useTheme";
|
|
32
|
-
import {
|
|
70
|
+
import { Pressability } from "./Pressability";
|
|
71
|
+
import { Slot, mergeEvent } from "./views/Slot";
|
|
33
72
|
import { TextAncestorContext } from "./views/TextAncestorContext";
|
|
34
73
|
React["keep"];
|
|
35
|
-
const defaultComponentState = {
|
|
74
|
+
const defaultComponentState = Object.freeze({
|
|
36
75
|
hover: false,
|
|
37
76
|
press: false,
|
|
38
77
|
pressIn: false,
|
|
39
78
|
focus: false,
|
|
40
79
|
mounted: false,
|
|
41
80
|
animation: null
|
|
42
|
-
};
|
|
81
|
+
});
|
|
43
82
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
44
83
|
if (typeof document !== "undefined") {
|
|
45
84
|
document.addEventListener("mouseup", () => {
|
|
@@ -60,7 +99,6 @@ function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
|
60
99
|
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
61
100
|
}
|
|
62
101
|
}
|
|
63
|
-
__name(mergeShorthands, "mergeShorthands");
|
|
64
102
|
let initialTheme;
|
|
65
103
|
function createComponent(configIn, ParentComponent) {
|
|
66
104
|
const staticConfig = (() => {
|
|
@@ -71,7 +109,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
71
109
|
return parseStaticConfig(config);
|
|
72
110
|
}
|
|
73
111
|
})();
|
|
74
|
-
const
|
|
112
|
+
const defaultComponentClassName = `is_${staticConfig.componentName}`;
|
|
75
113
|
let tamaguiConfig;
|
|
76
114
|
let AnimatedText;
|
|
77
115
|
let AnimatedView;
|
|
@@ -80,96 +118,327 @@ function createComponent(configIn, ParentComponent) {
|
|
|
80
118
|
let defaultNativeStyleSheet;
|
|
81
119
|
let tamaguiDefaultProps;
|
|
82
120
|
let initialSplitStyles;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (defaultPseudoStyle) {
|
|
91
|
-
styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle);
|
|
121
|
+
const component = forwardRef((propsIn, forwardedRef) => {
|
|
122
|
+
var _a, _d, _e, _f;
|
|
123
|
+
let props;
|
|
124
|
+
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
125
|
+
props = mergeProps(tamaguiDefaultProps, propsIn)[0];
|
|
126
|
+
} else {
|
|
127
|
+
props = propsIn;
|
|
92
128
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props;
|
|
98
|
-
const { Component, componentName, isText, isZStack } = staticConfig;
|
|
129
|
+
const hostRef = useRef(null);
|
|
130
|
+
const { Component, isText, isZStack } = staticConfig;
|
|
131
|
+
const componentName = props.componentName || staticConfig.componentName;
|
|
132
|
+
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
99
133
|
if (process.env.NODE_ENV === "development") {
|
|
100
134
|
if (props["debug"]) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
135
|
+
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
136
|
+
const banner = `${name} ${propsIn["data-is"] || ""}`;
|
|
137
|
+
console.group(`%c \u{1F41B} ${banner}`, "background: yellow;");
|
|
138
|
+
console.log("props", propsIn);
|
|
139
|
+
console.log("ref", hostRef);
|
|
140
|
+
if (props["debug"] === "break") {
|
|
104
141
|
debugger;
|
|
142
|
+
}
|
|
105
143
|
}
|
|
106
144
|
}
|
|
107
145
|
const forceUpdate = useForceUpdate();
|
|
108
|
-
const theme = useTheme(props.theme,
|
|
109
|
-
const
|
|
110
|
-
const setStateShallow = createShallowUpdate(
|
|
146
|
+
const theme = useTheme(props.theme, componentName, props, forceUpdate);
|
|
147
|
+
const statesUsed = useState(defaultComponentState);
|
|
148
|
+
const setStateShallow = createShallowUpdate(statesUsed[1]);
|
|
149
|
+
let state = statesUsed[0];
|
|
150
|
+
if (propsIn.forceStyle) {
|
|
151
|
+
state = __spreadProps(__spreadValues({}, state), {
|
|
152
|
+
[propsIn.forceStyle]: true
|
|
153
|
+
});
|
|
154
|
+
}
|
|
111
155
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
112
|
-
const
|
|
156
|
+
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
157
|
+
const hasTextAncestor = !!(isWeb ? useContext(TextAncestorContext) : false);
|
|
158
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? __spreadProps(__spreadValues({}, state), {
|
|
159
|
+
hasTextAncestor,
|
|
160
|
+
dynamicStylesInline: true
|
|
161
|
+
}) : __spreadProps(__spreadValues({}, state), {
|
|
162
|
+
noClassNames: true,
|
|
163
|
+
dynamicStylesInline: true,
|
|
164
|
+
hasTextAncestor,
|
|
165
|
+
resolveVariablesAs: "value"
|
|
166
|
+
});
|
|
167
|
+
const splitStyles = useSplitStyles(props, staticConfig, theme, splitStyleState, props.asChild ? null : initialSplitStyles.classNames, props["debug"]);
|
|
113
168
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
114
169
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
115
170
|
const isAnimated = !!(useAnimations && props.animation);
|
|
116
171
|
const hasEnterStyle = !!props.enterStyle;
|
|
172
|
+
const animationFeatureStylesIn = props.animation ? __spreadValues(__spreadValues({}, defaultNativeStyle), style) : null;
|
|
117
173
|
const features = useFeatures(props, {
|
|
118
174
|
forceUpdate,
|
|
119
175
|
setStateShallow,
|
|
120
176
|
useAnimations,
|
|
121
177
|
state,
|
|
122
|
-
style:
|
|
178
|
+
style: animationFeatureStylesIn,
|
|
123
179
|
pseudos,
|
|
124
180
|
staticConfig,
|
|
125
181
|
theme,
|
|
182
|
+
hostRef,
|
|
126
183
|
onDidAnimate: props.onDidAnimate
|
|
127
184
|
});
|
|
128
|
-
const {
|
|
185
|
+
const _b = viewPropsIn, {
|
|
129
186
|
tag,
|
|
130
187
|
hitSlop,
|
|
131
188
|
asChild,
|
|
132
189
|
children,
|
|
133
|
-
pointerEvents,
|
|
134
190
|
onPress,
|
|
135
191
|
onPressIn,
|
|
136
192
|
onPressOut,
|
|
137
193
|
onHoverIn,
|
|
138
194
|
onHoverOut,
|
|
139
|
-
space,
|
|
140
|
-
|
|
195
|
+
space: spaceProp,
|
|
196
|
+
spaceDirection: _spaceDirection,
|
|
197
|
+
disabled: disabledProp,
|
|
198
|
+
onMouseUp,
|
|
199
|
+
onMouseDown,
|
|
141
200
|
onMouseEnter,
|
|
142
201
|
onMouseLeave,
|
|
143
202
|
hrefAttrs,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
onResponderEnd,
|
|
147
|
-
onResponderGrant,
|
|
148
|
-
onResponderMove,
|
|
149
|
-
onResponderReject,
|
|
150
|
-
onResponderRelease,
|
|
151
|
-
onResponderStart,
|
|
152
|
-
onResponderTerminate,
|
|
153
|
-
onResponderTerminationRequest,
|
|
154
|
-
onScrollShouldSetResponder,
|
|
155
|
-
onScrollShouldSetResponderCapture,
|
|
156
|
-
onSelectionChangeShouldSetResponder,
|
|
157
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
158
|
-
onStartShouldSetResponder,
|
|
159
|
-
onStartShouldSetResponderCapture,
|
|
160
|
-
onMouseDown,
|
|
161
|
-
nativeID,
|
|
162
|
-
accessible,
|
|
163
|
-
accessibilityRole,
|
|
164
|
-
collapsable,
|
|
165
|
-
focusable,
|
|
203
|
+
separator,
|
|
204
|
+
forceStyle: _forceStyle,
|
|
166
205
|
onClick,
|
|
167
206
|
theme: _themeProp,
|
|
168
|
-
defaultVariants
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
207
|
+
defaultVariants
|
|
208
|
+
} = _b, nonTamaguiProps = __objRest(_b, [
|
|
209
|
+
"tag",
|
|
210
|
+
"hitSlop",
|
|
211
|
+
"asChild",
|
|
212
|
+
"children",
|
|
213
|
+
"onPress",
|
|
214
|
+
"onPressIn",
|
|
215
|
+
"onPressOut",
|
|
216
|
+
"onHoverIn",
|
|
217
|
+
"onHoverOut",
|
|
218
|
+
"space",
|
|
219
|
+
"spaceDirection",
|
|
220
|
+
"disabled",
|
|
221
|
+
"onMouseUp",
|
|
222
|
+
"onMouseDown",
|
|
223
|
+
"onMouseEnter",
|
|
224
|
+
"onMouseLeave",
|
|
225
|
+
"hrefAttrs",
|
|
226
|
+
"separator",
|
|
227
|
+
"forceStyle",
|
|
228
|
+
"onClick",
|
|
229
|
+
"theme",
|
|
230
|
+
"defaultVariants"
|
|
231
|
+
]);
|
|
232
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
233
|
+
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
234
|
+
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
235
|
+
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
236
|
+
let elementType = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
237
|
+
elementType = Component || elementType;
|
|
238
|
+
const isStringElement = typeof elementType === "string";
|
|
239
|
+
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
240
|
+
let viewProps;
|
|
241
|
+
if (process.env.TAMAGUI_TARGET === "web" && !staticConfig.isReactNativeWeb) {
|
|
242
|
+
const _c = nonTamaguiProps, {
|
|
243
|
+
onMoveShouldSetResponder,
|
|
244
|
+
onMoveShouldSetResponderCapture,
|
|
245
|
+
onResponderEnd,
|
|
246
|
+
onResponderGrant,
|
|
247
|
+
onResponderMove,
|
|
248
|
+
onResponderReject,
|
|
249
|
+
onResponderRelease,
|
|
250
|
+
onResponderStart,
|
|
251
|
+
onResponderTerminate,
|
|
252
|
+
onResponderTerminationRequest,
|
|
253
|
+
onScrollShouldSetResponder,
|
|
254
|
+
onScrollShouldSetResponderCapture,
|
|
255
|
+
onSelectionChangeShouldSetResponder,
|
|
256
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
257
|
+
onStartShouldSetResponder,
|
|
258
|
+
onStartShouldSetResponderCapture,
|
|
259
|
+
nativeID,
|
|
260
|
+
accessibilityActiveDescendant,
|
|
261
|
+
accessibilityAtomic,
|
|
262
|
+
accessibilityAutoComplete,
|
|
263
|
+
accessibilityBusy,
|
|
264
|
+
accessibilityChecked,
|
|
265
|
+
accessibilityColumnCount,
|
|
266
|
+
accessibilityColumnIndex,
|
|
267
|
+
accessibilityColumnSpan,
|
|
268
|
+
accessibilityControls,
|
|
269
|
+
accessibilityCurrent,
|
|
270
|
+
accessibilityDescribedBy,
|
|
271
|
+
accessibilityDetails,
|
|
272
|
+
accessibilityDisabled,
|
|
273
|
+
accessibilityErrorMessage,
|
|
274
|
+
accessibilityExpanded,
|
|
275
|
+
accessibilityFlowTo,
|
|
276
|
+
accessibilityHasPopup,
|
|
277
|
+
accessibilityHidden,
|
|
278
|
+
accessibilityInvalid,
|
|
279
|
+
accessibilityKeyShortcuts,
|
|
280
|
+
accessibilityLabel,
|
|
281
|
+
accessibilityLabelledBy,
|
|
282
|
+
accessibilityLevel,
|
|
283
|
+
accessibilityLiveRegion,
|
|
284
|
+
accessibilityModal,
|
|
285
|
+
accessibilityMultiline,
|
|
286
|
+
accessibilityMultiSelectable,
|
|
287
|
+
accessibilityOrientation,
|
|
288
|
+
accessibilityOwns,
|
|
289
|
+
accessibilityPlaceholder,
|
|
290
|
+
accessibilityPosInSet,
|
|
291
|
+
accessibilityPressed,
|
|
292
|
+
accessibilityReadOnly,
|
|
293
|
+
accessibilityRequired,
|
|
294
|
+
accessibilityRole,
|
|
295
|
+
accessibilityRoleDescription,
|
|
296
|
+
accessibilityRowCount,
|
|
297
|
+
accessibilityRowIndex,
|
|
298
|
+
accessibilityRowSpan,
|
|
299
|
+
accessibilitySelected,
|
|
300
|
+
accessibilitySetSize,
|
|
301
|
+
accessibilitySort,
|
|
302
|
+
accessibilityValueMax,
|
|
303
|
+
accessibilityValueMin,
|
|
304
|
+
accessibilityValueNow,
|
|
305
|
+
accessibilityValueText,
|
|
306
|
+
accessible,
|
|
307
|
+
accessibilityState,
|
|
308
|
+
accessibilityValue,
|
|
309
|
+
collapsable,
|
|
310
|
+
focusable,
|
|
311
|
+
onLayout
|
|
312
|
+
} = _c, webProps = __objRest(_c, [
|
|
313
|
+
"onMoveShouldSetResponder",
|
|
314
|
+
"onMoveShouldSetResponderCapture",
|
|
315
|
+
"onResponderEnd",
|
|
316
|
+
"onResponderGrant",
|
|
317
|
+
"onResponderMove",
|
|
318
|
+
"onResponderReject",
|
|
319
|
+
"onResponderRelease",
|
|
320
|
+
"onResponderStart",
|
|
321
|
+
"onResponderTerminate",
|
|
322
|
+
"onResponderTerminationRequest",
|
|
323
|
+
"onScrollShouldSetResponder",
|
|
324
|
+
"onScrollShouldSetResponderCapture",
|
|
325
|
+
"onSelectionChangeShouldSetResponder",
|
|
326
|
+
"onSelectionChangeShouldSetResponderCapture",
|
|
327
|
+
"onStartShouldSetResponder",
|
|
328
|
+
"onStartShouldSetResponderCapture",
|
|
329
|
+
"nativeID",
|
|
330
|
+
"accessibilityActiveDescendant",
|
|
331
|
+
"accessibilityAtomic",
|
|
332
|
+
"accessibilityAutoComplete",
|
|
333
|
+
"accessibilityBusy",
|
|
334
|
+
"accessibilityChecked",
|
|
335
|
+
"accessibilityColumnCount",
|
|
336
|
+
"accessibilityColumnIndex",
|
|
337
|
+
"accessibilityColumnSpan",
|
|
338
|
+
"accessibilityControls",
|
|
339
|
+
"accessibilityCurrent",
|
|
340
|
+
"accessibilityDescribedBy",
|
|
341
|
+
"accessibilityDetails",
|
|
342
|
+
"accessibilityDisabled",
|
|
343
|
+
"accessibilityErrorMessage",
|
|
344
|
+
"accessibilityExpanded",
|
|
345
|
+
"accessibilityFlowTo",
|
|
346
|
+
"accessibilityHasPopup",
|
|
347
|
+
"accessibilityHidden",
|
|
348
|
+
"accessibilityInvalid",
|
|
349
|
+
"accessibilityKeyShortcuts",
|
|
350
|
+
"accessibilityLabel",
|
|
351
|
+
"accessibilityLabelledBy",
|
|
352
|
+
"accessibilityLevel",
|
|
353
|
+
"accessibilityLiveRegion",
|
|
354
|
+
"accessibilityModal",
|
|
355
|
+
"accessibilityMultiline",
|
|
356
|
+
"accessibilityMultiSelectable",
|
|
357
|
+
"accessibilityOrientation",
|
|
358
|
+
"accessibilityOwns",
|
|
359
|
+
"accessibilityPlaceholder",
|
|
360
|
+
"accessibilityPosInSet",
|
|
361
|
+
"accessibilityPressed",
|
|
362
|
+
"accessibilityReadOnly",
|
|
363
|
+
"accessibilityRequired",
|
|
364
|
+
"accessibilityRole",
|
|
365
|
+
"accessibilityRoleDescription",
|
|
366
|
+
"accessibilityRowCount",
|
|
367
|
+
"accessibilityRowIndex",
|
|
368
|
+
"accessibilityRowSpan",
|
|
369
|
+
"accessibilitySelected",
|
|
370
|
+
"accessibilitySetSize",
|
|
371
|
+
"accessibilitySort",
|
|
372
|
+
"accessibilityValueMax",
|
|
373
|
+
"accessibilityValueMin",
|
|
374
|
+
"accessibilityValueNow",
|
|
375
|
+
"accessibilityValueText",
|
|
376
|
+
"accessible",
|
|
377
|
+
"accessibilityState",
|
|
378
|
+
"accessibilityValue",
|
|
379
|
+
"collapsable",
|
|
380
|
+
"focusable",
|
|
381
|
+
"onLayout"
|
|
382
|
+
]);
|
|
383
|
+
viewProps = webProps;
|
|
384
|
+
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
385
|
+
useElementLayout(hostRef, onLayout);
|
|
386
|
+
useResponderEvents(hostRef, {
|
|
387
|
+
onMoveShouldSetResponder,
|
|
388
|
+
onMoveShouldSetResponderCapture,
|
|
389
|
+
onResponderEnd,
|
|
390
|
+
onResponderGrant,
|
|
391
|
+
onResponderMove,
|
|
392
|
+
onResponderReject,
|
|
393
|
+
onResponderRelease,
|
|
394
|
+
onResponderStart,
|
|
395
|
+
onResponderTerminate,
|
|
396
|
+
onResponderTerminationRequest,
|
|
397
|
+
onScrollShouldSetResponder,
|
|
398
|
+
onScrollShouldSetResponderCapture,
|
|
399
|
+
onSelectionChangeShouldSetResponder,
|
|
400
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
401
|
+
onStartShouldSetResponder,
|
|
402
|
+
onStartShouldSetResponderCapture
|
|
403
|
+
});
|
|
404
|
+
const platformMethodsRef = usePlatformMethods(viewProps);
|
|
405
|
+
const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
|
|
406
|
+
viewProps.ref = setRef;
|
|
407
|
+
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
408
|
+
const { download, rel, target } = hrefAttrs;
|
|
409
|
+
if (download != null) {
|
|
410
|
+
viewProps.download = download;
|
|
411
|
+
}
|
|
412
|
+
if (rel != null) {
|
|
413
|
+
viewProps.rel = rel;
|
|
414
|
+
}
|
|
415
|
+
if (typeof target === "string") {
|
|
416
|
+
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
const _focusable = focusable != void 0 ? focusable : accessible;
|
|
420
|
+
const role = viewProps.role;
|
|
421
|
+
if (_focusable === false) {
|
|
422
|
+
viewProps.tabIndex = "-1";
|
|
423
|
+
}
|
|
424
|
+
if (elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
425
|
+
if (_focusable === false || accessibilityDisabled === true) {
|
|
426
|
+
viewProps.tabIndex = "-1";
|
|
427
|
+
}
|
|
428
|
+
} else if (role === "button" || role === "checkbox" || role === "link" || role === "radio" || role === "textbox" || role === "switch") {
|
|
429
|
+
if (_focusable !== false) {
|
|
430
|
+
viewProps.tabIndex = "0";
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (_focusable === true) {
|
|
434
|
+
viewProps.tabIndex = "0";
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
viewProps = nonTamaguiProps;
|
|
438
|
+
if (forwardedRef) {
|
|
439
|
+
viewProps.ref = forwardedRef;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
173
442
|
if (process.env.NODE_ENV === "development" && !isText && isWeb) {
|
|
174
443
|
Children.toArray(props.children).forEach((item) => {
|
|
175
444
|
if (typeof item === "string") {
|
|
@@ -177,8 +446,6 @@ function createComponent(configIn, ParentComponent) {
|
|
|
177
446
|
}
|
|
178
447
|
});
|
|
179
448
|
}
|
|
180
|
-
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
|
|
181
|
-
const hostRef = useRef(null);
|
|
182
449
|
const internal = useRef();
|
|
183
450
|
if (!internal.current) {
|
|
184
451
|
internal.current = {
|
|
@@ -193,133 +460,76 @@ function createComponent(configIn, ParentComponent) {
|
|
|
193
460
|
}
|
|
194
461
|
internal.current.isMounted = true;
|
|
195
462
|
return () => {
|
|
463
|
+
var _a2;
|
|
196
464
|
mouseUps.delete(unPress);
|
|
197
465
|
internal.current.isMounted = false;
|
|
466
|
+
(_a2 = internal.current.unmountEffects) == null ? void 0 : _a2.forEach((cb) => cb());
|
|
198
467
|
};
|
|
199
468
|
}, [hasEnterStyle, props.animation]);
|
|
200
|
-
if (nativeID) {
|
|
201
|
-
viewProps.id = nativeID;
|
|
202
|
-
}
|
|
203
|
-
if (isAndroid) {
|
|
204
|
-
if (collapsable)
|
|
205
|
-
viewProps.collapsable = collapsable;
|
|
206
|
-
if (focusable)
|
|
207
|
-
viewProps.focusable = focusable;
|
|
208
|
-
}
|
|
209
|
-
if (!isWeb) {
|
|
210
|
-
if (accessible)
|
|
211
|
-
viewProps.accessible = accessible;
|
|
212
|
-
if (accessibilityRole)
|
|
213
|
-
viewProps.accessibilityRole = accessibilityRole;
|
|
214
|
-
}
|
|
215
|
-
if (isWeb && !asChild) {
|
|
216
|
-
rnw.useResponderEvents(hostRef, {
|
|
217
|
-
onMoveShouldSetResponder,
|
|
218
|
-
onMoveShouldSetResponderCapture,
|
|
219
|
-
onResponderEnd,
|
|
220
|
-
onResponderGrant,
|
|
221
|
-
onResponderMove,
|
|
222
|
-
onResponderReject,
|
|
223
|
-
onResponderRelease,
|
|
224
|
-
onResponderStart,
|
|
225
|
-
onResponderTerminate,
|
|
226
|
-
onResponderTerminationRequest,
|
|
227
|
-
onScrollShouldSetResponder,
|
|
228
|
-
onScrollShouldSetResponderCapture,
|
|
229
|
-
onSelectionChangeShouldSetResponder,
|
|
230
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
231
|
-
onStartShouldSetResponder,
|
|
232
|
-
onStartShouldSetResponderCapture
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
const isTaggable = !Component || typeof Component === "string";
|
|
236
|
-
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
237
|
-
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
238
|
-
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
239
|
-
let ViewComponent = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
240
|
-
ViewComponent = Component || ViewComponent;
|
|
241
469
|
let styles;
|
|
242
|
-
const isStringElement = typeof ViewComponent === "string";
|
|
243
470
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
244
|
-
if (isStringElement && shouldAvoidClasses) {
|
|
245
|
-
styles = {
|
|
246
|
-
...defaultNativeStyle,
|
|
247
|
-
...animationStyles,
|
|
248
|
-
...medias
|
|
249
|
-
};
|
|
471
|
+
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
472
|
+
styles = __spreadValues(__spreadValues(__spreadValues({}, defaultNativeStyle), animationStyles ?? style), medias);
|
|
250
473
|
} else {
|
|
251
474
|
styles = [
|
|
252
475
|
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
253
|
-
animationStyles
|
|
476
|
+
animationStyles ?? style,
|
|
254
477
|
medias
|
|
255
478
|
];
|
|
256
479
|
if (!animationStyles) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
state.
|
|
260
|
-
state.
|
|
480
|
+
const initPseudos = initialSplitStyles.pseudos;
|
|
481
|
+
const force = shouldForcePseudo;
|
|
482
|
+
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
483
|
+
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", force);
|
|
484
|
+
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", force);
|
|
485
|
+
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", force);
|
|
261
486
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const classList = [
|
|
268
|
-
componentName ? componentClassName : "",
|
|
269
|
-
fontFamily ? `font_${fontFamily}` : "",
|
|
270
|
-
theme.className,
|
|
271
|
-
classNames ? Object.values(classNames).join(" ") : ""
|
|
272
|
-
];
|
|
273
|
-
const className = classList.join(" ");
|
|
274
|
-
if (process.env.NODE_ENV === "development") {
|
|
275
|
-
if (props["debug"]) {
|
|
276
|
-
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]])) });
|
|
487
|
+
if (shouldForcePseudo) {
|
|
488
|
+
const next = {};
|
|
489
|
+
for (const style2 of styles) {
|
|
490
|
+
if (style2) {
|
|
491
|
+
Object.assign(next, style2);
|
|
277
492
|
}
|
|
278
493
|
}
|
|
279
|
-
|
|
280
|
-
viewProps.style = animationStyles;
|
|
281
|
-
} else {
|
|
282
|
-
viewProps.style = styles;
|
|
494
|
+
Object.assign(splitStyles.style, next);
|
|
283
495
|
}
|
|
284
|
-
} else {
|
|
285
|
-
viewProps.style = styles;
|
|
286
|
-
}
|
|
287
|
-
if (pointerEvents) {
|
|
288
|
-
viewProps.pointerEvents = pointerEvents;
|
|
289
496
|
}
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
497
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
498
|
+
const fontFamilyName = isText ? props.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
499
|
+
const fontFamily = fontFamilyName && fontFamilyName[0] === "$" ? fontFamilyName.slice(1) : null;
|
|
500
|
+
const classList = [
|
|
501
|
+
componentName ? componentClassName : "",
|
|
502
|
+
fontFamily ? `font_${fontFamily}` : "",
|
|
503
|
+
theme.className,
|
|
504
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
505
|
+
];
|
|
506
|
+
const className = classList.join(" ");
|
|
507
|
+
const style2 = animationStyles ?? splitStyles.style;
|
|
508
|
+
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
509
|
+
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
510
|
+
viewProps.dataSet = __spreadProps(__spreadValues({}, viewProps.dataSet), {
|
|
511
|
+
className,
|
|
512
|
+
id: props.id
|
|
513
|
+
});
|
|
514
|
+
if (props["data-is"]) {
|
|
515
|
+
viewProps.dataSet.is = props["data-is"];
|
|
310
516
|
}
|
|
517
|
+
} else {
|
|
518
|
+
viewProps.className = className;
|
|
311
519
|
}
|
|
520
|
+
viewProps.style = style2;
|
|
312
521
|
} else {
|
|
313
|
-
|
|
314
|
-
viewProps.ref = forwardedRef;
|
|
315
|
-
}
|
|
522
|
+
viewProps.style = styles;
|
|
316
523
|
}
|
|
317
524
|
const initialPseudos = initialSplitStyles.pseudos;
|
|
318
|
-
const attachPress = !!(pseudos
|
|
525
|
+
const attachPress = !!((pseudos == null ? void 0 : pseudos.pressStyle) || (initialPseudos == null ? void 0 : initialPseudos.pressStyle) || onPress || onPressOut || onPressIn || onClick);
|
|
319
526
|
const isTouch = useIsTouchDevice();
|
|
320
527
|
const isHoverable = isWeb && !isTouch;
|
|
321
528
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
322
|
-
const
|
|
529
|
+
const handlesPressEvents = !isStringElement && !asChild;
|
|
530
|
+
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
531
|
+
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
532
|
+
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
323
533
|
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
324
534
|
const unPress = useCallback(() => {
|
|
325
535
|
if (!internal.current.isMounted)
|
|
@@ -329,46 +539,45 @@ function createComponent(configIn, ParentComponent) {
|
|
|
329
539
|
pressIn: false
|
|
330
540
|
});
|
|
331
541
|
}, []);
|
|
332
|
-
const events = shouldAttach ? {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
542
|
+
const events = shouldAttach ? __spreadValues(__spreadProps(__spreadValues({
|
|
543
|
+
[pressOutKey]: attachPress ? (e) => {
|
|
544
|
+
unPress();
|
|
545
|
+
onPressOut == null ? void 0 : onPressOut(e);
|
|
546
|
+
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
547
|
+
} : void 0
|
|
548
|
+
}, isHoverable && {
|
|
549
|
+
onMouseEnter: attachHover ? (e) => {
|
|
550
|
+
const next = {};
|
|
551
|
+
if (attachHover) {
|
|
552
|
+
next.hover = true;
|
|
337
553
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
setStateShallow(next);
|
|
366
|
-
}
|
|
367
|
-
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
368
|
-
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
369
|
-
} : void 0
|
|
370
|
-
},
|
|
371
|
-
onMouseDown: attachPress ? (e) => {
|
|
554
|
+
if (state.pressIn) {
|
|
555
|
+
next.press = true;
|
|
556
|
+
}
|
|
557
|
+
if (Object.keys(next).length) {
|
|
558
|
+
setStateShallow(next);
|
|
559
|
+
}
|
|
560
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
561
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
562
|
+
} : void 0,
|
|
563
|
+
onMouseLeave: attachHover ? (e) => {
|
|
564
|
+
const next = {};
|
|
565
|
+
mouseUps.add(unPress);
|
|
566
|
+
if (attachHover) {
|
|
567
|
+
next.hover = false;
|
|
568
|
+
}
|
|
569
|
+
if (state.pressIn) {
|
|
570
|
+
next.press = false;
|
|
571
|
+
next.pressIn = false;
|
|
572
|
+
}
|
|
573
|
+
if (Object.keys(next).length) {
|
|
574
|
+
setStateShallow(next);
|
|
575
|
+
}
|
|
576
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
577
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
578
|
+
} : void 0
|
|
579
|
+
}), {
|
|
580
|
+
[pressInKey]: attachPress ? (e) => {
|
|
372
581
|
setStateShallow({
|
|
373
582
|
press: true,
|
|
374
583
|
pressIn: true
|
|
@@ -379,83 +588,145 @@ function createComponent(configIn, ParentComponent) {
|
|
|
379
588
|
mouseUps.add(unPress);
|
|
380
589
|
}
|
|
381
590
|
} : null,
|
|
382
|
-
[
|
|
591
|
+
[pressKey]: attachPress ? (e) => {
|
|
592
|
+
unPress();
|
|
383
593
|
onClick == null ? void 0 : onClick(e);
|
|
384
594
|
onPress == null ? void 0 : onPress(e);
|
|
385
|
-
unPress();
|
|
386
|
-
onPressOut == null ? void 0 : onPressOut(e);
|
|
387
595
|
} : null
|
|
388
|
-
}
|
|
596
|
+
}), !isWeb && {
|
|
597
|
+
cancelable: !props.rejectResponderTermination,
|
|
598
|
+
disabled: props.disabled !== null ? props.disabled : (_d = props.accessibilityState) == null ? void 0 : _d.disabled,
|
|
599
|
+
hitSlop: props.hitSlop,
|
|
600
|
+
delayLongPress: props.delayLongPress,
|
|
601
|
+
delayPressIn: props.delayPressIn,
|
|
602
|
+
delayPressOut: props.delayPressOut,
|
|
603
|
+
focusable: viewProps.focusable ?? true,
|
|
604
|
+
minPressDuration: 0
|
|
605
|
+
}) : null;
|
|
606
|
+
let space = spaceProp;
|
|
607
|
+
if (features.enabled.mediaQuery) {
|
|
608
|
+
for (const key in mediaState) {
|
|
609
|
+
if (!mediaState[key])
|
|
610
|
+
continue;
|
|
611
|
+
if (props[key] && props[key].space !== void 0) {
|
|
612
|
+
space = props[key].space;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
389
616
|
const childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
|
|
617
|
+
separator,
|
|
390
618
|
children,
|
|
391
619
|
space,
|
|
392
|
-
|
|
620
|
+
direction: props.spaceDirection || "both",
|
|
393
621
|
isZStack
|
|
394
622
|
}), getThemeManagerIfChanged(theme));
|
|
395
|
-
const [pressProps] = usePressable(events ? {
|
|
396
|
-
disabled,
|
|
397
|
-
...hitSlop && {
|
|
398
|
-
hitSlop
|
|
399
|
-
},
|
|
400
|
-
onPressIn: events.onMouseDown,
|
|
401
|
-
onPressOut: events.onPressOut,
|
|
402
|
-
onPress: events[pressEventKey]
|
|
403
|
-
} : {
|
|
404
|
-
disabled: true
|
|
405
|
-
});
|
|
406
623
|
let content;
|
|
624
|
+
if (asChild) {
|
|
625
|
+
elementType = Slot;
|
|
626
|
+
viewProps = __spreadProps(__spreadValues({}, viewProps), {
|
|
627
|
+
onPress,
|
|
628
|
+
onPressIn,
|
|
629
|
+
onPressOut
|
|
630
|
+
});
|
|
631
|
+
}
|
|
407
632
|
if (isWeb) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
633
|
+
const [pressableProps] = usePressable(events ? __spreadProps(__spreadValues({
|
|
634
|
+
disabled
|
|
635
|
+
}, hitSlop && {
|
|
636
|
+
hitSlop
|
|
637
|
+
}), {
|
|
638
|
+
onPressOut: events[pressOutKey],
|
|
639
|
+
onPressIn: events[pressInKey],
|
|
640
|
+
onPress: events[pressKey]
|
|
641
|
+
}) : {
|
|
642
|
+
disabled: true
|
|
643
|
+
});
|
|
644
|
+
if (events) {
|
|
645
|
+
if (handlesPressEvents) {
|
|
646
|
+
Object.assign(viewProps, pressableProps);
|
|
647
|
+
} else {
|
|
648
|
+
Object.assign(viewProps, events);
|
|
419
649
|
}
|
|
420
650
|
}
|
|
421
651
|
}
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
652
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
653
|
+
const attachFocus = !!(pseudos && pseudos.focusStyle || initialPseudos && initialPseudos.focusStyle);
|
|
654
|
+
if (attachFocus) {
|
|
655
|
+
viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {
|
|
656
|
+
setStateShallow({ focus: true });
|
|
657
|
+
});
|
|
658
|
+
viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {
|
|
659
|
+
setStateShallow({ focus: false });
|
|
660
|
+
});
|
|
427
661
|
}
|
|
428
662
|
}
|
|
429
|
-
if (
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
663
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
664
|
+
const pressability = useMemo(() => {
|
|
665
|
+
if (attachPress && events) {
|
|
666
|
+
const pressability2 = new Pressability(events);
|
|
667
|
+
internal.current.unmountEffects = [
|
|
668
|
+
() => {
|
|
669
|
+
pressability2.reset();
|
|
670
|
+
}
|
|
671
|
+
];
|
|
672
|
+
return pressability2;
|
|
673
|
+
}
|
|
674
|
+
}, []);
|
|
675
|
+
if (attachPress && events) {
|
|
676
|
+
pressability.configure(events);
|
|
677
|
+
const eventHandlers = pressability.getEventHandlers();
|
|
678
|
+
for (const key in eventHandlers) {
|
|
679
|
+
if (key === "onBlur" || key === "onFocus") {
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
const og = props[key];
|
|
683
|
+
const val = eventHandlers[key];
|
|
684
|
+
viewProps[key] = og ? composeEventHandlers(og, val) : val;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
content = createElement(elementType, viewProps, childEls);
|
|
689
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
690
|
+
const isAnimatedRNWView = isAnimated && typeof elementType !== "string";
|
|
691
|
+
const shouldWrapWithComponentTheme = isAnimatedRNWView && getReturnVariablesAs(props, splitStyleState) === "non-color-value";
|
|
692
|
+
const shouldWrapWithHover = events && attachHover;
|
|
693
|
+
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
694
|
+
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
695
|
+
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
696
|
+
content = /* @__PURE__ */ React.createElement("span", __spreadValues({
|
|
697
|
+
className: `${hoverClassName} ${themeClassName}`,
|
|
698
|
+
style: {
|
|
699
|
+
display: "contents"
|
|
700
|
+
}
|
|
701
|
+
}, shouldWrapWithHover && {
|
|
702
|
+
onMouseEnter: events.onMouseEnter,
|
|
703
|
+
onMouseLeave: events.onMouseLeave
|
|
704
|
+
}), content);
|
|
705
|
+
}
|
|
444
706
|
}
|
|
445
707
|
if (process.env.NODE_ENV === "development") {
|
|
446
708
|
if (props["debug"]) {
|
|
447
|
-
|
|
448
|
-
|
|
709
|
+
console.groupCollapsed(elementType, `props out`, viewProps);
|
|
710
|
+
for (const key in viewProps) {
|
|
711
|
+
console.log(key, viewProps[key]);
|
|
712
|
+
}
|
|
713
|
+
console.groupEnd();
|
|
714
|
+
if (typeof window !== "undefined") {
|
|
715
|
+
console.log(__spreadValues({ state, viewProps, splitStyles, animationStyles, isStringElement, classNamesIn: (_e = props.className) == null ? void 0 : _e.split(" "), classNamesOut: (_f = viewProps.className) == null ? void 0 : _f.split(" "), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles }, typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null));
|
|
716
|
+
}
|
|
717
|
+
console.groupEnd();
|
|
449
718
|
}
|
|
450
719
|
}
|
|
451
|
-
if (features.length) {
|
|
452
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, features, content);
|
|
720
|
+
if (features.elements.length) {
|
|
721
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, features.elements, content);
|
|
453
722
|
}
|
|
454
723
|
return content;
|
|
455
724
|
});
|
|
456
|
-
|
|
725
|
+
if (staticConfig.componentName) {
|
|
726
|
+
component.displayName = staticConfig.componentName;
|
|
727
|
+
}
|
|
457
728
|
onConfiguredOnce((conf) => {
|
|
458
|
-
var _a, _b, _c
|
|
729
|
+
var _a, _b, _c;
|
|
459
730
|
if (process.env.IS_STATIC === "is_static") {
|
|
460
731
|
return;
|
|
461
732
|
}
|
|
@@ -465,7 +736,18 @@ function createComponent(configIn, ParentComponent) {
|
|
|
465
736
|
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
466
737
|
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
467
738
|
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
468
|
-
|
|
739
|
+
const config = getConfig();
|
|
740
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
741
|
+
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
742
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
743
|
+
defaultPropsIn = mergeConfigDefaultProps(staticConfig.componentName, defaultPropsIn, config.defaultProps, parentNames);
|
|
744
|
+
}
|
|
745
|
+
const debug = process.env.NODE_ENV === "development" ? defaultPropsIn["debug"] : false;
|
|
746
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
747
|
+
debugger;
|
|
748
|
+
}
|
|
749
|
+
const [parentProps, parentClassNames] = mergeProps(defaultPropsIn, {}, true);
|
|
750
|
+
initialSplitStyles = insertSplitStyles(parentProps, staticConfig, initialTheme, {
|
|
469
751
|
mounted: true,
|
|
470
752
|
hover: false,
|
|
471
753
|
press: false,
|
|
@@ -473,28 +755,36 @@ function createComponent(configIn, ParentComponent) {
|
|
|
473
755
|
focus: false,
|
|
474
756
|
resolveVariablesAs: "both",
|
|
475
757
|
keepVariantsAsProps: true
|
|
476
|
-
});
|
|
477
|
-
const
|
|
758
|
+
}, void 0, debug);
|
|
759
|
+
const [defaults, defaultsClassnames] = mergeProps(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
760
|
+
initialSplitStyles.classNames = __spreadValues(__spreadValues(__spreadValues({}, parentClassNames), defaultsClassnames), initialSplitStyles.classNames);
|
|
478
761
|
defaultNativeStyle = {};
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
762
|
+
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
763
|
+
if (!isWeb) {
|
|
764
|
+
for (const key in staticConfig.defaultProps) {
|
|
765
|
+
const val = staticConfig.defaultProps[key];
|
|
766
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
767
|
+
defaults[key] = val;
|
|
768
|
+
} else {
|
|
769
|
+
defaultNativeStyle[key] = val;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
482
772
|
}
|
|
483
773
|
defaultNativeStyleSheet = StyleSheet.create({
|
|
484
774
|
base: defaultNativeStyle
|
|
485
775
|
});
|
|
486
|
-
const defaults = {
|
|
487
|
-
...viewProps,
|
|
488
|
-
...component.defaultProps
|
|
489
|
-
};
|
|
490
776
|
if (Object.keys(defaults).length) {
|
|
491
777
|
tamaguiDefaultProps = defaults;
|
|
492
778
|
}
|
|
493
|
-
if (process.env.NODE_ENV === "development" &&
|
|
779
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
494
780
|
if (process.env.IS_STATIC !== "is_static") {
|
|
495
781
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
496
782
|
staticConfig,
|
|
497
|
-
initialSplitStyles
|
|
783
|
+
initialSplitStyles,
|
|
784
|
+
tamaguiDefaultProps,
|
|
785
|
+
defaultNativeStyle,
|
|
786
|
+
defaults,
|
|
787
|
+
defaultPropsIn
|
|
498
788
|
});
|
|
499
789
|
}
|
|
500
790
|
}
|
|
@@ -503,41 +793,37 @@ function createComponent(configIn, ParentComponent) {
|
|
|
503
793
|
if (configIn.memo) {
|
|
504
794
|
res = memo(res);
|
|
505
795
|
}
|
|
506
|
-
res
|
|
507
|
-
validStyles: staticConfig.validStyles || stylePropsView
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
res["extractable"] = (Component, conf) => {
|
|
514
|
-
Component["staticConfig"] = extendStaticConfig({
|
|
515
|
-
Component,
|
|
516
|
-
...conf,
|
|
796
|
+
res.staticConfig = __spreadValues({
|
|
797
|
+
validStyles: staticConfig.validStyles || stylePropsView
|
|
798
|
+
}, staticConfig);
|
|
799
|
+
res.extractable = (Component, conf) => {
|
|
800
|
+
Component.staticConfig = extendStaticConfig(__spreadProps(__spreadValues({
|
|
801
|
+
Component
|
|
802
|
+
}, conf), {
|
|
517
803
|
neverFlatten: true,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
}, res);
|
|
804
|
+
isExtractable: true,
|
|
805
|
+
defaultProps: __spreadValues(__spreadValues({}, Component.defaultProps), conf == null ? void 0 : conf.defaultProps)
|
|
806
|
+
}), res);
|
|
523
807
|
return Component;
|
|
524
808
|
};
|
|
525
809
|
return res;
|
|
526
810
|
}
|
|
527
|
-
|
|
811
|
+
const Unspaced = (props) => {
|
|
812
|
+
return props.children;
|
|
813
|
+
};
|
|
814
|
+
Unspaced["isUnspaced"] = true;
|
|
528
815
|
const Spacer = createComponent({
|
|
529
816
|
memo: true,
|
|
530
817
|
componentName: "Spacer",
|
|
531
|
-
|
|
532
|
-
|
|
818
|
+
validStyles,
|
|
819
|
+
defaultProps: __spreadProps(__spreadValues({}, stackDefaultStyles), {
|
|
533
820
|
size: true
|
|
534
|
-
},
|
|
821
|
+
}),
|
|
535
822
|
variants: {
|
|
536
823
|
size: {
|
|
537
824
|
"...size": (size, { tokens }) => {
|
|
538
|
-
var _a;
|
|
539
825
|
size = size == true ? "$true" : size;
|
|
540
|
-
const sizePx =
|
|
826
|
+
const sizePx = tokens.space[size] ?? size;
|
|
541
827
|
return {
|
|
542
828
|
width: sizePx,
|
|
543
829
|
height: sizePx,
|
|
@@ -548,7 +834,7 @@ const Spacer = createComponent({
|
|
|
548
834
|
},
|
|
549
835
|
flex: {
|
|
550
836
|
true: {
|
|
551
|
-
|
|
837
|
+
flexGrow: 1
|
|
552
838
|
}
|
|
553
839
|
},
|
|
554
840
|
direction: {
|
|
@@ -559,73 +845,161 @@ const Spacer = createComponent({
|
|
|
559
845
|
vertical: {
|
|
560
846
|
width: 0,
|
|
561
847
|
minWidth: 0
|
|
562
|
-
}
|
|
848
|
+
},
|
|
849
|
+
both: {}
|
|
563
850
|
}
|
|
851
|
+
},
|
|
852
|
+
defaultVariants: {
|
|
853
|
+
direction: "both"
|
|
564
854
|
}
|
|
565
855
|
});
|
|
566
856
|
function spacedChildren({
|
|
567
857
|
isZStack,
|
|
568
858
|
children,
|
|
569
859
|
space,
|
|
570
|
-
|
|
571
|
-
spaceFlex
|
|
860
|
+
direction,
|
|
861
|
+
spaceFlex,
|
|
862
|
+
separator
|
|
572
863
|
}) {
|
|
573
|
-
|
|
864
|
+
const hasSpace = !!(space || spaceFlex);
|
|
865
|
+
const hasSeparator = !(separator === void 0 || separator === null);
|
|
866
|
+
if (!hasSpace && !hasSeparator && !isZStack) {
|
|
867
|
+
return children;
|
|
868
|
+
}
|
|
574
869
|
const childrenList = Children.toArray(children);
|
|
575
|
-
|
|
576
|
-
if (len === 1) {
|
|
870
|
+
if (childrenList.length <= 1 && !isZStack) {
|
|
577
871
|
return childrenList;
|
|
578
872
|
}
|
|
579
|
-
const
|
|
873
|
+
const final = [];
|
|
580
874
|
for (const [index, child] of childrenList.entries()) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
if (!child || child["key"] && !isZStack) {
|
|
585
|
-
next.push(child);
|
|
875
|
+
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
876
|
+
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
877
|
+
final.push(child);
|
|
586
878
|
} else {
|
|
587
|
-
|
|
879
|
+
final.push(/* @__PURE__ */ React.createElement(Fragment, {
|
|
588
880
|
key: index
|
|
589
881
|
}, isZStack ? /* @__PURE__ */ React.createElement(AbsoluteFill, null, child) : child));
|
|
590
882
|
}
|
|
591
|
-
if ((
|
|
883
|
+
if (isUnspaced(child) && index === 0) {
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
if (isZStack) {
|
|
592
887
|
continue;
|
|
593
888
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
889
|
+
const next = childrenList[index + 1];
|
|
890
|
+
if (next && !isUnspaced(next)) {
|
|
891
|
+
if (separator) {
|
|
892
|
+
if (hasSpace) {
|
|
893
|
+
final.push(createSpacer({
|
|
894
|
+
key: `_${index}_before_sep_spacer`,
|
|
895
|
+
direction,
|
|
896
|
+
space,
|
|
897
|
+
spaceFlex
|
|
898
|
+
}));
|
|
899
|
+
}
|
|
900
|
+
final.push(React.isValidElement(separator) ? React.cloneElement(separator, { key: `sep_${index}` }) : separator);
|
|
901
|
+
if (hasSpace) {
|
|
902
|
+
final.push(createSpacer({
|
|
903
|
+
key: `_${index}_after_sep_spacer`,
|
|
904
|
+
direction,
|
|
905
|
+
space,
|
|
906
|
+
spaceFlex
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
} else {
|
|
910
|
+
final.push(createSpacer({
|
|
597
911
|
key: `_${index}_spacer`,
|
|
598
|
-
direction
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
flex: spaceFlex
|
|
602
|
-
}
|
|
912
|
+
direction,
|
|
913
|
+
space,
|
|
914
|
+
spaceFlex
|
|
603
915
|
}));
|
|
604
916
|
}
|
|
605
917
|
}
|
|
606
918
|
}
|
|
607
|
-
return
|
|
919
|
+
return final;
|
|
920
|
+
}
|
|
921
|
+
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
922
|
+
return /* @__PURE__ */ React.createElement(Spacer, __spreadValues({
|
|
923
|
+
key,
|
|
924
|
+
size: space,
|
|
925
|
+
direction
|
|
926
|
+
}, spaceFlex && {
|
|
927
|
+
flex: spaceFlex
|
|
928
|
+
}));
|
|
929
|
+
}
|
|
930
|
+
function isUnspaced(child) {
|
|
931
|
+
var _a, _b;
|
|
932
|
+
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"]);
|
|
608
933
|
}
|
|
609
|
-
__name(spacedChildren, "spacedChildren");
|
|
610
934
|
function AbsoluteFill(props) {
|
|
611
|
-
return
|
|
612
|
-
|
|
613
|
-
position: "absolute",
|
|
614
|
-
top: 0,
|
|
615
|
-
left: 0,
|
|
616
|
-
right: 0,
|
|
617
|
-
bottom: 0
|
|
618
|
-
}
|
|
619
|
-
}, props.children) : /* @__PURE__ */ React.createElement(View, {
|
|
935
|
+
return /* @__PURE__ */ React.createElement(View, {
|
|
936
|
+
pointerEvents: "box-none",
|
|
620
937
|
style: StyleSheet.absoluteFill
|
|
621
|
-
}, props.
|
|
938
|
+
}, props.children);
|
|
939
|
+
}
|
|
940
|
+
function processIDRefList(idRefList) {
|
|
941
|
+
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
942
|
+
}
|
|
943
|
+
const accessibilityRoleToWebRole = {
|
|
944
|
+
adjustable: "slider",
|
|
945
|
+
button: "button",
|
|
946
|
+
header: "heading",
|
|
947
|
+
image: "img",
|
|
948
|
+
imagebutton: null,
|
|
949
|
+
keyboardkey: null,
|
|
950
|
+
label: null,
|
|
951
|
+
link: "link",
|
|
952
|
+
none: "presentation",
|
|
953
|
+
search: "search",
|
|
954
|
+
summary: "region",
|
|
955
|
+
text: null
|
|
956
|
+
};
|
|
957
|
+
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
958
|
+
const pseudoStyle = pseudos[name];
|
|
959
|
+
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
960
|
+
const defaultPseudoStyle = initialPseudos[name];
|
|
961
|
+
const style = defaultPseudoStyle ? __spreadValues(__spreadValues({}, defaultPseudoStyle), pseudoStyle) : pseudoStyle;
|
|
962
|
+
if (style) {
|
|
963
|
+
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
967
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
968
|
+
const len = parentNames.length;
|
|
969
|
+
let prev;
|
|
970
|
+
for (let i = 0; i < len; i++) {
|
|
971
|
+
const n = parentNames[i];
|
|
972
|
+
if (!n)
|
|
973
|
+
continue;
|
|
974
|
+
if (DefaultProps.has(n)) {
|
|
975
|
+
prev = DefaultProps.get(n);
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
const props2 = configDefaults[n];
|
|
979
|
+
if (!props2) {
|
|
980
|
+
if (prev) {
|
|
981
|
+
DefaultProps.set(n, prev);
|
|
982
|
+
}
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
prev = mergeProps(prev || {}, props2)[0];
|
|
986
|
+
console.log("set prev", prev);
|
|
987
|
+
DefaultProps.set(n, prev);
|
|
988
|
+
}
|
|
989
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
990
|
+
if (ourDefaultsMerged) {
|
|
991
|
+
return mergeProps(props, ourDefaultsMerged)[0];
|
|
992
|
+
}
|
|
993
|
+
return props;
|
|
622
994
|
}
|
|
623
|
-
__name(AbsoluteFill, "AbsoluteFill");
|
|
624
995
|
export {
|
|
625
996
|
AbsoluteFill,
|
|
626
997
|
Spacer,
|
|
998
|
+
Unspaced,
|
|
999
|
+
accessibilityRoleToWebRole,
|
|
627
1000
|
createComponent,
|
|
628
1001
|
mouseUps,
|
|
1002
|
+
processIDRefList,
|
|
629
1003
|
spacedChildren
|
|
630
1004
|
};
|
|
631
1005
|
//# sourceMappingURL=createComponent.js.map
|