@tamagui/web 1.79.6 → 1.79.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/helpers/getThemeCSSRules.js +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/hooks/useMedia.js +1 -1
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +1 -1
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +2 -2
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +2 -2
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/internalWithTheme.js +4 -4
- package/dist/cjs/internalWithTheme.js.map +1 -1
- package/dist/cjs/internalWithTheme.native.js +4 -4
- package/dist/cjs/internalWithTheme.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +2 -2
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +3 -3
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +3 -3
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/internalWithTheme.js +3 -4
- package/dist/esm/internalWithTheme.js.map +1 -1
- package/dist/esm/internalWithTheme.native.js +3 -4
- package/dist/esm/internalWithTheme.native.js.map +1 -1
- package/package.json +10 -10
- package/src/helpers/getThemeCSSRules.ts +8 -2
- package/src/hooks/useMedia.tsx +2 -2
- package/src/hooks/useTheme.tsx +2 -2
- package/src/internalWithTheme.tsx +3 -6
- package/src/types.tsx +6 -5
- package/types/config.d.ts +17 -17
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/hooks/useConfiguration.d.ts +39 -39
- package/types/internalWithTheme.d.ts +1 -1
- package/types/internalWithTheme.d.ts.map +1 -1
- package/types/types.d.ts +5 -3
- package/types/types.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.79.
|
|
3
|
+
"version": "1.79.8",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.79.
|
|
31
|
-
"@tamagui/constants": "1.79.
|
|
32
|
-
"@tamagui/helpers": "1.79.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.79.
|
|
34
|
-
"@tamagui/timer": "1.79.
|
|
35
|
-
"@tamagui/use-did-finish-ssr": "1.79.
|
|
36
|
-
"@tamagui/use-event": "1.79.
|
|
37
|
-
"@tamagui/use-force-update": "1.79.
|
|
30
|
+
"@tamagui/compose-refs": "1.79.8",
|
|
31
|
+
"@tamagui/constants": "1.79.8",
|
|
32
|
+
"@tamagui/helpers": "1.79.8",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.79.8",
|
|
34
|
+
"@tamagui/timer": "1.79.8",
|
|
35
|
+
"@tamagui/use-did-finish-ssr": "1.79.8",
|
|
36
|
+
"@tamagui/use-event": "1.79.8",
|
|
37
|
+
"@tamagui/use-force-update": "1.79.8"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@tamagui/build": "1.79.
|
|
43
|
+
"@tamagui/build": "1.79.8",
|
|
44
44
|
"@testing-library/react": "^14.0.0",
|
|
45
45
|
"csstype": "^3.0.10",
|
|
46
46
|
"react": "^18.2.0",
|
|
@@ -77,8 +77,8 @@ export function getThemeCSSRules(props: {
|
|
|
77
77
|
continue
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
const parents = new Array(depth + 1).fill(0).map((_,
|
|
81
|
-
return `${CNP}${
|
|
80
|
+
const parents = new Array(depth + 1).fill(0).map((_, idx) => {
|
|
81
|
+
return `${CNP}${idx % 2 === 0 ? stronger : weaker}`
|
|
82
82
|
})
|
|
83
83
|
|
|
84
84
|
let parentSelectors = parents.length > 1 ? parents.slice(1) : parents
|
|
@@ -103,6 +103,12 @@ export function getThemeCSSRules(props: {
|
|
|
103
103
|
|
|
104
104
|
const selectors = [...selectorsSet].sort((a, b) => a.localeCompare(b))
|
|
105
105
|
|
|
106
|
+
// let specificity = 1 //themeName.split('_').length
|
|
107
|
+
|
|
108
|
+
// if (themeName.includes('accent_Button')) {
|
|
109
|
+
// specificity = 2
|
|
110
|
+
// }
|
|
111
|
+
|
|
106
112
|
// only do our :root attach if it's not light/dark - not support sub themes on root saves a lot of effort/size
|
|
107
113
|
// this isBaseTheme logic could probably be done more efficiently above
|
|
108
114
|
const selectorsString = selectors
|
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
|
+
import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
2
2
|
import { useRef, useSyncExternalStore } from 'react'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
@@ -198,7 +198,7 @@ export function useMedia(uid?: any, componentContext?: ComponentContextI): UseMe
|
|
|
198
198
|
const internal = useRef<UseMediaInternalState | undefined>()
|
|
199
199
|
// performance boost to avoid using context twice
|
|
200
200
|
const disableSSR = componentContext ? getDisableSSR(componentContext) : useDisableSSR()
|
|
201
|
-
const initialState = (disableSSR ? mediaState : initState) || {}
|
|
201
|
+
const initialState = (disableSSR || !isWeb ? mediaState : initState) || {}
|
|
202
202
|
|
|
203
203
|
const state = useSyncExternalStore<MediaQueryState>(
|
|
204
204
|
subscribe,
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -325,7 +325,7 @@ export const useChangeThemeEffect = (
|
|
|
325
325
|
|
|
326
326
|
if (!isServer) {
|
|
327
327
|
// listen for parent change + notify children change
|
|
328
|
-
|
|
328
|
+
useEffect(() => {
|
|
329
329
|
if (!themeManager) return
|
|
330
330
|
|
|
331
331
|
// SSR safe inverse (because server can't know prefers scheme)
|
|
@@ -375,7 +375,7 @@ export const useChangeThemeEffect = (
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
if (shouldTryUpdate) {
|
|
378
|
-
setThemeState(createState)
|
|
378
|
+
setThemeState((prev) => createState(prev, force))
|
|
379
379
|
}
|
|
380
380
|
},
|
|
381
381
|
themeManager.id
|
|
@@ -4,13 +4,10 @@ import { useTheme } from './hooks/useTheme'
|
|
|
4
4
|
|
|
5
5
|
/** internal: this is for tamagui babel plugin usage only */
|
|
6
6
|
|
|
7
|
-
export const internalWithTheme = (
|
|
8
|
-
Component: any,
|
|
9
|
-
styleProvider: any,
|
|
10
|
-
memoArgs: string[]
|
|
11
|
-
) => {
|
|
7
|
+
export const internalWithTheme = (Component: any, styleProvider: any) => {
|
|
12
8
|
return (props) => {
|
|
9
|
+
const { expressions, ...rest } = props
|
|
13
10
|
const theme = useTheme()
|
|
14
|
-
return <Component style={
|
|
11
|
+
return <Component style={styleProvider(theme, props.expressions)} {...rest} />
|
|
15
12
|
}
|
|
16
13
|
}
|
package/src/types.tsx
CHANGED
|
@@ -388,9 +388,11 @@ type Tokenify<A extends GenericTokens> = Omit<
|
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
type TokenifyRecord<A extends CreateTokens[keyof CreateTokens]> = {
|
|
391
|
-
[Key in keyof A]:
|
|
391
|
+
[Key in keyof A]: CoerceToVariable<A[Key]>
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
type CoerceToVariable<A> = A extends Variable ? A : Variable<A>
|
|
395
|
+
|
|
394
396
|
export type TamaguiBaseTheme = {
|
|
395
397
|
// defined for our tamagui kit , we could do this inside `tamagui`
|
|
396
398
|
// but maybe helpful to have some sort of universally shared things +
|
|
@@ -486,9 +488,7 @@ export type CreateTamaguiConfig<
|
|
|
486
488
|
// parsed
|
|
487
489
|
themes: {
|
|
488
490
|
[Name in keyof B]: {
|
|
489
|
-
[Key in keyof B[Name]]: B[Name][Key]
|
|
490
|
-
? B[Name][Key]
|
|
491
|
-
: Variable<B[Name][Key]>
|
|
491
|
+
[Key in keyof B[Name]]: CoerceToVariable<B[Name][Key]>
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
shorthands: C
|
|
@@ -582,7 +582,7 @@ export type ThemeDefinition = BaseThemeDefinitions extends never
|
|
|
582
582
|
: BaseThemeDefinitions
|
|
583
583
|
export type ThemeKeys = keyof ThemeDefinition
|
|
584
584
|
export type ThemeParsed = {
|
|
585
|
-
[key in ThemeKeys]: ThemeDefinition[key]
|
|
585
|
+
[key in ThemeKeys]: CoerceToVariable<ThemeDefinition[key]>
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
export type Tokens = TamaguiConfig['tokens']
|
|
@@ -1377,6 +1377,7 @@ export type SpaceValue = number | SpaceTokens | ThemeValueFallback
|
|
|
1377
1377
|
type SharedBaseExtraStyleProps = {
|
|
1378
1378
|
columnGap?: SpaceValue
|
|
1379
1379
|
contain?: Properties['contain']
|
|
1380
|
+
touchAction?: Properties['touchAction']
|
|
1380
1381
|
cursor?: Properties['cursor']
|
|
1381
1382
|
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'
|
|
1382
1383
|
gap?: SpaceValue
|
package/types/config.d.ts
CHANGED
|
@@ -23,23 +23,23 @@ export declare const useTokens: ({ prefixed, }?: {
|
|
|
23
23
|
}) => TokensMerged;
|
|
24
24
|
export declare const getThemes: () => {
|
|
25
25
|
[x: string]: {
|
|
26
|
-
[x: string]: import("./createVariable").Variable<import("./types").
|
|
27
|
-
background?: import("./createVariable").Variable<import("./
|
|
28
|
-
backgroundHover?: import("./createVariable").Variable<import("./
|
|
29
|
-
backgroundPress?: import("./createVariable").Variable<import("./
|
|
30
|
-
backgroundFocus?: import("./createVariable").Variable<import("./
|
|
31
|
-
color?: import("./createVariable").Variable<import("./
|
|
32
|
-
colorHover?: import("./createVariable").Variable<import("./
|
|
33
|
-
colorPress?: import("./createVariable").Variable<import("./
|
|
34
|
-
colorFocus?: import("./createVariable").Variable<import("./
|
|
35
|
-
borderColor?: import("./createVariable").Variable<import("./
|
|
36
|
-
borderColorHover?: import("./createVariable").Variable<import("./
|
|
37
|
-
borderColorPress?: import("./createVariable").Variable<import("./
|
|
38
|
-
borderColorFocus?: import("./createVariable").Variable<import("./
|
|
39
|
-
shadowColor?: import("./createVariable").Variable<import("./
|
|
40
|
-
shadowColorHover?: import("./createVariable").Variable<import("./
|
|
41
|
-
shadowColorPress?: import("./createVariable").Variable<import("./
|
|
42
|
-
shadowColorFocus?: import("./createVariable").Variable<import("./
|
|
26
|
+
[x: string]: import("./createVariable").Variable<any> | import("./createVariable").Variable<string> | import("./createVariable").Variable<number> | import("./createVariable").Variable<import("./types").VariableValGeneric>;
|
|
27
|
+
background?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
28
|
+
backgroundHover?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
29
|
+
backgroundPress?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
30
|
+
backgroundFocus?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
31
|
+
color?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
32
|
+
colorHover?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
33
|
+
colorPress?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
34
|
+
colorFocus?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
35
|
+
borderColor?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
36
|
+
borderColorHover?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
37
|
+
borderColorPress?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
38
|
+
borderColorFocus?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
39
|
+
shadowColor?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
40
|
+
shadowColorHover?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
41
|
+
shadowColorPress?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
42
|
+
shadowColorFocus?: import("./createVariable").Variable<string> | import("./createVariable").Variable<any> | import("./createVariable").Variable<undefined> | undefined;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
export declare const configListeners: Set<ConfigListener>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,
|
|
1
|
+
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,YAgKA"}
|
|
@@ -30,23 +30,23 @@ export declare const useConfiguration: () => {
|
|
|
30
30
|
fontLanguages: string[];
|
|
31
31
|
themes: {
|
|
32
32
|
[x: string]: {
|
|
33
|
-
[x: string]: import("..").Variable<import("..").
|
|
34
|
-
background?: import("..").Variable<import("..").
|
|
35
|
-
backgroundHover?: import("..").Variable<import("..").
|
|
36
|
-
backgroundPress?: import("..").Variable<import("..").
|
|
37
|
-
backgroundFocus?: import("..").Variable<import("..").
|
|
38
|
-
color?: import("..").Variable<import("..").
|
|
39
|
-
colorHover?: import("..").Variable<import("..").
|
|
40
|
-
colorPress?: import("..").Variable<import("..").
|
|
41
|
-
colorFocus?: import("..").Variable<import("..").
|
|
42
|
-
borderColor?: import("..").Variable<import("..").
|
|
43
|
-
borderColorHover?: import("..").Variable<import("..").
|
|
44
|
-
borderColorPress?: import("..").Variable<import("..").
|
|
45
|
-
borderColorFocus?: import("..").Variable<import("..").
|
|
46
|
-
shadowColor?: import("..").Variable<import("..").
|
|
47
|
-
shadowColorHover?: import("..").Variable<import("..").
|
|
48
|
-
shadowColorPress?: import("..").Variable<import("..").
|
|
49
|
-
shadowColorFocus?: import("..").Variable<import("..").
|
|
33
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
34
|
+
background?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
35
|
+
backgroundHover?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
36
|
+
backgroundPress?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
37
|
+
backgroundFocus?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
38
|
+
color?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
39
|
+
colorHover?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
40
|
+
colorPress?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
41
|
+
colorFocus?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
42
|
+
borderColor?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
43
|
+
borderColorHover?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
44
|
+
borderColorPress?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
45
|
+
borderColorFocus?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
46
|
+
shadowColor?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
47
|
+
shadowColorHover?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
48
|
+
shadowColorPress?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
49
|
+
shadowColorFocus?: import("..").Variable<string> | import("..").Variable<any> | import("..").Variable<undefined> | undefined;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
shorthands: import("..").GenericShorthands;
|
|
@@ -72,74 +72,74 @@ export declare const useConfiguration: () => {
|
|
|
72
72
|
};
|
|
73
73
|
tokens: Omit<{
|
|
74
74
|
[x: string]: {
|
|
75
|
-
[x: string]: import("..").Variable<import("..").
|
|
75
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
76
76
|
};
|
|
77
77
|
color: {
|
|
78
|
-
[x: string]: import("..").Variable<import("..").
|
|
78
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
79
79
|
};
|
|
80
80
|
space: {
|
|
81
|
-
[x: string]: import("..").Variable<import("..").
|
|
81
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
82
82
|
};
|
|
83
83
|
size: {
|
|
84
|
-
[x: string]: import("..").Variable<import("..").
|
|
84
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
85
85
|
};
|
|
86
86
|
radius: {
|
|
87
|
-
[x: string]: import("..").Variable<import("..").
|
|
87
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
88
88
|
};
|
|
89
89
|
zIndex: {
|
|
90
|
-
[x: string]: import("..").Variable<import("..").
|
|
90
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
91
91
|
};
|
|
92
92
|
}, "color" | "space" | "size" | "radius" | "zIndex"> & {
|
|
93
93
|
color: {
|
|
94
|
-
[x: string]: import("..").Variable<import("..").
|
|
94
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
95
95
|
};
|
|
96
96
|
space: {
|
|
97
|
-
[x: string]: import("..").Variable<import("..").
|
|
97
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
98
98
|
};
|
|
99
99
|
size: {
|
|
100
|
-
[x: string]: import("..").Variable<import("..").
|
|
100
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
101
101
|
};
|
|
102
102
|
radius: {
|
|
103
|
-
[x: string]: import("..").Variable<import("..").
|
|
103
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
104
104
|
};
|
|
105
105
|
zIndex: {
|
|
106
|
-
[x: string]: import("..").Variable<import("..").
|
|
106
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
tokensParsed: Omit<{
|
|
110
110
|
[x: string]: {
|
|
111
|
-
[x: string]: import("..").Variable<import("..").
|
|
111
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
112
112
|
};
|
|
113
113
|
color: {
|
|
114
|
-
[x: string]: import("..").Variable<import("..").
|
|
114
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
115
115
|
};
|
|
116
116
|
space: {
|
|
117
|
-
[x: string]: import("..").Variable<import("..").
|
|
117
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
118
118
|
};
|
|
119
119
|
size: {
|
|
120
|
-
[x: string]: import("..").Variable<import("..").
|
|
120
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
121
121
|
};
|
|
122
122
|
radius: {
|
|
123
|
-
[x: string]: import("..").Variable<import("..").
|
|
123
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
124
124
|
};
|
|
125
125
|
zIndex: {
|
|
126
|
-
[x: string]: import("..").Variable<import("..").
|
|
126
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
127
127
|
};
|
|
128
128
|
}, "color" | "space" | "size" | "radius" | "zIndex"> & {
|
|
129
129
|
color: {
|
|
130
|
-
[x: string]: import("..").Variable<import("..").
|
|
130
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
131
131
|
};
|
|
132
132
|
space: {
|
|
133
|
-
[x: string]: import("..").Variable<import("..").
|
|
133
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
134
134
|
};
|
|
135
135
|
size: {
|
|
136
|
-
[x: string]: import("..").Variable<import("..").
|
|
136
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
137
137
|
};
|
|
138
138
|
radius: {
|
|
139
|
-
[x: string]: import("..").Variable<import("..").
|
|
139
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
140
140
|
};
|
|
141
141
|
zIndex: {
|
|
142
|
-
[x: string]: import("..").Variable<import("..").
|
|
142
|
+
[x: string]: import("..").Variable<any> | import("..").Variable<string> | import("..").Variable<number> | import("..").Variable<import("..").VariableValGeneric>;
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
themeConfig: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/** internal: this is for tamagui babel plugin usage only */
|
|
3
|
-
export declare const internalWithTheme: (Component: any, styleProvider: any
|
|
3
|
+
export declare const internalWithTheme: (Component: any, styleProvider: any) => (props: any) => JSX.Element;
|
|
4
4
|
//# sourceMappingURL=internalWithTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalWithTheme.d.ts","sourceRoot":"","sources":["../src/internalWithTheme.tsx"],"names":[],"mappings":";AAIA,4DAA4D;AAE5D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"internalWithTheme.d.ts","sourceRoot":"","sources":["../src/internalWithTheme.tsx"],"names":[],"mappings":";AAIA,4DAA4D;AAE5D,eAAO,MAAM,iBAAiB,cAAe,GAAG,iBAAiB,GAAG,gCAMnE,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -207,8 +207,9 @@ type Tokenify<A extends GenericTokens> = Omit<{
|
|
|
207
207
|
zIndex: TokenifyRecord<A['zIndex']>;
|
|
208
208
|
};
|
|
209
209
|
type TokenifyRecord<A extends CreateTokens[keyof CreateTokens]> = {
|
|
210
|
-
[Key in keyof A]:
|
|
210
|
+
[Key in keyof A]: CoerceToVariable<A[Key]>;
|
|
211
211
|
};
|
|
212
|
+
type CoerceToVariable<A> = A extends Variable ? A : Variable<A>;
|
|
212
213
|
export type TamaguiBaseTheme = {
|
|
213
214
|
background: VariableColorVal;
|
|
214
215
|
backgroundHover: VariableColorVal;
|
|
@@ -263,7 +264,7 @@ export type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes
|
|
|
263
264
|
tokens: A;
|
|
264
265
|
themes: {
|
|
265
266
|
[Name in keyof B]: {
|
|
266
|
-
[Key in keyof B[Name]]:
|
|
267
|
+
[Key in keyof B[Name]]: CoerceToVariable<B[Name][Key]>;
|
|
267
268
|
};
|
|
268
269
|
};
|
|
269
270
|
shorthands: C;
|
|
@@ -298,7 +299,7 @@ type GenericThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['theme
|
|
|
298
299
|
export type ThemeDefinition = BaseThemeDefinitions extends never ? GenericThemeDefinition : BaseThemeDefinitions;
|
|
299
300
|
export type ThemeKeys = keyof ThemeDefinition;
|
|
300
301
|
export type ThemeParsed = {
|
|
301
|
-
[key in ThemeKeys]: ThemeDefinition[key]
|
|
302
|
+
[key in ThemeKeys]: CoerceToVariable<ThemeDefinition[key]>;
|
|
302
303
|
};
|
|
303
304
|
export type Tokens = TamaguiConfig['tokens'];
|
|
304
305
|
export type TokensParsed = {
|
|
@@ -712,6 +713,7 @@ export type SpaceValue = number | SpaceTokens | ThemeValueFallback;
|
|
|
712
713
|
type SharedBaseExtraStyleProps = {
|
|
713
714
|
columnGap?: SpaceValue;
|
|
714
715
|
contain?: Properties['contain'];
|
|
716
|
+
touchAction?: Properties['touchAction'];
|
|
715
717
|
cursor?: Properties['cursor'];
|
|
716
718
|
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex';
|
|
717
719
|
gap?: SpaceValue;
|