@tamagui/core 1.0.1-beta.99 → 1.0.1-rc.0.1
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 +12 -6
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +77 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +25 -13
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +16 -23
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/constants/isDevTools.js +37 -0
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +16 -9
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/platform.native.js +62 -0
- package/dist/cjs/constants/platform.native.js.map +7 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +1 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/contexts/ButtonNestingContext.js +30 -0
- package/dist/cjs/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/contexts/TextAncestorContext.js +30 -0
- package/dist/cjs/contexts/TextAncestorContext.js.map +7 -0
- package/dist/cjs/{ThemeContext.js → contexts/ThemeContext.js} +1 -0
- package/dist/cjs/contexts/ThemeContext.js.map +7 -0
- package/dist/cjs/createComponent.js +583 -644
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +39 -19
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createFont.test.js +125 -0
- package/dist/cjs/createFont.test.js.map +7 -0
- package/dist/cjs/createShorthands.js +1 -0
- package/dist/cjs/createShorthands.js.map +2 -2
- package/dist/cjs/createTamagui.js +98 -193
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +1 -0
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +1 -4
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createTokens.test.js +27 -0
- package/dist/cjs/createTokens.test.js.map +7 -0
- package/dist/cjs/createVariable.js +36 -40
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariable.test.js +7 -0
- package/dist/cjs/createVariable.test.js.map +7 -0
- package/dist/cjs/createVariables.js +15 -19
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +230 -0
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/ThemeManager.test.js +465 -0
- package/dist/cjs/helpers/ThemeManager.test.js.map +7 -0
- package/dist/cjs/helpers/ThemeManagerContext.js +30 -0
- package/dist/cjs/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +1 -0
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/cache.js +43 -0
- package/dist/cjs/helpers/cache.js.map +7 -0
- package/dist/cjs/helpers/calc.js +1 -0
- package/dist/cjs/helpers/calc.js.map +3 -3
- package/dist/cjs/helpers/createMediaStyle.js +23 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +185 -57
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createProxy.js +43 -0
- package/dist/cjs/helpers/createProxy.js.map +7 -0
- package/dist/cjs/helpers/createShallowUpdate.js +13 -23
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +9 -30
- package/dist/cjs/helpers/expandStyle.js.map +3 -3
- package/dist/cjs/helpers/expandStyles.js +26 -37
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +35 -34
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +1 -0
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.js +32 -0
- package/dist/cjs/helpers/getAnimationDriver.js.map +7 -0
- package/dist/cjs/helpers/getBoundingClientRect.js +37 -0
- package/dist/cjs/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -3
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/getFont.js +7 -2
- package/dist/cjs/helpers/getFont.js.map +2 -2
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getRect.js +36 -0
- package/dist/cjs/helpers/getRect.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +3 -2
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +538 -228
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +1 -0
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +53 -65
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.js +108 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js +31 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +50 -7
- package/dist/cjs/helpers/getVariantExtras.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +55 -29
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +1 -0
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/cjs/helpers/isTamaguiElement.js +1 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -5
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +5 -1
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +19 -14
- package/dist/cjs/helpers/mergeProps.js.map +2 -2
- package/dist/cjs/helpers/mergeTransform.js +12 -8
- package/dist/cjs/helpers/mergeTransform.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +5 -1
- package/dist/cjs/helpers/normalizeColor.js.map +2 -2
- package/dist/cjs/helpers/normalizeValueWithProperty.js +47 -5
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/cjs/helpers/proxyThemeVariables.js +3 -1
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +12 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/cjs/helpers/registerCSSVariable.js +8 -8
- package/dist/cjs/helpers/registerCSSVariable.js.map +2 -2
- package/dist/cjs/{constants/rnw.js → helpers/startTransition.js} +13 -9
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -43
- package/dist/cjs/helpers/themeable.js.map +3 -3
- package/dist/cjs/helpers/themes.js +79 -0
- package/dist/cjs/helpers/themes.js.map +7 -0
- package/dist/cjs/{constants/rnw.native.js → helpers/timer.js} +14 -7
- package/dist/cjs/helpers/timer.js.map +7 -0
- package/dist/cjs/helpers/useShallowSetState.js +49 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -124
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +1 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +37 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -0
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +84 -0
- package/dist/cjs/hooks/useElementLayout.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -32
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +1 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +4 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +165 -120
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +2 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +58 -0
- package/dist/cjs/hooks/useSafeRef.js.map +7 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +182 -163
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useThemeName.js +52 -0
- package/dist/cjs/hooks/useThemeName.js.map +7 -0
- package/dist/cjs/hooks/useUnmountEffect.js +1 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +41 -30
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/inject-styles.js +40 -0
- package/dist/cjs/inject-styles.js.map +7 -0
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +19 -15
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/setupReactNative.js +50 -0
- package/dist/cjs/setupReactNative.js.map +7 -0
- package/dist/cjs/static.js +2 -17
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +30 -49
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/{helpers/cssHash.js → updateTheme.js} +23 -26
- package/dist/cjs/updateTheme.js.map +7 -0
- package/dist/cjs/{Pressability.js → vendor/Pressability.js} +6 -2
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/{Pressability.native.js → vendor/Pressability.native.js} +6 -2
- package/dist/cjs/vendor/Pressability.native.js.map +7 -0
- package/dist/cjs/views/FontLanguage.js +38 -0
- package/dist/cjs/views/FontLanguage.js.map +7 -0
- package/dist/cjs/views/FontLanguage.native.js +38 -0
- package/dist/cjs/views/FontLanguage.native.js.map +7 -0
- package/dist/cjs/{helpers/nativeGestureHandler.native.js → views/FontLanguage.types.js} +4 -5
- package/dist/cjs/views/FontLanguage.types.js.map +7 -0
- package/dist/cjs/views/Slot.js +49 -52
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +83 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +32 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +55 -23
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +22 -20
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +14 -27
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +11 -5
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +7 -5
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +53 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/{conf.js → config.js} +18 -8
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +13 -24
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +13 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +11 -7
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/platform.native.js +28 -0
- package/dist/esm/constants/platform.native.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/esm/contexts/ButtonNestingContext.js +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +6 -0
- package/dist/esm/contexts/TextAncestorContext.js.map +7 -0
- package/dist/esm/{ThemeContext.js → contexts/ThemeContext.js} +0 -0
- package/dist/esm/contexts/ThemeContext.js.map +7 -0
- package/dist/esm/createComponent.js +583 -648
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +38 -19
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createFont.test.js +124 -0
- package/dist/esm/createFont.test.js.map +7 -0
- package/dist/esm/createShorthands.js +0 -0
- package/dist/esm/createShorthands.js.map +2 -2
- package/dist/esm/createTamagui.js +95 -192
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +0 -0
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +0 -4
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createTokens.test.js +26 -0
- package/dist/esm/createTokens.test.js.map +7 -0
- package/dist/esm/createVariable.js +32 -38
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariable.test.js +6 -0
- package/dist/esm/createVariable.test.js.map +7 -0
- package/dist/esm/createVariables.js +14 -19
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +186 -0
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/ThemeManager.test.js +464 -0
- package/dist/esm/helpers/ThemeManager.test.js.map +7 -0
- package/dist/esm/helpers/ThemeManagerContext.js +6 -0
- package/dist/esm/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +0 -0
- package/dist/esm/helpers/areEqualSets.js.map +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/esm/helpers/cache.js +18 -0
- package/dist/esm/helpers/cache.js.map +7 -0
- package/dist/esm/helpers/calc.js +0 -0
- package/dist/esm/helpers/calc.js.map +3 -3
- package/dist/esm/helpers/createMediaStyle.js +22 -9
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +180 -55
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createProxy.js +19 -0
- package/dist/esm/helpers/createProxy.js.map +7 -0
- package/dist/esm/helpers/createShallowUpdate.js +12 -25
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +8 -32
- package/dist/esm/helpers/expandStyle.js.map +3 -3
- package/dist/esm/helpers/expandStyles.js +25 -39
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js +34 -36
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -0
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getBoundingClientRect.js +13 -0
- package/dist/esm/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/getFont.js +6 -2
- package/dist/esm/helpers/getFont.js.map +2 -2
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getRect.js +12 -0
- package/dist/esm/helpers/getRect.js.map +7 -0
- package/dist/esm/helpers/getSize.js +2 -2
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +551 -229
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +0 -0
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +49 -59
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -0
- package/dist/esm/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/getThemeCSSRules.js +84 -0
- package/dist/esm/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/esm/helpers/getVariantExtras.js +47 -6
- package/dist/esm/helpers/getVariantExtras.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +50 -26
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +0 -0
- package/dist/esm/helpers/isObj.js.map +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/esm/helpers/isTamaguiElement.js +0 -0
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -5
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +0 -0
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +18 -14
- package/dist/esm/helpers/mergeProps.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +8 -6
- package/dist/esm/helpers/mergeTransform.js.map +2 -2
- package/dist/esm/helpers/normalizeColor.js +0 -0
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js +44 -4
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/helpers/proxyThemeVariables.js +2 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +11 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/esm/helpers/registerCSSVariable.js +5 -6
- package/dist/esm/helpers/registerCSSVariable.js.map +2 -2
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +12 -44
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/themes.js +54 -0
- package/dist/esm/helpers/themes.js.map +7 -0
- package/dist/esm/helpers/timer.js +11 -0
- package/dist/esm/helpers/timer.js.map +7 -0
- package/dist/esm/helpers/useShallowSetState.js +25 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -98
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +0 -0
- package/dist/esm/helpers/withStaticProperties.js.map +0 -0
- package/dist/esm/hooks/getThemeUnwrapped.js +12 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -1
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +59 -0
- package/dist/esm/hooks/useElementLayout.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -28
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +0 -0
- package/dist/esm/hooks/useIsMounted.js.map +1 -1
- package/dist/esm/hooks/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +3 -9
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +159 -122
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +1 -16
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +34 -0
- package/dist/esm/hooks/useSafeRef.js.map +7 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +178 -162
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useThemeName.js +28 -0
- package/dist/esm/hooks/useThemeName.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js +0 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +37 -22
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/inject-styles.js +16 -0
- package/dist/esm/inject-styles.js.map +7 -0
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +18 -15
- package/dist/esm/insertFont.js.map +2 -2
- package/dist/esm/setupReactNative.js +24 -0
- package/dist/esm/setupReactNative.js.map +7 -0
- package/dist/esm/static.js +1 -17
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +29 -51
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types-rnw.js +0 -0
- package/dist/esm/types-rnw.js.map +0 -0
- package/dist/esm/types.js +0 -0
- package/dist/esm/types.js.map +0 -0
- package/dist/esm/updateTheme.js +23 -0
- package/dist/esm/updateTheme.js.map +7 -0
- package/dist/esm/{Pressability.js → vendor/Pressability.js} +3 -1
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/{Pressability.native.js → vendor/Pressability.native.js} +3 -1
- package/dist/esm/vendor/Pressability.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.js +14 -0
- package/dist/esm/views/FontLanguage.js.map +7 -0
- package/dist/esm/views/FontLanguage.native.js +14 -0
- package/dist/esm/views/FontLanguage.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.types.js +1 -0
- package/dist/{cjs/defaultComponentState.js.map → esm/views/FontLanguage.types.js.map} +0 -0
- package/dist/esm/views/Slot.js +47 -50
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +3 -21
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +53 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +29 -29
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +48 -21
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +20 -15
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +11 -22
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +6 -4
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +51 -19
- package/reset.css +1 -9
- package/src/Tamagui.ts +48 -0
- package/src/__snapshots__/createTokens.test.ts.snap +877 -0
- package/src/addTheme.ts +65 -0
- package/src/config.ts +52 -0
- package/src/constants/constants.ts +19 -0
- package/src/constants/isDevTools.ts +12 -0
- package/src/contexts/ButtonNestingContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +3 -0
- package/src/createComponent.tsx +1277 -0
- package/src/createFont.test.ts +129 -0
- package/src/createFont.ts +52 -0
- package/src/createShorthands.ts +7 -0
- package/src/createTamagui.ts +230 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.test.ts +29 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.test.ts +7 -0
- package/src/createVariable.ts +79 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.test.tsx +497 -0
- package/src/helpers/ThemeManager.tsx +252 -0
- package/src/helpers/ThemeManagerContext.tsx +5 -0
- package/src/helpers/cache.ts +18 -0
- package/src/helpers/createMediaStyle.ts +55 -0
- package/src/helpers/createPropMapper.ts +526 -0
- package/src/helpers/createProxy.ts +16 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +75 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getBoundingClientRect.tsx +7 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getRect.tsx +8 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +980 -0
- package/src/helpers/getStylesAtomic.native.ts +4 -0
- package/src/helpers/getStylesAtomic.ts +275 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +114 -0
- package/src/helpers/getVariantExtras.tsx +85 -0
- package/src/helpers/insertStyleRule.tsx +162 -0
- package/src/helpers/isObj.ts +1 -0
- package/src/helpers/isTamaguiComponent.tsx +15 -0
- package/src/helpers/isTamaguiElement.tsx +12 -0
- package/src/helpers/matchMedia.native.ts +6 -0
- package/src/helpers/matchMedia.ts +17 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +23 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +123 -0
- package/src/helpers/proxyThemeVariables.tsx +15 -0
- package/src/helpers/pseudoDescriptors.ts +40 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/themeable.tsx +44 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/timer.ts +9 -0
- package/src/helpers/useShallowSetState.tsx +29 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +7 -0
- package/src/hooks/useElementLayout.tsx +85 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsTouchDevice.tsx +6 -0
- package/src/hooks/useMedia.tsx +265 -0
- package/src/hooks/useSafeRef.ts +48 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +243 -0
- package/src/hooks/useThemeName.tsx +27 -0
- package/src/index.ts +73 -0
- package/src/inject-styles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/setupReactNative.ts +20 -0
- package/src/static.ts +5 -0
- package/src/styled.tsx +172 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1350 -0
- package/src/updateTheme.ts +26 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +10 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +147 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +59 -0
- package/src/views/Text.tsx +87 -0
- package/src/views/Theme.tsx +77 -0
- package/src/views/ThemeProvider.tsx +41 -0
- package/types/Tamagui.d.ts +9 -7
- package/types/addTheme.d.ts +32 -0
- package/types/config.d.ts +46 -0
- package/types/constants/constants.d.ts +14 -3
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/contexts/ButtonNestingContext.d.ts +3 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/contexts/TextAncestorContext.d.ts +3 -0
- package/types/createComponent.d.ts +1 -24
- package/types/createFont.d.ts +0 -0
- package/types/createFont.test.d.ts +2 -0
- package/types/createShorthands.d.ts +2 -1
- package/types/createTamagui.d.ts +2 -25
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -5
- package/types/createTokens.test.d.ts +2 -0
- package/types/createVariable.d.ts +15 -10
- package/types/createVariable.test.d.ts +2 -0
- package/types/createVariables.d.ts +1 -1
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +36 -0
- package/types/helpers/ThemeManager.test.d.ts +2 -0
- package/types/helpers/ThemeManagerContext.d.ts +4 -0
- package/types/helpers/cache.d.ts +12 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +3 -1
- package/types/helpers/createProxy.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +4 -0
- package/types/helpers/expandStyles.d.ts +20 -1
- package/types/helpers/extendStaticConfig.d.ts +0 -0
- package/types/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getBoundingClientRect.d.ts +2 -0
- package/types/helpers/getExpandedShorthands.d.ts +0 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getRect.d.ts +9 -0
- package/types/helpers/getSize.d.ts +0 -0
- package/types/helpers/getSplitStyles.d.ts +32 -16
- package/types/helpers/getStylesAtomic.d.ts +11 -10
- package/types/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +4 -6
- package/types/helpers/insertStyleRule.d.ts +8 -4
- package/types/helpers/isObj.d.ts +0 -0
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/mergeProps.d.ts +16 -1
- package/types/helpers/mergeTransform.d.ts +6 -4
- package/types/helpers/normalizeColor.d.ts +0 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +5 -0
- package/types/helpers/proxyThemeVariables.d.ts +0 -0
- package/types/helpers/pseudoDescriptors.d.ts +8 -14
- package/types/helpers/registerCSSVariable.d.ts +3 -3
- package/types/helpers/themeable.d.ts +7 -7
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/timer.d.ts +2 -0
- package/types/helpers/useShallowSetState.d.ts +4 -0
- package/types/helpers/withStaticProperties.d.ts +0 -0
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useElementLayout.d.ts +19 -0
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsTouchDevice.d.ts +0 -0
- package/types/hooks/useMedia.d.ts +22 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +11 -41
- package/types/hooks/useThemeName.d.ts +5 -0
- package/types/index.d.ts +17 -17
- package/types/inject-styles.d.ts +7 -0
- package/types/insertFont.d.ts +4 -1
- package/types/setupReactNative.d.ts +5 -0
- package/types/static.d.ts +1 -17
- package/types/styled.d.ts +6 -2
- package/types/types-rnw.d.ts +0 -0
- package/types/types.d.ts +298 -89
- package/types/updateTheme.d.ts +30 -0
- package/types/vendor/Pressability.d.ts +3 -0
- package/types/vendor/Pressability.native.d.ts +3 -0
- package/types/views/FontLanguage.d.ts +4 -0
- package/types/views/FontLanguage.native.d.ts +4 -0
- package/types/views/FontLanguage.types.d.ts +11 -0
- package/types/views/Slot.d.ts +4 -4
- package/types/views/Stack.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Text.d.ts +1 -1
- package/types/views/Theme.d.ts +4 -3
- package/types/views/ThemeProvider.d.ts +0 -1
- package/dist/cjs/Pressability.js.map +0 -7
- package/dist/cjs/Pressability.native.js.map +0 -7
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js +0 -204
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -91
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/cssHash.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js +0 -55
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -37
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -230
- package/dist/cjs/hooks/useFeatures.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/views/TextAncestorContext.js +0 -43
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/Pressability.js.map +0 -7
- package/dist/esm/Pressability.native.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js +0 -179
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -6
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -67
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/cssHash.js +0 -27
- package/dist/esm/helpers/cssHash.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js +0 -32
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.native.js +0 -2
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -11
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -206
- package/dist/esm/hooks/useFeatures.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/views/TextAncestorContext.js +0 -15
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/types/Pressability.d.ts +0 -2
- package/types/Pressability.native.d.ts +0 -2
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts +0 -7
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -52
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts +0 -26
- package/types/conf.d.ts.map +0 -1
- package/types/constants/platform.d.ts +0 -12
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/constants/rnw.native.d.ts +0 -2
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -3
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/helpers/areEqualSets.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts.map +0 -1
- package/types/helpers/assignNativePropsToWeb.native.d.ts +0 -2
- package/types/helpers/calc.d.ts +0 -12
- package/types/helpers/calc.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts +0 -3
- package/types/helpers/createTamaguiProvider.d.ts +0 -3
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/cssHash.d.ts +0 -2
- package/types/helpers/cssHash.d.ts.map +0 -1
- package/types/helpers/expandStyle.d.ts.map +0 -1
- package/types/helpers/expandStyles.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getFont.d.ts +0 -3
- package/types/helpers/getFont.d.ts.map +0 -1
- package/types/helpers/getSize.d.ts.map +0 -1
- package/types/helpers/getSplitStyles.d.ts.map +0 -1
- package/types/helpers/getStackSize.d.ts +0 -8
- package/types/helpers/getStackSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/normalizeColor.d.ts.map +0 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts +0 -4
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts +0 -2
- package/types/hooks/useFeatures.d.ts +0 -24
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts +0 -3
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts +0 -3
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts +0 -2
- package/types/index.d.ts.map +0 -1
- package/types/insertFont.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/views/Stack.d.ts.map +0 -1
- package/types/views/Text.d.ts.map +0 -1
- package/types/views/TextAncestorContext.d.ts +0 -5
- package/types/views/TextAncestorContext.d.ts.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts +0 -10
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts +0 -4
- package/types/views/ThemeReset.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/mergeTransform.ts"],
|
|
4
|
-
"sourcesContent": ["import { ViewStyle } from 'react-native'\n\nexport const mergeTransform = (obj: ViewStyle, key: string, val: any, backwards = false) => {\n obj.transform ||= []\n obj.transform[backwards ? 'unshift' : 'push']({ [mapTransformKeys[key] || key]: val } as any)\n}\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { ViewStyle } from '@tamagui/types-react-native'\n\nexport type FlatTransforms = Record<string, any>\n\nexport const mergeTransform = (obj: ViewStyle, key: string, val: any, backwards = false) => {\n obj.transform ||= []\n obj.transform[backwards ? 'unshift' : 'push']({ [mapTransformKeys[key] || key]: val } as any)\n}\n\nexport const mergeTransforms = (\n obj: ViewStyle,\n flatTransforms: FlatTransforms,\n backwards = false\n) => {\n Object.entries(flatTransforms).forEach(([key, val]) => {\n mergeTransform(obj, key, val, backwards)\n })\n}\n\nexport const mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,iBAAiB,CAAC,KAAgB,KAAa,KAAU,YAAY,UAAU;AAC1F,MAAI,cAAJ,IAAI,YAAc,CAAC;AACnB,MAAI,UAAU,YAAY,YAAY,QAAQ,EAAE,CAAC,iBAAiB,QAAQ,MAAM,IAAI,CAAQ;AAC9F;AAEO,MAAM,kBAAkB,CAC7B,KACA,gBACA,YAAY,UACT;AACH,SAAO,QAAQ,cAAc,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AACrD,mBAAe,KAAK,KAAK,KAAK,SAAS;AAAA,EACzC,CAAC;AACH;AAEO,MAAM,mBAAmB;AAAA,EAC9B,GAAG;AAAA,EACH,GAAG;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -16,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
17
|
}
|
|
17
18
|
return to;
|
|
18
19
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
20
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
25
|
var normalizeColor_exports = {};
|
|
22
26
|
__export(normalizeColor_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/normalizeColor.ts"],
|
|
4
4
|
"sourcesContent": ["import normalizeCSSColor from 'normalize-css-color'\n\nexport const normalizeColor = (color?: number | string | null, opacity?: number) => {\n if (color == null || color == undefined) {\n return\n }\n if (\n color[0] === '$' ||\n (process.env.TAMAGUI_TARGET === 'web' &&\n typeof color === 'string' &&\n (webColors[color] || color[0] === '_' || color.startsWith('var(')))\n ) {\n return color\n } else {\n const rgba = colorToRGBA(color)\n if (rgba != null) {\n const [r, g, b, a] = rgba\n const alpha = (opacity ?? a).toFixed(2)\n return `rgba(${r},${g},${b},${alpha})`\n }\n }\n return color\n}\n\nconst webColors = {\n currentColor: true,\n currentcolor: true,\n transparent: true,\n inherit: true,\n}\n\nexport function colorToRGBA(color: string | number) {\n const colorInt = processColor(color)\n if (colorInt != null) {\n const r = (colorInt >> 16) & 255\n const g = (colorInt >> 8) & 255\n const b = colorInt & 255\n const a = ((colorInt >> 24) & 255) / 255\n return [r, g, b, a] as const\n }\n return null\n}\n\nconst processColor = (color?: number | string) => {\n if (color === undefined || color === null) {\n return null\n }\n const intColor = normalizeCSSColor(color)\n if (intColor === undefined || intColor === null) {\n return null\n }\n return ((+intColor << 24) | (+intColor >>> 8)) >>> 0\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA8B;AAEvB,MAAM,iBAAiB,CAAC,OAAgC,YAAqB;AAClF,MAAI,SAAS,QAAQ,SAAS,QAAW;AACvC;AAAA,EACF;AACA,MACE,MAAM,OAAO,OACZ,QAAQ,IAAI,mBAAmB,SAC9B,OAAO,UAAU,aAChB,UAAU,UAAU,MAAM,OAAO,OAAO,MAAM,WAAW,MAAM,IAClE;AACA,WAAO;AAAA,EACT,OAAO;AACL,UAAM,OAAO,YAAY,KAAK;AAC9B,QAAI,QAAQ,MAAM;AAChB,YAAM,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI;AACrB,YAAM,SAAS,WAAW,GAAG,QAAQ,CAAC;AACtC,aAAO,QAAQ,KAAK,KAAK,KAAK;AAAA,IAChC;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,YAAY;AAAA,EAChB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AAAA,EACb,SAAS;AACX;AAEO,SAAS,YAAY,OAAwB;AAClD,QAAM,WAAW,aAAa,KAAK;AACnC,MAAI,YAAY,MAAM;AACpB,UAAM,IAAK,YAAY,KAAM;AAC7B,UAAM,IAAK,YAAY,IAAK;AAC5B,UAAM,IAAI,WAAW;AACrB,UAAM,KAAM,YAAY,KAAM,OAAO;AACrC,WAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,EACpB;AACA,SAAO;AACT;AAEA,MAAM,eAAe,CAAC,UAA4B;AAChD,MAAI,UAAU,UAAa,UAAU,MAAM;AACzC,WAAO;AAAA,EACT;AACA,QAAM,eAAW,2BAAAA,SAAkB,KAAK;AACxC,MAAI,aAAa,UAAa,aAAa,MAAM;AAC/C,WAAO;AAAA,EACT;AACA,UAAS,CAAC,YAAY,KAAO,CAAC,aAAa,OAAQ;AACrD;",
|
|
6
|
+
"names": ["normalizeCSSColor"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -17,18 +18,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
19
|
var normalizeValueWithProperty_exports = {};
|
|
19
20
|
__export(normalizeValueWithProperty_exports, {
|
|
20
|
-
normalizeValueWithProperty: () => normalizeValueWithProperty
|
|
21
|
+
normalizeValueWithProperty: () => normalizeValueWithProperty,
|
|
22
|
+
reverseMapClassNameToValue: () => reverseMapClassNameToValue
|
|
21
23
|
});
|
|
22
24
|
module.exports = __toCommonJS(normalizeValueWithProperty_exports);
|
|
25
|
+
var import_constants = require("@tamagui/constants");
|
|
26
|
+
var import_insertStyleRule = require("./insertStyleRule");
|
|
23
27
|
var import_normalizeColor = require("./normalizeColor");
|
|
24
28
|
const cache = {};
|
|
25
29
|
function normalizeValueWithProperty(value, property) {
|
|
30
|
+
if (property && unitlessNumbers[property]) {
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
26
33
|
const cached = cache[value];
|
|
27
|
-
if (cached)
|
|
34
|
+
if (cached !== void 0) {
|
|
28
35
|
return cached;
|
|
36
|
+
}
|
|
29
37
|
let res = value;
|
|
30
|
-
if (process.env.TAMAGUI_TARGET === "web" && typeof value === "number" && (property === void 0 || !unitlessNumbers[property])) {
|
|
38
|
+
if (process.env.TAMAGUI_TARGET === "web" && typeof value === "number" && (property === void 0 || !unitlessNumbers[property] && !stringNumbers[property])) {
|
|
31
39
|
res = `${value}px`;
|
|
40
|
+
} else if (import_constants.isWeb && property !== void 0 && stringNumbers[property]) {
|
|
41
|
+
res = `${res}`;
|
|
32
42
|
} else if (property && colorProps[property]) {
|
|
33
43
|
res = (0, import_normalizeColor.normalizeColor)(value);
|
|
34
44
|
cache[value] = res;
|
|
@@ -47,7 +57,11 @@ const colorProps = {
|
|
|
47
57
|
textDecorationColor: true,
|
|
48
58
|
textShadowColor: true
|
|
49
59
|
};
|
|
60
|
+
const stringNumbers = {
|
|
61
|
+
zIndex: true
|
|
62
|
+
};
|
|
50
63
|
const unitlessNumbers = {
|
|
64
|
+
WebkitLineClamp: true,
|
|
51
65
|
animationIterationCount: true,
|
|
52
66
|
aspectRatio: true,
|
|
53
67
|
borderImageOutset: true,
|
|
@@ -75,7 +89,6 @@ const unitlessNumbers = {
|
|
|
75
89
|
orphans: true,
|
|
76
90
|
tabSize: true,
|
|
77
91
|
widows: true,
|
|
78
|
-
zIndex: true,
|
|
79
92
|
zoom: true,
|
|
80
93
|
scale: true,
|
|
81
94
|
scaleX: true,
|
|
@@ -83,8 +96,37 @@ const unitlessNumbers = {
|
|
|
83
96
|
scaleZ: true,
|
|
84
97
|
shadowOpacity: true
|
|
85
98
|
};
|
|
99
|
+
const rcache = {};
|
|
100
|
+
function reverseMapClassNameToValue(key, className) {
|
|
101
|
+
const selectors = (0, import_insertStyleRule.getAllSelectors)();
|
|
102
|
+
const cssRule = selectors[className];
|
|
103
|
+
if (rcache[cssRule])
|
|
104
|
+
return rcache[cssRule];
|
|
105
|
+
if (!cssRule) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim();
|
|
109
|
+
let res;
|
|
110
|
+
if (cssVal.startsWith("var(")) {
|
|
111
|
+
res = cssVal;
|
|
112
|
+
} else if (unitlessNumbers[key]) {
|
|
113
|
+
res = +cssVal;
|
|
114
|
+
} else if (cssVal.endsWith("px")) {
|
|
115
|
+
res = +cssVal.replace("px", "");
|
|
116
|
+
} else {
|
|
117
|
+
res = cssVal;
|
|
118
|
+
}
|
|
119
|
+
rcache[cssRule] = res;
|
|
120
|
+
if (process.env.NODE_ENV === "development") {
|
|
121
|
+
if (typeof res === "number" && isNaN(res)) {
|
|
122
|
+
console.log(`Tamagui invalid parsed value, NaN:`, { res, cssVal, cssRule, key, className });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return res;
|
|
126
|
+
}
|
|
86
127
|
// Annotate the CommonJS export names for ESM import in node:
|
|
87
128
|
0 && (module.exports = {
|
|
88
|
-
normalizeValueWithProperty
|
|
129
|
+
normalizeValueWithProperty,
|
|
130
|
+
reverseMapClassNameToValue
|
|
89
131
|
});
|
|
90
132
|
//# sourceMappingURL=normalizeValueWithProperty.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/normalizeValueWithProperty.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { normalizeColor } from './normalizeColor'\n\nconst cache = {}\n\nexport function normalizeValueWithProperty(value: any, property?: string): any {\n const cached = cache[value]\n if (cached) return cached\n let res = value\n if (\n process.env.TAMAGUI_TARGET === 'web' &&\n typeof value === 'number' &&\n (property === undefined || !unitlessNumbers[property])\n ) {\n res = `${value}px`\n } else if (property && colorProps[property]) {\n res = normalizeColor(value)\n cache[value] = res\n }\n return res\n}\n\nconst colorProps = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n\nconst unitlessNumbers = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowGap: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnGap: true,\n gridColumnStart: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { isWeb } from '@tamagui/constants'\n\nimport { getAllSelectors } from './insertStyleRule'\nimport { normalizeColor } from './normalizeColor'\n\nconst cache = {}\n\nexport function normalizeValueWithProperty(value: any, property?: string): any {\n if (property && unitlessNumbers[property]) {\n return value\n }\n const cached = cache[value]\n if (cached !== undefined) {\n return cached\n }\n let res = value\n if (\n process.env.TAMAGUI_TARGET === 'web' &&\n typeof value === 'number' &&\n (property === undefined || (!unitlessNumbers[property] && !stringNumbers[property]))\n ) {\n res = `${value}px`\n } else if (isWeb && property !== undefined && stringNumbers[property]) {\n res = `${res}`\n } else if (property && colorProps[property]) {\n res = normalizeColor(value)\n cache[value] = res\n }\n return res\n}\n\n// TODO react-native-web-lite\n\nconst colorProps = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n\nconst stringNumbers = {\n zIndex: true,\n}\n\nconst unitlessNumbers = {\n WebkitLineClamp: true,\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowGap: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnGap: true,\n gridColumnStart: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zoom: true,\n scale: true,\n scaleX: true,\n scaleY: true,\n scaleZ: true,\n shadowOpacity: true,\n}\n\n// getting real values for colors for animations (reverse mapped from CSS)\n// this isn't beautiful, but will do relatively fine performance for now\nconst rcache = {}\nexport function reverseMapClassNameToValue(key: string, className: string) {\n const selectors = getAllSelectors()\n const cssRule = selectors[className]\n if (rcache[cssRule]) return rcache[cssRule]\n if (!cssRule) {\n return\n }\n const cssVal = cssRule.replace(/.*:/, '').replace(/;.*/, '').trim()\n let res: any\n if (cssVal.startsWith('var(')) {\n res = cssVal\n } else if (unitlessNumbers[key]) {\n res = +cssVal\n } else if (cssVal.endsWith('px')) {\n res = +cssVal.replace('px', '')\n } else {\n res = cssVal\n }\n rcache[cssRule] = res\n if (process.env.NODE_ENV === 'development') {\n // ensure we are parsing properly\n if (typeof res === 'number' && isNaN(res)) {\n // eslint-disable-next-line no-console\n console.log(`Tamagui invalid parsed value, NaN:`, { res, cssVal, cssRule, key, className })\n }\n }\n return res\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAAsB;AAEtB,6BAAgC;AAChC,4BAA+B;AAE/B,MAAM,QAAQ,CAAC;AAER,SAAS,2BAA2B,OAAY,UAAwB;AAC7E,MAAI,YAAY,gBAAgB,WAAW;AACzC,WAAO;AAAA,EACT;AACA,QAAM,SAAS,MAAM;AACrB,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,EACT;AACA,MAAI,MAAM;AACV,MACE,QAAQ,IAAI,mBAAmB,SAC/B,OAAO,UAAU,aAChB,aAAa,UAAc,CAAC,gBAAgB,aAAa,CAAC,cAAc,YACzE;AACA,UAAM,GAAG;AAAA,EACX,WAAW,0BAAS,aAAa,UAAa,cAAc,WAAW;AACrE,UAAM,GAAG;AAAA,EACX,WAAW,YAAY,WAAW,WAAW;AAC3C,cAAM,sCAAe,KAAK;AAC1B,UAAM,SAAS;AAAA,EACjB;AACA,SAAO;AACT;AAIA,MAAM,aAAa;AAAA,EACjB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AACnB;AAEA,MAAM,gBAAgB;AAAA,EACpB,QAAQ;AACV;AAEA,MAAM,kBAAkB;AAAA,EACtB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,eAAe;AACjB;AAIA,MAAM,SAAS,CAAC;AACT,SAAS,2BAA2B,KAAa,WAAmB;AACzE,QAAM,gBAAY,wCAAgB;AAClC,QAAM,UAAU,UAAU;AAC1B,MAAI,OAAO;AAAU,WAAO,OAAO;AACnC,MAAI,CAAC,SAAS;AACZ;AAAA,EACF;AACA,QAAM,SAAS,QAAQ,QAAQ,OAAO,EAAE,EAAE,QAAQ,OAAO,EAAE,EAAE,KAAK;AAClE,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM,GAAG;AAC7B,UAAM;AAAA,EACR,WAAW,gBAAgB,MAAM;AAC/B,UAAM,CAAC;AAAA,EACT,WAAW,OAAO,SAAS,IAAI,GAAG;AAChC,UAAM,CAAC,OAAO,QAAQ,MAAM,EAAE;AAAA,EAChC,OAAO;AACL,UAAM;AAAA,EACR;AACA,SAAO,WAAW;AAClB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,QAAI,OAAO,QAAQ,YAAY,MAAM,GAAG,GAAG;AAEzC,cAAQ,IAAI,sCAAsC,EAAE,KAAK,QAAQ,SAAS,KAAK,UAAU,CAAC;AAAA,IAC5F;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -20,8 +21,9 @@ __export(proxyThemeVariables_exports, {
|
|
|
20
21
|
proxyThemeVariables: () => proxyThemeVariables
|
|
21
22
|
});
|
|
22
23
|
module.exports = __toCommonJS(proxyThemeVariables_exports);
|
|
24
|
+
var import_createProxy = require("./createProxy");
|
|
23
25
|
function proxyThemeVariables(obj) {
|
|
24
|
-
return
|
|
26
|
+
return (0, import_createProxy.createProxy)(obj || {}, {
|
|
25
27
|
has(target, key) {
|
|
26
28
|
return Reflect.has(target, removeStarting$(key));
|
|
27
29
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/proxyThemeVariables.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { createProxy } from './createProxy'\n\nexport function proxyThemeVariables<A extends Object>(obj: A): A {\n return createProxy<A>(obj || {}, {\n has(target, key) {\n return Reflect.has(target, removeStarting$(key))\n },\n get(target, key) {\n return Reflect.get(target, removeStarting$(key))\n },\n })\n}\n\nconst removeStarting$ = (str: string | symbol) =>\n typeof str === 'string' && str[0] === '$' ? str.slice(1) : str\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAErB,SAAS,oBAAsC,KAAW;AAC/D,aAAO,gCAAe,OAAO,CAAC,GAAG;AAAA,IAC/B,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,IACA,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,EACF,CAAC;AACH;AAEA,MAAM,kBAAkB,CAAC,QACvB,OAAO,QAAQ,YAAY,IAAI,OAAO,MAAM,IAAI,MAAM,CAAC,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -27,11 +28,22 @@ const pseudoDescriptors = {
|
|
|
27
28
|
},
|
|
28
29
|
pressStyle: {
|
|
29
30
|
name: "active",
|
|
31
|
+
stateKey: "press",
|
|
30
32
|
priority: 2
|
|
31
33
|
},
|
|
32
34
|
focusStyle: {
|
|
33
35
|
name: "focus",
|
|
34
36
|
priority: 3
|
|
37
|
+
},
|
|
38
|
+
enterStyle: {
|
|
39
|
+
name: "enter",
|
|
40
|
+
stateKey: "unmounted",
|
|
41
|
+
priority: 4
|
|
42
|
+
},
|
|
43
|
+
exitStyle: {
|
|
44
|
+
name: "exit",
|
|
45
|
+
stateKey: "isExiting",
|
|
46
|
+
priority: 5
|
|
35
47
|
}
|
|
36
48
|
};
|
|
37
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/pseudoDescriptors.ts"],
|
|
4
|
-
"sourcesContent": ["// *0 order matches to *1\n\nexport const pseudoDescriptors = {\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n}
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// *0 order matches to *1\n\nexport const pseudoDescriptors: Record<\n 'hoverStyle' | 'pressStyle' | 'focusStyle' | 'enterStyle' | 'exitStyle',\n PseudoDescriptor\n> = {\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n pressStyle: {\n name: 'active',\n stateKey: 'press',\n priority: 2,\n },\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n enterStyle: {\n name: 'enter',\n stateKey: 'unmounted',\n priority: 4,\n },\n exitStyle: {\n name: 'exit',\n stateKey: 'isExiting',\n priority: 5,\n },\n}\n\nexport type PseudoDescriptor = {\n name: string\n priority: number\n stateKey?: string\n}\n\nexport type PseudoDescriptors = {\n [Key in keyof typeof pseudoDescriptors]: PseudoDescriptor\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,oBAGT;AAAA,EACF,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -18,23 +19,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
19
|
var registerCSSVariable_exports = {};
|
|
19
20
|
__export(registerCSSVariable_exports, {
|
|
20
21
|
registerCSSVariable: () => registerCSSVariable,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
tokensValueToVariable: () => tokensValueToVariable,
|
|
23
|
+
variableToCSS: () => variableToCSS
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(registerCSSVariable_exports);
|
|
25
26
|
var import_createVariable = require("../createVariable");
|
|
26
27
|
const registerCSSVariable = (v) => {
|
|
27
28
|
tokensValueToVariable.set(v.val, v);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return val
|
|
29
|
+
};
|
|
30
|
+
const variableToCSS = (v) => {
|
|
31
|
+
return `--${(0, import_createVariable.createCSSVariable)(v.name, false)}:${typeof v.val === "number" ? `${v.val}px` : v.val}`;
|
|
31
32
|
};
|
|
32
33
|
const tokensValueToVariable = /* @__PURE__ */ new Map();
|
|
33
|
-
const tokenRules = /* @__PURE__ */ new Set();
|
|
34
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
35
|
0 && (module.exports = {
|
|
36
36
|
registerCSSVariable,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
tokensValueToVariable,
|
|
38
|
+
variableToCSS
|
|
39
39
|
});
|
|
40
40
|
//# sourceMappingURL=registerCSSVariable.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/registerCSSVariable.ts"],
|
|
4
|
-
"sourcesContent": ["import { Variable, createCSSVariable } from '../createVariable'\n\nexport const registerCSSVariable = (v: Variable) => {\n tokensValueToVariable.set(v.val, v)\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Variable, createCSSVariable } from '../createVariable'\n\nexport const registerCSSVariable = (v: Variable) => {\n tokensValueToVariable.set(v.val, v)\n}\n\nexport const variableToCSS = (v: Variable) => {\n return `--${createCSSVariable(v.name, false)}:${typeof v.val === 'number' ? `${v.val}px` : v.val}`\n}\n\nexport const tokensValueToVariable = new Map<any, any>()\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA4C;AAErC,MAAM,sBAAsB,CAAC,MAAgB;AAClD,wBAAsB,IAAI,EAAE,KAAK,CAAC;AACpC;AAEO,MAAM,gBAAgB,CAAC,MAAgB;AAC5C,SAAO,SAAK,yCAAkB,EAAE,MAAM,KAAK,KAAK,OAAO,EAAE,QAAQ,WAAW,GAAG,EAAE,UAAU,EAAE;AAC/F;AAEO,MAAM,wBAAwB,oBAAI,IAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -16,17 +17,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
17
|
}
|
|
17
18
|
return to;
|
|
18
19
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
20
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
|
|
25
|
+
var startTransition_exports = {};
|
|
26
|
+
__export(startTransition_exports, {
|
|
27
|
+
startTransition: () => startTransition
|
|
24
28
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
var
|
|
27
|
-
const
|
|
29
|
+
module.exports = __toCommonJS(startTransition_exports);
|
|
30
|
+
var import_react = __toESM(require("react"));
|
|
31
|
+
const startTransition = import_react.default.startTransition || ((cb) => cb());
|
|
28
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
33
|
0 && (module.exports = {
|
|
30
|
-
|
|
34
|
+
startTransition
|
|
31
35
|
});
|
|
32
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=startTransition.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/startTransition.ts"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGX,MAAM,kBAAkB,aAAAA,QAAM,oBAAoB,CAAC,OAAO,GAAG;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -1,38 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
8
|
var __export = (target, all) => {
|
|
37
9
|
for (var name in all)
|
|
38
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -45,30 +17,32 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
45
17
|
}
|
|
46
18
|
return to;
|
|
47
19
|
};
|
|
48
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
49
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
25
|
var themeable_exports = {};
|
|
51
26
|
__export(themeable_exports, {
|
|
52
27
|
themeable: () => themeable
|
|
53
28
|
});
|
|
54
29
|
module.exports = __toCommonJS(themeable_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
31
|
var import_react = __toESM(require("react"));
|
|
56
32
|
var import_Theme = require("../views/Theme");
|
|
57
|
-
var import_ThemeInverse = require("../views/ThemeInverse");
|
|
58
33
|
function themeable(component, opts) {
|
|
59
34
|
const withThemeComponent = (0, import_react.forwardRef)(function WithTheme(props, ref) {
|
|
60
|
-
const
|
|
61
|
-
const element = import_react.default.createElement(component,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
return element;
|
|
35
|
+
const { themeInverse, theme, componentName, reset, ...rest } = props;
|
|
36
|
+
const element = import_react.default.createElement(component, { ...rest, ref });
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
|
|
38
|
+
inverse: themeInverse,
|
|
39
|
+
componentName: componentName || (opts == null ? void 0 : opts.componentName),
|
|
40
|
+
name: theme || null,
|
|
41
|
+
"data-themeable": true,
|
|
42
|
+
debug: props.debug,
|
|
43
|
+
reset: props.reset,
|
|
44
|
+
children: element
|
|
45
|
+
});
|
|
72
46
|
});
|
|
73
47
|
const withTheme = withThemeComponent;
|
|
74
48
|
withTheme.displayName = `Themed(${(component == null ? void 0 : component.displayName) || (component == null ? void 0 : component.name) || "Anonymous"})`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/themeable.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { forwardRef } from 'react'\n\nimport { ThemeName } from '../types'\nimport { Theme } from '../views/Theme'\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React, { forwardRef, useId } from 'react'\n\nimport { ThemeName } from '../types'\nimport { Theme } from '../views/Theme'\n\nexport interface ThemeableProps {\n theme?: ThemeName | null\n themeInverse?: boolean\n componentName?: string\n debug?: boolean | 'verbose'\n reset?: boolean\n}\n\nexport function themeable<Component extends (props: any) => any>(\n component: Component,\n opts?: { componentName?: string }\n) {\n const withThemeComponent = forwardRef(function WithTheme(props: ThemeableProps, ref) {\n const { themeInverse, theme, componentName, reset, ...rest } = props\n const element = React.createElement(component, { ...rest, ref } as any)\n\n return (\n <Theme\n inverse={themeInverse}\n componentName={componentName || opts?.componentName}\n name={(theme as any) || null}\n data-themeable\n debug={props.debug}\n reset={props.reset}\n >\n {element}\n </Theme>\n )\n })\n\n const withTheme: any = withThemeComponent\n withTheme.displayName = `Themed(${\n (component as any)?.displayName || (component as any)?.name || 'Anonymous'\n })`\n\n return withTheme as Component extends (props: infer P) => infer R\n ? (props: Omit<P, 'theme' | 'themeInverse'> & ThemeableProps) => R\n : unknown\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBM;AAtBN,mBAAyC;AAGzC,mBAAsB;AAUf,SAAS,UACd,WACA,MACA;AACA,QAAM,yBAAqB,yBAAW,SAAS,UAAU,OAAuB,KAAK;AACnF,UAAM,EAAE,cAAc,OAAO,eAAe,UAAU,KAAK,IAAI;AAC/D,UAAM,UAAU,aAAAA,QAAM,cAAc,WAAW,EAAE,GAAG,MAAM,IAAI,CAAQ;AAEtE,WACE,4CAAC;AAAA,MACC,SAAS;AAAA,MACT,eAAe,kBAAiB,6BAAM;AAAA,MACtC,MAAO,SAAiB;AAAA,MACxB,kBAAc;AAAA,MACd,OAAO,MAAM;AAAA,MACb,OAAO,MAAM;AAAA,MAEZ;AAAA,KACH;AAAA,EAEJ,CAAC;AAED,QAAM,YAAiB;AACvB,YAAU,cAAc,WACrB,uCAAmB,iBAAgB,uCAAmB,SAAQ;AAGjE,SAAO;AAGT;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var themes_exports = {};
|
|
20
|
+
__export(themes_exports, {
|
|
21
|
+
ensureThemeVariable: () => ensureThemeVariable,
|
|
22
|
+
proxyThemeToParents: () => proxyThemeToParents
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(themes_exports);
|
|
25
|
+
var import_createVariable = require("../createVariable");
|
|
26
|
+
var import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
27
|
+
function ensureThemeVariable(theme, key) {
|
|
28
|
+
const val = theme[key];
|
|
29
|
+
const themeKey = key;
|
|
30
|
+
if (!(0, import_createVariable.isVariable)(val)) {
|
|
31
|
+
theme[key] = (0, import_createVariable.createVariable)({
|
|
32
|
+
key: themeKey,
|
|
33
|
+
name: themeKey,
|
|
34
|
+
val
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
if (val.name !== themeKey) {
|
|
38
|
+
theme[key] = (0, import_createVariable.createVariable)({
|
|
39
|
+
key: val.name,
|
|
40
|
+
name: themeKey,
|
|
41
|
+
val: val.val
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function proxyThemeToParents(themeName, theme, themes) {
|
|
47
|
+
const cur = [];
|
|
48
|
+
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
49
|
+
cur.push(part);
|
|
50
|
+
return cur.join("_");
|
|
51
|
+
});
|
|
52
|
+
const hasParents = parents.length;
|
|
53
|
+
return new Proxy(theme, {
|
|
54
|
+
get(target, key) {
|
|
55
|
+
if (key === import_getThemeUnwrapped.GetThemeUnwrapped) {
|
|
56
|
+
return theme;
|
|
57
|
+
}
|
|
58
|
+
if (!hasParents || Reflect.has(target, key)) {
|
|
59
|
+
return Reflect.get(target, key);
|
|
60
|
+
}
|
|
61
|
+
for (let i = parents.length - 1; i >= 0; i--) {
|
|
62
|
+
const parent = themes[parents[i]];
|
|
63
|
+
if (!parent) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (Reflect.has(parent, key)) {
|
|
67
|
+
return Reflect.get(parent, key);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return Reflect.get(target, key);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
ensureThemeVariable,
|
|
77
|
+
proxyThemeToParents
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=themes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/themes.ts"],
|
|
4
|
+
"sourcesContent": ["import { createVariable, isVariable } from '../createVariable'\nimport { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped'\nimport { CreateTamaguiProps } from '../types'\n\n// mutates, freeze after\n// shared by createTamagui so extracted here\nexport function ensureThemeVariable(theme: any, key: string) {\n const val = theme[key]\n const themeKey = key\n if (!isVariable(val)) {\n theme[key] = createVariable({\n key: themeKey,\n name: themeKey,\n val,\n })\n } else {\n if (val.name !== themeKey) {\n // rename to theme name\n theme[key] = createVariable({\n key: val.name,\n name: themeKey,\n val: val.val,\n })\n }\n }\n}\n\nexport function proxyThemeToParents(\n themeName: string,\n theme: any,\n themes: CreateTamaguiProps['themes']\n) {\n // we could test if this is better as just a straight object spread or fancier proxy\n const cur: string[] = []\n // if theme is dark_blue_alt1_Button\n // this will be the parent names in order: ['dark', 'dark_blue', 'dark_blue_alt1\"]\n const parents = themeName\n .split('_')\n .slice(0, -1)\n .map((part) => {\n cur.push(part)\n return cur.join('_')\n })\n\n const hasParents = parents.length\n\n // proxy fallback values to parent theme values\n return new Proxy(theme, {\n get(target, key) {\n if (key === GetThemeUnwrapped) {\n return theme\n }\n if (!hasParents || Reflect.has(target, key)) {\n return Reflect.get(target, key)\n }\n // check parents\n for (let i = parents.length - 1; i >= 0; i--) {\n const parent = themes[parents[i]]\n if (!parent) {\n continue\n }\n if (Reflect.has(parent, key)) {\n return Reflect.get(parent, key)\n }\n }\n return Reflect.get(target, key)\n },\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2C;AAC3C,+BAAkC;AAK3B,SAAS,oBAAoB,OAAY,KAAa;AAC3D,QAAM,MAAM,MAAM;AAClB,QAAM,WAAW;AACjB,MAAI,KAAC,kCAAW,GAAG,GAAG;AACpB,UAAM,WAAO,sCAAe;AAAA,MAC1B,KAAK;AAAA,MACL,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,SAAS,UAAU;AAEzB,YAAM,WAAO,sCAAe;AAAA,QAC1B,KAAK,IAAI;AAAA,QACT,MAAM;AAAA,QACN,KAAK,IAAI;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,SAAS,oBACd,WACA,OACA,QACA;AAEA,QAAM,MAAgB,CAAC;AAGvB,QAAM,UAAU,UACb,MAAM,GAAG,EACT,MAAM,GAAG,EAAE,EACX,IAAI,CAAC,SAAS;AACb,QAAI,KAAK,IAAI;AACb,WAAO,IAAI,KAAK,GAAG;AAAA,EACrB,CAAC;AAEH,QAAM,aAAa,QAAQ;AAG3B,SAAO,IAAI,MAAM,OAAO;AAAA,IACtB,IAAI,QAAQ,KAAK;AACf,UAAI,QAAQ,4CAAmB;AAC7B,eAAO;AAAA,MACT;AACA,UAAI,CAAC,cAAc,QAAQ,IAAI,QAAQ,GAAG,GAAG;AAC3C,eAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,MAChC;AAEA,eAAS,IAAI,QAAQ,SAAS,GAAG,KAAK,GAAG,KAAK;AAC5C,cAAM,SAAS,OAAO,QAAQ;AAC9B,YAAI,CAAC,QAAQ;AACX;AAAA,QACF;AACA,YAAI,QAAQ,IAAI,QAAQ,GAAG,GAAG;AAC5B,iBAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,QAChC;AAAA,MACF;AACA,aAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,IAChC;AAAA,EACF,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -15,14 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
16
|
return to;
|
|
16
17
|
};
|
|
17
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
20
|
-
|
|
19
|
+
var timer_exports = {};
|
|
20
|
+
__export(timer_exports, {
|
|
21
|
+
time: () => time
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(timer_exports);
|
|
24
|
+
const timer = require("@tamagui/timer").timer();
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
timer.print();
|
|
27
|
+
}, 2e3);
|
|
28
|
+
const time = timer.start({
|
|
29
|
+
quiet: true
|
|
21
30
|
});
|
|
22
|
-
module.exports = __toCommonJS(rnw_native_exports);
|
|
23
|
-
const rnw = {};
|
|
24
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
25
32
|
0 && (module.exports = {
|
|
26
|
-
|
|
33
|
+
time
|
|
27
34
|
});
|
|
28
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=timer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/timer.ts"],
|
|
4
|
+
"sourcesContent": ["const timer = require('@tamagui/timer').timer()\n\nsetTimeout(() => {\n timer.print()\n}, 2000)\n\nexport const time = timer.start({\n quiet: true,\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,QAAQ,QAAQ,gBAAgB,EAAE,MAAM;AAE9C,WAAW,MAAM;AACf,QAAM,MAAM;AACd,GAAG,GAAI;AAEA,MAAM,OAAO,MAAM,MAAM;AAAA,EAC9B,OAAO;AACT,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useShallowSetState_exports = {};
|
|
20
|
+
__export(useShallowSetState_exports, {
|
|
21
|
+
useShallowSetState: () => useShallowSetState
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useShallowSetState_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
function useShallowSetState(setter, debug, debugName) {
|
|
26
|
+
return (0, import_react.useCallback)(
|
|
27
|
+
(next) => {
|
|
28
|
+
setter((prev) => {
|
|
29
|
+
for (const key in next) {
|
|
30
|
+
if (prev[key] !== next[key]) {
|
|
31
|
+
if (process.env.NODE_ENV === "development") {
|
|
32
|
+
if (debug === "verbose") {
|
|
33
|
+
console.log(` \u25B2 setState ${debugName}`, next);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { ...prev, ...next };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return prev;
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
[setter]
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
useShallowSetState
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=useShallowSetState.js.map
|