@tamagui/web 1.22.7 → 1.22.9
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 +28 -49
- 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 +8 -8
- 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 +9 -9
- 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/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 +1 -1
- 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 +3 -3
- 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/ThemeProvider.js +2 -2
- package/dist/esm/Tamagui.js +3 -3
- package/dist/esm/Tamagui.mjs +3 -3
- package/dist/esm/createComponent.js +29 -50
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +29 -50
- 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 +8 -8
- package/dist/esm/helpers/createPropMapper.mjs +8 -8
- 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 +9 -9
- package/dist/esm/helpers/getSplitStyles.mjs +9 -9
- 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/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 +1 -1
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themeable.mjs +1 -1
- 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 +3 -3
- package/dist/esm/styled.mjs +3 -3
- 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/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 +30 -59
- 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 +10 -10
- 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 +11 -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/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 +3 -2
- 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 +5 -5
- 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 +2 -2
- 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/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
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
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isAndroid, isWeb } from '@tamagui/constants'
|
|
2
2
|
|
|
3
|
-
import { getConfig } from '../config
|
|
4
|
-
import { isDevTools } from '../constants/isDevTools
|
|
5
|
-
import { Variable, getVariableValue, isVariable } from '../createVariable
|
|
3
|
+
import { getConfig } from '../config'
|
|
4
|
+
import { isDevTools } from '../constants/isDevTools'
|
|
5
|
+
import { Variable, getVariableValue, isVariable } from '../createVariable'
|
|
6
6
|
import type {
|
|
7
7
|
DebugProp,
|
|
8
8
|
GenericVariantDefinitions,
|
|
@@ -11,13 +11,13 @@ import type {
|
|
|
11
11
|
StaticConfigParsed,
|
|
12
12
|
TamaguiInternalConfig,
|
|
13
13
|
VariantSpreadFunction,
|
|
14
|
-
} from '../types
|
|
15
|
-
import type { LanguageContextType } from '../views/FontLanguage.types
|
|
16
|
-
import { expandStyle } from './expandStyle
|
|
17
|
-
import { expandStyles } from './expandStyles
|
|
18
|
-
import { getFontsForLanguage, getVariantExtras } from './getVariantExtras
|
|
19
|
-
import { isObj } from './isObj
|
|
20
|
-
import { mergeProps } from './mergeProps
|
|
14
|
+
} from '../types'
|
|
15
|
+
import type { LanguageContextType } from '../views/FontLanguage.types'
|
|
16
|
+
import { expandStyle } from './expandStyle'
|
|
17
|
+
import { expandStyles } from './expandStyles'
|
|
18
|
+
import { getFontsForLanguage, getVariantExtras } from './getVariantExtras'
|
|
19
|
+
import { isObj } from './isObj'
|
|
20
|
+
import { mergeProps } from './mergeProps'
|
|
21
21
|
|
|
22
22
|
export type ResolveVariableTypes =
|
|
23
23
|
| 'auto'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isWeb } from '@tamagui/constants'
|
|
2
2
|
|
|
3
|
-
import { getConfig } from '../config
|
|
4
|
-
import { expandStyle } from './expandStyle
|
|
3
|
+
import { getConfig } from '../config'
|
|
4
|
+
import { expandStyle } from './expandStyle'
|
|
5
5
|
import { normalizeShadow } from './normalizeShadow'
|
|
6
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty
|
|
7
|
-
import { pseudoDescriptors } from './pseudoDescriptors
|
|
6
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
7
|
+
import { pseudoDescriptors } from './pseudoDescriptors'
|
|
8
8
|
|
|
9
9
|
let shorthands: Record<string, string> | null = null
|
|
10
10
|
|
|
@@ -5,9 +5,9 @@ import type {
|
|
|
5
5
|
StaticConfig,
|
|
6
6
|
StaticConfigParsed,
|
|
7
7
|
StylableComponent,
|
|
8
|
-
} from '../types
|
|
9
|
-
import { createPropMapper } from './createPropMapper
|
|
10
|
-
import { mergeProps } from './mergeProps
|
|
8
|
+
} from '../types'
|
|
9
|
+
import { createPropMapper } from './createPropMapper'
|
|
10
|
+
import { mergeProps } from './mergeProps'
|
|
11
11
|
|
|
12
12
|
export function extendStaticConfig(
|
|
13
13
|
config: Partial<StaticConfig>,
|
|
@@ -16,15 +16,15 @@ import {
|
|
|
16
16
|
} from '@tamagui/helpers'
|
|
17
17
|
import { useInsertionEffect } from 'react'
|
|
18
18
|
|
|
19
|
-
import { getConfig, getFont } from '../config
|
|
20
|
-
import { isDevTools } from '../constants/isDevTools
|
|
19
|
+
import { getConfig, getFont } from '../config'
|
|
20
|
+
import { isDevTools } from '../constants/isDevTools'
|
|
21
21
|
import {
|
|
22
22
|
getMediaImportanceIfMoreImportant,
|
|
23
23
|
mediaState as globalMediaState,
|
|
24
24
|
mediaKeysWithAndWithout$,
|
|
25
25
|
mediaQueryConfig,
|
|
26
26
|
mergeMediaByImportance,
|
|
27
|
-
} from '../hooks/useMedia
|
|
27
|
+
} from '../hooks/useMedia'
|
|
28
28
|
import type {
|
|
29
29
|
ClassNamesObject,
|
|
30
30
|
DebugProp,
|
|
@@ -41,14 +41,14 @@ import type {
|
|
|
41
41
|
TextStyleProps,
|
|
42
42
|
ThemeParsed,
|
|
43
43
|
ViewStyleWithPseudos,
|
|
44
|
-
} from '../types
|
|
44
|
+
} from '../types'
|
|
45
45
|
import type {
|
|
46
46
|
FontLanguageProps,
|
|
47
47
|
LanguageContextType,
|
|
48
|
-
} from '../views/FontLanguage.types
|
|
49
|
-
import { createMediaStyle } from './createMediaStyle
|
|
50
|
-
import { getPropMappedFontFamily } from './createPropMapper
|
|
51
|
-
import { fixStyles } from './expandStyles
|
|
48
|
+
} from '../views/FontLanguage.types'
|
|
49
|
+
import { createMediaStyle } from './createMediaStyle'
|
|
50
|
+
import { getPropMappedFontFamily } from './createPropMapper'
|
|
51
|
+
import { fixStyles } from './expandStyles'
|
|
52
52
|
import { generateAtomicStyles, getStylesAtomic, styleToCSS } from './getStylesAtomic'
|
|
53
53
|
import {
|
|
54
54
|
insertStyleRules,
|
|
@@ -56,12 +56,12 @@ import {
|
|
|
56
56
|
scanAllSheets,
|
|
57
57
|
shouldInsertStyleRules,
|
|
58
58
|
updateRules,
|
|
59
|
-
} from './insertStyleRule
|
|
59
|
+
} from './insertStyleRule'
|
|
60
60
|
import {
|
|
61
61
|
normalizeValueWithProperty,
|
|
62
62
|
reverseMapClassNameToValue,
|
|
63
|
-
} from './normalizeValueWithProperty
|
|
64
|
-
import { pseudoDescriptors } from './pseudoDescriptors
|
|
63
|
+
} from './normalizeValueWithProperty'
|
|
64
|
+
import { pseudoDescriptors } from './pseudoDescriptors'
|
|
65
65
|
|
|
66
66
|
type GetStyleState = {
|
|
67
67
|
style: TextStyleProps
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { StyleObject, simpleHash } from '@tamagui/helpers'
|
|
7
7
|
|
|
8
|
-
import { getConfig } from '../config
|
|
9
|
-
import type { TamaguiInternalConfig, ViewStyleWithPseudos } from '../types
|
|
10
|
-
import { defaultOffset } from './defaultOffset
|
|
11
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty
|
|
12
|
-
import { PseudoDescriptor, pseudoDescriptors } from './pseudoDescriptors
|
|
8
|
+
import { getConfig } from '../config'
|
|
9
|
+
import type { TamaguiInternalConfig, ViewStyleWithPseudos } from '../types'
|
|
10
|
+
import { defaultOffset } from './defaultOffset'
|
|
11
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
12
|
+
import { PseudoDescriptor, pseudoDescriptors } from './pseudoDescriptors'
|
|
13
13
|
|
|
14
14
|
// refactor this file away next...
|
|
15
15
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { simpleHash } from '@tamagui/helpers'
|
|
2
2
|
|
|
3
|
-
import { THEME_CLASSNAME_PREFIX } from '../constants/constants
|
|
4
|
-
import { Variable, variableToString } from '../createVariable
|
|
5
|
-
import type { CreateTamaguiProps, ThemeParsed } from '../types
|
|
6
|
-
import { tokensValueToVariable } from './registerCSSVariable
|
|
3
|
+
import { THEME_CLASSNAME_PREFIX } from '../constants/constants'
|
|
4
|
+
import { Variable, variableToString } from '../createVariable'
|
|
5
|
+
import type { CreateTamaguiProps, ThemeParsed } from '../types'
|
|
6
|
+
import { tokensValueToVariable } from './registerCSSVariable'
|
|
7
7
|
|
|
8
8
|
export function getThemeCSSRules({
|
|
9
9
|
config,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getConfig } from '../config
|
|
2
|
-
import { GenericFonts } from '../types
|
|
3
|
-
import { LanguageContextType } from '../views/FontLanguage.types
|
|
4
|
-
import { createProxy } from './createProxy
|
|
1
|
+
import { getConfig } from '../config'
|
|
2
|
+
import { GenericFonts } from '../types'
|
|
3
|
+
import { LanguageContextType } from '../views/FontLanguage.types'
|
|
4
|
+
import { createProxy } from './createProxy'
|
|
5
5
|
|
|
6
6
|
const extrasCache = new WeakMap()
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isClient } from '@tamagui/constants'
|
|
2
2
|
|
|
3
|
-
import type { RulesToInsert, StyleObject } from '../types
|
|
3
|
+
import type { RulesToInsert, StyleObject } from '../types'
|
|
4
4
|
|
|
5
5
|
const allSelectors: Record<string, string> = {}
|
|
6
6
|
const allRules: Record<string, string> = {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isValidElement } from 'react'
|
|
2
2
|
|
|
3
|
-
import { TamaguiReactElement } from '../types
|
|
4
|
-
import { isTamaguiComponent } from './isTamaguiComponent
|
|
3
|
+
import { TamaguiReactElement } from '../types'
|
|
4
|
+
import { isTamaguiComponent } from './isTamaguiComponent'
|
|
5
5
|
|
|
6
6
|
export const isTamaguiElement = (
|
|
7
7
|
child: any,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalizeCSSColor } from '@tamagui/normalize-css-color'
|
|
2
2
|
|
|
3
|
-
import { defaultOffset } from './defaultOffset
|
|
4
|
-
import { rgba } from './normalizeColor
|
|
5
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty
|
|
3
|
+
import { defaultOffset } from './defaultOffset'
|
|
4
|
+
import { rgba } from './normalizeColor'
|
|
5
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
6
6
|
|
|
7
7
|
export function normalizeShadow({
|
|
8
8
|
shadowColor,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defaultOffset } from './defaultOffset
|
|
2
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty
|
|
1
|
+
import { defaultOffset } from './defaultOffset'
|
|
2
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
3
3
|
|
|
4
4
|
export function normalizeShadow({
|
|
5
5
|
shadowColor,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { isWeb } from '@tamagui/constants'
|
|
7
7
|
|
|
8
|
-
import { getAllSelectors } from './insertStyleRule
|
|
9
|
-
import { names, normalizeColor } from './normalizeColor
|
|
8
|
+
import { getAllSelectors } from './insertStyleRule'
|
|
9
|
+
import { names, normalizeColor } from './normalizeColor'
|
|
10
10
|
import { normalizeStylePropKeys } from './normalizeStylePropKeys'
|
|
11
11
|
|
|
12
12
|
const colorCache = new Map()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
|
|
3
|
-
import { DebugProp, StaticConfig, ThemeName } from '../types
|
|
4
|
-
import { Theme } from '../views/Theme
|
|
3
|
+
import { DebugProp, StaticConfig, ThemeName } from '../types'
|
|
4
|
+
import { Theme } from '../views/Theme'
|
|
5
5
|
|
|
6
6
|
export interface ThemeableProps {
|
|
7
7
|
theme?: ThemeName | null
|
|
@@ -17,6 +17,7 @@ export function themeable<Component extends (props: any) => any>(
|
|
|
17
17
|
) {
|
|
18
18
|
const withThemeComponent = forwardRef(function WithTheme(props: ThemeableProps, ref) {
|
|
19
19
|
const { themeInverse, theme, componentName, themeReset, ...rest } = props
|
|
20
|
+
|
|
20
21
|
const element = React.createElement(component, { ...rest, ref } as any)
|
|
21
22
|
|
|
22
23
|
return (
|
package/src/helpers/themes.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createVariable, isVariable } from '../createVariable
|
|
2
|
-
import { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped
|
|
3
|
-
import { CreateTamaguiProps } from '../types
|
|
1
|
+
import { createVariable, isVariable } from '../createVariable'
|
|
2
|
+
import { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped'
|
|
3
|
+
import { CreateTamaguiProps } from '../types'
|
|
4
4
|
|
|
5
5
|
// mutates, freeze after
|
|
6
6
|
// shared by createTamagui so extracted here
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import { DebugProp, TamaguiComponentState } from '../types
|
|
3
|
+
import { DebugProp, TamaguiComponentState } from '../types'
|
|
4
4
|
|
|
5
5
|
export function useShallowSetState<State extends TamaguiComponentState>(
|
|
6
6
|
setter: React.Dispatch<React.SetStateAction<State>>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import { AnimationDriverContext } from '../contexts/AnimationDriverContext
|
|
4
|
-
import { getAnimationDriver } from '../helpers/getAnimationDriver
|
|
3
|
+
import { AnimationDriverContext } from '../contexts/AnimationDriverContext'
|
|
4
|
+
import { getAnimationDriver } from '../helpers/getAnimationDriver'
|
|
5
5
|
import { isRSC } from '@tamagui/constants'
|
|
6
6
|
|
|
7
7
|
export const useAnimationDriver = () => {
|
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useSyncExternalStore } from 'react'
|
|
2
2
|
|
|
3
|
-
import { getConfig } from '../config
|
|
4
|
-
import { createProxy } from '../helpers/createProxy
|
|
3
|
+
import { getConfig } from '../config'
|
|
4
|
+
import { createProxy } from '../helpers/createProxy'
|
|
5
5
|
import { matchMedia } from '../helpers/matchMedia'
|
|
6
6
|
import type {
|
|
7
7
|
MediaQueries,
|
|
@@ -9,8 +9,8 @@ import type {
|
|
|
9
9
|
MediaQueryObject,
|
|
10
10
|
MediaQueryState,
|
|
11
11
|
TamaguiInternalConfig,
|
|
12
|
-
} from '../types
|
|
13
|
-
import { useSafeRef } from './useSafeRef
|
|
12
|
+
} from '../types'
|
|
13
|
+
import { useSafeRef } from './useSafeRef'
|
|
14
14
|
|
|
15
15
|
export let mediaState: MediaQueryState =
|
|
16
16
|
// development only safeguard
|
package/src/hooks/useProps.tsx
CHANGED
package/src/hooks/useStyle.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isRSC, isWeb } from '@tamagui/constants'
|
|
2
2
|
import { useContext } from 'react'
|
|
3
3
|
|
|
4
|
-
import { FontLanguageContext } from '../contexts/FontLanguageContext
|
|
5
|
-
import { TextAncestorContext } from '../contexts/TextAncestorContext
|
|
6
|
-
import { useSplitStyles } from '../helpers/getSplitStyles
|
|
4
|
+
import { FontLanguageContext } from '../contexts/FontLanguageContext'
|
|
5
|
+
import { TextAncestorContext } from '../contexts/TextAncestorContext'
|
|
6
|
+
import { useSplitStyles } from '../helpers/getSplitStyles'
|
|
7
7
|
import {
|
|
8
8
|
DebugProp,
|
|
9
9
|
GetProps,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
TamaguiComponent,
|
|
12
12
|
TextNonStyleProps,
|
|
13
13
|
} from '../types'
|
|
14
|
-
import { useMedia } from './useMedia
|
|
15
|
-
import { useTheme } from './useTheme
|
|
14
|
+
import { useMedia } from './useMedia'
|
|
15
|
+
import { useTheme } from './useTheme'
|
|
16
16
|
|
|
17
17
|
export function useStyle<
|
|
18
18
|
Component extends TamaguiComponent,
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { isClient, isRSC, isServer, isWeb } from '@tamagui/constants'
|
|
3
3
|
import { useContext, useEffect, useLayoutEffect, useMemo, useState } from 'react'
|
|
4
4
|
|
|
5
|
-
import { getConfig } from '../config
|
|
6
|
-
import { isDevTools } from '../constants/isDevTools
|
|
7
|
-
import { createProxy } from '../helpers/createProxy
|
|
5
|
+
import { getConfig } from '../config'
|
|
6
|
+
import { isDevTools } from '../constants/isDevTools'
|
|
7
|
+
import { createProxy } from '../helpers/createProxy'
|
|
8
8
|
import {
|
|
9
9
|
ThemeManager,
|
|
10
10
|
ThemeManagerState,
|
|
11
11
|
getNonComponentParentManager,
|
|
12
|
-
} from '../helpers/ThemeManager
|
|
13
|
-
import { ThemeManagerContext } from '../helpers/ThemeManagerContext
|
|
14
|
-
import type { ThemeParsed, ThemeProps } from '../types
|
|
15
|
-
import { GetThemeUnwrapped } from './getThemeUnwrapped
|
|
16
|
-
import { useServerRef } from './useServerHooks
|
|
12
|
+
} from '../helpers/ThemeManager'
|
|
13
|
+
import { ThemeManagerContext } from '../helpers/ThemeManagerContext'
|
|
14
|
+
import type { ThemeParsed, ThemeProps } from '../types'
|
|
15
|
+
import { GetThemeUnwrapped } from './getThemeUnwrapped'
|
|
16
|
+
import { useServerRef } from './useServerHooks'
|
|
17
17
|
|
|
18
18
|
export type ChangedThemeResponse = {
|
|
19
19
|
isNewTheme: boolean
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isRSC, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
2
2
|
import { useContext, useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import { getConfig } from '../config
|
|
5
|
-
import { ThemeManagerContext } from '../helpers/ThemeManagerContext
|
|
6
|
-
import { ThemeName } from '../types
|
|
4
|
+
import { getConfig } from '../config'
|
|
5
|
+
import { ThemeManagerContext } from '../helpers/ThemeManagerContext'
|
|
6
|
+
import { ThemeName } from '../types'
|
|
7
7
|
|
|
8
8
|
export function useThemeName(opts?: { parent?: true }): ThemeName {
|
|
9
9
|
if (isRSC) {
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './Tamagui
|
|
2
|
-
export * from './createComponent
|
|
3
|
-
export * from './createShorthands
|
|
4
|
-
export * from './createTheme
|
|
5
|
-
export * from './createTamagui
|
|
6
|
-
export * from './createFont
|
|
7
|
-
export * from './createTokens
|
|
8
|
-
export * from './createVariable
|
|
9
|
-
export * from './createVariables
|
|
10
|
-
export * from './insertFont
|
|
11
|
-
export * from './styled
|
|
12
|
-
export * from './types
|
|
13
|
-
export * from './setupReactNative
|
|
1
|
+
export * from './Tamagui'
|
|
2
|
+
export * from './createComponent'
|
|
3
|
+
export * from './createShorthands'
|
|
4
|
+
export * from './createTheme'
|
|
5
|
+
export * from './createTamagui'
|
|
6
|
+
export * from './createFont'
|
|
7
|
+
export * from './createTokens'
|
|
8
|
+
export * from './createVariable'
|
|
9
|
+
export * from './createVariables'
|
|
10
|
+
export * from './insertFont'
|
|
11
|
+
export * from './styled'
|
|
12
|
+
export * from './types'
|
|
13
|
+
export * from './setupReactNative'
|
|
14
14
|
|
|
15
15
|
export {
|
|
16
16
|
getConfig,
|
|
@@ -18,30 +18,30 @@ export {
|
|
|
18
18
|
getTokens,
|
|
19
19
|
onConfiguredOnce,
|
|
20
20
|
updateConfig,
|
|
21
|
-
} from './config
|
|
21
|
+
} from './config'
|
|
22
22
|
|
|
23
|
-
export * from './constants/constants
|
|
23
|
+
export * from './constants/constants'
|
|
24
24
|
|
|
25
|
-
export * from './helpers/useShallowSetState
|
|
26
|
-
export * from './helpers/getVariantExtras
|
|
27
|
-
export * from './helpers/getAnimationDriver
|
|
28
|
-
export * from './helpers/getExpandedShorthands
|
|
29
|
-
export * from './helpers/getSplitStyles
|
|
25
|
+
export * from './helpers/useShallowSetState'
|
|
26
|
+
export * from './helpers/getVariantExtras'
|
|
27
|
+
export * from './helpers/getAnimationDriver'
|
|
28
|
+
export * from './helpers/getExpandedShorthands'
|
|
29
|
+
export * from './helpers/getSplitStyles'
|
|
30
30
|
export * from './helpers/getStylesAtomic'
|
|
31
|
-
export * from './helpers/pseudoDescriptors
|
|
32
|
-
export * from './helpers/mergeProps
|
|
33
|
-
export * from './helpers/expandStyles
|
|
34
|
-
export * from './helpers/isTamaguiElement
|
|
35
|
-
export * from './helpers/isTamaguiComponent
|
|
31
|
+
export * from './helpers/pseudoDescriptors'
|
|
32
|
+
export * from './helpers/mergeProps'
|
|
33
|
+
export * from './helpers/expandStyles'
|
|
34
|
+
export * from './helpers/isTamaguiElement'
|
|
35
|
+
export * from './helpers/isTamaguiComponent'
|
|
36
36
|
export * from './helpers/matchMedia'
|
|
37
|
-
export * from './helpers/themes
|
|
38
|
-
export * from './helpers/getThemeCSSRules
|
|
39
|
-
export * from './helpers/proxyThemeVariables
|
|
40
|
-
export * from './helpers/themeable
|
|
41
|
-
export * from './helpers/withStaticProperties
|
|
42
|
-
export * from './helpers/normalizeColor
|
|
37
|
+
export * from './helpers/themes'
|
|
38
|
+
export * from './helpers/getThemeCSSRules'
|
|
39
|
+
export * from './helpers/proxyThemeVariables'
|
|
40
|
+
export * from './helpers/themeable'
|
|
41
|
+
export * from './helpers/withStaticProperties'
|
|
42
|
+
export * from './helpers/normalizeColor'
|
|
43
43
|
|
|
44
|
-
export * from './contexts/ButtonNestingContext
|
|
44
|
+
export * from './contexts/ButtonNestingContext'
|
|
45
45
|
|
|
46
46
|
export {
|
|
47
47
|
configureMedia,
|
|
@@ -51,24 +51,24 @@ export {
|
|
|
51
51
|
useMediaPropsActive,
|
|
52
52
|
mediaObjectToString,
|
|
53
53
|
mediaQueryConfig,
|
|
54
|
-
} from './hooks/useMedia
|
|
55
|
-
export * from './hooks/useTheme
|
|
56
|
-
export * from './hooks/useThemeName
|
|
57
|
-
export * from './hooks/useSafeRef
|
|
58
|
-
export * from './hooks/useStyle
|
|
59
|
-
export * from './hooks/useAnimationDriver
|
|
60
|
-
export * from './hooks/useIsTouchDevice
|
|
61
|
-
export * from './hooks/useProps
|
|
54
|
+
} from './hooks/useMedia'
|
|
55
|
+
export * from './hooks/useTheme'
|
|
56
|
+
export * from './hooks/useThemeName'
|
|
57
|
+
export * from './hooks/useSafeRef'
|
|
58
|
+
export * from './hooks/useStyle'
|
|
59
|
+
export * from './hooks/useAnimationDriver'
|
|
60
|
+
export * from './hooks/useIsTouchDevice'
|
|
61
|
+
export * from './hooks/useProps'
|
|
62
62
|
|
|
63
|
-
export * from './views/Slot
|
|
64
|
-
export * from './views/Stack
|
|
65
|
-
export * from './views/Text
|
|
66
|
-
export * from './contexts/TextAncestorContext
|
|
67
|
-
export * from './views/Theme
|
|
68
|
-
export * from './views/ThemeProvider
|
|
63
|
+
export * from './views/Slot'
|
|
64
|
+
export * from './views/Stack'
|
|
65
|
+
export * from './views/Text'
|
|
66
|
+
export * from './contexts/TextAncestorContext'
|
|
67
|
+
export * from './views/Theme'
|
|
68
|
+
export * from './views/ThemeProvider'
|
|
69
69
|
export * from './views/FontLanguage'
|
|
70
|
-
export * from './views/TamaguiProvider
|
|
71
|
-
export * from './views/AnimationDriverProvider
|
|
70
|
+
export * from './views/TamaguiProvider'
|
|
71
|
+
export * from './views/AnimationDriverProvider'
|
|
72
72
|
|
|
73
73
|
export * from '@tamagui/use-force-update'
|
|
74
74
|
export * from '@tamagui/use-did-finish-ssr'
|
|
@@ -77,4 +77,4 @@ export * from '@tamagui/compose-refs'
|
|
|
77
77
|
export * from '@tamagui/helpers'
|
|
78
78
|
export * from '@tamagui/constants'
|
|
79
79
|
|
|
80
|
-
export * from './setupHooks
|
|
80
|
+
export * from './setupHooks'
|
package/src/insertFont.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { setConfigFont } from './config
|
|
2
|
-
import { createFont } from './createFont
|
|
3
|
-
import { Variable } from './createVariable
|
|
4
|
-
import { DeepVariableObject, createVariables } from './createVariables
|
|
5
|
-
import { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable
|
|
6
|
-
import { GenericFont } from './types
|
|
1
|
+
import { setConfigFont } from './config'
|
|
2
|
+
import { createFont } from './createFont'
|
|
3
|
+
import { Variable } from './createVariable'
|
|
4
|
+
import { DeepVariableObject, createVariables } from './createVariables'
|
|
5
|
+
import { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'
|
|
6
|
+
import { GenericFont } from './types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Runtime dynamic insert font
|
package/src/setupReactNative.ts
CHANGED