@tamagui/web 1.122.7 → 1.123.0
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/proxyThemeToParents.cjs +5 -17
- package/dist/cjs/helpers/proxyThemeToParents.js +4 -16
- package/dist/cjs/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js +18 -16
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +2 -2
- package/dist/cjs/hooks/useTheme.cjs +27 -37
- package/dist/cjs/hooks/useTheme.js +29 -48
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useTheme.native.js +48 -65
- package/dist/cjs/hooks/useTheme.native.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.cjs +18 -14
- package/dist/cjs/views/ThemeProvider.js +19 -16
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.native.js +6 -5
- package/dist/cjs/views/ThemeProvider.native.js.map +2 -2
- package/dist/esm/helpers/proxyThemeToParents.js +4 -16
- package/dist/esm/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +5 -17
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +17 -16
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +29 -49
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useTheme.mjs +28 -38
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +49 -66
- package/dist/esm/hooks/useTheme.native.js.map +2 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.js +19 -16
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs +18 -14
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +6 -5
- package/dist/esm/views/ThemeProvider.native.js.map +2 -2
- package/package.json +11 -11
- package/src/helpers/proxyThemeToParents.ts +6 -25
- package/src/hooks/useTheme.tsx +107 -142
- package/src/types.tsx +5 -8
- package/src/views/ThemeProvider.tsx +9 -7
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/sortString.d.ts +1 -1
- package/types/hooks/useConfiguration.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/types.d.ts +5 -5
- package/types/types.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
useContext,
|
|
4
4
|
useEffect,
|
|
5
5
|
useLayoutEffect,
|
|
6
|
-
useMemo,
|
|
7
6
|
useRef,
|
|
8
7
|
useState,
|
|
9
8
|
type MutableRefObject,
|
|
@@ -16,7 +15,6 @@ import { ThemeManager, getHasThemeUpdatingProps } from '../helpers/ThemeManager'
|
|
|
16
15
|
import { ThemeManagerContext } from '../helpers/ThemeManagerContext'
|
|
17
16
|
import { isEqualShallow } from '../helpers/createShallowSetState'
|
|
18
17
|
import type {
|
|
19
|
-
DebugProp,
|
|
20
18
|
ThemeParsed,
|
|
21
19
|
ThemeProps,
|
|
22
20
|
Tokens,
|
|
@@ -72,16 +70,6 @@ export type UseThemeResult = {
|
|
|
72
70
|
[Key in string & {}]?: ThemeGettable<Variable<any>>
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
// not used by anything but its technically more correct type, but its annoying to have in intellisense so leaving it
|
|
76
|
-
// type SimpleTokens = NonSpecificTokens extends `$${infer Token}` ? Token : never
|
|
77
|
-
// export type UseThemeWithTokens = {
|
|
78
|
-
// [Key in keyof ThemeParsed | keyof SimpleTokens]: ThemeGettable<
|
|
79
|
-
// Key extends keyof ThemeParsed
|
|
80
|
-
// ? ThemeParsed[Key]
|
|
81
|
-
// : Variable<ThemeValueGet<`$${Key}`> extends never ? any : ThemeValueGet<`$${Key}`>>
|
|
82
|
-
// >
|
|
83
|
-
// }
|
|
84
|
-
|
|
85
73
|
export const useTheme = (props: ThemeProps = emptyProps) => {
|
|
86
74
|
const [_, theme] = useThemeWithState(props)
|
|
87
75
|
const res = theme
|
|
@@ -92,7 +80,6 @@ export const useThemeWithState = (
|
|
|
92
80
|
props: UseThemeWithStateProps
|
|
93
81
|
): [ChangedThemeResponse, ThemeParsed] => {
|
|
94
82
|
const keys = useRef<string[] | null>(null)
|
|
95
|
-
|
|
96
83
|
const changedThemeState = useChangeThemeEffect(props, false, keys)
|
|
97
84
|
|
|
98
85
|
// @ts-expect-error
|
|
@@ -112,18 +99,7 @@ export const useThemeWithState = (
|
|
|
112
99
|
}
|
|
113
100
|
}
|
|
114
101
|
|
|
115
|
-
const themeProxied =
|
|
116
|
-
// reset keys on new theme
|
|
117
|
-
if (keys.current) {
|
|
118
|
-
keys.current = null
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (!themeManager || !state?.theme) {
|
|
122
|
-
return {}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return getThemeProxied(state, props.deopt, keys, themeManager, props.debug)
|
|
126
|
-
}, [state?.theme, themeManager, props.deopt, props.debug])
|
|
102
|
+
const themeProxied = getThemeProxied(props, state, keys, themeManager)
|
|
127
103
|
|
|
128
104
|
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
129
105
|
console.groupCollapsed(` 🔹 [${themeManager?.id}] useTheme =>`, state?.name)
|
|
@@ -140,141 +116,130 @@ export const useThemeWithState = (
|
|
|
140
116
|
return [changedThemeState, themeProxied]
|
|
141
117
|
}
|
|
142
118
|
|
|
119
|
+
const emptyObject = {}
|
|
120
|
+
|
|
121
|
+
// only proxy each theme one time, after that we know that renders are sync,
|
|
122
|
+
// so we can just change the focus of the proxied theme and it can be re-used
|
|
123
|
+
const ProxiedThemes: Map<ThemeParsed, UseThemeResult> = new Map()
|
|
124
|
+
|
|
125
|
+
let curKeys: MutableRefObject<string[] | null>
|
|
126
|
+
let curProps: UseThemeWithStateProps
|
|
127
|
+
let curThemeManger: ThemeManager
|
|
128
|
+
|
|
143
129
|
function getThemeProxied(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
// underscore to prevent accidental usage below
|
|
131
|
+
_props: UseThemeWithStateProps,
|
|
132
|
+
state: ThemeManagerState | undefined,
|
|
133
|
+
_keys: MutableRefObject<string[] | null>,
|
|
134
|
+
_themeManager?: ThemeManager | null
|
|
149
135
|
): UseThemeResult {
|
|
150
|
-
|
|
136
|
+
const theme = state?.theme
|
|
137
|
+
|
|
138
|
+
if (!theme || !_themeManager) {
|
|
139
|
+
return emptyObject
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
curKeys = _keys
|
|
143
|
+
curProps = _props
|
|
144
|
+
curThemeManger = _themeManager
|
|
145
|
+
|
|
146
|
+
if (ProxiedThemes.has(theme)) {
|
|
147
|
+
const proxied = ProxiedThemes.get(theme)!
|
|
148
|
+
return proxied
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// first time running on this theme, create:
|
|
152
|
+
// from here on only use current*
|
|
153
|
+
|
|
154
|
+
const { name, scheme } = state
|
|
151
155
|
|
|
152
156
|
const config = getConfig()
|
|
153
157
|
|
|
154
158
|
function track(key: string) {
|
|
155
|
-
if (!
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
if (!curKeys) return
|
|
160
|
+
if (!curKeys.current) {
|
|
161
|
+
curKeys.current = []
|
|
158
162
|
// tracking new key for first time, do an update check
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
// console.log('check')
|
|
164
|
+
// setTimeout(() => {
|
|
165
|
+
// curThemeManger?.selfUpdate()
|
|
166
|
+
// })
|
|
162
167
|
}
|
|
163
|
-
|
|
164
|
-
if (process.env.NODE_ENV === 'development' && debug) {
|
|
168
|
+
curKeys.current.push(key)
|
|
169
|
+
if (process.env.NODE_ENV === 'development' && curProps.debug) {
|
|
165
170
|
console.info(` 🎨 useTheme() tracking new key: ${key}`)
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
173
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
// always track .val
|
|
206
|
-
track(keyString)
|
|
207
|
-
}
|
|
208
|
-
} else if (subkey === 'get') {
|
|
209
|
-
return (platform?: 'web') => {
|
|
210
|
-
const outVal = getVariable(val)
|
|
211
|
-
|
|
212
|
-
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
213
|
-
// ios can avoid re-rendering in some cases when we are using a root light/dark
|
|
214
|
-
// disabled in cases where we have animations
|
|
215
|
-
if (
|
|
216
|
-
platform !== 'web' &&
|
|
217
|
-
isIos &&
|
|
218
|
-
!deopt &&
|
|
219
|
-
getSetting('fastSchemeChange') &&
|
|
220
|
-
!shouldDeoptDueToParentScheme(themeManager)
|
|
221
|
-
) {
|
|
222
|
-
if (scheme) {
|
|
223
|
-
const oppositeScheme = scheme === 'dark' ? 'light' : 'dark'
|
|
224
|
-
const oppositeName = name.replace(scheme, oppositeScheme)
|
|
225
|
-
const color = getVariable(config.themes[name]?.[keyString])
|
|
226
|
-
const oppositeColor = getVariable(
|
|
227
|
-
config.themes[oppositeName]?.[keyString]
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
const dynamicVal = {
|
|
231
|
-
dynamic: {
|
|
232
|
-
[scheme]: color,
|
|
233
|
-
[oppositeScheme]: oppositeColor,
|
|
234
|
-
},
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return dynamicVal
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (process.env.NODE_ENV === 'development' && debug) {
|
|
242
|
-
console.info(` 🎨 useTheme() tracking new key because of:
|
|
243
|
-
not web: ${platform !== 'web'}
|
|
244
|
-
isIOS: ${isIos}
|
|
245
|
-
deopt: ${deopt}
|
|
246
|
-
fastScheme: ${getSetting('fastSchemeChange')}
|
|
247
|
-
inversed: ${getIsInversed(themeManager)}
|
|
248
|
-
`)
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
track(keyString)
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return outVal
|
|
174
|
+
const proxied = Object.fromEntries(
|
|
175
|
+
Object.entries(theme).flatMap(([key, value]) => {
|
|
176
|
+
const proxied = {
|
|
177
|
+
...value,
|
|
178
|
+
get val() {
|
|
179
|
+
// when they touch the actual value we only track it if its a variable (web), its ignored!
|
|
180
|
+
if (!globalThis.tamaguiAvoidTracking) {
|
|
181
|
+
// always track .val
|
|
182
|
+
track(key)
|
|
183
|
+
}
|
|
184
|
+
return value.val
|
|
185
|
+
},
|
|
186
|
+
get(platform?: 'web') {
|
|
187
|
+
const outVal = getVariable(value)
|
|
188
|
+
|
|
189
|
+
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
190
|
+
// ios can avoid re-rendering in some cases when we are using a root light/dark
|
|
191
|
+
// disabled in cases where we have animations
|
|
192
|
+
if (
|
|
193
|
+
platform !== 'web' &&
|
|
194
|
+
isIos &&
|
|
195
|
+
!curProps.deopt &&
|
|
196
|
+
getSetting('fastSchemeChange') &&
|
|
197
|
+
!shouldDeoptDueToParentScheme(curThemeManger)
|
|
198
|
+
) {
|
|
199
|
+
if (scheme) {
|
|
200
|
+
const oppositeScheme = scheme === 'dark' ? 'light' : 'dark'
|
|
201
|
+
const oppositeName = name.replace(scheme, oppositeScheme)
|
|
202
|
+
const color = getVariable(config.themes[name]?.[key])
|
|
203
|
+
const oppositeColor = getVariable(config.themes[oppositeName]?.[key])
|
|
204
|
+
|
|
205
|
+
const dynamicVal = {
|
|
206
|
+
dynamic: {
|
|
207
|
+
[scheme]: color,
|
|
208
|
+
[oppositeScheme]: oppositeColor,
|
|
209
|
+
},
|
|
255
210
|
}
|
|
211
|
+
|
|
212
|
+
return dynamicVal
|
|
256
213
|
}
|
|
214
|
+
}
|
|
257
215
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
216
|
+
if (process.env.NODE_ENV === 'development' && curProps.debug) {
|
|
217
|
+
console.info(` 🎨 useTheme() tracking new key because of:
|
|
218
|
+
not web: ${platform !== 'web'}
|
|
219
|
+
isIOS: ${isIos}
|
|
220
|
+
deopt: ${curProps.deopt}
|
|
221
|
+
fastScheme: ${getSetting('fastSchemeChange')}
|
|
222
|
+
inversed: ${getIsInversed(curThemeManger)}
|
|
223
|
+
`)
|
|
224
|
+
}
|
|
262
225
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
`[tamagui] No theme key "${key}" found in theme ${name}. \n Keys in theme: ${Object.keys(
|
|
269
|
-
theme
|
|
270
|
-
).join(', ')}`
|
|
271
|
-
)
|
|
272
|
-
}
|
|
226
|
+
track(key)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return outVal
|
|
230
|
+
},
|
|
273
231
|
}
|
|
274
232
|
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
|
|
233
|
+
return [
|
|
234
|
+
[key, proxied],
|
|
235
|
+
[`$${key}`, proxied],
|
|
236
|
+
]
|
|
237
|
+
})
|
|
238
|
+
) as UseThemeResult
|
|
239
|
+
|
|
240
|
+
ProxiedThemes.set(theme, proxied)
|
|
241
|
+
|
|
242
|
+
return proxied
|
|
278
243
|
}
|
|
279
244
|
|
|
280
245
|
// to tell if we are inversing the scheme anywhere in the tree, if so we need to de-opt
|
package/src/types.tsx
CHANGED
|
@@ -12,25 +12,22 @@ import type {
|
|
|
12
12
|
} from 'react'
|
|
13
13
|
import type {
|
|
14
14
|
Text as RNText,
|
|
15
|
-
TextProps as ReactTextProps,
|
|
16
15
|
TextStyle as RNTextStyle,
|
|
16
|
+
TextProps as ReactTextProps,
|
|
17
17
|
View,
|
|
18
18
|
ViewProps,
|
|
19
19
|
ViewStyle,
|
|
20
20
|
} from 'react-native'
|
|
21
|
-
|
|
22
21
|
import type { Variable } from './createVariable'
|
|
23
22
|
import type { StyledContext } from './helpers/createStyledContext'
|
|
24
23
|
import type { CSSColorNames } from './interfaces/CSSColorNames'
|
|
24
|
+
import type { ColorKeys, SizeKeys, SpaceKeys } from './interfaces/KeyTypes'
|
|
25
25
|
import type { RNOnlyProps } from './interfaces/RNExclusiveTypes'
|
|
26
|
-
import type {
|
|
27
|
-
import type { ThemeProviderProps } from './views/ThemeProvider'
|
|
26
|
+
import type { TamaguiComponentPropsBaseBase } from './interfaces/TamaguiComponentPropsBaseBase'
|
|
28
27
|
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
29
28
|
import type { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
30
|
-
import type {
|
|
31
|
-
import type {
|
|
32
|
-
import { styled } from './styled'
|
|
33
|
-
import { Text } from './views/Text'
|
|
29
|
+
import type { LanguageContextType } from './views/FontLanguage.types'
|
|
30
|
+
import type { ThemeProviderProps } from './views/ThemeProvider'
|
|
34
31
|
|
|
35
32
|
export * from './interfaces/KeyTypes'
|
|
36
33
|
export * from './interfaces/TamaguiComponentState'
|
|
@@ -17,20 +17,22 @@ export type ThemeProviderProps = {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const ThemeProvider = (props: ThemeProviderProps) => {
|
|
20
|
+
const disableRootThemeClass =
|
|
21
|
+
props.disableRootThemeClass ?? getSetting('disableRootThemeClass')
|
|
22
|
+
const themeClassNameOnRoot =
|
|
23
|
+
props.themeClassNameOnRoot ?? getSetting('themeClassNameOnRoot')
|
|
24
|
+
|
|
20
25
|
// ensure theme is attached to root body node as well to work with modals by default
|
|
21
26
|
if (isClient) {
|
|
22
27
|
React.useLayoutEffect(() => {
|
|
23
|
-
if (
|
|
28
|
+
if (disableRootThemeClass) return
|
|
24
29
|
const cn = `${THEME_CLASSNAME_PREFIX}${props.defaultTheme}`
|
|
25
|
-
const target =
|
|
26
|
-
(props.themeClassNameOnRoot ?? getSetting('themeClassNameOnRoot'))
|
|
27
|
-
? document.documentElement
|
|
28
|
-
: document.body
|
|
30
|
+
const target = themeClassNameOnRoot ? document.documentElement : document.body
|
|
29
31
|
target.classList.add(cn)
|
|
30
32
|
return () => {
|
|
31
33
|
target.classList.remove(cn)
|
|
32
34
|
}
|
|
33
|
-
}, [props.defaultTheme,
|
|
35
|
+
}, [props.defaultTheme, disableRootThemeClass, themeClassNameOnRoot])
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
return (
|
|
@@ -38,7 +40,7 @@ export const ThemeProvider = (props: ThemeProviderProps) => {
|
|
|
38
40
|
className={props.className}
|
|
39
41
|
name={props.defaultTheme}
|
|
40
42
|
// if root class disabled, force class here
|
|
41
|
-
forceClassName={!
|
|
43
|
+
forceClassName={!disableRootThemeClass && !themeClassNameOnRoot}
|
|
42
44
|
// @ts-expect-error
|
|
43
45
|
_isRoot
|
|
44
46
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DedupedThemes, ThemeParsed } from '../types';
|
|
2
2
|
export declare function proxyThemesToParents(dedupedThemes: DedupedThemes): Record<string, ThemeParsed>;
|
|
3
|
-
export declare function proxyThemeToParents(themeName: string, theme: ThemeParsed):
|
|
3
|
+
export declare function proxyThemeToParents(themeName: string, theme: ThemeParsed): {};
|
|
4
4
|
//# sourceMappingURL=proxyThemeToParents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1D,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAsB7B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,MAmBxE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const sortString: (a: string, b: string) =>
|
|
1
|
+
export declare const sortString: (a: string, b: string) => 1 | 0 | -1;
|
|
2
2
|
//# sourceMappingURL=sortString.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfiguration.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfiguration.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;+
|
|
1
|
+
{"version":3,"file":"useConfiguration.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfiguration.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;+BAU0oE,CAAC;;;;;uBAAipjB,CAAC;aAAe,CAAC;;;;aAAo+B,CAAC;YAAqB,CAAC;cAAsB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD31pB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,YAAY,EAA4B,MAAM,yBAAyB,CAAA;AAGhF,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAClC,UAAU,EAAE,OAAO,CAAA;IAGnB,QAAQ,CAAC,EAAE,IAAI,GAAG,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAID,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI,GAAG,GAAG;IACrC;;;;;;;;;OASG;IACH,GAAG,EAAE,CACH,QAAQ,CAAC,EAAE,KAAK,KAEd,MAAM,GACN,CAAC,GAAG,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,GAC1B,CAAC,SAAS,kBAAkB,GAC1B,GAAG,GACH,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,GACtB,GAAG,SAAS,WAAW,GACrB,MAAM,GAAG,MAAM,GACf,OAAO,CAAC,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;KAC1B,GAAG,IAAI,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,aAAa,CAC/D,GAAG,SAAS,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CACjE;CACF,GAAG;KAED,GAAG,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CACpD,CAAA;AAED,eAAO,MAAM,QAAQ,WAAW,UAAU,KAG1B,cACf,CAAA;AAED,eAAO,MAAM,iBAAiB,UACrB,sBAAsB,KAC5B,CAAC,oBAAoB,EAAE,WAAW,CAoCpC,CAAA;AAmJD,eAAO,MAAM,mBAAmB,mBAA0B,CAAA;AAO1D,eAAO,MAAM,eAAe,OAAQ,MAAM,6BAEzC,CAAA;AAiDD,eAAO,MAAM,oBAAoB,UACxB,sBAAsB,2BAEtB,gBAAgB,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KACvC,oBAqUF,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { StyleObject } from '@tamagui/helpers';
|
|
2
2
|
import type { Properties } from 'csstype';
|
|
3
3
|
import type { CSSProperties, ComponentType, ForwardRefExoticComponent, FunctionComponent, HTMLAttributes, ReactNode, RefAttributes, RefObject } from 'react';
|
|
4
|
-
import type { Text as RNText,
|
|
4
|
+
import type { Text as RNText, TextStyle as RNTextStyle, TextProps as ReactTextProps, View, ViewProps, ViewStyle } from 'react-native';
|
|
5
5
|
import type { Variable } from './createVariable';
|
|
6
6
|
import type { StyledContext } from './helpers/createStyledContext';
|
|
7
7
|
import type { CSSColorNames } from './interfaces/CSSColorNames';
|
|
8
|
+
import type { ColorKeys, SizeKeys, SpaceKeys } from './interfaces/KeyTypes';
|
|
8
9
|
import type { RNOnlyProps } from './interfaces/RNExclusiveTypes';
|
|
9
|
-
import type {
|
|
10
|
-
import type { ThemeProviderProps } from './views/ThemeProvider';
|
|
10
|
+
import type { TamaguiComponentPropsBaseBase } from './interfaces/TamaguiComponentPropsBaseBase';
|
|
11
11
|
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState';
|
|
12
12
|
import type { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents';
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
13
|
+
import type { LanguageContextType } from './views/FontLanguage.types';
|
|
14
|
+
import type { ThemeProviderProps } from './views/ThemeProvider';
|
|
15
15
|
export * from './interfaces/KeyTypes';
|
|
16
16
|
export * from './interfaces/TamaguiComponentState';
|
|
17
17
|
export type { MediaStyleObject, StyleObject } from '@tamagui/helpers';
|