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