@tamagui/core 1.0.1-beta.19 → 1.0.1-beta.190
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 +14 -12
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +80 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +33 -19
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +11 -23
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/{helpers/nativeGestureHandler.js → constants/isDevTools.js} +8 -8
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +32 -16
- 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/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/{views → contexts}/TextAncestorContext.js +11 -13
- 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 +925 -484
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +5 -8
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js +1 -2
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +129 -177
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +4 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +5 -25
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +52 -28
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +52 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/{ThemeManager.js → helpers/ThemeManager.js} +54 -52
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +3 -3
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +188 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +30 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/calc.js +71 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +17 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +268 -120
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +14 -25
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +90 -0
- package/dist/cjs/helpers/expandStyle.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +115 -0
- package/dist/cjs/helpers/expandStyles.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +49 -37
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +3 -3
- 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/getExpandedShorthands.js +4 -5
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/{getTextSize.js → getFont.js} +22 -12
- package/dist/cjs/helpers/getFont.js.map +7 -0
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +19 -10
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +381 -208
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +46 -0
- package/dist/cjs/helpers/getStackSize.js.map +7 -0
- package/dist/cjs/helpers/getStylesAtomic.js +199 -133
- package/dist/cjs/helpers/getStylesAtomic.js.map +3 -3
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +103 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/{nativeGestureHandler.native.js → helpers/getThemeCSSRules.native.js} +18 -5
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +88 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +87 -52
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +2 -2
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +37 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/cjs/helpers/isTamaguiElement.js +5 -5
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -6
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +6 -3
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +54 -0
- package/dist/cjs/helpers/mergeProps.js.map +7 -0
- package/dist/cjs/helpers/mergeTransform.js +42 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/normalizeColor.js +80 -0
- package/dist/cjs/helpers/normalizeColor.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +93 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +7 -4
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +42 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/helpers/registerCSSVariable.js +40 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
- package/dist/cjs/helpers/{wrapThemeManagerContext.js → startTransition.js} +12 -15
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -40
- 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/helpers/useShallowSetState.js +44 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -122
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +3 -3
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +39 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -2
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useDidFinishSSR.js +60 -0
- package/dist/cjs/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -33
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +3 -4
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +11 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +162 -113
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +4 -18
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +60 -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 +166 -132
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useUnmountEffect.js +1 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +59 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +93 -0
- package/dist/cjs/insertFont.js.map +7 -0
- package/dist/cjs/static.js +22 -15
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +47 -44
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +2 -2
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/updateTheme.js +47 -0
- package/dist/cjs/updateTheme.js.map +7 -0
- package/dist/cjs/vendor/Pressability.js +32 -0
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/vendor/Pressability.native.js +32 -0
- 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 +63 -65
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +82 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +28 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +43 -21
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +25 -25
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +35 -23
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +18 -12
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +8 -11
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +56 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/config.js +45 -0
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +2 -2
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +5 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +25 -12
- 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/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +17 -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 +891 -389
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +4 -9
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js +0 -3
- package/dist/esm/createShorthands.js.map +1 -1
- package/dist/esm/createTamagui.js +128 -158
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +3 -3
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +3 -24
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +47 -26
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +28 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/{ThemeManager.js → helpers/ThemeManager.js} +53 -53
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +2 -4
- package/dist/esm/helpers/areEqualSets.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +16 -10
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +263 -121
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +13 -12
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +66 -0
- package/dist/esm/helpers/expandStyle.js.map +7 -0
- package/dist/esm/helpers/expandStyles.js +89 -0
- package/dist/esm/helpers/expandStyles.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +35 -28
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +2 -4
- package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -5
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/{getTextSize.js → getFont.js} +17 -9
- package/dist/esm/helpers/getFont.js.map +7 -0
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getSize.js +16 -10
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +364 -188
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +22 -0
- package/dist/esm/helpers/getStackSize.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +187 -108
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +79 -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 +63 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +82 -50
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +1 -3
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +13 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/esm/helpers/isTamaguiElement.js +4 -6
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -7
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +1 -3
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +30 -0
- package/dist/esm/helpers/mergeProps.js.map +7 -0
- package/dist/esm/helpers/mergeTransform.js +17 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/normalizeColor.js +49 -0
- package/dist/esm/helpers/normalizeColor.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +69 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +6 -5
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +18 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/registerCSSVariable.js +14 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +11 -9
- 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/useShallowSetState.js +20 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -75
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +2 -4
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/getThemeUnwrapped.js +14 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -4
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useDidFinishSSR.js +35 -0
- package/dist/esm/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -31
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -4
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +10 -10
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +157 -103
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +2 -4
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +36 -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 +159 -109
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useUnmountEffect.js +0 -3
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +51 -13
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +67 -0
- package/dist/esm/insertFont.js.map +7 -0
- package/dist/esm/static.js +15 -15
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +40 -12
- 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/vendor/Pressability.js +7 -0
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/vendor/Pressability.native.js +7 -0
- 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 +50 -32
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +0 -0
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js +52 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +13 -5
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +35 -19
- package/dist/esm/views/Theme.js.map +3 -3
- package/dist/esm/views/ThemeInverse.js +22 -20
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +28 -21
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +13 -12
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +48 -16
- package/reset.css +25 -4
- package/src/Tamagui.ts +44 -0
- package/src/addTheme.ts +67 -0
- package/src/config.ts +45 -0
- package/src/constants/constants.ts +15 -0
- package/src/constants/isDevTools.ts +6 -0
- package/src/constants/platform.native.ts +14 -0
- package/src/constants/platform.ts +41 -0
- package/src/contexts/ButtonInsideButtonContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +10 -0
- package/src/contexts/ThemeContext.tsx +5 -0
- package/src/createComponent.tsx +1599 -0
- package/src/createFont.ts +29 -0
- package/src/createShorthands.ts +5 -0
- package/src/createTamagui.ts +229 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.ts +85 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.tsx +235 -0
- package/src/helpers/areEqualSets.tsx +9 -0
- package/src/helpers/assignNativePropsToWeb.native.tsx +1 -0
- package/src/helpers/assignNativePropsToWeb.tsx +178 -0
- package/src/helpers/calc.ts +68 -0
- package/src/helpers/createMediaStyle.ts +48 -0
- package/src/helpers/createPropMapper.ts +523 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +76 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFont.tsx +43 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +738 -0
- package/src/helpers/getStackSize.ts +22 -0
- package/src/helpers/getStylesAtomic.native.ts +3 -0
- package/src/helpers/getStylesAtomic.ts +292 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +105 -0
- package/src/helpers/getVariantExtras.tsx +84 -0
- package/src/helpers/insertStyleRule.tsx +150 -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 +16 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +16 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +80 -0
- package/src/helpers/proxyThemeVariables.tsx +18 -0
- package/src/helpers/pseudoDescriptors.ts +18 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/startTransition.ts +4 -0
- package/src/helpers/themeable.tsx +45 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/useShallowSetState.tsx +20 -0
- package/src/helpers/validate.ts +80 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +8 -0
- package/src/hooks/useConstant.tsx +19 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsMounted.ts +16 -0
- package/src/hooks/useIsTouchDevice.tsx +20 -0
- package/src/hooks/useMedia.tsx +266 -0
- package/src/hooks/usePressable.tsx +9 -0
- package/src/hooks/useSafeRef.ts +49 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +299 -0
- package/src/hooks/useUnmountEffect.ts +5 -0
- package/src/index.ts +83 -0
- package/src/injectStyles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/static.ts +15 -0
- package/src/styled.tsx +198 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1307 -0
- package/src/updateTheme.ts +23 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +9 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +151 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +56 -0
- package/src/views/Text.tsx +79 -0
- package/src/views/Theme.tsx +72 -0
- package/src/views/ThemeInverse.tsx +33 -0
- package/src/views/ThemeProvider.tsx +63 -0
- package/src/views/ThemeReset.tsx +43 -0
- package/types/Tamagui.d.ts +6 -8
- package/types/addTheme.d.ts +11 -0
- package/types/conf.d.ts +4 -5
- package/types/config.d.ts +47 -0
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/constants/platform.d.ts +7 -6
- package/types/constants/platform.native.d.ts +13 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/{views → contexts}/TextAncestorContext.d.ts +0 -0
- package/types/{ThemeContext.d.ts → contexts/ThemeContext.d.ts} +1 -1
- package/types/createComponent.d.ts +32 -15
- package/types/createComponent.server.d.ts +36 -0
- package/types/createTamagui.d.ts +2 -17
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -6
- package/types/createVariable.d.ts +24 -12
- package/types/createVariables.d.ts +10 -0
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +46 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/calc.d.ts +17 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +6 -3
- package/types/helpers/createShallowUpdate.d.ts +1 -2
- package/types/helpers/cssHash.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +6 -0
- package/types/helpers/expandStyles.d.ts +26 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getFont.d.ts +3 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getSize.d.ts +3 -2
- package/types/helpers/getSplitStyles.d.ts +16 -9
- package/types/helpers/getStackSize.d.ts +8 -0
- package/types/helpers/getStylesAtomic.d.ts +17 -22
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +5 -0
- package/types/helpers/insertStyleRule.d.ts +7 -3
- package/types/helpers/isTamaguiComponent.d.ts +5 -0
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/mergeProps.d.ts +17 -0
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/normalizeColor.d.ts +3 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +6 -0
- package/types/helpers/pseudoDescriptors.d.ts +16 -0
- package/types/helpers/registerCSSVariable.d.ts +5 -0
- package/types/helpers/startTransition.d.ts +3 -0
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/useAnimationDriver.d.ts +1 -0
- package/types/helpers/useShallowSetState.d.ts +3 -0
- package/types/helpers/validate.d.ts +0 -3
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useAnimationDriver.d.ts +1 -0
- package/types/hooks/useDidFinishSSR.d.ts +3 -0
- package/types/hooks/useFeatures.d.ts +10 -5
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsSSR.d.ts +4 -0
- package/types/hooks/useMedia.d.ts +20 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerContext.d.ts +2 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +21 -31
- package/types/index.d.ts +29 -9
- package/types/injectStyles.d.ts +7 -0
- package/types/insertFont.d.ts +9 -0
- package/types/static.d.ts +2 -15
- package/types/styled.d.ts +7 -3
- package/types/types.d.ts +277 -77
- package/types/updateTheme.d.ts +9 -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 +1 -0
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Theme.d.ts +3 -9
- package/types/views/ThemeInverse.d.ts +4 -8
- package/types/views/ThemeProvider.d.ts +2 -1
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js +0 -46
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -93
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -53
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/cjs/helpers/getButtonSize.js +0 -45
- package/dist/cjs/helpers/getButtonSize.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -228
- 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/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js +0 -36
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -24
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
- package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -40
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -32
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/esm/helpers/getButtonSize.js +0 -24
- package/dist/esm/helpers/getButtonSize.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js +0 -7
- package/dist/esm/helpers/nativeGestureHandler.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 -14
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -173
- 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/nativeGestureHandler.native.js +0 -2
- package/dist/esm/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/views/TextAncestorContext.js +0 -18
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/dist/jsx/Tamagui.js +0 -41
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -186
- package/dist/jsx/conf.js +0 -35
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -23
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -636
- package/dist/jsx/createFont.js +0 -27
- package/dist/jsx/createShorthands.js +0 -9
- package/dist/jsx/createTamagui.js +0 -201
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -28
- package/dist/jsx/createVariable.js +0 -48
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
- package/dist/jsx/helpers/areEqualSets.js +0 -15
- package/dist/jsx/helpers/createMediaStyle.js +0 -30
- package/dist/jsx/helpers/createPropMapper.js +0 -237
- package/dist/jsx/helpers/createShallowUpdate.js +0 -18
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
- package/dist/jsx/helpers/extendStaticConfig.js +0 -61
- package/dist/jsx/helpers/fixNativeShadow.js +0 -7
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -31
- package/dist/jsx/helpers/getButtonSize.js +0 -23
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
- package/dist/jsx/helpers/getSize.js +0 -12
- package/dist/jsx/helpers/getSplitStyles.js +0 -322
- package/dist/jsx/helpers/getStylesAtomic.js +0 -130
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
- package/dist/jsx/helpers/getTextSize.js +0 -33
- package/dist/jsx/helpers/insertStyleRule.js +0 -94
- package/dist/jsx/helpers/isObj.js +0 -6
- package/dist/jsx/helpers/isTamaguiElement.js +0 -10
- package/dist/jsx/helpers/matchMedia.js +0 -17
- package/dist/jsx/helpers/matchMedia.native.js +0 -8
- package/dist/jsx/helpers/nativeGestureHandler.js +0 -6
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
- package/dist/jsx/helpers/themeable.js +0 -24
- package/dist/jsx/helpers/validate.js +0 -75
- package/dist/jsx/helpers/withStaticProperties.js +0 -9
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
- package/dist/jsx/hooks/useConstant.js +0 -14
- package/dist/jsx/hooks/useFeatures.js +0 -167
- package/dist/jsx/hooks/useId.js +0 -34
- package/dist/jsx/hooks/useIsMounted.js +0 -18
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
- package/dist/jsx/hooks/useMedia.js +0 -158
- package/dist/jsx/hooks/usePressable.js +0 -13
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -177
- package/dist/jsx/hooks/useUnmountEffect.js +0 -10
- package/dist/jsx/index.js +0 -54
- package/dist/jsx/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/static.js +0 -16
- package/dist/jsx/styled.js +0 -47
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -75
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -56
- package/dist/jsx/views/TextAncestorContext.js +0 -15
- package/dist/jsx/views/Theme.js +0 -31
- package/dist/jsx/views/ThemeInverse.js +0 -27
- package/dist/jsx/views/ThemeProvider.js +0 -35
- package/dist/jsx/views/ThemeReset.js +0 -34
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -49
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts.map +0 -1
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/platform.d.ts.map +0 -1
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTheme.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/createVariable.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/defaultComponentState.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/addStylesUsingClassname.d.ts +0 -3
- package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/types/helpers/areEqualSets.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts.map +0 -1
- package/types/helpers/createTamaguiProvider.d.ts +0 -7
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.native.d.ts +0 -3
- package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/types/helpers/getButtonSize.d.ts +0 -8
- package/types/helpers/getButtonSize.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.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/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getTextSize.d.ts +0 -3
- package/types/helpers/getTextSize.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts.map +0 -1
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts.map +0 -1
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts.map +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/nativeGestureHandler.native.d.ts +0 -2
- package/types/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types-rnw.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/views/Slot.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.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
6
|
var __export = (target, all) => {
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -18,60 +18,84 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var createVariable_exports = {};
|
|
20
20
|
__export(createVariable_exports, {
|
|
21
|
-
IS_VARIABLE_SYMBOL: () => IS_VARIABLE_SYMBOL,
|
|
22
|
-
Variable: () => Variable,
|
|
23
21
|
createCSSVariable: () => createCSSVariable,
|
|
24
22
|
createVariable: () => createVariable,
|
|
23
|
+
getVariable: () => getVariable,
|
|
25
24
|
getVariableName: () => getVariableName,
|
|
26
25
|
getVariableValue: () => getVariableValue,
|
|
27
|
-
|
|
26
|
+
getVariableVariable: () => getVariableVariable,
|
|
27
|
+
isVariable: () => isVariable,
|
|
28
|
+
variableToString: () => variableToString
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(createVariable_exports);
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.name = name;
|
|
38
|
-
this.variable = import_platform.isWeb ? createCSSVariable(name) : this.val;
|
|
31
|
+
var import_constants = require("@tamagui/constants");
|
|
32
|
+
var import_helpers = require("@tamagui/helpers");
|
|
33
|
+
var import_config = require("./config");
|
|
34
|
+
const IS_VAR = "__isVar__";
|
|
35
|
+
const createVariable = (props) => {
|
|
36
|
+
if (isVariable(props)) {
|
|
37
|
+
return props;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return {
|
|
40
|
+
[IS_VAR]: true,
|
|
41
|
+
...props,
|
|
42
|
+
variable: import_constants.isWeb ? createCSSVariable(props.name) : ""
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
function variableToString(vrble, getValue = false) {
|
|
46
|
+
if (!vrble)
|
|
47
|
+
return "";
|
|
48
|
+
if (isVariable(vrble)) {
|
|
49
|
+
if (getValue)
|
|
50
|
+
return `${vrble.val}`;
|
|
51
|
+
return `${import_constants.isWeb ? vrble.variable : vrble.val}`;
|
|
42
52
|
}
|
|
53
|
+
return `${vrble}`;
|
|
43
54
|
}
|
|
44
|
-
__name(Variable, "Variable");
|
|
45
|
-
_a = IS_VARIABLE_SYMBOL;
|
|
46
|
-
const createVariable = /* @__PURE__ */ __name((props) => new Variable(props), "createVariable");
|
|
47
55
|
function isVariable(v) {
|
|
48
|
-
return v
|
|
56
|
+
return !!(v && v[IS_VAR]);
|
|
57
|
+
}
|
|
58
|
+
function getVariable(nameOrVariable) {
|
|
59
|
+
if (isVariable(nameOrVariable)) {
|
|
60
|
+
return variableToString(nameOrVariable);
|
|
61
|
+
}
|
|
62
|
+
const tokens = (0, import_config.getConfig)().tokensParsed;
|
|
63
|
+
return variableToString(tokens[nameOrVariable] ?? nameOrVariable);
|
|
49
64
|
}
|
|
50
|
-
__name(isVariable, "isVariable");
|
|
51
65
|
function getVariableValue(v) {
|
|
52
66
|
if (isVariable(v))
|
|
53
67
|
return v.val;
|
|
54
68
|
return v;
|
|
55
69
|
}
|
|
56
|
-
__name(getVariableValue, "getVariableValue");
|
|
57
70
|
function getVariableName(v) {
|
|
58
71
|
if (isVariable(v))
|
|
59
72
|
return v.name;
|
|
60
73
|
return v;
|
|
61
74
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
function getVariableVariable(v) {
|
|
76
|
+
if (isVariable(v))
|
|
77
|
+
return v.variable;
|
|
78
|
+
return v;
|
|
79
|
+
}
|
|
80
|
+
const createCSSVariable = (nameProp, includeVar = true) => {
|
|
81
|
+
if (process.env.NODE_ENV === "development") {
|
|
82
|
+
if (!nameProp || typeof nameProp !== "string") {
|
|
83
|
+
console.trace("createCSSVariable invalid name", nameProp);
|
|
84
|
+
return ``;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const name = (0, import_helpers.simpleHash)(nameProp, 60);
|
|
65
88
|
return includeVar ? `var(--${name})` : name;
|
|
66
|
-
}
|
|
89
|
+
};
|
|
67
90
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
91
|
0 && (module.exports = {
|
|
69
|
-
IS_VARIABLE_SYMBOL,
|
|
70
|
-
Variable,
|
|
71
92
|
createCSSVariable,
|
|
72
93
|
createVariable,
|
|
94
|
+
getVariable,
|
|
73
95
|
getVariableName,
|
|
74
96
|
getVariableValue,
|
|
75
|
-
|
|
97
|
+
getVariableVariable,
|
|
98
|
+
isVariable,
|
|
99
|
+
variableToString
|
|
76
100
|
});
|
|
77
101
|
//# sourceMappingURL=createVariable.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createVariable.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\nimport { simpleHash } from '@tamagui/helpers'\n\nimport { getConfig } from './config'\n\n/**\n * Should rename this to Token\n * Moving to objects for React Server Components support\n */\n\nconst IS_VAR = '__isVar__'\n\ntype VariableIn<A = any> = {\n val: A\n name: string\n key: string\n isFloating?: boolean\n}\n\nexport type Variable<A = any> = VariableIn<A> & {\n [IS_VAR]?: true\n variable?: string\n}\n\nexport const createVariable = <A extends string | number = any>(props: VariableIn<A>) => {\n if (isVariable(props)) {\n return props\n }\n return {\n [IS_VAR]: true,\n // @ts-ignore\n ...props,\n variable: isWeb ? createCSSVariable(props.name) : '',\n }\n}\n\n// on the client maybe we can change the prototype of variable object toString to keep backwards compat\nexport function variableToString(vrble?: any, getValue = false) {\n if (!vrble) return ''\n if (isVariable(vrble)) {\n if (getValue) return `${vrble.val}`\n return `${isWeb ? vrble.variable : vrble.val}`\n }\n return `${vrble}`\n}\n\nexport function isVariable(v: Variable | any): v is Variable {\n return !!(v && v[IS_VAR])\n}\n\nexport function getVariable(nameOrVariable: Variable | string) {\n if (isVariable(nameOrVariable)) {\n return variableToString(nameOrVariable)\n }\n const tokens = getConfig().tokensParsed\n return variableToString(tokens[nameOrVariable] ?? nameOrVariable)\n}\n\nexport function getVariableValue(v: Variable | any) {\n if (isVariable(v)) return v.val\n return v\n}\n\nexport function getVariableName(v: Variable | any) {\n if (isVariable(v)) return v.name\n return v\n}\n\nexport function getVariableVariable(v: Variable | any) {\n if (isVariable(v)) return v.variable\n return v\n}\n\n// bugfix { space: { 0.5: 10 } } was generating var(--space-0.5) (invalid CSS):\nexport const createCSSVariable = (nameProp: string, includeVar = true) => {\n if (process.env.NODE_ENV === 'development') {\n if (!nameProp || typeof nameProp !== 'string') {\n // eslint-disable-next-line no-console\n console.trace('createCSSVariable invalid name', nameProp)\n return ``\n }\n }\n const name = simpleHash(nameProp, 60)\n return includeVar ? `var(--${name})` : name\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AACtB,qBAA2B;AAE3B,oBAA0B;AAO1B,MAAM,SAAS;AAcR,MAAM,iBAAiB,CAAkC,UAAyB;AACvF,MAAI,WAAW,KAAK,GAAG;AACrB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,CAAC,SAAS;AAAA,IAEV,GAAG;AAAA,IACH,UAAU,yBAAQ,kBAAkB,MAAM,IAAI,IAAI;AAAA,EACpD;AACF;AAGO,SAAS,iBAAiB,OAAa,WAAW,OAAO;AAC9D,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,WAAW,KAAK,GAAG;AACrB,QAAI;AAAU,aAAO,GAAG,MAAM;AAC9B,WAAO,GAAG,yBAAQ,MAAM,WAAW,MAAM;AAAA,EAC3C;AACA,SAAO,GAAG;AACZ;AAEO,SAAS,WAAW,GAAkC;AAC3D,SAAO,CAAC,EAAE,KAAK,EAAE;AACnB;AAEO,SAAS,YAAY,gBAAmC;AAC7D,MAAI,WAAW,cAAc,GAAG;AAC9B,WAAO,iBAAiB,cAAc;AAAA,EACxC;AACA,QAAM,aAAS,yBAAU,EAAE;AAC3B,SAAO,iBAAiB,OAAO,mBAAmB,cAAc;AAClE;AAEO,SAAS,iBAAiB,GAAmB;AAClD,MAAI,WAAW,CAAC;AAAG,WAAO,EAAE;AAC5B,SAAO;AACT;AAEO,SAAS,gBAAgB,GAAmB;AACjD,MAAI,WAAW,CAAC;AAAG,WAAO,EAAE;AAC5B,SAAO;AACT;AAEO,SAAS,oBAAoB,GAAmB;AACrD,MAAI,WAAW,CAAC;AAAG,WAAO,EAAE;AAC5B,SAAO;AACT;AAGO,MAAM,oBAAoB,CAAC,UAAkB,aAAa,SAAS;AACxE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,YAAY,OAAO,aAAa,UAAU;AAE7C,cAAQ,MAAM,kCAAkC,QAAQ;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,WAAO,2BAAW,UAAU,EAAE;AACpC,SAAO,aAAa,SAAS,UAAU;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 createVariables_exports = {};
|
|
20
|
+
__export(createVariables_exports, {
|
|
21
|
+
createVariables: () => createVariables
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(createVariables_exports);
|
|
24
|
+
var import_createVariable = require("./createVariable");
|
|
25
|
+
const createVariables = (tokens, parentPath = "", isFont = false) => {
|
|
26
|
+
const res = {};
|
|
27
|
+
let i = 0;
|
|
28
|
+
for (const key in tokens) {
|
|
29
|
+
i++;
|
|
30
|
+
const variableName = isFont ? key.slice(0, 2) : i;
|
|
31
|
+
const val = tokens[key];
|
|
32
|
+
if ((0, import_createVariable.isVariable)(val)) {
|
|
33
|
+
res[key] = val;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
let name = parentPath ? `${parentPath}-${variableName}` : key;
|
|
37
|
+
if (isFont && name.includes("_")) {
|
|
38
|
+
name = name.replace(/_[a-z0-9]+/i, "");
|
|
39
|
+
}
|
|
40
|
+
if (val && typeof val === "object") {
|
|
41
|
+
res[key] = createVariables(tokens[key], `${name}`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
res[key] = (0, import_createVariable.isVariable)(val) ? val : (0, import_createVariable.createVariable)({ val, name, key });
|
|
45
|
+
}
|
|
46
|
+
return res;
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
createVariables
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=createVariables.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/createVariables.ts"],
|
|
4
|
+
"sourcesContent": ["import { Variable, createVariable, isVariable } from './createVariable'\n\ntype DeepTokenObject<Val extends string | number = any> = {\n [key: string]: Val | DeepTokenObject<Val>\n}\n\nexport type DeepVariableObject<A extends DeepTokenObject> = {\n [Key in keyof A]: A[Key] extends string | number\n ? Variable<A[Key]>\n : A[Key] extends DeepTokenObject\n ? DeepVariableObject<A[Key]>\n : never\n}\n\nexport const createVariables = <A extends DeepTokenObject>(\n tokens: A,\n parentPath = '',\n isFont = false\n): DeepVariableObject<A> => {\n const res: any = {}\n let i = 0\n for (const key in tokens) {\n i++\n const variableName = isFont ? key.slice(0, 2) : i\n const val = tokens[key]\n if (isVariable(val)) {\n res[key] = val\n continue\n }\n let name = parentPath ? `${parentPath}-${variableName}` : key\n if (isFont && name.includes('_')) {\n name = name.replace(/_[a-z0-9]+/i, '')\n }\n if (val && typeof val === 'object') {\n // recurse\n res[key] = createVariables(tokens[key] as any, `${name}`)\n continue\n }\n res[key] = isVariable(val) ? val : createVariable({ val, name, key })\n }\n return res\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAqD;AAc9C,MAAM,kBAAkB,CAC7B,QACA,aAAa,IACb,SAAS,UACiB;AAC1B,QAAM,MAAW,CAAC;AAClB,MAAI,IAAI;AACR,aAAW,OAAO,QAAQ;AACxB;AACA,UAAM,eAAe,SAAS,IAAI,MAAM,GAAG,CAAC,IAAI;AAChD,UAAM,MAAM,OAAO;AACnB,YAAI,kCAAW,GAAG,GAAG;AACnB,UAAI,OAAO;AACX;AAAA,IACF;AACA,QAAI,OAAO,aAAa,GAAG,cAAc,iBAAiB;AAC1D,QAAI,UAAU,KAAK,SAAS,GAAG,GAAG;AAChC,aAAO,KAAK,QAAQ,eAAe,EAAE;AAAA,IACvC;AACA,QAAI,OAAO,OAAO,QAAQ,UAAU;AAElC,UAAI,OAAO,gBAAgB,OAAO,MAAa,GAAG,MAAM;AACxD;AAAA,IACF;AACA,QAAI,WAAO,kCAAW,GAAG,IAAI,UAAM,sCAAe,EAAE,KAAK,MAAM,IAAI,CAAC;AAAA,EACtE;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
@@ -16,21 +15,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
15
|
}
|
|
17
16
|
return to;
|
|
18
17
|
};
|
|
19
|
-
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));
|
|
20
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
19
|
var RNComponents_exports = {};
|
|
22
20
|
__export(RNComponents_exports, {
|
|
23
21
|
RNComponents: () => RNComponents
|
|
24
22
|
});
|
|
25
23
|
module.exports = __toCommonJS(RNComponents_exports);
|
|
26
|
-
var
|
|
27
|
-
const RNComponents = /* @__PURE__ */ new
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var import_react_native = require("react-native");
|
|
25
|
+
const RNComponents = /* @__PURE__ */ new Set([
|
|
26
|
+
import_react_native.Image,
|
|
27
|
+
import_react_native.TextInput,
|
|
28
|
+
import_react_native.Text,
|
|
29
|
+
import_react_native.View,
|
|
30
|
+
"Image",
|
|
31
|
+
"TextInput",
|
|
32
|
+
"Text",
|
|
33
|
+
"View"
|
|
34
|
+
]);
|
|
34
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
36
|
0 && (module.exports = {
|
|
36
37
|
RNComponents
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/RNComponents.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Image, Text, TextInput, View } from 'react-native'\n\n// limited support\nexport const RNComponents = new Set<any>([\n Image,\n TextInput,\n Text,\n View,\n // see fake-react-native + styled() check\n 'Image',\n 'TextInput',\n 'Text',\n 'View',\n])\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6C;AAGtC,MAAM,eAAe,oBAAI,IAAS;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
6
|
var __export = (target, all) => {
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -16,19 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __accessCheck = (obj, member, msg) => {
|
|
20
|
-
if (!member.has(obj))
|
|
21
|
-
throw TypeError("Cannot " + msg);
|
|
22
|
-
};
|
|
23
|
-
var __privateAdd = (obj, member, value) => {
|
|
24
|
-
if (member.has(obj))
|
|
25
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
26
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
27
|
-
};
|
|
28
|
-
var __privateMethod = (obj, member, method) => {
|
|
29
|
-
__accessCheck(obj, member, "access private method");
|
|
30
|
-
return method;
|
|
31
|
-
};
|
|
32
19
|
var ThemeManager_exports = {};
|
|
33
20
|
__export(ThemeManager_exports, {
|
|
34
21
|
ThemeManager: () => ThemeManager,
|
|
@@ -37,19 +24,19 @@ __export(ThemeManager_exports, {
|
|
|
37
24
|
});
|
|
38
25
|
module.exports = __toCommonJS(ThemeManager_exports);
|
|
39
26
|
var import_react = require("react");
|
|
40
|
-
var
|
|
41
|
-
var import_constants = require("
|
|
42
|
-
var
|
|
27
|
+
var import_config = require("../config");
|
|
28
|
+
var import_constants = require("../constants/constants");
|
|
29
|
+
var import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
43
30
|
class ThemeManager {
|
|
44
|
-
constructor(name = "", theme = null, parentManager = null) {
|
|
31
|
+
constructor(name = "", className = "", theme = null, parentManager = null, reset = false) {
|
|
45
32
|
this.name = name;
|
|
33
|
+
this.className = className;
|
|
46
34
|
this.theme = theme;
|
|
47
35
|
this.parentManager = parentManager;
|
|
48
|
-
|
|
36
|
+
this.reset = reset;
|
|
49
37
|
this.keys = /* @__PURE__ */ new Map();
|
|
50
38
|
this.listeners = /* @__PURE__ */ new Map();
|
|
51
39
|
this.themeListeners = /* @__PURE__ */ new Set();
|
|
52
|
-
this.className = null;
|
|
53
40
|
let parent = parentManager;
|
|
54
41
|
let tries = 0;
|
|
55
42
|
while (true) {
|
|
@@ -67,6 +54,9 @@ class ThemeManager {
|
|
|
67
54
|
}
|
|
68
55
|
}
|
|
69
56
|
}
|
|
57
|
+
get didChangeTheme() {
|
|
58
|
+
return this.parentManager && this.name !== this.parentManager.fullName;
|
|
59
|
+
}
|
|
70
60
|
get parentName() {
|
|
71
61
|
var _a;
|
|
72
62
|
return ((_a = this.parentManager) == null ? void 0 : _a.name) || null;
|
|
@@ -84,28 +74,42 @@ class ThemeManager {
|
|
|
84
74
|
return theme[key];
|
|
85
75
|
}
|
|
86
76
|
manager = this.parentManager;
|
|
87
|
-
if (!manager) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (manager.theme === theme) {
|
|
77
|
+
if (!manager || manager.theme === theme) {
|
|
91
78
|
return;
|
|
92
79
|
}
|
|
93
80
|
theme = manager.theme;
|
|
94
81
|
}
|
|
95
82
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
isTracking(uuid) {
|
|
84
|
+
var _a;
|
|
85
|
+
return Boolean((_a = this.keys.get(uuid)) == null ? void 0 : _a.size);
|
|
86
|
+
}
|
|
87
|
+
update({ name, theme, className } = {}, force = false, notify = true) {
|
|
88
|
+
if (!force) {
|
|
89
|
+
const nameChanged = name !== this.name;
|
|
90
|
+
if (!nameChanged) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
100
93
|
}
|
|
101
|
-
this.className = className ||
|
|
94
|
+
this.className = className || "";
|
|
102
95
|
this.name = name || "";
|
|
103
96
|
this.theme = theme;
|
|
104
|
-
|
|
97
|
+
if (notify) {
|
|
98
|
+
this.notifyListeners();
|
|
99
|
+
}
|
|
105
100
|
return true;
|
|
106
101
|
}
|
|
107
|
-
getNextTheme(
|
|
108
|
-
|
|
102
|
+
getNextTheme(props = {}, debug) {
|
|
103
|
+
var _a;
|
|
104
|
+
const { themes = (0, import_config.getThemes)(), name, componentName } = props;
|
|
105
|
+
if (props.reset && name) {
|
|
106
|
+
return {
|
|
107
|
+
name,
|
|
108
|
+
theme: themes[name],
|
|
109
|
+
className: this.getClassName(name)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const parentIsReset = (_a = this.parentManager) == null ? void 0 : _a.reset;
|
|
109
113
|
if (!name) {
|
|
110
114
|
if (componentName) {
|
|
111
115
|
const names = [
|
|
@@ -114,29 +118,27 @@ class ThemeManager {
|
|
|
114
118
|
];
|
|
115
119
|
for (const name2 of names) {
|
|
116
120
|
if (name2 in themes) {
|
|
117
|
-
|
|
121
|
+
const className = this.getClassName(name2);
|
|
122
|
+
return { name: name2, theme: themes[name2], className };
|
|
118
123
|
}
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
return {
|
|
122
127
|
name: this.name,
|
|
123
|
-
theme: this.theme
|
|
128
|
+
theme: this.theme,
|
|
129
|
+
className: this.className
|
|
124
130
|
};
|
|
125
131
|
}
|
|
126
132
|
let nextName = name || this.name || "";
|
|
127
|
-
let parentName = this.fullName;
|
|
133
|
+
let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName;
|
|
128
134
|
while (true) {
|
|
129
|
-
if (nextName in themes)
|
|
135
|
+
if (nextName in themes)
|
|
130
136
|
break;
|
|
131
|
-
}
|
|
132
137
|
nextName = `${parentName}_${name}`;
|
|
133
|
-
if (nextName in themes)
|
|
138
|
+
if (nextName in themes)
|
|
134
139
|
break;
|
|
135
|
-
|
|
136
|
-
if (!parentName.includes(import_constants.THEME_NAME_SEPARATOR)) {
|
|
137
|
-
console.warn("theme not found", name);
|
|
140
|
+
if (!parentName.includes(import_constants.THEME_NAME_SEPARATOR))
|
|
138
141
|
break;
|
|
139
|
-
}
|
|
140
142
|
parentName = parentName.slice(0, parentName.lastIndexOf(import_constants.THEME_NAME_SEPARATOR));
|
|
141
143
|
}
|
|
142
144
|
if (componentName) {
|
|
@@ -154,15 +156,20 @@ class ThemeManager {
|
|
|
154
156
|
if (!theme) {
|
|
155
157
|
theme = themes[`light_${nextName}`];
|
|
156
158
|
}
|
|
157
|
-
if (process.env.NODE_ENV === "development"
|
|
158
|
-
|
|
159
|
+
if (process.env.NODE_ENV === "development") {
|
|
160
|
+
if (debug) {
|
|
161
|
+
console.log("getNextTheme", this.getClassName(nextName), { props, nextName, parentName });
|
|
162
|
+
}
|
|
159
163
|
}
|
|
160
164
|
return {
|
|
161
165
|
name: nextName,
|
|
162
|
-
theme,
|
|
163
|
-
className:
|
|
166
|
+
theme: (0, import_getThemeUnwrapped.getThemeUnwrapped)(theme),
|
|
167
|
+
className: this.getClassName(nextName)
|
|
164
168
|
};
|
|
165
169
|
}
|
|
170
|
+
getClassName(name) {
|
|
171
|
+
return `${import_constants.THEME_CLASSNAME_PREFIX}${name} t_Theme`.replace("light_", "").replace("dark_", "");
|
|
172
|
+
}
|
|
166
173
|
track(uuid, keys) {
|
|
167
174
|
if (!this.name)
|
|
168
175
|
return;
|
|
@@ -194,14 +201,9 @@ class ThemeManager {
|
|
|
194
201
|
};
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
|
-
__name(ThemeManager, "ThemeManager");
|
|
198
|
-
_getClassName = new WeakSet();
|
|
199
|
-
getClassName_fn = /* @__PURE__ */ __name(function(name) {
|
|
200
|
-
return `${import_constants.THEME_CLASSNAME_PREFIX}${name} tui_theme`.replace("light_", "").replace("dark_", "");
|
|
201
|
-
}, "#getClassName");
|
|
202
204
|
const ThemeManagerContext = (0, import_react.createContext)(null);
|
|
203
205
|
const emptyManager = new ThemeManager();
|
|
204
|
-
const withoutComponentName =
|
|
206
|
+
const withoutComponentName = (name) => name.replace(/(\_[A-Z][a-zA-Z]+)+$/g, "");
|
|
205
207
|
// Annotate the CommonJS export names for ESM import in node:
|
|
206
208
|
0 && (module.exports = {
|
|
207
209
|
ThemeManager,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/ThemeManager.tsx"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react'\n\nimport { getThemes } from '../config'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants'\nimport { getThemeUnwrapped } from '../hooks/getThemeUnwrapped'\nimport { ThemeParsed, Themes } from '../types'\n\ntype ThemeListener = (name: string | null, themeManager: ThemeManager) => void\n\nexport type SetActiveThemeProps = {\n className?: string\n parentManager?: ThemeManager | null\n name?: string | null\n theme?: any\n}\n\nexport type GetNextThemeProps = {\n themes?: Themes\n name?: string | null\n componentName?: string | null\n reset?: boolean\n}\n\nexport class ThemeManager {\n keys = new Map<any, Set<string>>()\n listeners = new Map<any, Function>()\n themeListeners = new Set<ThemeListener>()\n\n constructor(\n public name: string = '',\n public className: string = '',\n public theme: ThemeParsed | null = null,\n public parentManager: ThemeManager | null = null,\n public reset: boolean = false\n ) {\n // find the nearest different parentManager\n let parent = parentManager\n let tries = 0\n while (true) {\n tries++\n if (tries > 10) {\n throw new Error(`Nested 10 of the same theme in a row, likely error`)\n }\n if (!parent) break\n if (parent.name === name) {\n // go up if same\n parent = parent.parentManager\n } else {\n this.parentManager = parent\n break\n }\n }\n }\n\n get didChangeTheme() {\n return this.parentManager && this.name !== this.parentManager.fullName\n }\n\n get parentName() {\n return this.parentManager?.name || null\n }\n\n get fullName(): string {\n return this.getNextTheme().name || this.name || ''\n // const parentName = this.parentManager?.fullName || ''\n // const name = this.name || ''\n // const parts = [...new Set([...`${parentName}_${name}`.split('_')])].filter(Boolean)\n // return parts.join('_')\n }\n\n // gets value going up to parents\n getValue(key: string) {\n let theme = this.theme\n let manager = this as ThemeManager | null\n while (true) {\n if (!theme) return\n if (key in theme) {\n return theme[key]\n }\n manager = this.parentManager\n if (!manager || manager.theme === theme) {\n return\n }\n theme = manager.theme\n }\n }\n\n isTracking(uuid: Object) {\n return Boolean(this.keys.get(uuid)?.size)\n }\n\n update({ name, theme, className }: SetActiveThemeProps = {}, force = false, notify = true) {\n if (!force) {\n // className compare on web, avoids light/dark re-renders\n const nameChanged = name !== this.name\n if (!nameChanged) {\n return false\n }\n }\n this.className = className || ''\n this.name = name || ''\n this.theme = theme\n if (notify) {\n this.notifyListeners()\n }\n return true\n }\n\n getNextTheme(\n props: GetNextThemeProps = {},\n debug?: any\n ): {\n name: string\n theme: ThemeParsed | null\n className: string | undefined\n } {\n const { themes = getThemes(), name, componentName } = props\n\n if (props.reset && name) {\n return {\n name: name,\n theme: themes[name] as ThemeParsed,\n className: this.getClassName(name),\n }\n }\n\n const parentIsReset = this.parentManager?.reset\n\n if (!name) {\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${this.name}_${componentName}`,\n `${withoutComponentName(this.name)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n const className = this.getClassName(name)\n return { name, theme: themes[name], className }\n }\n }\n }\n return {\n name: this.name,\n theme: this.theme,\n className: this.className,\n }\n }\n\n let nextName = name || this.name || ''\n let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName\n\n while (true) {\n if (nextName in themes) break\n nextName = `${parentName}_${name}`\n if (nextName in themes) break\n // this is fine - some themes can not have parents\n if (!parentName.includes(THEME_NAME_SEPARATOR)) break\n // go up one\n parentName = parentName.slice(0, parentName.lastIndexOf(THEME_NAME_SEPARATOR))\n }\n\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${nextName}_${componentName}`,\n `${withoutComponentName(nextName)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n nextName = name\n }\n }\n }\n\n let theme = themes[nextName]\n if (!theme) {\n theme = themes[`light_${nextName}`]\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log('getNextTheme', this.getClassName(nextName), { props, nextName, parentName })\n }\n }\n\n return {\n name: nextName,\n theme: getThemeUnwrapped(theme),\n className: this.getClassName(nextName),\n }\n }\n\n getClassName(name: string) {\n return `${THEME_CLASSNAME_PREFIX}${name} t_Theme`.replace('light_', '').replace('dark_', '')\n }\n\n track(uuid: any, keys: Set<string>) {\n if (!this.name) return\n this.keys.set(uuid, keys)\n }\n\n notifyListeners() {\n if (!this.name) {\n this.keys.clear()\n }\n for (const [uuid, keys] of this.keys.entries()) {\n if (keys.size) {\n this.listeners.get(uuid)?.()\n }\n }\n this.themeListeners.forEach((cb) => cb(this.name, this))\n }\n\n onChangeTheme(cb: ThemeListener) {\n this.themeListeners.add(cb)\n return () => {\n this.themeListeners.delete(cb)\n }\n }\n\n onUpdate(uuid: any, cb: Function) {\n this.listeners.set(uuid, cb)\n return () => {\n this.listeners.delete(uuid)\n this.keys.delete(uuid)\n }\n }\n}\n\nexport const ThemeManagerContext = createContext<ThemeManager | null>(null)\nexport const emptyManager = new ThemeManager()\n\nconst withoutComponentName = (name: string) => name.replace(/(\\_[A-Z][a-zA-Z]+)+$/g, '')\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["name"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
6
|
var __export = (target, all) => {
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -21,7 +21,7 @@ __export(areEqualSets_exports, {
|
|
|
21
21
|
areEqualSets: () => areEqualSets
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(areEqualSets_exports);
|
|
24
|
-
const areEqualSets =
|
|
24
|
+
const areEqualSets = (a, b) => {
|
|
25
25
|
if (a.size !== b.size)
|
|
26
26
|
return false;
|
|
27
27
|
for (const val in a) {
|
|
@@ -30,7 +30,7 @@ const areEqualSets = /* @__PURE__ */ __name((a, b) => {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
return true;
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
35
|
0 && (module.exports = {
|
|
36
36
|
areEqualSets
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/areEqualSets.tsx"],
|
|
4
4
|
"sourcesContent": ["export const areEqualSets = (a: Set<string>, b: Set<string>) => {\n if (a.size !== b.size) return false\n for (const val in a) {\n if (!b.has(val)) {\n return false\n }\n }\n return true\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,CAAC,GAAgB,MAAmB;AAC9D,MAAI,EAAE,SAAS,EAAE;AAAM,WAAO;AAC9B,aAAW,OAAO,GAAG;AACnB,QAAI,CAAC,EAAE,IAAI,GAAG,GAAG;AACf,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|