@tamagui/web 1.22.6 → 1.22.8
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 +3 -3
- package/dist/cjs/createComponent.js +35 -60
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createTamagui.js +9 -9
- package/dist/cjs/createTokens.js +1 -1
- package/dist/cjs/createVariable.js +1 -1
- package/dist/cjs/createVariables.js +1 -1
- package/dist/cjs/helpers/ThemeManager.js +3 -3
- package/dist/cjs/helpers/createMediaStyle.js +1 -1
- package/dist/cjs/helpers/createPropMapper.js +18 -12
- package/dist/cjs/helpers/createPropMapper.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.js +4 -4
- package/dist/cjs/helpers/extendStaticConfig.js +2 -2
- package/dist/cjs/helpers/getAnimationDriver.js +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +11 -10
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +4 -4
- package/dist/cjs/helpers/getThemeCSSRules.js +3 -3
- package/dist/cjs/helpers/getVariantExtras.js +2 -2
- package/dist/cjs/helpers/isTamaguiElement.js +1 -1
- package/dist/cjs/helpers/memoizeFunctionByArgumentsReference.js +31 -0
- package/dist/cjs/helpers/memoizeFunctionByArgumentsReference.js.map +6 -0
- package/dist/cjs/helpers/normalizeShadow.js +2 -2
- package/dist/cjs/helpers/normalizeShadow.native.js +3 -3
- package/dist/cjs/helpers/normalizeValueWithProperty.js +2 -2
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -1
- package/dist/cjs/helpers/registerCSSVariable.js +1 -1
- package/dist/cjs/helpers/themeable.js +2 -2
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themes.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.js +2 -2
- package/dist/cjs/hooks/useMedia.js +3 -3
- package/dist/cjs/hooks/useProps.js +1 -1
- package/dist/cjs/hooks/useStyle.js +5 -5
- package/dist/cjs/hooks/useTheme.js +7 -7
- package/dist/cjs/hooks/useThemeName.js +2 -2
- package/dist/cjs/index.js +96 -96
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/insertFont.js +4 -4
- package/dist/cjs/styled.js +12 -5
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js +1 -1
- package/dist/cjs/views/Stack.js +2 -2
- package/dist/cjs/views/TamaguiProvider.js +5 -5
- package/dist/cjs/views/Text.js +1 -1
- package/dist/cjs/views/Theme.js +4 -4
- package/dist/cjs/views/ThemeDebug.js +1 -1
- package/dist/cjs/views/ThemeDebug.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +2 -2
- package/dist/esm/Tamagui.js +3 -3
- package/dist/esm/Tamagui.mjs +3 -3
- package/dist/esm/createComponent.js +36 -61
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +36 -61
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createTamagui.js +9 -9
- package/dist/esm/createTamagui.mjs +9 -9
- package/dist/esm/createTokens.js +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createVariable.js +1 -1
- package/dist/esm/createVariable.mjs +1 -1
- package/dist/esm/createVariables.js +1 -1
- package/dist/esm/createVariables.mjs +1 -1
- package/dist/esm/helpers/ThemeManager.js +3 -3
- package/dist/esm/helpers/ThemeManager.mjs +3 -3
- package/dist/esm/helpers/createMediaStyle.js +1 -1
- package/dist/esm/helpers/createMediaStyle.mjs +1 -1
- package/dist/esm/helpers/createPropMapper.js +18 -12
- package/dist/esm/helpers/createPropMapper.js.map +1 -1
- package/dist/esm/helpers/createPropMapper.mjs +18 -12
- package/dist/esm/helpers/createPropMapper.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.js +4 -4
- package/dist/esm/helpers/expandStyles.mjs +4 -4
- package/dist/esm/helpers/extendStaticConfig.js +2 -2
- package/dist/esm/helpers/extendStaticConfig.mjs +2 -2
- package/dist/esm/helpers/getAnimationDriver.js +1 -1
- package/dist/esm/helpers/getAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +1 -1
- package/dist/esm/helpers/getExpandedShorthands.mjs +1 -1
- package/dist/esm/helpers/getSplitStyles.js +11 -10
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +11 -10
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +4 -4
- package/dist/esm/helpers/getStylesAtomic.mjs +4 -4
- package/dist/esm/helpers/getThemeCSSRules.js +3 -3
- package/dist/esm/helpers/getThemeCSSRules.mjs +3 -3
- package/dist/esm/helpers/getVariantExtras.js +2 -2
- package/dist/esm/helpers/getVariantExtras.mjs +2 -2
- package/dist/esm/helpers/isTamaguiElement.js +1 -1
- package/dist/esm/helpers/isTamaguiElement.mjs +1 -1
- package/dist/esm/helpers/memoizeFunctionByArgumentsReference.js +30 -0
- package/dist/esm/helpers/memoizeFunctionByArgumentsReference.js.map +6 -0
- package/dist/esm/helpers/memoizeFunctionByArgumentsReference.mjs +30 -0
- package/dist/esm/helpers/memoizeFunctionByArgumentsReference.mjs.map +6 -0
- package/dist/esm/helpers/normalizeShadow.js +2 -2
- package/dist/esm/helpers/normalizeShadow.mjs +2 -2
- package/dist/esm/helpers/normalizeShadow.native.js +3 -3
- package/dist/esm/helpers/normalizeShadow.native.mjs +3 -3
- package/dist/esm/helpers/normalizeValueWithProperty.js +2 -2
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -2
- package/dist/esm/helpers/proxyThemeVariables.js +1 -1
- package/dist/esm/helpers/proxyThemeVariables.mjs +1 -1
- package/dist/esm/helpers/registerCSSVariable.js +1 -1
- package/dist/esm/helpers/registerCSSVariable.mjs +1 -1
- package/dist/esm/helpers/themeable.js +2 -2
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themeable.mjs +2 -2
- package/dist/esm/helpers/themeable.mjs.map +1 -1
- package/dist/esm/helpers/themes.js +2 -2
- package/dist/esm/helpers/themes.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useMedia.js +3 -3
- package/dist/esm/hooks/useMedia.mjs +3 -3
- package/dist/esm/hooks/useProps.js +1 -1
- package/dist/esm/hooks/useProps.mjs +1 -1
- package/dist/esm/hooks/useStyle.js +5 -5
- package/dist/esm/hooks/useStyle.mjs +5 -5
- package/dist/esm/hooks/useTheme.js +7 -7
- package/dist/esm/hooks/useTheme.mjs +7 -7
- package/dist/esm/hooks/useThemeName.js +2 -2
- package/dist/esm/hooks/useThemeName.mjs +2 -2
- package/dist/esm/index.js +49 -49
- package/dist/esm/index.mjs +49 -49
- package/dist/esm/insertFont.js +4 -4
- package/dist/esm/insertFont.mjs +4 -4
- package/dist/esm/styled.js +12 -5
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/styled.mjs +12 -5
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +1 -1
- package/dist/esm/views/FontLanguage.native.mjs +1 -1
- package/dist/esm/views/Stack.js +2 -2
- package/dist/esm/views/Stack.mjs +2 -2
- package/dist/esm/views/TamaguiProvider.js +5 -5
- package/dist/esm/views/TamaguiProvider.mjs +5 -5
- package/dist/esm/views/Text.js +1 -1
- package/dist/esm/views/Text.mjs +1 -1
- package/dist/esm/views/Theme.js +4 -4
- package/dist/esm/views/Theme.mjs +4 -4
- package/dist/esm/views/ThemeDebug.js +1 -1
- package/dist/esm/views/ThemeDebug.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.js +2 -2
- package/dist/esm/views/ThemeProvider.mjs +2 -2
- package/package.json +9 -9
- package/src/Tamagui.ts +3 -3
- package/src/config.ts +1 -1
- package/src/contexts/FontLanguageContext.tsx +1 -1
- package/src/createComponent.tsx +36 -69
- package/src/createFont.ts +1 -1
- package/src/createShorthands.ts +1 -1
- package/src/createTamagui.ts +10 -10
- package/src/createTheme.ts +1 -1
- package/src/createTokens.ts +3 -3
- package/src/createVariable.ts +1 -1
- package/src/createVariables.ts +1 -1
- package/src/helpers/ThemeManager.tsx +4 -4
- package/src/helpers/ThemeManagerContext.tsx +1 -1
- package/src/helpers/createMediaStyle.ts +2 -2
- package/src/helpers/createPropMapper.ts +25 -16
- package/src/helpers/expandStyles.ts +4 -4
- package/src/helpers/extendStaticConfig.ts +3 -3
- package/src/helpers/getAnimationDriver.tsx +1 -1
- package/src/helpers/getExpandedShorthands.ts +2 -2
- package/src/helpers/getSplitStyles.tsx +12 -11
- package/src/helpers/getStylesAtomic.ts +5 -5
- package/src/helpers/getThemeCSSRules.ts +4 -4
- package/src/helpers/getVariantExtras.tsx +4 -4
- package/src/helpers/insertStyleRule.tsx +1 -1
- package/src/helpers/isTamaguiComponent.tsx +1 -1
- package/src/helpers/isTamaguiElement.tsx +2 -2
- package/src/helpers/matchMedia.native.ts +1 -1
- package/src/helpers/matchMedia.ts +1 -1
- package/src/helpers/memoizeFunctionByArgumentsReference.ts +38 -0
- package/src/helpers/normalizeShadow.native.ts +3 -3
- package/src/helpers/normalizeShadow.ts +2 -2
- package/src/helpers/normalizeValueWithProperty.ts +2 -2
- package/src/helpers/proxyThemeVariables.tsx +1 -1
- package/src/helpers/registerCSSVariable.ts +1 -1
- package/src/helpers/themeable.tsx +4 -3
- package/src/helpers/themes.ts +3 -3
- package/src/helpers/useShallowSetState.tsx +1 -1
- package/src/hooks/useAnimationDriver.tsx +2 -2
- package/src/hooks/useMedia.tsx +4 -4
- package/src/hooks/useProps.tsx +1 -1
- package/src/hooks/useStyle.tsx +5 -5
- package/src/hooks/useTheme.tsx +8 -8
- package/src/hooks/useThemeName.tsx +3 -3
- package/src/index.ts +49 -49
- package/src/insertFont.ts +6 -6
- package/src/setupReactNative.ts +1 -1
- package/src/styled.tsx +13 -16
- package/src/types.tsx +5 -5
- package/src/views/FontLanguage.native.tsx +2 -2
- package/src/views/FontLanguage.tsx +1 -1
- package/src/views/Stack.tsx +3 -3
- package/src/views/TamaguiProvider.tsx +6 -6
- package/src/views/Text.tsx +2 -2
- package/src/views/Theme.tsx +5 -5
- package/src/views/ThemeDebug.tsx +3 -3
- package/src/views/ThemeProvider.tsx +2 -2
- package/types/Tamagui.d.ts +1 -1
- package/types/Tamagui.d.ts.map +1 -1
- package/types/config.d.ts +19 -19
- package/types/config.d.ts.map +1 -1
- package/types/contexts/FontLanguageContext.d.ts +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createFont.d.ts +1 -1
- package/types/createFont.d.ts.map +1 -1
- package/types/createShorthands.d.ts +1 -1
- package/types/createShorthands.d.ts.map +1 -1
- package/types/createTamagui.d.ts +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -1
- package/types/createTheme.d.ts.map +1 -1
- package/types/createTokens.d.ts +2 -2
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariables.d.ts +1 -1
- package/types/createVariables.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts +2 -2
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/ThemeManagerContext.d.ts +1 -1
- package/types/helpers/ThemeManagerContext.d.ts.map +1 -1
- package/types/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/extendStaticConfig.d.ts +1 -1
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/getAnimationDriver.d.ts +1 -1
- package/types/helpers/getExpandedShorthands.d.ts +1 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -2
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +2 -2
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +2 -2
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -1
- package/types/helpers/isTamaguiElement.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.d.ts.map +1 -1
- package/types/helpers/matchMedia.native.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts.map +1 -1
- package/types/helpers/memoizeFunctionByArgumentsReference.d.ts +11 -0
- package/types/helpers/memoizeFunctionByArgumentsReference.d.ts.map +1 -0
- package/types/helpers/registerCSSVariable.d.ts +1 -1
- package/types/helpers/registerCSSVariable.d.ts.map +1 -1
- package/types/helpers/themeable.d.ts +1 -1
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +1 -1
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/useShallowSetState.d.ts +1 -1
- package/types/helpers/useShallowSetState.d.ts.map +1 -1
- package/types/hooks/useAnimationDriver.d.ts +1 -1
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +1 -1
- package/types/hooks/useTheme.d.ts +2 -2
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeName.d.ts +1 -1
- package/types/hooks/useThemeName.d.ts.map +1 -1
- package/types/index.d.ts +49 -49
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts +2 -2
- package/types/insertFont.d.ts.map +1 -1
- package/types/setupReactNative.d.ts +1 -1
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +4 -4
- package/types/types.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.d.ts.map +1 -1
- package/types/views/FontLanguage.native.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/Stack.d.ts +2 -2
- package/types/views/Stack.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts +2 -2
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts +2 -2
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts +2 -2
- package/types/views/ThemeDebug.d.ts.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { FontLanguageContext } from "../contexts/FontLanguageContext
|
|
3
|
+
import { FontLanguageContext } from "../contexts/FontLanguageContext";
|
|
4
4
|
const FontLanguage = ({ children, ...props }) => {
|
|
5
5
|
const value = useMemo(() => props, [JSON.stringify(props)]);
|
|
6
6
|
return /* @__PURE__ */ jsx(FontLanguageContext.Provider, { value, children });
|
package/dist/esm/views/Stack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stackDefaultStyles } from "../constants/constants
|
|
2
|
-
import { createComponent } from "../createComponent
|
|
1
|
+
import { stackDefaultStyles } from "../constants/constants";
|
|
2
|
+
import { createComponent } from "../createComponent";
|
|
3
3
|
const Stack = createComponent({
|
|
4
4
|
acceptsClassName: true,
|
|
5
5
|
defaultProps: {
|
package/dist/esm/views/Stack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stackDefaultStyles } from "../constants/constants
|
|
2
|
-
import { createComponent } from "../createComponent
|
|
1
|
+
import { stackDefaultStyles } from "../constants/constants";
|
|
2
|
+
import { createComponent } from "../createComponent";
|
|
3
3
|
const Stack = createComponent({
|
|
4
4
|
acceptsClassName: true,
|
|
5
5
|
defaultProps: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isClient, isRSC, isServer, isWeb } from "@tamagui/constants";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ButtonNestingContext } from "../contexts/ButtonNestingContext
|
|
5
|
-
import { TextAncestorContext } from "../contexts/TextAncestorContext
|
|
6
|
-
import { useMediaListeners } from "../hooks/useMedia
|
|
7
|
-
import { ThemeProvider } from "./ThemeProvider
|
|
8
|
-
import { AnimationDriverContext } from "../contexts/AnimationDriverContext
|
|
4
|
+
import { ButtonNestingContext } from "../contexts/ButtonNestingContext";
|
|
5
|
+
import { TextAncestorContext } from "../contexts/TextAncestorContext";
|
|
6
|
+
import { useMediaListeners } from "../hooks/useMedia";
|
|
7
|
+
import { ThemeProvider } from "./ThemeProvider";
|
|
8
|
+
import { AnimationDriverContext } from "../contexts/AnimationDriverContext";
|
|
9
9
|
function TamaguiProvider({
|
|
10
10
|
children,
|
|
11
11
|
disableInjectCSS,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isClient, isRSC, isServer, isWeb } from "@tamagui/constants";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ButtonNestingContext } from "../contexts/ButtonNestingContext
|
|
5
|
-
import { TextAncestorContext } from "../contexts/TextAncestorContext
|
|
6
|
-
import { useMediaListeners } from "../hooks/useMedia
|
|
7
|
-
import { ThemeProvider } from "./ThemeProvider
|
|
8
|
-
import { AnimationDriverContext } from "../contexts/AnimationDriverContext
|
|
4
|
+
import { ButtonNestingContext } from "../contexts/ButtonNestingContext";
|
|
5
|
+
import { TextAncestorContext } from "../contexts/TextAncestorContext";
|
|
6
|
+
import { useMediaListeners } from "../hooks/useMedia";
|
|
7
|
+
import { ThemeProvider } from "./ThemeProvider";
|
|
8
|
+
import { AnimationDriverContext } from "../contexts/AnimationDriverContext";
|
|
9
9
|
function TamaguiProvider({
|
|
10
10
|
children,
|
|
11
11
|
disableInjectCSS,
|
package/dist/esm/views/Text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
|
|
3
|
-
import { createComponent } from "../createComponent
|
|
3
|
+
import { createComponent } from "../createComponent";
|
|
4
4
|
const ellipseStyle = {
|
|
5
5
|
maxWidth: "100%",
|
|
6
6
|
overflow: "hidden",
|
package/dist/esm/views/Text.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { stylePropsTextOnly, validStyles } from "@tamagui/helpers";
|
|
3
|
-
import { createComponent } from "../createComponent
|
|
3
|
+
import { createComponent } from "../createComponent";
|
|
4
4
|
const ellipseStyle = {
|
|
5
5
|
maxWidth: "100%",
|
|
6
6
|
overflow: "hidden",
|
package/dist/esm/views/Theme.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
3
|
import { Children, cloneElement, isValidElement, useMemo } from "react";
|
|
4
|
-
import { variableToString } from "../createVariable
|
|
5
|
-
import { ThemeManagerContext } from "../helpers/ThemeManagerContext
|
|
6
|
-
import { useServerRef } from "../hooks/useServerHooks
|
|
7
|
-
import { useChangeThemeEffect } from "../hooks/useTheme
|
|
4
|
+
import { variableToString } from "../createVariable";
|
|
5
|
+
import { ThemeManagerContext } from "../helpers/ThemeManagerContext";
|
|
6
|
+
import { useServerRef } from "../hooks/useServerHooks";
|
|
7
|
+
import { useChangeThemeEffect } from "../hooks/useTheme";
|
|
8
8
|
import { ThemeDebug } from "./ThemeDebug";
|
|
9
9
|
function Theme(props) {
|
|
10
10
|
if (props.disable) {
|
package/dist/esm/views/Theme.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
3
|
import { Children, cloneElement, isValidElement, useMemo } from "react";
|
|
4
|
-
import { variableToString } from "../createVariable
|
|
5
|
-
import { ThemeManagerContext } from "../helpers/ThemeManagerContext
|
|
6
|
-
import { useServerRef } from "../hooks/useServerHooks
|
|
7
|
-
import { useChangeThemeEffect } from "../hooks/useTheme
|
|
4
|
+
import { variableToString } from "../createVariable";
|
|
5
|
+
import { ThemeManagerContext } from "../helpers/ThemeManagerContext";
|
|
6
|
+
import { useServerRef } from "../hooks/useServerHooks";
|
|
7
|
+
import { useChangeThemeEffect } from "../hooks/useTheme";
|
|
8
8
|
import { ThemeDebug } from "./ThemeDebug";
|
|
9
9
|
function Theme(props) {
|
|
10
10
|
if (props.disable) {
|
|
@@ -45,7 +45,7 @@ function ThemeDebug({
|
|
|
45
45
|
});
|
|
46
46
|
}, [themeState.themeManager]);
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
const tm = setInterval(rerender,
|
|
48
|
+
const tm = setInterval(rerender, 1e3);
|
|
49
49
|
return () => clearTimeout(tm);
|
|
50
50
|
}, []);
|
|
51
51
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/ThemeDebug.tsx"],
|
|
4
|
-
"mappings": "AA+DM,mBA+BE,K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IAAyB,kBAAzB,gBAAAC,IAAwC;AAAA,UACxG;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,WAAW,YAAY,CAAC;AAE5B,cAAU,MAAM;AAEd,YAAM,KAAK,YAAY,UAAU,GAAI;AACrC,aAAO,MAAM,aAAa,EAAE;AAAA,IAC9B,GAAG,CAAC,CAAC;AAEL,WACE,iCACG;AAAA;AAAA,QACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,YAAY;AAAA,YACd;AAAA,YACD;AAAA;AAAA,cACY;AAAA,cAAG;AAAA,cACb,KAAK;AAAA,gBACJ;AAAA,kBACE,MAAM,WAAW;AAAA,kBACjB,WAAW,WAAW;AAAA,kBACtB,SAAS,WAAW;AAAA,kBACpB,gBAAgB,WAAW;AAAA,kBAC3B,SAAQ,gBAAW,iBAAX,mBAAyB,MAAM;AAAA,kBACvC,KAAI,gBAAW,iBAAX,mBAAyB;AAAA,kBAC7B,WAAU,sBAAW,iBAAX,mBAAyB,kBAAzB,mBAAwC;AAAA,kBAClD,OAAO,WAAW;AAAA,kBAClB;AAAA,kBACA,WAAW,CAAC,KAAI,gBAAW,iBAAX,mBAA0B,qBAAoB,CAAC,CAAE,EAAE;AAAA,oBACjE;AAAA,kBACF;AAAA,kBACA,uBAAsB,gBAAW,iBAAX,mBAA0B;AAAA,gBAClD;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA;AAAA;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,MAEA,oBAAC,SAAI,OAAO,EAAE,OAAO,MAAM,GAAI,cAAG;AAAA,MAEjC;AAAA,OACH;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
5
5
|
"names": ["_a", "_b", "_c"]
|
|
6
6
|
}
|
|
@@ -45,7 +45,7 @@ function ThemeDebug({
|
|
|
45
45
|
});
|
|
46
46
|
}, [themeState.themeManager]);
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
const tm = setInterval(rerender,
|
|
48
|
+
const tm = setInterval(rerender, 1e3);
|
|
49
49
|
return () => clearTimeout(tm);
|
|
50
50
|
}, []);
|
|
51
51
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/ThemeDebug.tsx"],
|
|
4
|
-
"mappings": "AA+DM,mBA+BE,KA7BE,YAFJ;AA/DN,SAAS,sBAAsB;AAC/B,SAAS,WAAW,OAAO,gBAAgB;AAC3C,SAAS,oBAAoB;AAK7B,IAAI;AAEG,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AAjBH;AAmBE,MAAI,WAAW,qBAAqB,GAAG;AACrC,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,UAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,UAAM,WAAW,eAAe;AAChC,UAAM,KAAK,MAAM;AAEjB,QAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,aAAa,aAAa;AAC7E,UAAI,CAAC,MAAM;AACT,eAAO,SAAS,cAAc,KAAK;AACnC,aAAK,MAAM,SAAS;AACpB,aAAK,MAAM,YAAY;AACvB,aAAK,MAAM,WAAW;AACtB,aAAK,MAAM,SAAS;AACpB,aAAK,MAAM,MAAM;AACjB,aAAK,MAAM,OAAO;AAClB,aAAK,MAAM,QAAQ;AACnB,aAAK,MAAM,UAAU;AACrB,aAAK,MAAM,SAAS;AACpB,aAAK,MAAM,gBAAgB;AAC3B,aAAK,MAAM,aAAa;AACxB,iBAAS,KAAK,YAAY,IAAI;AAAA,MAChC;AAAA,IACF;AAEA,cAAU,MAAM;AA9CpB,UAAAA,KAAAC;AA+CM,OAAAA,OAAAD,MAAA,WAAW,iBAAX,gBAAAA,IAAyB,kBAAzB,gBAAAC,IAAwC,cAAc,CAAC,MAAM,YAAY;AA/C/E,YAAAD,KAAAC,KA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AI,cAAG;AAAA,MAEjC;AAAA,OACH;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
5
5
|
"names": ["_a", "_b", "_c"]
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isClient } from "@tamagui/constants";
|
|
3
3
|
import { createContext, useLayoutEffect, useMemo } from "react";
|
|
4
|
-
import { THEME_CLASSNAME_PREFIX } from "../constants/constants
|
|
5
|
-
import { Theme } from "./Theme
|
|
4
|
+
import { THEME_CLASSNAME_PREFIX } from "../constants/constants";
|
|
5
|
+
import { Theme } from "./Theme";
|
|
6
6
|
const ThemeProviderRootContext = createContext(null);
|
|
7
7
|
const ThemeProvider = (props) => {
|
|
8
8
|
if (isClient) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isClient } from "@tamagui/constants";
|
|
3
3
|
import { createContext, useLayoutEffect, useMemo } from "react";
|
|
4
|
-
import { THEME_CLASSNAME_PREFIX } from "../constants/constants
|
|
5
|
-
import { Theme } from "./Theme
|
|
4
|
+
import { THEME_CLASSNAME_PREFIX } from "../constants/constants";
|
|
5
|
+
import { Theme } from "./Theme";
|
|
6
6
|
const ThemeProviderRootContext = createContext(null);
|
|
7
7
|
const ThemeProvider = (props) => {
|
|
8
8
|
if (isClient) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.8",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.22.
|
|
31
|
-
"@tamagui/constants": "1.22.
|
|
32
|
-
"@tamagui/helpers": "1.22.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.22.
|
|
34
|
-
"@tamagui/use-did-finish-ssr": "1.22.
|
|
35
|
-
"@tamagui/use-event": "1.22.
|
|
36
|
-
"@tamagui/use-force-update": "1.22.
|
|
30
|
+
"@tamagui/compose-refs": "1.22.8",
|
|
31
|
+
"@tamagui/constants": "1.22.8",
|
|
32
|
+
"@tamagui/helpers": "1.22.8",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.22.8",
|
|
34
|
+
"@tamagui/use-did-finish-ssr": "1.22.8",
|
|
35
|
+
"@tamagui/use-event": "1.22.8",
|
|
36
|
+
"@tamagui/use-force-update": "1.22.8"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.22.
|
|
42
|
+
"@tamagui/build": "1.22.8",
|
|
43
43
|
"@testing-library/react": "^13.4.0",
|
|
44
44
|
"csstype": "^3.0.10",
|
|
45
45
|
"react": "^18.2.0",
|
package/src/Tamagui.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as Helpers from '@tamagui/helpers'
|
|
2
2
|
|
|
3
|
-
import { getConfig } from './config
|
|
3
|
+
import { getConfig } from './config'
|
|
4
4
|
import {
|
|
5
5
|
getAllRules,
|
|
6
6
|
getAllSelectors,
|
|
7
7
|
getAllTransforms,
|
|
8
|
-
} from './helpers/insertStyleRule
|
|
9
|
-
import { mediaState } from './hooks/useMedia
|
|
8
|
+
} from './helpers/insertStyleRule'
|
|
9
|
+
import { mediaState } from './hooks/useMedia'
|
|
10
10
|
|
|
11
11
|
// easy introspection
|
|
12
12
|
// only included in dev mode
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import type { LanguageContextType } from '../views/FontLanguage.types
|
|
3
|
+
import type { LanguageContextType } from '../views/FontLanguage.types'
|
|
4
4
|
|
|
5
5
|
export const FontLanguageContext = createContext<LanguageContextType | null>(null)
|
package/src/createComponent.tsx
CHANGED
|
@@ -15,27 +15,26 @@ import React, {
|
|
|
15
15
|
memo,
|
|
16
16
|
useCallback,
|
|
17
17
|
useContext,
|
|
18
|
-
useEffect,
|
|
19
18
|
useId,
|
|
20
19
|
useRef,
|
|
21
20
|
} from 'react'
|
|
22
21
|
|
|
23
|
-
import { onConfiguredOnce } from './config
|
|
24
|
-
import { stackDefaultStyles } from './constants/constants
|
|
25
|
-
import { FontLanguageContext } from './contexts/FontLanguageContext
|
|
26
|
-
import { TextAncestorContext } from './contexts/TextAncestorContext
|
|
27
|
-
import { didGetVariableValue, setDidGetVariableValue } from './createVariable
|
|
28
|
-
import { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig
|
|
29
|
-
import { useSplitStyles } from './helpers/getSplitStyles
|
|
30
|
-
import { mergeProps } from './helpers/mergeProps
|
|
31
|
-
import { proxyThemeVariables } from './helpers/proxyThemeVariables
|
|
32
|
-
import { themeable } from './helpers/themeable
|
|
33
|
-
import { useShallowSetState } from './helpers/useShallowSetState
|
|
34
|
-
import { useAnimationDriver } from './hooks/useAnimationDriver
|
|
35
|
-
import { setMediaShouldUpdate, useMedia } from './hooks/useMedia
|
|
36
|
-
import { useServerRef, useServerState } from './hooks/useServerHooks
|
|
37
|
-
import { useThemeWithState } from './hooks/useTheme
|
|
38
|
-
import { hooks } from './setupHooks
|
|
22
|
+
import { onConfiguredOnce } from './config'
|
|
23
|
+
import { stackDefaultStyles } from './constants/constants'
|
|
24
|
+
import { FontLanguageContext } from './contexts/FontLanguageContext'
|
|
25
|
+
import { TextAncestorContext } from './contexts/TextAncestorContext'
|
|
26
|
+
import { didGetVariableValue, setDidGetVariableValue } from './createVariable'
|
|
27
|
+
import { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'
|
|
28
|
+
import { useSplitStyles } from './helpers/getSplitStyles'
|
|
29
|
+
import { mergeProps } from './helpers/mergeProps'
|
|
30
|
+
import { proxyThemeVariables } from './helpers/proxyThemeVariables'
|
|
31
|
+
import { themeable } from './helpers/themeable'
|
|
32
|
+
import { useShallowSetState } from './helpers/useShallowSetState'
|
|
33
|
+
import { useAnimationDriver } from './hooks/useAnimationDriver'
|
|
34
|
+
import { setMediaShouldUpdate, useMedia } from './hooks/useMedia'
|
|
35
|
+
import { useServerRef, useServerState } from './hooks/useServerHooks'
|
|
36
|
+
import { useThemeWithState } from './hooks/useTheme'
|
|
37
|
+
import { hooks } from './setupHooks'
|
|
39
38
|
import {
|
|
40
39
|
DebugProp,
|
|
41
40
|
SpaceDirection,
|
|
@@ -47,14 +46,13 @@ import {
|
|
|
47
46
|
TamaguiComponent,
|
|
48
47
|
TamaguiComponentEvents,
|
|
49
48
|
TamaguiComponentState,
|
|
50
|
-
TamaguiConfig,
|
|
51
49
|
TamaguiElement,
|
|
52
50
|
TamaguiInternalConfig,
|
|
53
51
|
UseAnimationHook,
|
|
54
52
|
UseAnimationProps,
|
|
55
53
|
} from './types'
|
|
56
|
-
import { Slot } from './views/Slot
|
|
57
|
-
import { useThemedChildren } from './views/Theme
|
|
54
|
+
import { Slot } from './views/Slot'
|
|
55
|
+
import { useThemedChildren } from './views/Theme'
|
|
58
56
|
import { ThemeDebug } from './views/ThemeDebug'
|
|
59
57
|
|
|
60
58
|
// let t
|
|
@@ -128,6 +126,7 @@ export function createComponent<
|
|
|
128
126
|
) {
|
|
129
127
|
const staticConfig = (() => {
|
|
130
128
|
const next = extendStaticConfig(configIn, ParentComponent)
|
|
129
|
+
|
|
131
130
|
if ('parsed' in next) {
|
|
132
131
|
return next
|
|
133
132
|
} else {
|
|
@@ -138,7 +137,7 @@ export function createComponent<
|
|
|
138
137
|
const { isHOC } = staticConfig
|
|
139
138
|
|
|
140
139
|
const defaultComponentClassName = `is_${staticConfig.componentName}`
|
|
141
|
-
let
|
|
140
|
+
let defaultProps: any
|
|
142
141
|
let defaultTag: string | undefined
|
|
143
142
|
|
|
144
143
|
// see onConfiguredOnce below which attaches a name then to this component
|
|
@@ -167,8 +166,8 @@ export function createComponent<
|
|
|
167
166
|
// React inserts default props after your props for some reason...
|
|
168
167
|
// order important so we do loops, you can't just spread because JS does weird things
|
|
169
168
|
let props: any
|
|
170
|
-
if (
|
|
171
|
-
props = mergeProps(
|
|
169
|
+
if (defaultProps && !propsIn.asChild) {
|
|
170
|
+
props = mergeProps(defaultProps, propsIn)[0]
|
|
172
171
|
} else {
|
|
173
172
|
props = propsIn
|
|
174
173
|
}
|
|
@@ -827,7 +826,7 @@ export function createComponent<
|
|
|
827
826
|
if (typeof window !== 'undefined') {
|
|
828
827
|
// prettier-ignore
|
|
829
828
|
// rome-ignore lint/nursery/noConsoleLog: <explanation>
|
|
830
|
-
console.log({ state, themeState, isAnimated, isAnimatedReactNativeWeb,
|
|
829
|
+
console.log({ state, themeState, isAnimated, isAnimatedReactNativeWeb, defaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, styles, pseudos, content, shouldAvoidClasses, avoidClasses: avoidClassesWhileAnimating, animation: props.animation, style: splitStylesStyle, staticConfig, tamaguiConfig, shouldForcePseudo })
|
|
831
830
|
}
|
|
832
831
|
console.groupEnd()
|
|
833
832
|
console.groupEnd()
|
|
@@ -877,35 +876,14 @@ export function createComponent<
|
|
|
877
876
|
|
|
878
877
|
const debug = defaultPropsIn['debug']
|
|
879
878
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
if (ourProps.tag) {
|
|
884
|
-
defaultTag = ourProps.tag
|
|
879
|
+
if (defaultPropsIn.tag) {
|
|
880
|
+
defaultTag = defaultPropsIn.tag
|
|
885
881
|
}
|
|
886
882
|
|
|
887
883
|
const noClassNames = !staticConfig.acceptsClassName
|
|
888
|
-
const { name, variants, defaultVariants, ...restProps } =
|
|
889
|
-
|
|
890
|
-
// must preserve prop order
|
|
891
|
-
// leave out className because we handle that already with initialSplitStyles.classNames
|
|
892
|
-
// otherwise it confuses variant functions getting className props
|
|
893
|
-
const [defaults, defaultsClassnames] = mergeProps(
|
|
894
|
-
component.defaultProps as any,
|
|
895
|
-
restProps
|
|
896
|
-
)
|
|
897
|
-
|
|
898
|
-
// split - keep variables on props to be processed using theme values at runtime (native)
|
|
899
|
-
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
900
|
-
for (const key in staticConfig.defaultProps) {
|
|
901
|
-
const val = staticConfig.defaultProps[key]
|
|
902
|
-
if (validPseudoKeys[key]) continue
|
|
903
|
-
defaults[key] = val
|
|
904
|
-
}
|
|
905
|
-
}
|
|
884
|
+
const { name, variants, defaultVariants, ...restProps } = defaultPropsIn
|
|
906
885
|
|
|
907
|
-
|
|
908
|
-
tamaguiDefaultProps = defaults
|
|
886
|
+
defaultProps = restProps
|
|
909
887
|
|
|
910
888
|
// add debug logs
|
|
911
889
|
if (process.env.NODE_ENV === 'development' && debug) {
|
|
@@ -913,17 +891,9 @@ export function createComponent<
|
|
|
913
891
|
// rome-ignore lint/nursery/noConsoleLog: <explanation>
|
|
914
892
|
console.log(`🐛 [${staticConfig.componentName || 'Component'}]`, {
|
|
915
893
|
staticConfig,
|
|
916
|
-
tamaguiDefaultProps,
|
|
917
|
-
defaults,
|
|
918
894
|
defaultPropsIn,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
k,
|
|
922
|
-
defaultPropsIn[k],
|
|
923
|
-
]),
|
|
924
|
-
ourProps,
|
|
925
|
-
ourClassNames,
|
|
926
|
-
defaultsClassnames,
|
|
895
|
+
defaultProps,
|
|
896
|
+
defaultPropsKeyOrder: Object.keys(defaultProps),
|
|
927
897
|
defaultTag,
|
|
928
898
|
noClassNames,
|
|
929
899
|
})
|
|
@@ -939,40 +909,37 @@ export function createComponent<
|
|
|
939
909
|
res = memo(res) as any
|
|
940
910
|
}
|
|
941
911
|
|
|
912
|
+
// is this necessary?
|
|
942
913
|
res.staticConfig = {
|
|
943
914
|
validStyles: staticConfig.validStyles || stylePropsView,
|
|
944
915
|
...staticConfig,
|
|
945
916
|
}
|
|
946
917
|
|
|
947
|
-
function extendStyledConfig(
|
|
918
|
+
function extendStyledConfig() {
|
|
948
919
|
return extendStaticConfig(
|
|
949
920
|
{
|
|
950
|
-
|
|
951
|
-
...conf,
|
|
921
|
+
...staticConfig,
|
|
952
922
|
neverFlatten: true,
|
|
953
923
|
isHOC: true,
|
|
954
|
-
defaultProps: mergeProps(Component['defaultProps'], conf?.defaultProps)[0],
|
|
955
924
|
},
|
|
956
925
|
res
|
|
957
926
|
)
|
|
958
927
|
}
|
|
959
928
|
|
|
960
|
-
function extractable(Component
|
|
961
|
-
|
|
962
|
-
Component.staticConfig = extendedConfig
|
|
929
|
+
function extractable(Component: any) {
|
|
930
|
+
Component.staticConfig = extendStyledConfig()
|
|
963
931
|
Component.styleable = styleable
|
|
964
932
|
return Component
|
|
965
933
|
}
|
|
966
934
|
|
|
967
|
-
function styleable(Component: any
|
|
935
|
+
function styleable(Component: any) {
|
|
968
936
|
const isForwardedRefAlready = Component.render?.length === 2
|
|
969
937
|
const ComponentForwardedRef = isForwardedRefAlready
|
|
970
938
|
? (Component as any)
|
|
971
939
|
: forwardRef(Component as any)
|
|
972
940
|
|
|
973
|
-
const extendedConfig = extendStyledConfig(
|
|
941
|
+
const extendedConfig = extendStyledConfig()
|
|
974
942
|
const out = themeable(ComponentForwardedRef, extendedConfig) as any
|
|
975
|
-
extendedConfig.Component = out
|
|
976
943
|
out.staticConfig = extendedConfig
|
|
977
944
|
out.styleable = styleable
|
|
978
945
|
return out
|
package/src/createFont.ts
CHANGED
package/src/createShorthands.ts
CHANGED
package/src/createTamagui.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { isRSC, isWeb } from '@tamagui/constants'
|
|
2
2
|
|
|
3
|
-
import { configListeners, setConfig } from './config
|
|
4
|
-
import { createVariables, tokensKeysOrdered } from './createVariables
|
|
5
|
-
import { getThemeCSSRules } from './helpers/getThemeCSSRules
|
|
3
|
+
import { configListeners, setConfig } from './config'
|
|
4
|
+
import { createVariables, tokensKeysOrdered } from './createVariables'
|
|
5
|
+
import { getThemeCSSRules } from './helpers/getThemeCSSRules'
|
|
6
6
|
import {
|
|
7
7
|
getAllRules,
|
|
8
8
|
listenForSheetChanges,
|
|
9
9
|
scanAllSheets,
|
|
10
|
-
} from './helpers/insertStyleRule
|
|
10
|
+
} from './helpers/insertStyleRule'
|
|
11
11
|
import {
|
|
12
12
|
registerCSSVariable,
|
|
13
13
|
tokensValueToVariable,
|
|
14
14
|
variableToCSS,
|
|
15
|
-
} from './helpers/registerCSSVariable
|
|
16
|
-
import { ensureThemeVariable, proxyThemeToParents } from './helpers/themes
|
|
17
|
-
import { configureMedia } from './hooks/useMedia
|
|
18
|
-
import { parseFont, registerFontVariables } from './insertFont
|
|
19
|
-
import { Tamagui } from './Tamagui
|
|
15
|
+
} from './helpers/registerCSSVariable'
|
|
16
|
+
import { ensureThemeVariable, proxyThemeToParents } from './helpers/themes'
|
|
17
|
+
import { configureMedia } from './hooks/useMedia'
|
|
18
|
+
import { parseFont, registerFontVariables } from './insertFont'
|
|
19
|
+
import { Tamagui } from './Tamagui'
|
|
20
20
|
import {
|
|
21
21
|
CreateTamaguiProps,
|
|
22
22
|
InferTamaguiConfig,
|
|
23
23
|
TamaguiInternalConfig,
|
|
24
24
|
ThemeParsed,
|
|
25
|
-
} from './types
|
|
25
|
+
} from './types'
|
|
26
26
|
|
|
27
27
|
// config is re-run by the @tamagui/static, dont double validate
|
|
28
28
|
const createdConfigs = new WeakMap<any, boolean>()
|
package/src/createTheme.ts
CHANGED
package/src/createTokens.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Variable } from './createVariable
|
|
2
|
-
import { createVariables } from './createVariables
|
|
3
|
-
import { CreateTokens } from './types
|
|
1
|
+
import { Variable } from './createVariable'
|
|
2
|
+
import { createVariables } from './createVariables'
|
|
3
|
+
import { CreateTokens } from './types'
|
|
4
4
|
|
|
5
5
|
// tokens.color.dark.red ===> { var: `color-dark-red`, val: '' }
|
|
6
6
|
export function createTokens<T extends CreateTokens>(tokens: T): MakeTokens<T> {
|
package/src/createVariable.ts
CHANGED
package/src/createVariables.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { simpleHash } from '@tamagui/helpers'
|
|
2
2
|
|
|
3
|
-
import { Variable, createVariable, isVariable } from './createVariable
|
|
3
|
+
import { Variable, createVariable, isVariable } from './createVariable'
|
|
4
4
|
|
|
5
5
|
type DeepTokenObject<Val extends string | number = any> = {
|
|
6
6
|
[key: string]: Val | DeepTokenObject<Val>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getThemes, getTokens } from '../config
|
|
2
|
-
import { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants
|
|
3
|
-
import { getThemeUnwrapped } from '../hooks/getThemeUnwrapped
|
|
4
|
-
import { ThemeParsed, ThemeProps } from '../types
|
|
1
|
+
import { getThemes, getTokens } from '../config'
|
|
2
|
+
import { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants'
|
|
3
|
+
import { getThemeUnwrapped } from '../hooks/getThemeUnwrapped'
|
|
4
|
+
import { ThemeParsed, ThemeProps } from '../types'
|
|
5
5
|
|
|
6
6
|
type ThemeListener = (name: string | null, themeManager: ThemeManager) => void
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mediaObjectToString } from '../hooks/useMedia
|
|
2
|
-
import type { MediaQueries, MediaStyleObject, StyleObject } from '../types
|
|
1
|
+
import { mediaObjectToString } from '../hooks/useMedia'
|
|
2
|
+
import type { MediaQueries, MediaStyleObject, StyleObject } from '../types'
|
|
3
3
|
|
|
4
4
|
// TODO have this be used by extractMediaStyle in tamagui static
|
|
5
5
|
// not synced to static/constants for now
|