@tamagui/web 1.41.0 → 1.42.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/createComponent.js +5 -2
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.js +63 -23
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +43 -7
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +19 -7
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useStyle.js +2 -2
- package/dist/cjs/hooks/useStyle.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +34 -29
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/styled.js.map +1 -1
- package/dist/esm/createComponent.js +5 -2
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +63 -23
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +44 -7
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +19 -7
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useStyle.js +3 -3
- package/dist/esm/hooks/useStyle.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +34 -29
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/styled.js.map +1 -1
- package/package.json +9 -9
- package/src/createComponent.tsx +8 -3
- package/src/helpers/createMediaStyle.ts +76 -28
- package/src/helpers/getSplitStyles.tsx +54 -7
- package/src/hooks/useMedia.tsx +30 -7
- package/src/hooks/useStyle.tsx +3 -3
- package/src/hooks/useTheme.tsx +37 -41
- package/src/styled.tsx +3 -4
- package/src/types.tsx +23 -3
- package/types/createComponent.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/getSplitStyles.d.ts +4 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +2 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/hooks/useTheme.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 +15 -2
- package/types/types.d.ts.map +1 -1
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { useMemo, useSyncExternalStore } from 'react'
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
5
|
import { createProxy } from '../helpers/createProxy'
|
|
6
6
|
import { matchMedia } from '../helpers/matchMedia'
|
|
7
|
+
import { pseudoDescriptors } from '../helpers/pseudoDescriptors'
|
|
7
8
|
import type {
|
|
8
9
|
MediaQueries,
|
|
9
10
|
MediaQueryKey,
|
|
@@ -37,7 +38,8 @@ export let mediaState: MediaQueryState =
|
|
|
37
38
|
export const mediaQueryConfig: MediaQueries = {}
|
|
38
39
|
export const getMedia = () => mediaState
|
|
39
40
|
export const mediaKeys = new Set<string>() // with $ prefix
|
|
40
|
-
export const isMediaKey = (key: string) =>
|
|
41
|
+
export const isMediaKey = (key: string) =>
|
|
42
|
+
mediaKeys.has(key) || key.startsWith('$platform-') || key.startsWith('$theme-')
|
|
41
43
|
|
|
42
44
|
// for SSR capture it at time of startup
|
|
43
45
|
let initState: MediaQueryState
|
|
@@ -45,11 +47,21 @@ export const getInitialMediaState = () => {
|
|
|
45
47
|
return (getConfig().disableSSR ? mediaState : initState) || {}
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
// media always above pseudos
|
|
51
|
+
const defaultMediaImportance = Object.keys(pseudoDescriptors).length
|
|
52
|
+
|
|
48
53
|
let mediaKeysOrdered: string[]
|
|
54
|
+
|
|
49
55
|
export const getMediaKeyImportance = (key: string) => {
|
|
50
56
|
if (process.env.NODE_ENV === 'development' && key[0] === '$') {
|
|
51
57
|
throw new Error('use short key')
|
|
52
58
|
}
|
|
59
|
+
|
|
60
|
+
const conf = getConfig()
|
|
61
|
+
if (conf.settings.mediaPropOrder) {
|
|
62
|
+
return defaultMediaImportance
|
|
63
|
+
}
|
|
64
|
+
|
|
53
65
|
// + 100 because we set base usedKeys=1, psuedos are 2-N (however many we have)
|
|
54
66
|
// all media go above all pseudos so we need to pad it based on that
|
|
55
67
|
// right now theres 5 pseudos but in the future could be a few more
|
|
@@ -253,14 +265,14 @@ export function useMediaPropsActive<A extends Object>(
|
|
|
253
265
|
if (shouldExpandShorthands) {
|
|
254
266
|
subKey = config.shorthands[subKey] || subKey
|
|
255
267
|
}
|
|
256
|
-
mergeMediaByImportance(next, mediaKey, subKey, value, importancesUsed)
|
|
268
|
+
mergeMediaByImportance(next, mediaKey, subKey, value, importancesUsed, true)
|
|
257
269
|
}
|
|
258
270
|
}
|
|
259
271
|
} else {
|
|
260
272
|
if (shouldExpandShorthands) {
|
|
261
273
|
key = config.shorthands[key] || key
|
|
262
274
|
}
|
|
263
|
-
mergeMediaByImportance(next, '', key, val, importancesUsed)
|
|
275
|
+
mergeMediaByImportance(next, '', key, val, importancesUsed, true)
|
|
264
276
|
}
|
|
265
277
|
}
|
|
266
278
|
|
|
@@ -271,9 +283,14 @@ export function useMediaPropsActive<A extends Object>(
|
|
|
271
283
|
export const getMediaImportanceIfMoreImportant = (
|
|
272
284
|
mediaKey: string,
|
|
273
285
|
key: string,
|
|
274
|
-
importancesUsed: Record<string, number
|
|
286
|
+
importancesUsed: Record<string, number>,
|
|
287
|
+
isSizeMedia: boolean
|
|
275
288
|
) => {
|
|
276
|
-
const
|
|
289
|
+
const conf = getConfig()
|
|
290
|
+
const importance =
|
|
291
|
+
isSizeMedia && !conf.settings.mediaPropOrder
|
|
292
|
+
? getMediaKeyImportance(mediaKey)
|
|
293
|
+
: defaultMediaImportance
|
|
277
294
|
return !importancesUsed[key] || importance > importancesUsed[key] ? importance : null
|
|
278
295
|
}
|
|
279
296
|
|
|
@@ -282,9 +299,15 @@ export function mergeMediaByImportance(
|
|
|
282
299
|
mediaKey: string,
|
|
283
300
|
key: string,
|
|
284
301
|
value: any,
|
|
285
|
-
importancesUsed: Record<string, number
|
|
302
|
+
importancesUsed: Record<string, number>,
|
|
303
|
+
isSizeMedia: boolean
|
|
286
304
|
) {
|
|
287
|
-
const importance = getMediaImportanceIfMoreImportant(
|
|
305
|
+
const importance = getMediaImportanceIfMoreImportant(
|
|
306
|
+
mediaKey,
|
|
307
|
+
key,
|
|
308
|
+
importancesUsed,
|
|
309
|
+
isSizeMedia
|
|
310
|
+
)
|
|
288
311
|
if (importance === null) {
|
|
289
312
|
return false
|
|
290
313
|
}
|
package/src/hooks/useStyle.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TextNonStyleProps,
|
|
13
13
|
} from '../types'
|
|
14
14
|
import { useMedia } from './useMedia'
|
|
15
|
-
import {
|
|
15
|
+
import { useThemeWithState } from './useTheme'
|
|
16
16
|
|
|
17
17
|
export function useStyle<
|
|
18
18
|
Component extends TamaguiComponent,
|
|
@@ -25,12 +25,12 @@ export function useStyle<
|
|
|
25
25
|
const isText = base.staticConfig.isText
|
|
26
26
|
const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false)
|
|
27
27
|
const languageContext = isRSC ? null : useContext(FontLanguageContext)
|
|
28
|
-
const
|
|
28
|
+
const themeState = useThemeWithState({})
|
|
29
29
|
const media = useMedia()
|
|
30
30
|
const out = useSplitStyles(
|
|
31
31
|
style as any,
|
|
32
32
|
base.staticConfig,
|
|
33
|
-
|
|
33
|
+
themeState!,
|
|
34
34
|
{
|
|
35
35
|
...(options as any),
|
|
36
36
|
mediaState: media,
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -61,7 +61,7 @@ export const useThemeWithState = (props: ThemeProps) => {
|
|
|
61
61
|
keys.current,
|
|
62
62
|
isClient
|
|
63
63
|
? () => {
|
|
64
|
-
return props.shouldUpdate?.() ?? keys.current.length
|
|
64
|
+
return props.shouldUpdate?.() ?? (keys.current.length > 0 ? true : undefined)
|
|
65
65
|
}
|
|
66
66
|
: undefined
|
|
67
67
|
)
|
|
@@ -120,40 +120,32 @@ export function getThemeProxied(
|
|
|
120
120
|
if (key === GetThemeUnwrapped) {
|
|
121
121
|
return theme
|
|
122
122
|
}
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
key === '$
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
keys.push(keyString)
|
|
147
|
-
}
|
|
148
|
-
if (subkey === 'get') {
|
|
149
|
-
return () => getVariable(val)
|
|
150
|
-
}
|
|
151
|
-
return Reflect.get(val as any, subkey)
|
|
152
|
-
},
|
|
153
|
-
})
|
|
123
|
+
if (typeof key === 'string' && keys) {
|
|
124
|
+
// auto convert variables to plain
|
|
125
|
+
const keyString = key[0] === '$' ? key.slice(1) : key
|
|
126
|
+
const val = themeManager!.getValue(keyString)
|
|
127
|
+
if (val && typeof val === 'object') {
|
|
128
|
+
return new Proxy(val as any, {
|
|
129
|
+
// when they touch the actual value we only track it
|
|
130
|
+
// if its a variable (web), its ignored!
|
|
131
|
+
get(_, subkey) {
|
|
132
|
+
// trigger read key that makes it track updates
|
|
133
|
+
if (
|
|
134
|
+
(subkey === 'val' || (subkey === 'get' && !isWeb)) &&
|
|
135
|
+
!keys.includes(keyString)
|
|
136
|
+
) {
|
|
137
|
+
keys.push(keyString)
|
|
138
|
+
}
|
|
139
|
+
if (subkey === 'get') {
|
|
140
|
+
return () => getVariable(val)
|
|
141
|
+
}
|
|
142
|
+
return Reflect.get(val as any, subkey)
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
}
|
|
154
146
|
}
|
|
155
147
|
|
|
156
|
-
return
|
|
148
|
+
return Reflect.get(_, key)
|
|
157
149
|
},
|
|
158
150
|
}) as UseThemeResult
|
|
159
151
|
}
|
|
@@ -164,7 +156,7 @@ export const useChangeThemeEffect = (
|
|
|
164
156
|
props: ThemeProps,
|
|
165
157
|
root = false,
|
|
166
158
|
keys?: string[],
|
|
167
|
-
|
|
159
|
+
shouldUpdate?: () => boolean | undefined
|
|
168
160
|
): ChangedThemeResponse => {
|
|
169
161
|
if (isRSC) {
|
|
170
162
|
// we need context working for this to work well
|
|
@@ -203,11 +195,14 @@ export const useChangeThemeEffect = (
|
|
|
203
195
|
prevState: ThemeManagerState = state,
|
|
204
196
|
forceShouldChange = false
|
|
205
197
|
) {
|
|
198
|
+
if (forceShouldChange) return
|
|
199
|
+
const forceUpdate = shouldUpdate?.()
|
|
200
|
+
if (forceUpdate === false) return
|
|
206
201
|
const next = nextState || manager.getState(props, parentManager)
|
|
207
|
-
// if (props.inverse) return true
|
|
208
202
|
if (!next) return
|
|
209
|
-
if (
|
|
210
|
-
|
|
203
|
+
if (forceUpdate !== true) {
|
|
204
|
+
if (!manager.getStateShouldChange(next, prevState)) return
|
|
205
|
+
}
|
|
211
206
|
return next
|
|
212
207
|
}
|
|
213
208
|
|
|
@@ -251,13 +246,14 @@ export const useChangeThemeEffect = (
|
|
|
251
246
|
})
|
|
252
247
|
|
|
253
248
|
const disposeChangeListener = parentManager?.onChangeTheme((name, manager) => {
|
|
254
|
-
const
|
|
249
|
+
const force = shouldUpdate?.()
|
|
250
|
+
const doUpdate = force ?? Boolean(keys?.length || isNewTheme)
|
|
255
251
|
if (process.env.NODE_ENV === 'development' && props.debug) {
|
|
256
|
-
const logs = {
|
|
252
|
+
const logs = { force, doUpdate, props, name, manager, keys }
|
|
257
253
|
// rome-ignore lint/nursery/noConsoleLog: <explanation>
|
|
258
254
|
console.log(` 🔸 onChange`, themeManager.id, logs)
|
|
259
255
|
}
|
|
260
|
-
if (
|
|
256
|
+
if (doUpdate) {
|
|
261
257
|
setThemeState(createState)
|
|
262
258
|
}
|
|
263
259
|
}, themeManager.id)
|
|
@@ -305,7 +301,7 @@ export const useChangeThemeEffect = (
|
|
|
305
301
|
}
|
|
306
302
|
|
|
307
303
|
function createState(prev?: State, force = false): State {
|
|
308
|
-
if (prev &&
|
|
304
|
+
if (prev && shouldUpdate?.() === false) {
|
|
309
305
|
return prev
|
|
310
306
|
}
|
|
311
307
|
|
package/src/styled.tsx
CHANGED
|
@@ -187,16 +187,15 @@ export function styled<
|
|
|
187
187
|
type OurVariantProps = Variants extends void ? {} : GetVariantAcceptedValues<Variants>
|
|
188
188
|
|
|
189
189
|
type VariantProps = Omit<ParentVariants, keyof OurVariantProps> & OurVariantProps
|
|
190
|
-
type
|
|
190
|
+
type OurPropsBaseBase = ParentPropsBase & VariantProps
|
|
191
|
+
type OurPropsBase = OurPropsBaseBase & PseudoProps<Partial<OurPropsBaseBase>>
|
|
191
192
|
|
|
192
193
|
type Props = Variants extends void
|
|
193
194
|
? GetProps<ParentComponent>
|
|
194
195
|
: // start with base props
|
|
195
196
|
OurPropsBase &
|
|
196
197
|
// add in media (+ pseudos nested)
|
|
197
|
-
MediaProps<Partial<OurPropsBase>>
|
|
198
|
-
// add in pseudos
|
|
199
|
-
PseudoProps<Partial<OurPropsBase>>
|
|
198
|
+
MediaProps<Partial<OurPropsBase>>
|
|
200
199
|
|
|
201
200
|
type ParentStaticProperties = {
|
|
202
201
|
[Key in Exclude<
|
package/src/types.tsx
CHANGED
|
@@ -454,8 +454,8 @@ export interface ThemeProps {
|
|
|
454
454
|
inverse?: boolean
|
|
455
455
|
// on the web, for portals we need to re-insert className
|
|
456
456
|
forceClassName?: boolean
|
|
457
|
-
// allows for
|
|
458
|
-
shouldUpdate?: () => boolean
|
|
457
|
+
// allows for forcing the auto-update behavior
|
|
458
|
+
shouldUpdate?: () => boolean | undefined
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
type ArrayIntersection<A extends any[]> = A[keyof A]
|
|
@@ -533,6 +533,16 @@ type GenericTamaguiSettings = {
|
|
|
533
533
|
* @default except-special
|
|
534
534
|
*/
|
|
535
535
|
autocompleteSpecificTokens?: AutocompleteSpecificTokensSetting
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Will change the behavior of media styles. By default they have a fixed specificity: they
|
|
539
|
+
* always override any $theme- or $platform- styles. With this enabled, media styles will have
|
|
540
|
+
* the same precedence as the theme and platform styles, meaning that the order of the props
|
|
541
|
+
* determines if they override.
|
|
542
|
+
*
|
|
543
|
+
* @default false
|
|
544
|
+
*/
|
|
545
|
+
mediaPropOrder?: boolean
|
|
536
546
|
}
|
|
537
547
|
|
|
538
548
|
export type TamaguiSettings = TamaguiConfig['settings']
|
|
@@ -685,9 +695,16 @@ export type MediaQueryObject = { [key: string]: string | number | string }
|
|
|
685
695
|
export type MediaQueryKey = keyof Media
|
|
686
696
|
export type MediaPropKeys = `$${MediaQueryKey}`
|
|
687
697
|
export type MediaQueryState = { [key in MediaQueryKey]: boolean }
|
|
698
|
+
|
|
699
|
+
export type ThemeMediaKeys<TK extends keyof Themes = keyof Themes> =
|
|
700
|
+
`$theme-${TK extends `${string}_${string}` ? never : TK}`
|
|
701
|
+
|
|
702
|
+
export type PlatformMediaKeys = `$platform-${AllPlatforms}`
|
|
703
|
+
|
|
688
704
|
export type MediaProps<A> = {
|
|
689
|
-
[key in MediaPropKeys]?: A
|
|
705
|
+
[key in MediaPropKeys | ThemeMediaKeys | PlatformMediaKeys]?: A
|
|
690
706
|
}
|
|
707
|
+
|
|
691
708
|
export type MediaQueries = {
|
|
692
709
|
[key in MediaQueryKey]: MediaQueryObject
|
|
693
710
|
}
|
|
@@ -1081,6 +1098,8 @@ export type PseudoStyles = {
|
|
|
1081
1098
|
exitStyle?: ViewStyle
|
|
1082
1099
|
}
|
|
1083
1100
|
|
|
1101
|
+
export type AllPlatforms = 'web' | 'native' | 'android' | 'ios'
|
|
1102
|
+
|
|
1084
1103
|
//
|
|
1085
1104
|
// add both theme and shorthands
|
|
1086
1105
|
//
|
|
@@ -1976,6 +1995,7 @@ export type GetStyleResult = {
|
|
|
1976
1995
|
fontFamily: string | undefined
|
|
1977
1996
|
space?: any // SpaceTokens?
|
|
1978
1997
|
hasMedia: boolean | string[]
|
|
1998
|
+
dynamicThemeAccess?: boolean
|
|
1979
1999
|
}
|
|
1980
2000
|
|
|
1981
2001
|
export type ClassNamesObject = Record<string, string>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AASA,OAAO,KAWN,MAAM,OAAO,CAAA;AAkBd,OAAO,EACL,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,cAAc,EAIf,MAAM,SAAS,CAAA;AAoBhB,eAAO,MAAM,qBAAqB,EAAE,qBAMnC,CAAA;AAmBD,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAqB3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AASA,OAAO,KAWN,MAAM,OAAO,CAAA;AAkBd,OAAO,EACL,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,cAAc,EAIf,MAAM,SAAS,CAAA;AAoBhB,eAAO,MAAM,qBAAqB,EAAE,qBAMnC,CAAA;AAmBD,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAqB3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,4DAi2B3D;AAGD,eAAO,MAAM,QAAQ;YAAW;QAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE;;CAAmB,CAAA;AAMrE,eAAO,MAAM,MAAM,0DA8CjB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAkGxD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { MediaQueries, MediaStyleObject, StyleObject } from '../types';
|
|
2
2
|
export declare const MEDIA_SEP = "_";
|
|
3
|
-
export declare const createMediaStyle: ({ property, identifier, rules }: StyleObject, mediaKey: string, mediaQueries: MediaQueries, negate?: boolean) => MediaStyleObject;
|
|
3
|
+
export declare const createMediaStyle: ({ property, identifier, rules }: StyleObject, mediaKey: string, mediaQueries: MediaQueries, negate?: boolean, priority?: number) => MediaStyleObject;
|
|
4
4
|
//# sourceMappingURL=createMediaStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMediaStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/createMediaStyle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMediaStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/createMediaStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3E,eAAO,MAAM,SAAS,MAAM,CAAA;AAK5B,eAAO,MAAM,gBAAgB,oCACM,WAAW,YAClC,MAAM,gBACF,YAAY,WACjB,OAAO,aACL,MAAM,KAChB,gBAoFF,CAAA"}
|
|
@@ -18,7 +18,10 @@ export type SplitStyles = ReturnType<typeof getSplitStyles>;
|
|
|
18
18
|
export type SplitStyleResult = ReturnType<typeof getSplitStyles>;
|
|
19
19
|
type StyleSplitter = (props: {
|
|
20
20
|
[key: string]: any;
|
|
21
|
-
}, staticConfig: StaticConfigParsed,
|
|
21
|
+
}, staticConfig: StaticConfigParsed, themeState: {
|
|
22
|
+
theme: ThemeParsed;
|
|
23
|
+
name: string;
|
|
24
|
+
}, state: SplitStyleState, parentSplitStyles?: GetStyleResult | null, languageContext?: LanguageContextType, elementType?: string, debug?: DebugProp) => GetStyleResult;
|
|
22
25
|
export declare const PROP_SPLIT = "-";
|
|
23
26
|
export declare const getSplitStyles: StyleSplitter;
|
|
24
27
|
export declare const getSubStyle: (styleState: GetStyleState, subKey: string, styleIn: Object, fontFamily?: string, avoidDefaultProps?: boolean, avoidMergeTransform?: boolean) => TextStyleProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,cAAc,EAMd,eAAe,EACf,kBAAkB,EAElB,qBAAqB,EACrB,cAAc,EACd,WAAW,EAEZ,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE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WACL,MAAM,eACF,MAAM,sBACC,OAAO,wBACL,OAAO,KAC5B,cAgCF,CAAA;AAOD,eAAO,MAAM,cAAc,EAAE,aAU5B,CAAA;AA6BD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA"}
|
|
@@ -33,8 +33,8 @@ export declare function useMediaPropsActive<A extends Object>(props: A, opts?: {
|
|
|
33
33
|
}): {
|
|
34
34
|
[Key in keyof A extends `$${string}` ? never : keyof A]?: A[Key];
|
|
35
35
|
};
|
|
36
|
-
export declare const getMediaImportanceIfMoreImportant: (mediaKey: string, key: string, importancesUsed: Record<string, number
|
|
37
|
-
export declare function mergeMediaByImportance(onto: Record<string, any>, mediaKey: string, key: string, value: any, importancesUsed: Record<string, number
|
|
36
|
+
export declare const getMediaImportanceIfMoreImportant: (mediaKey: string, key: string, importancesUsed: Record<string, number>, isSizeMedia: boolean) => number | null;
|
|
37
|
+
export declare function mergeMediaByImportance(onto: Record<string, any>, mediaKey: string, key: string, value: any, importancesUsed: Record<string, number>, isSizeMedia: boolean): boolean;
|
|
38
38
|
export declare function mediaObjectToString(query: string | MediaQueryObject): string;
|
|
39
39
|
export {};
|
|
40
40
|
//# sourceMappingURL=useMedia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACtB,MAAM,UAAU,CAAA;AAGjB,eAAO,IAAI,UAAU,EAAE,eAmBN,CAAA;AAEjB,eAAO,MAAM,gBAAgB,EAAE,YAAiB,CAAA;AAChD,eAAO,MAAM,QAAQ,uBAAmB,CAAA;AACxC,eAAO,MAAM,SAAS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M,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,WAAW,EAAE,OAAO,WAcrB;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,UAgBnE"}
|
|
@@ -24,6 +24,6 @@ export declare function getThemeProxied({ theme, themeManager, }: Partial<Change
|
|
|
24
24
|
theme: ThemeParsed;
|
|
25
25
|
}, keys?: string[]): UseThemeResult;
|
|
26
26
|
export declare const activeThemeManagers: Set<ThemeManager>;
|
|
27
|
-
export declare const useChangeThemeEffect: (props: ThemeProps, root?: boolean, keys?: string[],
|
|
27
|
+
export declare const useChangeThemeEffect: (props: ThemeProps, root?: boolean, keys?: string[], shouldUpdate?: () => boolean | undefined) => ChangedThemeResponse;
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EAGb,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAIvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAoBD,KAAK,cAAc,GAAG;KACnB,GAAG,IAAI,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG;QAC7C,GAAG,EAAE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAA;KAC5C;CACF,CAAA;AAED,eAAO,MAAM,QAAQ,WAAW,UAAU,KAAgB,cAEzD,CAAA;AAED,e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,GACd,cAAc,CAyChB;AAED,eAAO,MAAM,mBAAmB,mBAA0B,CAAA;AAE1D,eAAO,MAAM,oBAAoB,UACxB,UAAU,yBAEV,MAAM,EAAE,iBACA,MAAM,OAAO,GAAG,SAAS,KACvC,oBAmPF,CAAA"}
|
package/types/styled.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export declare function styled<ParentComponent extends StylableComponent, Varian
|
|
|
11
11
|
defaultVariants?: GetVariantAcceptedValues<Variants>;
|
|
12
12
|
context?: StyledContext;
|
|
13
13
|
acceptsClassName?: boolean;
|
|
14
|
-
}, staticExtractionOptions?: Partial<StaticConfig>): TamaguiComponent<Variants extends void ? GetProps<ParentComponent> : GetBaseProps<ParentComponent> & Omit<GetVariantProps<ParentComponent>, keyof (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>) &
|
|
14
|
+
}, staticExtractionOptions?: Partial<StaticConfig>): TamaguiComponent<Variants extends void ? GetProps<ParentComponent> : GetBaseProps<ParentComponent> & Omit<GetVariantProps<ParentComponent>, keyof (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>) & PseudoProps<Partial<GetBaseProps<ParentComponent> & Omit<GetVariantProps<ParentComponent>, keyof (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)>> & MediaProps<Partial<GetBaseProps<ParentComponent> & Omit<GetVariantProps<ParentComponent>, keyof (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>) & PseudoProps<Partial<GetBaseProps<ParentComponent> & Omit<GetVariantProps<ParentComponent>, keyof (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>)>>>>, GetRef<ParentComponent>, GetBaseProps<ParentComponent>, GetVariantProps<ParentComponent> & (Variants extends void ? {} : GetVariantAcceptedValues<Variants>), { [Key in Exclude<keyof ParentComponent, "defaultProps" | "propTypes" | "staticConfig" | "extractable" | "styleable" | "$$typeof">]: ParentComponent[Key]; }>;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=styled.d.ts.map
|
package/types/styled.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,KAAK,YAAY,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,gBAAgB,CACzE,GAAG,EACH,GAAG,EACH,MAAM,CAAC,CACR,GACG,CAAC,GACD,QAAQ,CAAC,CAAC,CAAC,CAAA;AAEf,KAAK,eAAe,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,gBAAgB,CAC5E,GAAG,EACH,GAAG,EACH,GAAG,EACH,MAAM,CAAC,CACR,GACG,CAAC,GACD,EAAE,CAAA;AAEN,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC/C;KACG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GACnE,GAAG,GACH,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;CACnC,GACD,SAAS,CAAA;AAEb,wBAAgB,MAAM,CACpB,eAAe,SAAS,iBAAiB,EACzC,QAAQ,SAAS,kBAAkB,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,kBAAkB,CAA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C,GAAG,CAAC,CAAC;CACnC,GACD,SAAS,CAAA;AAEb,wBAAgB,MAAM,CACpB,eAAe,SAAS,iBAAiB,EACzC,QAAQ,SAAS,kBAAkB,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,kBAAkB,CAAC,eAAe,CAAC,GAAG,IAAI,EAExG,WAAW,EAAE,eAAe,EAE5B,OAAO,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC/B,eAAe,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IACpD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,EACD,uBAAuB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,4xCAyKhD"}
|
package/types/types.d.ts
CHANGED
|
@@ -224,7 +224,7 @@ export interface ThemeProps {
|
|
|
224
224
|
debug?: DebugProp | any;
|
|
225
225
|
inverse?: boolean;
|
|
226
226
|
forceClassName?: boolean;
|
|
227
|
-
shouldUpdate?: () => boolean;
|
|
227
|
+
shouldUpdate?: () => boolean | undefined;
|
|
228
228
|
}
|
|
229
229
|
type ArrayIntersection<A extends any[]> = A[keyof A];
|
|
230
230
|
type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
|
|
@@ -277,6 +277,15 @@ type GenericTamaguiSettings = {
|
|
|
277
277
|
* @default except-special
|
|
278
278
|
*/
|
|
279
279
|
autocompleteSpecificTokens?: AutocompleteSpecificTokensSetting;
|
|
280
|
+
/**
|
|
281
|
+
* Will change the behavior of media styles. By default they have a fixed specificity: they
|
|
282
|
+
* always override any $theme- or $platform- styles. With this enabled, media styles will have
|
|
283
|
+
* the same precedence as the theme and platform styles, meaning that the order of the props
|
|
284
|
+
* determines if they override.
|
|
285
|
+
*
|
|
286
|
+
* @default false
|
|
287
|
+
*/
|
|
288
|
+
mediaPropOrder?: boolean;
|
|
280
289
|
};
|
|
281
290
|
export type TamaguiSettings = TamaguiConfig['settings'];
|
|
282
291
|
export type CreateTamaguiProps = {
|
|
@@ -399,8 +408,10 @@ export type MediaPropKeys = `$${MediaQueryKey}`;
|
|
|
399
408
|
export type MediaQueryState = {
|
|
400
409
|
[key in MediaQueryKey]: boolean;
|
|
401
410
|
};
|
|
411
|
+
export type ThemeMediaKeys<TK extends keyof Themes = keyof Themes> = `$theme-${TK extends `${string}_${string}` ? never : TK}`;
|
|
412
|
+
export type PlatformMediaKeys = `$platform-${AllPlatforms}`;
|
|
402
413
|
export type MediaProps<A> = {
|
|
403
|
-
[key in MediaPropKeys]?: A;
|
|
414
|
+
[key in MediaPropKeys | ThemeMediaKeys | PlatformMediaKeys]?: A;
|
|
404
415
|
};
|
|
405
416
|
export type MediaQueries = {
|
|
406
417
|
[key in MediaQueryKey]: MediaQueryObject;
|
|
@@ -536,6 +547,7 @@ export type PseudoStyles = {
|
|
|
536
547
|
enterStyle?: ViewStyle;
|
|
537
548
|
exitStyle?: ViewStyle;
|
|
538
549
|
};
|
|
550
|
+
export type AllPlatforms = 'web' | 'native' | 'android' | 'ios';
|
|
539
551
|
type WithThemeAndShorthands<A extends object> = WithThemeValues<OmitLonghands<A>> & WithShorthands<WithThemeValues<A>>;
|
|
540
552
|
type WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>;
|
|
541
553
|
type WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>;
|
|
@@ -893,6 +905,7 @@ export type GetStyleResult = {
|
|
|
893
905
|
fontFamily: string | undefined;
|
|
894
906
|
space?: any;
|
|
895
907
|
hasMedia: boolean | string[];
|
|
908
|
+
dynamicThemeAccess?: boolean;
|
|
896
909
|
};
|
|
897
910
|
export type ClassNamesObject = Record<string, string>;
|
|
898
911
|
export type TamaguiComponentEvents = {
|