@tamagui/web 1.129.2 → 1.129.4
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.cjs +9 -10
- package/dist/cjs/createComponent.js +9 -9
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +10 -10
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +13 -14
- package/dist/cjs/helpers/getSplitStyles.js +12 -12
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +13 -13
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/hooks/useComponentState.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/styled.cjs +5 -5
- package/dist/cjs/styled.js +4 -4
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/styled.native.js +4 -4
- package/dist/cjs/styled.native.js.map +2 -2
- package/dist/cjs/views/Configuration.cjs +11 -6
- package/dist/cjs/views/Configuration.js +3 -3
- package/dist/cjs/views/Configuration.js.map +1 -1
- package/dist/cjs/views/Configuration.native.js +5 -3
- package/dist/cjs/views/Configuration.native.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.cjs +20 -15
- package/dist/cjs/views/TamaguiProvider.js +16 -14
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +20 -16
- package/dist/cjs/views/TamaguiProvider.native.js.map +2 -2
- package/dist/esm/createComponent.js +8 -9
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +9 -10
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +9 -10
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +11 -12
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +13 -14
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +12 -13
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.js +1 -1
- package/dist/esm/hooks/useComponentState.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +1 -1
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +1 -1
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/styled.js +4 -4
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/styled.mjs +5 -5
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +6 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/Configuration.js +4 -3
- package/dist/esm/views/Configuration.js.map +1 -1
- package/dist/esm/views/Configuration.mjs +11 -6
- package/dist/esm/views/Configuration.mjs.map +1 -1
- package/dist/esm/views/Configuration.native.js +11 -6
- package/dist/esm/views/Configuration.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js +19 -16
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +21 -16
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +21 -16
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/package.json +11 -11
- package/src/createComponent.tsx +11 -11
- package/src/helpers/getSplitStyles.tsx +17 -19
- package/src/hooks/useComponentState.ts +2 -2
- package/src/styled.tsx +13 -15
- package/src/types.tsx +5 -0
- package/src/views/Configuration.tsx +12 -3
- package/src/views/TamaguiProvider.tsx +28 -19
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/styled.d.ts +2 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +4 -0
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -0
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/dist/cjs/helpers/consoleLog.cjs +0 -30
- package/dist/cjs/helpers/consoleLog.js +0 -23
- package/dist/cjs/helpers/consoleLog.js.map +0 -6
- package/dist/esm/helpers/consoleLog.js +0 -7
- package/dist/esm/helpers/consoleLog.js.map +0 -6
- package/dist/esm/helpers/consoleLog.mjs +0 -6
- package/dist/esm/helpers/consoleLog.mjs.map +0 -1
- package/src/helpers/consoleLog.ts +0 -8
- package/types/helpers/consoleLog.d.ts +0 -11
- package/types/helpers/consoleLog.d.ts.map +0 -1
|
@@ -56,7 +56,6 @@ import type {
|
|
|
56
56
|
ThemeParsed,
|
|
57
57
|
ViewStyleWithPseudos,
|
|
58
58
|
} from '../types'
|
|
59
|
-
import { groupCollapsed, groupEnd } from './consoleLog'
|
|
60
59
|
import { createMediaStyle } from './createMediaStyle'
|
|
61
60
|
import { fixStyles } from './expandStyles'
|
|
62
61
|
import { getCSSStylesAtomic, getStyleAtomic, styleToCSS } from './getCSSStylesAtomic'
|
|
@@ -235,7 +234,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
235
234
|
debug !== 'profile' &&
|
|
236
235
|
isClient
|
|
237
236
|
) {
|
|
238
|
-
groupCollapsed('getSplitStyles (collapsed)')
|
|
237
|
+
console.groupCollapsed('getSplitStyles (collapsed)')
|
|
239
238
|
log({
|
|
240
239
|
props,
|
|
241
240
|
staticConfig,
|
|
@@ -246,7 +245,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
246
245
|
styleState,
|
|
247
246
|
theme: { ...theme },
|
|
248
247
|
})
|
|
249
|
-
groupEnd()
|
|
248
|
+
console.groupEnd()
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
const { asChild } = props
|
|
@@ -288,7 +287,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
288
287
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
289
288
|
// otherwise things just keep nesting - careful don't leave these around
|
|
290
289
|
// they cause big performance dips in Chrome, only use them when debug prop set
|
|
291
|
-
groupEnd()
|
|
290
|
+
// console.groupEnd()
|
|
292
291
|
}
|
|
293
292
|
|
|
294
293
|
// normalize shorthands up front
|
|
@@ -533,9 +532,8 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
533
532
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough
|
|
534
533
|
|
|
535
534
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
536
|
-
groupEnd() // react native was not nesting right
|
|
537
|
-
|
|
538
|
-
groupCollapsed(
|
|
535
|
+
// console.groupEnd() // react native was not nesting right
|
|
536
|
+
console.groupCollapsed(
|
|
539
537
|
` 🔑 ${keyOg}${
|
|
540
538
|
keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ''
|
|
541
539
|
} ${shouldPassThrough ? '(pass)' : ''}`
|
|
@@ -612,9 +610,9 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
612
610
|
}
|
|
613
611
|
|
|
614
612
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
615
|
-
groupCollapsed(' 💠 expanded', keyInit, '=>', key)
|
|
613
|
+
console.groupCollapsed(' 💠 expanded', keyInit, '=>', key)
|
|
616
614
|
log(val)
|
|
617
|
-
groupEnd()
|
|
615
|
+
console.groupEnd()
|
|
618
616
|
}
|
|
619
617
|
|
|
620
618
|
if (val == null) return
|
|
@@ -656,9 +654,9 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
656
654
|
if (shouldPassThrough) {
|
|
657
655
|
passDownProp(viewProps, key, val, isMediaOrPseudo)
|
|
658
656
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
659
|
-
groupCollapsed(` - passing down prop ${key}`)
|
|
657
|
+
console.groupCollapsed(` - passing down prop ${key}`)
|
|
660
658
|
log({ val, after: { ...viewProps[key] } })
|
|
661
|
-
groupEnd()
|
|
659
|
+
console.groupEnd()
|
|
662
660
|
}
|
|
663
661
|
return
|
|
664
662
|
}
|
|
@@ -728,9 +726,9 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
728
726
|
}
|
|
729
727
|
|
|
730
728
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
731
|
-
groupCollapsed('pseudo', key, { isDisabled })
|
|
729
|
+
console.groupCollapsed('pseudo', key, { isDisabled })
|
|
732
730
|
log({ pseudoStyleObject, isDisabled, descriptor, componentState })
|
|
733
|
-
groupEnd()
|
|
731
|
+
console.groupEnd()
|
|
734
732
|
}
|
|
735
733
|
|
|
736
734
|
const importance = descriptor.priority
|
|
@@ -1058,7 +1056,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1058
1056
|
} catch {
|
|
1059
1057
|
// RN can run into PayloadTooLargeError: request entity too large
|
|
1060
1058
|
}
|
|
1061
|
-
groupEnd()
|
|
1059
|
+
console.groupEnd()
|
|
1062
1060
|
}
|
|
1063
1061
|
} // end prop loop
|
|
1064
1062
|
|
|
@@ -1173,11 +1171,11 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1173
1171
|
}
|
|
1174
1172
|
|
|
1175
1173
|
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
1176
|
-
groupEnd() // ensure group ended from loop above
|
|
1177
|
-
groupCollapsed(`🔹 getSplitStyles final style object`)
|
|
1174
|
+
// console.groupEnd() // ensure group ended from loop above
|
|
1175
|
+
console.groupCollapsed(`🔹 getSplitStyles final style object`)
|
|
1178
1176
|
console.info(styleState.style)
|
|
1179
1177
|
console.info(`retainedStyles`, retainedStyles)
|
|
1180
|
-
groupEnd()
|
|
1178
|
+
console.groupEnd()
|
|
1181
1179
|
}
|
|
1182
1180
|
|
|
1183
1181
|
if (shouldRetain || !(process.env.IS_STATIC === 'is_static')) {
|
|
@@ -1359,7 +1357,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1359
1357
|
|
|
1360
1358
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
1361
1359
|
if (isDevTools) {
|
|
1362
|
-
groupCollapsed('🔹 getSplitStyles ===>')
|
|
1360
|
+
console.groupCollapsed('🔹 getSplitStyles ===>')
|
|
1363
1361
|
try {
|
|
1364
1362
|
// prettier-ignore
|
|
1365
1363
|
const logs = {
|
|
@@ -1376,7 +1374,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1376
1374
|
} catch {
|
|
1377
1375
|
// RN can run into PayloadTooLargeError: request entity too large
|
|
1378
1376
|
}
|
|
1379
|
-
groupEnd()
|
|
1377
|
+
console.groupEnd()
|
|
1380
1378
|
}
|
|
1381
1379
|
}
|
|
1382
1380
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isServer, isWeb
|
|
1
|
+
import { IS_REACT_19, isServer, isWeb } from '@tamagui/constants'
|
|
2
2
|
import { useDidFinishSSR } from '@tamagui/use-did-finish-ssr'
|
|
3
|
-
import {
|
|
3
|
+
import { useRef, useState } from 'react'
|
|
4
4
|
import {
|
|
5
5
|
defaultComponentState,
|
|
6
6
|
defaultComponentStateMounted,
|
package/src/styled.tsx
CHANGED
|
@@ -35,12 +35,12 @@ type GetVariantAcceptedValues<V> = V extends Object
|
|
|
35
35
|
|
|
36
36
|
export function styled<
|
|
37
37
|
ParentComponent extends StylableComponent,
|
|
38
|
-
|
|
39
|
-
Variants extends VariantDefinitions<ParentComponent,
|
|
38
|
+
StyledConfig extends StaticConfigPublic,
|
|
39
|
+
Variants extends VariantDefinitions<ParentComponent, StyledConfig>,
|
|
40
40
|
>(
|
|
41
41
|
ComponentIn: ParentComponent,
|
|
42
42
|
// this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues
|
|
43
|
-
options?: Partial<InferStyledProps<ParentComponent,
|
|
43
|
+
options?: Partial<InferStyledProps<ParentComponent, StyledConfig>> & {
|
|
44
44
|
name?: string
|
|
45
45
|
variants?: Variants | undefined
|
|
46
46
|
defaultVariants?: GetVariantAcceptedValues<Variants>
|
|
@@ -48,14 +48,14 @@ export function styled<
|
|
|
48
48
|
/** @deprecated pass in instead as the third argument to styled() */
|
|
49
49
|
acceptsClassName?: boolean
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
config?: StyledConfig
|
|
52
52
|
) {
|
|
53
53
|
// do type stuff at top for easier readability
|
|
54
54
|
|
|
55
55
|
// get parent props without pseudos and medias so we can rebuild both with new variants
|
|
56
56
|
// get parent props without pseudos and medias so we can rebuild both with new variants
|
|
57
57
|
type ParentNonStyledProps = GetNonStyledProps<ParentComponent>
|
|
58
|
-
type ParentStylesBase = GetBaseStyles<ParentComponent,
|
|
58
|
+
type ParentStylesBase = GetBaseStyles<ParentComponent, StyledConfig>
|
|
59
59
|
type ParentVariants = GetStyledVariants<ParentComponent>
|
|
60
60
|
|
|
61
61
|
type OurVariantProps = AreVariantsUndefined<Variants> extends true
|
|
@@ -72,15 +72,15 @@ export function styled<
|
|
|
72
72
|
| (Key extends keyof OurVariantProps ? OurVariantProps[Key] : undefined)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
type Accepted =
|
|
75
|
+
type Accepted = StyledConfig['accept']
|
|
76
76
|
type CustomTokenProps = Accepted extends Record<string, any>
|
|
77
77
|
? {
|
|
78
78
|
[Key in keyof Accepted]?:
|
|
79
79
|
| (Key extends keyof ParentStylesBase ? ParentStylesBase[Key] : never)
|
|
80
80
|
| (Accepted[Key] extends 'style'
|
|
81
|
-
? Partial<InferStyledProps<ParentComponent,
|
|
81
|
+
? Partial<InferStyledProps<ParentComponent, StyledConfig>>
|
|
82
82
|
: Accepted[Key] extends 'textStyle'
|
|
83
|
-
? Partial<InferStyledProps<typeof Text,
|
|
83
|
+
? Partial<InferStyledProps<typeof Text, StyledConfig>>
|
|
84
84
|
: Omit<ThemeValueGet<Accepted[Key]>, 'unset'>)
|
|
85
85
|
}
|
|
86
86
|
: {}
|
|
@@ -103,7 +103,7 @@ export function styled<
|
|
|
103
103
|
? ParentStylesBase & CustomTokenProps
|
|
104
104
|
: ParentStylesBase,
|
|
105
105
|
MergedVariants,
|
|
106
|
-
GetStaticConfig<ParentComponent,
|
|
106
|
+
GetStaticConfig<ParentComponent, StyledConfig>
|
|
107
107
|
>
|
|
108
108
|
|
|
109
109
|
// validate not using a variant over an existing valid style
|
|
@@ -131,9 +131,7 @@ export function styled<
|
|
|
131
131
|
: undefined
|
|
132
132
|
|
|
133
133
|
const isReactNative = Boolean(
|
|
134
|
-
reactNativeConfig ||
|
|
135
|
-
staticExtractionOptions?.isReactNative ||
|
|
136
|
-
parentStaticConfig?.isReactNative
|
|
134
|
+
reactNativeConfig || config?.isReactNative || parentStaticConfig?.isReactNative
|
|
137
135
|
)
|
|
138
136
|
|
|
139
137
|
const staticConfigProps = (() => {
|
|
@@ -196,10 +194,10 @@ export function styled<
|
|
|
196
194
|
}
|
|
197
195
|
}
|
|
198
196
|
|
|
199
|
-
const isText = Boolean(
|
|
197
|
+
const isText = Boolean(config?.isText || parentStaticConfig?.isText)
|
|
200
198
|
|
|
201
199
|
const acceptsClassName =
|
|
202
|
-
|
|
200
|
+
config?.acceptsClassName ??
|
|
203
201
|
acceptsClassNameProp ??
|
|
204
202
|
(isPlainStyledComponent ||
|
|
205
203
|
isReactNative ||
|
|
@@ -207,7 +205,7 @@ export function styled<
|
|
|
207
205
|
|
|
208
206
|
const conf: Partial<StaticConfig> = {
|
|
209
207
|
...parentStaticConfig,
|
|
210
|
-
...
|
|
208
|
+
...config,
|
|
211
209
|
...(!isPlainStyledComponent && {
|
|
212
210
|
Component,
|
|
213
211
|
}),
|
package/src/types.tsx
CHANGED
|
@@ -2168,6 +2168,11 @@ export type StaticConfigPublic = {
|
|
|
2168
2168
|
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
2169
2169
|
*/
|
|
2170
2170
|
acceptsClassName?: boolean
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* memoizes component, rarely useful except mostly style components that don't take children
|
|
2174
|
+
*/
|
|
2175
|
+
memo?: boolean
|
|
2171
2176
|
}
|
|
2172
2177
|
|
|
2173
2178
|
type StaticConfigBase = StaticConfigPublic & {
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ClientOnly, ClientOnlyContext } from '@tamagui/use-did-finish-ssr'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
3
|
import { ComponentContext } from '../contexts/ComponentContext'
|
|
4
4
|
import type { AnimationDriver } from '../types'
|
|
5
5
|
|
|
6
6
|
interface ConfigurationProps {
|
|
7
7
|
animationDriver?: AnimationDriver | null
|
|
8
|
+
disableSSR?: boolean
|
|
8
9
|
children: React.ReactNode
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const Configuration = (props: ConfigurationProps) => {
|
|
12
13
|
const current = React.useContext(ComponentContext)
|
|
13
|
-
|
|
14
|
+
const clientOnly = useContext(ClientOnlyContext)
|
|
15
|
+
|
|
16
|
+
const children = <ComponentContext.Provider {...current} {...props} />
|
|
17
|
+
|
|
18
|
+
if (clientOnly) {
|
|
19
|
+
return <ClientOnly>{children}</ClientOnly>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return children
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
Configuration['displayName'] = 'Configuration'
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
IS_REACT_19,
|
|
2
3
|
isClient,
|
|
3
4
|
isWeb,
|
|
4
5
|
useIsomorphicLayoutEffect,
|
|
5
|
-
IS_REACT_19,
|
|
6
6
|
} from '@tamagui/constants'
|
|
7
|
+
import { ClientOnly } from '@tamagui/use-did-finish-ssr'
|
|
7
8
|
import React, { useEffect } from 'react'
|
|
8
9
|
import { getSetting } from '../config'
|
|
9
10
|
import { ComponentContext } from '../contexts/ComponentContext'
|
|
11
|
+
import { updateMediaListeners } from '../hooks/useMedia'
|
|
10
12
|
import type { TamaguiProviderProps } from '../types'
|
|
11
13
|
import { ThemeProvider } from './ThemeProvider'
|
|
12
|
-
import { updateMediaListeners } from '../hooks/useMedia'
|
|
13
14
|
|
|
14
15
|
const listeners = new Set<() => void>()
|
|
15
16
|
let didRender = false
|
|
@@ -61,25 +62,33 @@ export function TamaguiProvider({
|
|
|
61
62
|
updateMediaListeners()
|
|
62
63
|
}, [])
|
|
63
64
|
|
|
65
|
+
let contents = (
|
|
66
|
+
<UnmountedClassName>
|
|
67
|
+
<ComponentContext.Provider animationDriver={config?.animations}>
|
|
68
|
+
<ThemeProvider
|
|
69
|
+
themeClassNameOnRoot={
|
|
70
|
+
themeClassNameOnRoot ?? getSetting('themeClassNameOnRoot')
|
|
71
|
+
}
|
|
72
|
+
disableRootThemeClass={
|
|
73
|
+
disableRootThemeClass ?? getSetting('disableRootThemeClass')
|
|
74
|
+
}
|
|
75
|
+
defaultTheme={defaultTheme ?? (config ? Object.keys(config.themes)[0] : '')}
|
|
76
|
+
reset={reset}
|
|
77
|
+
className={className}
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
</ThemeProvider>
|
|
81
|
+
</ComponentContext.Provider>
|
|
82
|
+
</UnmountedClassName>
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
if (getSetting('disableSSR')) {
|
|
86
|
+
contents = <ClientOnly>{contents}</ClientOnly>
|
|
87
|
+
}
|
|
88
|
+
|
|
64
89
|
return (
|
|
65
90
|
<>
|
|
66
|
-
|
|
67
|
-
<ComponentContext.Provider animationDriver={config?.animations}>
|
|
68
|
-
<ThemeProvider
|
|
69
|
-
themeClassNameOnRoot={
|
|
70
|
-
themeClassNameOnRoot ?? getSetting('themeClassNameOnRoot')
|
|
71
|
-
}
|
|
72
|
-
disableRootThemeClass={
|
|
73
|
-
disableRootThemeClass ?? getSetting('disableRootThemeClass')
|
|
74
|
-
}
|
|
75
|
-
defaultTheme={defaultTheme ?? (config ? Object.keys(config.themes)[0] : '')}
|
|
76
|
-
reset={reset}
|
|
77
|
-
className={className}
|
|
78
|
-
>
|
|
79
|
-
{children}
|
|
80
|
-
</ThemeProvider>
|
|
81
|
-
</ComponentContext.Provider>
|
|
82
|
-
</UnmountedClassName>
|
|
91
|
+
{contents}
|
|
83
92
|
|
|
84
93
|
{process.env.TAMAGUI_TARGET !== 'native' &&
|
|
85
94
|
IS_REACT_19 &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAA;AAmBzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAG/E,OAAO,KAAK,EAEV,SAAS,EAGT,cAAc,EACd,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAElB,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EAMf,MAAM,SAAS,CAAA;AAYhB,KAAK,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA;AAEpF,eAAO,MAAM,kBAAkB,wBAA+B,CAAA;AAuF9D,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACnD,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,SAAS,GAAG,KAAK,EACjB,UAAU,SAAS,MAAM,GAAG,KAAK,EACjC,YAAY,EAAE,YAAY,wEAumC3B;AAoBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,OAEjD;yBAFe,QAAQ;;;AAkBxB,eAAO,MAAM,MAAM,yFA0CjB,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,GAAG,OAAO,CAAA;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAgGxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAOb,eAAe,EACf,YAAY,EAGZ,SAAS,EACT,WAAW,EAEZ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAOb,eAAe,EACf,YAAY,EAGZ,SAAS,EACT,WAAW,EAEZ,MAAM,UAAU,CAAA;AAgBjB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAMhE,KAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,qBAAqB,EACrC,UAAU,EAAE,eAAe,EAC3B,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,EACzC,OAAO,CAAC,EAAE,iBAAiB,EAE3B,WAAW,CAAC,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,OAAO,EAC3B,KAAK,CAAC,EAAE,SAAS,KACd,cAAc,CAAA;AAEnB,eAAO,MAAM,UAAU,MAAM,CAAA;AA+B7B,eAAO,MAAM,cAAc,EAAE,aA2uC5B,CAAA;AAuCD,eAAO,MAAM,WAAW,GACtB,YAAY,aAAa,EACzB,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,sBAAsB,OAAO,KAC5B,SA6CF,CAAA;AAQD,eAAO,MAAM,cAAc,EAAE,aAc5B,CAAA"}
|
package/types/styled.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ type AreVariantsUndefined<Variants> = Required<Variants> extends {
|
|
|
7
7
|
type GetVariantAcceptedValues<V> = V extends Object ? {
|
|
8
8
|
[Key in keyof V]?: V[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof V[Key]>;
|
|
9
9
|
} : undefined;
|
|
10
|
-
export declare function styled<ParentComponent extends StylableComponent,
|
|
10
|
+
export declare function styled<ParentComponent extends StylableComponent, StyledConfig extends StaticConfigPublic, Variants extends VariantDefinitions<ParentComponent, StyledConfig>>(ComponentIn: ParentComponent, options?: Partial<InferStyledProps<ParentComponent, StyledConfig>> & {
|
|
11
11
|
name?: string;
|
|
12
12
|
variants?: Variants | undefined;
|
|
13
13
|
defaultVariants?: GetVariantAcceptedValues<Variants>;
|
|
14
14
|
context?: StyledContext;
|
|
15
15
|
/** @deprecated pass in instead as the third argument to styled() */
|
|
16
16
|
acceptsClassName?: boolean;
|
|
17
|
-
},
|
|
17
|
+
}, config?: StyledConfig): TamaguiComponent<TamaDefer, GetRef<ParentComponent>, GetNonStyledProps<ParentComponent>, StyledConfig["accept"] extends Record<string, any> ? GetBaseStyles<ParentComponent, StyledConfig> & (StyledConfig["accept"] extends Record<string, any> ? { [Key in keyof StyledConfig["accept"]]?: (Key extends keyof GetBaseStyles<ParentComponent, StyledConfig> ? GetBaseStyles<ParentComponent, StyledConfig>[Key] : never) | (StyledConfig["accept"][Key] extends "style" ? Partial<InferStyledProps<ParentComponent, StyledConfig>> : StyledConfig["accept"][Key] extends "textStyle" ? Partial<import("./types").TextProps> : Omit<ThemeValueGet<StyledConfig["accept"][Key]>, "unset">) | undefined; } : {}) : GetBaseStyles<ParentComponent, StyledConfig>, AreVariantsUndefined<Variants> extends true ? GetStyledVariants<ParentComponent> : AreVariantsUndefined<GetStyledVariants<ParentComponent>> extends true ? Omit<AreVariantsUndefined<Variants> extends true ? {} : GetVariantAcceptedValues<Variants>, "_isEmpty"> : { [Key_1 in Exclude<keyof GetStyledVariants<ParentComponent>, "_isEmpty"> | Exclude<keyof (AreVariantsUndefined<Variants> extends true ? {} : GetVariantAcceptedValues<Variants>), "_isEmpty">]?: (Key_1 extends keyof GetStyledVariants<ParentComponent> ? GetStyledVariants<ParentComponent>[Key_1] : undefined) | (Key_1 extends keyof (AreVariantsUndefined<Variants> extends true ? {} : GetVariantAcceptedValues<Variants>) ? (AreVariantsUndefined<Variants> extends true ? {} : GetVariantAcceptedValues<Variants>)[Key_1] : undefined) | undefined; }, GetStaticConfig<ParentComponent, StyledConfig>>;
|
|
18
18
|
export {};
|
|
19
19
|
//# 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":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAGhB,KAAK,oBAAoB,CAAC,QAAQ,IAEhC,QAAQ,CAAC,QAAQ,CAAC,SAAS;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,CAAA;AAE3D,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,
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAGhB,KAAK,oBAAoB,CAAC,QAAQ,IAEhC,QAAQ,CAAC,QAAQ,CAAC,SAAS;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,CAAA;AAE3D,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,YAAY,SAAS,kBAAkB,EACvC,QAAQ,SAAS,kBAAkB,CAAC,eAAe,EAAE,YAAY,CAAC,EAElE,WAAW,EAAE,eAAe,EAE5B,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,GAAG;IACnE,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,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,EACD,MAAM,CAAC,EAAE,YAAY,yPA2Bd,GAAG,2zCAuKX"}
|
package/types/types.d.ts
CHANGED
|
@@ -1363,6 +1363,10 @@ export type StaticConfigPublic = {
|
|
|
1363
1363
|
* Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
|
|
1364
1364
|
*/
|
|
1365
1365
|
acceptsClassName?: boolean;
|
|
1366
|
+
/**
|
|
1367
|
+
* memoizes component, rarely useful except mostly style components that don't take children
|
|
1368
|
+
*/
|
|
1369
|
+
memo?: boolean;
|
|
1366
1370
|
};
|
|
1367
1371
|
type StaticConfigBase = StaticConfigPublic & {
|
|
1368
1372
|
Component?: FunctionComponent<any> & StaticComponentObject<any, any, any, any, any, any>;
|