@tamagui/web 1.112.1 → 1.112.2
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 +6 -141
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +8 -143
- package/dist/cjs/createComponent.native.js.map +2 -2
- package/dist/cjs/createTamagui.js +2 -3
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/createTamagui.native.js +2 -5
- package/dist/cjs/createTamagui.native.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +2 -2
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.js +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/sortString.js +21 -0
- package/dist/cjs/helpers/sortString.js.map +6 -0
- package/dist/cjs/helpers/sortString.native.js +28 -0
- package/dist/cjs/helpers/sortString.native.js.map +6 -0
- package/dist/cjs/helpers/subscribeToContextGroup.js +53 -0
- package/dist/cjs/helpers/subscribeToContextGroup.js.map +6 -0
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +52 -0
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +6 -0
- package/dist/cjs/hooks/useComponentState.js +113 -0
- package/dist/cjs/hooks/useComponentState.js.map +6 -0
- package/dist/cjs/hooks/useComponentState.native.js +127 -0
- package/dist/cjs/hooks/useComponentState.native.js.map +6 -0
- package/dist/cjs/hooks/useProps.js +3 -3
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +3 -3
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/subscribeToContextGroup.js +53 -0
- package/dist/cjs/subscribeToContextGroup.js.map +6 -0
- package/dist/cjs/subscribeToContextGroup.native.js +52 -0
- package/dist/cjs/subscribeToContextGroup.native.js.map +6 -0
- package/dist/esm/createComponent.js +8 -151
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.mjs +18 -182
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +20 -200
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.js +2 -3
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/createTamagui.mjs +2 -5
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +2 -5
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +2 -1
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +2 -1
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +2 -1
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +2 -1
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +2 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/sortString.js +5 -0
- package/dist/esm/helpers/sortString.js.map +6 -0
- package/dist/esm/helpers/sortString.mjs +3 -0
- package/dist/esm/helpers/sortString.mjs.map +1 -0
- package/dist/esm/helpers/sortString.native.js +5 -0
- package/dist/esm/helpers/sortString.native.js.map +1 -0
- package/dist/esm/helpers/subscribeToContextGroup.js +38 -0
- package/dist/esm/helpers/subscribeToContextGroup.js.map +6 -0
- package/dist/esm/helpers/subscribeToContextGroup.mjs +38 -0
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -0
- package/dist/esm/helpers/subscribeToContextGroup.native.js +42 -0
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -0
- package/dist/esm/hooks/useComponentState.js +107 -0
- package/dist/esm/hooks/useComponentState.js.map +6 -0
- package/dist/esm/hooks/useComponentState.mjs +135 -0
- package/dist/esm/hooks/useComponentState.mjs.map +1 -0
- package/dist/esm/hooks/useComponentState.native.js +147 -0
- package/dist/esm/hooks/useComponentState.native.js.map +1 -0
- package/dist/esm/hooks/useProps.js +2 -1
- package/dist/esm/hooks/useProps.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +2 -1
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +2 -1
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/subscribeToContextGroup.js +38 -0
- package/dist/esm/subscribeToContextGroup.js.map +6 -0
- package/dist/esm/subscribeToContextGroup.mjs +38 -0
- package/dist/esm/subscribeToContextGroup.mjs.map +1 -0
- package/dist/esm/subscribeToContextGroup.native.js +42 -0
- package/dist/esm/subscribeToContextGroup.native.js.map +1 -0
- package/package.json +12 -12
- package/src/createComponent.tsx +6 -316
- package/src/createTamagui.ts +11 -4
- package/src/helpers/getSplitStyles.tsx +2 -1
- package/src/helpers/getThemeCSSRules.ts +2 -1
- package/src/helpers/insertStyleRule.tsx +1 -0
- package/src/helpers/sortString.ts +1 -0
- package/src/helpers/subscribeToContextGroup.tsx +56 -0
- package/src/hooks/useComponentState.ts +258 -0
- package/src/hooks/useProps.tsx +2 -2
- package/types/createComponent.d.ts +1 -30
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/sortString.d.ts +2 -0
- package/types/helpers/sortString.d.ts.map +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts +10 -0
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -0
- package/types/hooks/useComponentState.d.ts +22 -0
- package/types/hooks/useComponentState.d.ts.map +1 -0
- package/types/hooks/useProps.d.ts.map +1 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultComponentState,
|
|
3
|
+
defaultComponentStateMounted,
|
|
4
|
+
defaultComponentStateShouldEnter,
|
|
5
|
+
} from '../defaultComponentState'
|
|
6
|
+
import { useDidHydrateOnce } from '../hooks/useDidHydrateOnce'
|
|
7
|
+
import { useRef, useState } from 'react'
|
|
8
|
+
import type {
|
|
9
|
+
ComponentContextI,
|
|
10
|
+
GroupStateListener,
|
|
11
|
+
StackProps,
|
|
12
|
+
StaticConfig,
|
|
13
|
+
TamaguiComponentState,
|
|
14
|
+
TamaguiComponentStateRef,
|
|
15
|
+
TamaguiInternalConfig,
|
|
16
|
+
TextProps,
|
|
17
|
+
UseAnimationHook,
|
|
18
|
+
} from '../types'
|
|
19
|
+
import { isServer, isWeb } from '@tamagui/constants'
|
|
20
|
+
import { createShallowSetState } from '../helpers/createShallowSetState'
|
|
21
|
+
import { isObj } from '../helpers/isObj'
|
|
22
|
+
import { log } from '../helpers/log'
|
|
23
|
+
|
|
24
|
+
export const useComponentState = (
|
|
25
|
+
props: StackProps | TextProps | Record<string, any>,
|
|
26
|
+
{ animationDriver, groups }: ComponentContextI,
|
|
27
|
+
staticConfig: StaticConfig,
|
|
28
|
+
config: TamaguiInternalConfig
|
|
29
|
+
) => {
|
|
30
|
+
const useAnimations = animationDriver?.useAnimations as UseAnimationHook | undefined
|
|
31
|
+
|
|
32
|
+
const stateRef = useRef<TamaguiComponentStateRef>(
|
|
33
|
+
undefined as any as TamaguiComponentStateRef
|
|
34
|
+
)
|
|
35
|
+
if (!stateRef.current) {
|
|
36
|
+
stateRef.current = {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// after we get states mount we need to turn off isAnimated for server side
|
|
40
|
+
const hasAnimationProp = Boolean(
|
|
41
|
+
'animation' in props || (props.style && hasAnimatedStyleValue(props.style))
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
// disable for now still ssr issues
|
|
45
|
+
const supportsCSSVars = animationDriver?.supportsCSSVars
|
|
46
|
+
const curStateRef = stateRef.current
|
|
47
|
+
|
|
48
|
+
const willBeAnimatedClient = (() => {
|
|
49
|
+
const next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations)
|
|
50
|
+
return Boolean(next || curStateRef.hasAnimated)
|
|
51
|
+
})()
|
|
52
|
+
|
|
53
|
+
const willBeAnimated = !isServer && willBeAnimatedClient
|
|
54
|
+
|
|
55
|
+
// once animated, always animated to preserve hooks / vdom structure
|
|
56
|
+
if (willBeAnimated && !curStateRef.hasAnimated) {
|
|
57
|
+
curStateRef.hasAnimated = true
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// HOOK
|
|
61
|
+
const presence =
|
|
62
|
+
(willBeAnimated &&
|
|
63
|
+
props['animatePresence'] !== false &&
|
|
64
|
+
animationDriver?.usePresence?.()) ||
|
|
65
|
+
null
|
|
66
|
+
const presenceState = presence?.[2]
|
|
67
|
+
const isExiting = presenceState?.isPresent === false
|
|
68
|
+
const isEntering = presenceState?.isPresent === true && presenceState.initial !== false
|
|
69
|
+
|
|
70
|
+
const hasEnterStyle = !!props.enterStyle
|
|
71
|
+
// finish animated logic, avoid isAnimated when unmounted
|
|
72
|
+
const hasRNAnimation = hasAnimationProp && animationDriver?.isReactNative
|
|
73
|
+
|
|
74
|
+
const hasEnterState = hasEnterStyle || isEntering
|
|
75
|
+
|
|
76
|
+
// this can be conditional because its only ever needed with animations
|
|
77
|
+
const didHydrateOnce = willBeAnimated ? useDidHydrateOnce() : true
|
|
78
|
+
const shouldEnter = hasEnterState || (!didHydrateOnce && hasRNAnimation)
|
|
79
|
+
const shouldEnterFromUnhydrated = isWeb && !didHydrateOnce
|
|
80
|
+
|
|
81
|
+
const initialState = shouldEnter
|
|
82
|
+
? // on the very first render we switch all spring animation drivers to css rendering
|
|
83
|
+
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
84
|
+
// without flickers of the wrong colors.
|
|
85
|
+
// but once we do that initial hydration and we are in client side rendering mode,
|
|
86
|
+
// we can avoid the extra re-render on mount
|
|
87
|
+
shouldEnterFromUnhydrated
|
|
88
|
+
? defaultComponentState
|
|
89
|
+
: defaultComponentStateShouldEnter
|
|
90
|
+
: defaultComponentStateMounted
|
|
91
|
+
|
|
92
|
+
// will be nice to deprecate half of these:
|
|
93
|
+
const disabled = isDisabled(props)
|
|
94
|
+
|
|
95
|
+
if (disabled != null) {
|
|
96
|
+
initialState.disabled = disabled
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// HOOK
|
|
100
|
+
const states = useState<TamaguiComponentState>(initialState)
|
|
101
|
+
|
|
102
|
+
const state = props.forceStyle ? { ...states[0], [props.forceStyle]: true } : states[0]
|
|
103
|
+
const setState = states[1]
|
|
104
|
+
|
|
105
|
+
const isHydrated = state.unmounted === false || state.unmounted === 'should-enter'
|
|
106
|
+
|
|
107
|
+
// only web server + initial client render run this when not hydrated:
|
|
108
|
+
let isAnimated = willBeAnimated
|
|
109
|
+
if (isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === true) {
|
|
110
|
+
isAnimated = false
|
|
111
|
+
curStateRef.willHydrate = true
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// immediately update disabled state and reset component state
|
|
115
|
+
if (disabled !== state.disabled) {
|
|
116
|
+
state.disabled = disabled
|
|
117
|
+
// if disabled remove all press/focus/hover states
|
|
118
|
+
if (disabled) {
|
|
119
|
+
Object.assign(state, defaultComponentStateMounted)
|
|
120
|
+
}
|
|
121
|
+
setState({ ...state })
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let setStateShallow = createShallowSetState(setState, disabled, false, props.debug)
|
|
125
|
+
|
|
126
|
+
// if (isHydrated && state.unmounted === 'should-enter') {
|
|
127
|
+
// state.unmounted = true
|
|
128
|
+
// }
|
|
129
|
+
|
|
130
|
+
// set enter/exit variants onto our new props object
|
|
131
|
+
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
132
|
+
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
133
|
+
console.warn(`has presenceState ${JSON.stringify(presenceState)}`)
|
|
134
|
+
}
|
|
135
|
+
const { enterVariant, exitVariant, enterExitVariant, custom } = presenceState
|
|
136
|
+
if (isObj(custom)) {
|
|
137
|
+
Object.assign(props, custom)
|
|
138
|
+
}
|
|
139
|
+
const exv = exitVariant ?? enterExitVariant
|
|
140
|
+
const env = enterVariant ?? enterExitVariant
|
|
141
|
+
if (state.unmounted && env && staticConfig.variants[env]) {
|
|
142
|
+
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
143
|
+
console.warn(`Animating presence ENTER "${env}"`)
|
|
144
|
+
}
|
|
145
|
+
props[env] = true
|
|
146
|
+
} else if (isExiting && exv) {
|
|
147
|
+
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
148
|
+
console.warn(`Animating presence EXIT "${exv}"`)
|
|
149
|
+
}
|
|
150
|
+
props[exv] = exitVariant !== enterExitVariant
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let shouldAvoidClasses = !isWeb
|
|
155
|
+
|
|
156
|
+
// on server for SSR and animation compat added the && isHydrated but perhaps we want
|
|
157
|
+
// disableClassName="until-hydrated" to be more straightforward
|
|
158
|
+
// see issue if not, Button sets disableClassName to true <Button animation="" /> with
|
|
159
|
+
// the react-native driver errors because it tries to animate var(--color) to rbga(..)
|
|
160
|
+
if (isWeb) {
|
|
161
|
+
const { disableClassName } = props
|
|
162
|
+
|
|
163
|
+
const isAnimatedAndHydrated =
|
|
164
|
+
isAnimated && !supportsCSSVars && didHydrateOnce && !isServer
|
|
165
|
+
|
|
166
|
+
const isClassNameDisabled =
|
|
167
|
+
!staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce)
|
|
168
|
+
|
|
169
|
+
const isDisabledManually =
|
|
170
|
+
disableClassName && !isServer && didHydrateOnce && state.unmounted === true
|
|
171
|
+
|
|
172
|
+
if (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) {
|
|
173
|
+
shouldAvoidClasses = true
|
|
174
|
+
|
|
175
|
+
if (process.env.NODE_ENV === 'development' && props.debug) {
|
|
176
|
+
log(`avoiding className`, {
|
|
177
|
+
isAnimatedAndHydrated,
|
|
178
|
+
isDisabledManually,
|
|
179
|
+
isClassNameDisabled,
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const groupName = props.group as any as string
|
|
186
|
+
|
|
187
|
+
if (groupName && !curStateRef.group) {
|
|
188
|
+
const listeners = new Set<GroupStateListener>()
|
|
189
|
+
curStateRef.group = {
|
|
190
|
+
listeners,
|
|
191
|
+
emit(name, state) {
|
|
192
|
+
listeners.forEach((l) => l(name, state))
|
|
193
|
+
},
|
|
194
|
+
subscribe(cb) {
|
|
195
|
+
listeners.add(cb)
|
|
196
|
+
return () => {
|
|
197
|
+
listeners.delete(cb)
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (groupName) {
|
|
204
|
+
// when we set state we also set our group state and emit an event for children listening:
|
|
205
|
+
const groupContextState = groups.state
|
|
206
|
+
const og = setStateShallow
|
|
207
|
+
setStateShallow = (state) => {
|
|
208
|
+
og(state)
|
|
209
|
+
curStateRef.group!.emit(groupName, {
|
|
210
|
+
pseudo: state,
|
|
211
|
+
})
|
|
212
|
+
// and mutate the current since its concurrent safe (children throw it in useState on mount)
|
|
213
|
+
const next = {
|
|
214
|
+
...groupContextState[groupName],
|
|
215
|
+
...state,
|
|
216
|
+
}
|
|
217
|
+
groupContextState[groupName] = next
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
curStateRef,
|
|
223
|
+
disabled,
|
|
224
|
+
groupName,
|
|
225
|
+
hasAnimationProp,
|
|
226
|
+
hasEnterStyle,
|
|
227
|
+
isAnimated,
|
|
228
|
+
isExiting,
|
|
229
|
+
isHydrated,
|
|
230
|
+
presence,
|
|
231
|
+
presenceState,
|
|
232
|
+
setState,
|
|
233
|
+
setStateShallow,
|
|
234
|
+
shouldAvoidClasses,
|
|
235
|
+
state,
|
|
236
|
+
stateRef,
|
|
237
|
+
supportsCSSVars,
|
|
238
|
+
willBeAnimated,
|
|
239
|
+
willBeAnimatedClient,
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function hasAnimatedStyleValue(style: Object) {
|
|
244
|
+
return Object.keys(style).some((k) => {
|
|
245
|
+
const val = style[k]
|
|
246
|
+
return val && typeof val === 'object' && '_animation' in val
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const isDisabled = (props: any) => {
|
|
251
|
+
return (
|
|
252
|
+
props.disabled ||
|
|
253
|
+
props.accessibilityState?.disabled ||
|
|
254
|
+
props['aria-disabled'] ||
|
|
255
|
+
props.accessibilityDisabled ||
|
|
256
|
+
false
|
|
257
|
+
)
|
|
258
|
+
}
|
package/src/hooks/useProps.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { getConfig } from '../config'
|
|
4
3
|
import { ComponentContext } from '../contexts/ComponentContext'
|
|
5
|
-
import { subscribeToContextGroup, useComponentState } from '../createComponent'
|
|
6
4
|
import { useSplitStyles } from '../helpers/getSplitStyles'
|
|
5
|
+
import { subscribeToContextGroup } from '../helpers/subscribeToContextGroup'
|
|
7
6
|
import type { SplitStyleProps, StaticConfig, ThemeParsed, UseMediaState } from '../types'
|
|
8
7
|
import { Stack } from '../views/Stack'
|
|
9
8
|
import type { ViewProps, ViewStyle } from '../views/View'
|
|
9
|
+
import { useComponentState } from './useComponentState'
|
|
10
10
|
import { useMedia } from './useMedia'
|
|
11
11
|
import { useThemeWithState } from './useTheme'
|
|
12
12
|
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DebugProp, SpaceDirection, SpaceValue, SpacerProps, SpacerStyleProps, StackNonStyleProps, StaticConfig, TamaguiComponent, TamaguiElement } from './types';
|
|
4
4
|
type ComponentSetState = React.Dispatch<React.SetStateAction<TamaguiComponentState>>;
|
|
5
5
|
export declare const componentSetStates: Set<ComponentSetState>;
|
|
6
|
-
export declare const useComponentState: (props: StackProps | TextProps | Record<string, any>, { animationDriver, groups }: ComponentContextI, staticConfig: StaticConfig, config: TamaguiInternalConfig) => {
|
|
7
|
-
curStateRef: TamaguiComponentStateRef;
|
|
8
|
-
disabled: any;
|
|
9
|
-
groupName: string;
|
|
10
|
-
hasAnimationProp: boolean;
|
|
11
|
-
hasEnterStyle: boolean;
|
|
12
|
-
isAnimated: boolean;
|
|
13
|
-
isExiting: boolean;
|
|
14
|
-
isHydrated: boolean;
|
|
15
|
-
presence: import("./types").UsePresenceResult | null;
|
|
16
|
-
presenceState: import("./types").PresenceContextProps | null | undefined;
|
|
17
|
-
setState: React.Dispatch<React.SetStateAction<TamaguiComponentState>>;
|
|
18
|
-
setStateShallow: (next?: Partial<TamaguiComponentState> | undefined) => void;
|
|
19
|
-
shouldAvoidClasses: boolean;
|
|
20
|
-
state: TamaguiComponentState;
|
|
21
|
-
stateRef: React.MutableRefObject<TamaguiComponentStateRef>;
|
|
22
|
-
supportsCSSVars: boolean | undefined;
|
|
23
|
-
willBeAnimated: boolean;
|
|
24
|
-
willBeAnimatedClient: boolean;
|
|
25
|
-
};
|
|
26
6
|
export declare function createComponent<ComponentPropTypes extends Record<string, any> = {}, Ref extends TamaguiElement = TamaguiElement, BaseProps = never, BaseStyles extends Object = never>(staticConfig: StaticConfig): TamaguiComponent<ComponentPropTypes, Ref, BaseProps, BaseStyles, {}>;
|
|
27
7
|
export declare function Unspaced(props: {
|
|
28
8
|
children?: any;
|
|
@@ -42,14 +22,5 @@ export type SpacedChildrenProps = {
|
|
|
42
22
|
debug?: DebugProp;
|
|
43
23
|
};
|
|
44
24
|
export declare function spacedChildren(props: SpacedChildrenProps): React.ReactNode;
|
|
45
|
-
export declare const isDisabled: (props: any) => any;
|
|
46
|
-
export declare const subscribeToContextGroup: ({ disabled, setStateShallow, pseudoGroups, mediaGroups, componentContext, state, }: {
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
setStateShallow: (next?: Partial<TamaguiComponentState> | undefined) => void;
|
|
49
|
-
pseudoGroups?: Set<string>;
|
|
50
|
-
mediaGroups?: Set<string>;
|
|
51
|
-
componentContext: ComponentContextI;
|
|
52
|
-
state: TamaguiComponentState;
|
|
53
|
-
}) => import("./types").DisposeFn | undefined;
|
|
54
25
|
export {};
|
|
55
26
|
//# sourceMappingURL=createComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAiBzB,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;AAchB,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,wEAknC3B;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,mBAiGxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,kBAAkB,EAKlB,kBAAkB,EAMnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,kBAAkB,EAKlB,kBAAkB,EAMnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CA6R1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AA+BA,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":"AA+BA,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;AA0BjB,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,KAAK,CAAC,EAAE,SAAS,EACjB,wBAAwB,CAAC,EAAE,OAAO,KAC/B,cAAc,CAAA;AAEnB,eAAO,MAAM,UAAU,MAAM,CAAA;AA+B7B,eAAO,MAAM,cAAc,EAAE,aA6wC5B,CAAA;AAgED,eAAO,MAAM,WAAW,eACV,aAAa,UACjB,MAAM,WACL,MAAM,wBACO,OAAO,KAC5B,SA2BF,CAAA;AAQD,eAAO,MAAM,cAAc,EAAE,aAa5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAQ/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;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,YAmKA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,aAAa,EACb,aAAa,EAEb,YAAY,EACb,MAAM,UAAU,CAAA;AAQjB,eAAO,MAAM,kBAAkB,IAAK,CAAA;AAEpC,eAAO,MAAM,eAAe,8BAAqB,CAAA;AACjD,eAAO,MAAM,WAAW,gBAAgC,CAAA;AACxD,eAAO,MAAM,gBAAgB,UAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,aAAa,EACb,aAAa,EAEb,YAAY,EACb,MAAM,UAAU,CAAA;AAQjB,eAAO,MAAM,kBAAkB,IAAK,CAAA;AAEpC,eAAO,MAAM,eAAe,8BAAqB,CAAA;AACjD,eAAO,MAAM,WAAW,gBAAgC,CAAA;AACxD,eAAO,MAAM,gBAAgB,UAA2B,CAAA;AA8BxD,wBAAgB,qBAAqB,SAkBpC;AAID,wBAAgB,aAAa,CAC3B,aAAa,UAAQ,EACrB,MAAM,CAAC,EAAE,YAAY,GACpB,aAAa,GAAG,SAAS,CA8B3B;AAuOD,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,uBAW9D;AAGD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,QAEjC;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,aAAa,QAqC5D;AAUD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,WAuBxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortString.d.ts","sourceRoot":"","sources":["../../src/helpers/sortString.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,MAAO,MAAM,KAAK,MAAM,eAAiC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TamaguiComponentState, ComponentContextI } from '../types';
|
|
2
|
+
export declare const subscribeToContextGroup: ({ disabled, setStateShallow, pseudoGroups, mediaGroups, componentContext, state, }: {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
setStateShallow: (next?: Partial<TamaguiComponentState> | undefined) => void;
|
|
5
|
+
pseudoGroups?: Set<string>;
|
|
6
|
+
mediaGroups?: Set<string>;
|
|
7
|
+
componentContext: ComponentContextI;
|
|
8
|
+
state: TamaguiComponentState;
|
|
9
|
+
}) => import("../types").DisposeFn | undefined;
|
|
10
|
+
//# sourceMappingURL=subscribeToContextGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeToContextGroup.d.ts","sourceRoot":"","sources":["../../src/helpers/subscribeToContextGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAc,MAAM,UAAU,CAAA;AAEpF,eAAO,MAAM,uBAAuB,uFAOjC;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,KAAK,IAAI,CAAA;IAC5E,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,gBAAgB,EAAE,iBAAiB,CAAA;IACnC,KAAK,EAAE,qBAAqB,CAAA;CAC7B,6CAqCA,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentContextI, StackProps, StaticConfig, TamaguiComponentState, TamaguiComponentStateRef, TamaguiInternalConfig, TextProps } from '../types';
|
|
2
|
+
export declare const useComponentState: (props: StackProps | TextProps | Record<string, any>, { animationDriver, groups }: ComponentContextI, staticConfig: StaticConfig, config: TamaguiInternalConfig) => {
|
|
3
|
+
curStateRef: TamaguiComponentStateRef;
|
|
4
|
+
disabled: any;
|
|
5
|
+
groupName: string;
|
|
6
|
+
hasAnimationProp: boolean;
|
|
7
|
+
hasEnterStyle: boolean;
|
|
8
|
+
isAnimated: boolean;
|
|
9
|
+
isExiting: boolean;
|
|
10
|
+
isHydrated: boolean;
|
|
11
|
+
presence: import("../types").UsePresenceResult | null;
|
|
12
|
+
presenceState: import("../types").PresenceContextProps | null | undefined;
|
|
13
|
+
setState: import("react").Dispatch<import("react").SetStateAction<TamaguiComponentState>>;
|
|
14
|
+
setStateShallow: (next?: Partial<TamaguiComponentState> | undefined) => void;
|
|
15
|
+
shouldAvoidClasses: boolean;
|
|
16
|
+
state: TamaguiComponentState;
|
|
17
|
+
stateRef: import("react").MutableRefObject<TamaguiComponentStateRef>;
|
|
18
|
+
supportsCSSVars: boolean | undefined;
|
|
19
|
+
willBeAnimated: boolean;
|
|
20
|
+
willBeAnimatedClient: boolean;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useComponentState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentState.d.ts","sourceRoot":"","sources":["../../src/hooks/useComponentState.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,iBAAiB,EAEjB,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,SAAS,EAEV,MAAM,UAAU,CAAA;AAMjB,eAAO,MAAM,iBAAiB,UACrB,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,+BACtB,iBAAiB,gBAChC,YAAY,UAClB,qBAAqB;;;;;;;;;;;;;;;;;;;CAqN9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProps.d.ts","sourceRoot":"","sources":["../../src/hooks/useProps.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProps.d.ts","sourceRoot":"","sources":["../../src/hooks/useProps.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAKzD,KAAK,eAAe,GAAG,IAAI,CACzB,eAAe,EACf,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,CAC9D,GAAG;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,YAAY,CAAC,EAAE;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,CAAA;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;KAEtC,GAAG,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,EAAE,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;CACjE,CAAA;AAED,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAA;AACjE,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAA;AAEjE;;;;;KAKK;AACL,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,uBAAuB,CAAC,CAAC,CAAC,CAW5B;AAED;;;;;KAKK;AACL,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,uBAAuB,CAAC,CAAC,CAAC,CAE5B;AAED;;;;;KAKK;AACL,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EACxD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,CA8DtF"}
|