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