@tamagui/core 1.0.1-beta.141 → 1.0.1-beta.142
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/Tamagui.js +2 -2
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +28 -22
- package/dist/cjs/addTheme.js.map +2 -2
- package/dist/cjs/config.js +75 -0
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/platform.js +7 -1
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/platform.native.js +62 -0
- package/dist/cjs/constants/platform.native.js.map +7 -0
- package/dist/cjs/createComponent.js +71 -58
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.server.js +431 -0
- package/dist/cjs/createComponent.server.js.map +7 -0
- package/dist/cjs/createTamagui.js +10 -8
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createVariable.js +6 -12
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +5 -2
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/RNComponents.js +11 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +7 -9
- package/dist/cjs/helpers/ThemeManager.js.map +2 -2
- package/dist/cjs/helpers/assignNativePropsToWeb.js +0 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +3 -3
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/expandStyles.js +4 -4
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/getAnimationDriver.js +32 -0
- package/dist/cjs/helpers/getAnimationDriver.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +3 -3
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/getFont.js +1 -1
- package/dist/cjs/helpers/getFont.js.map +2 -2
- package/dist/cjs/helpers/getSize.js +2 -2
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +12 -13
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +6 -4
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getVariantExtras.js +2 -2
- package/dist/cjs/helpers/getVariantExtras.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +2 -2
- package/dist/cjs/helpers/normalizeColor.js.map +2 -2
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/cjs/helpers/useAnimationDriver.js +2 -0
- package/dist/cjs/helpers/useAnimationDriver.js.map +7 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js +2 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +2 -2
- package/dist/cjs/hooks/useAnimationDriver.js +2 -0
- package/dist/cjs/hooks/useAnimationDriver.js.map +7 -0
- package/dist/cjs/hooks/useFeatures.js +2 -2
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useServerContext.js +21 -0
- package/dist/cjs/hooks/useServerContext.js.map +7 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +71 -41
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/index.js +7 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +2 -2
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/styled.js +11 -1
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +6 -1
- package/dist/cjs/views/TamaguiProvider.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +9 -5
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/esm/Tamagui.js +1 -1
- package/dist/esm/Tamagui.js.map +1 -1
- package/dist/esm/addTheme.js +27 -21
- package/dist/esm/addTheme.js.map +2 -2
- package/dist/esm/config.js +43 -0
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/platform.js +5 -1
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/platform.native.js +28 -0
- package/dist/esm/constants/platform.native.js.map +7 -0
- package/dist/esm/createComponent.js +71 -60
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.server.js +408 -0
- package/dist/esm/createComponent.server.js.map +7 -0
- package/dist/esm/createTamagui.js +7 -5
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createVariable.js +6 -12
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +5 -2
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +6 -8
- package/dist/esm/helpers/ThemeManager.js.map +2 -2
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +2 -2
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/expandStyles.js +3 -3
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/getFont.js +1 -1
- package/dist/esm/helpers/getFont.js.map +2 -2
- package/dist/esm/helpers/getSize.js +1 -1
- package/dist/esm/helpers/getSize.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +12 -13
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +5 -3
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getVariantExtras.js +1 -1
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +1 -1
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/helpers/useAnimationDriver.js +1 -0
- package/dist/esm/helpers/useAnimationDriver.js.map +7 -0
- package/dist/esm/hooks/getThemeUnwrapped.js +2 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +2 -2
- package/dist/esm/hooks/useAnimationDriver.js +1 -0
- package/dist/esm/hooks/useAnimationDriver.js.map +7 -0
- package/dist/esm/hooks/useFeatures.js +1 -1
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useServerContext.js +4 -0
- package/dist/esm/hooks/useServerContext.js.map +7 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +72 -42
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +1 -1
- package/dist/esm/insertFont.js.map +1 -1
- package/dist/esm/styled.js +11 -1
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +7 -2
- package/dist/esm/views/TamaguiProvider.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +9 -5
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/package.json +35 -14
- package/src/Tamagui.ts +1 -1
- package/src/addTheme.ts +33 -21
- package/src/{conf.ts → config.ts} +4 -0
- package/src/constants/platform.native.ts +14 -0
- package/src/constants/platform.ts +12 -1
- package/src/createComponent.tsx +164 -148
- package/src/createTamagui.ts +11 -5
- package/src/createVariable.ts +8 -25
- package/src/createVariables.ts +5 -2
- package/src/helpers/RNComponents.tsx +13 -13
- package/src/helpers/ThemeManager.tsx +15 -12
- package/src/helpers/assignNativePropsToWeb.tsx +0 -1
- package/src/helpers/createPropMapper.ts +2 -2
- package/src/helpers/expandStyles.ts +4 -3
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getExpandedShorthands.ts +2 -2
- package/src/helpers/getFont.tsx +1 -1
- package/src/helpers/getSize.ts +1 -1
- package/src/helpers/getSplitStyles.tsx +12 -13
- package/src/helpers/getStylesAtomic.ts +6 -3
- package/src/helpers/getVariantExtras.tsx +2 -2
- package/src/helpers/normalizeColor.ts +1 -1
- package/src/helpers/normalizeValueWithProperty.ts +2 -0
- package/src/hooks/getThemeUnwrapped.tsx +1 -0
- package/src/hooks/useFeatures.tsx +2 -1
- package/src/hooks/useServerHooks.tsx +13 -0
- package/src/hooks/useTheme.tsx +94 -48
- package/src/index.ts +2 -1
- package/src/injectStyles.ts +20 -0
- package/src/insertFont.ts +1 -1
- package/src/styled.tsx +15 -1
- package/src/types.tsx +33 -0
- package/src/views/TamaguiProvider.tsx +11 -4
- package/src/views/ThemeProvider.tsx +9 -6
- package/types/config.d.ts +27 -0
- package/types/constants/platform.d.ts +1 -0
- package/types/constants/platform.native.d.ts +13 -0
- package/types/createComponent.server.d.ts +36 -0
- package/types/createVariable.d.ts +1 -2
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +2 -8
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/useAnimationDriver.d.ts +1 -0
- package/types/hooks/useAnimationDriver.d.ts +1 -0
- package/types/hooks/useServerContext.d.ts +2 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +5 -21
- package/types/index.d.ts +2 -1
- package/types/injectStyles.d.ts +7 -0
- package/types/types.d.ts +23 -0
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// for vite dev mode
|
|
2
|
+
|
|
3
|
+
const stylesheets: Record<string, HTMLElement> = {}
|
|
4
|
+
|
|
5
|
+
interface InjectStylesOptions {
|
|
6
|
+
filePath: string
|
|
7
|
+
css: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const injectStyles = ({ filePath, css }: InjectStylesOptions) => {
|
|
11
|
+
let stylesheet = stylesheets[filePath]
|
|
12
|
+
if (!stylesheet) {
|
|
13
|
+
const styleEl = document.createElement('style')
|
|
14
|
+
styleEl.setAttribute('data-file', filePath)
|
|
15
|
+
styleEl.setAttribute('type', 'text/css')
|
|
16
|
+
stylesheet = stylesheets[filePath] = styleEl
|
|
17
|
+
document.head.appendChild(styleEl)
|
|
18
|
+
}
|
|
19
|
+
stylesheet.innerHTML = css
|
|
20
|
+
}
|
package/src/insertFont.ts
CHANGED
package/src/styled.tsx
CHANGED
|
@@ -43,7 +43,21 @@ export function styled<
|
|
|
43
43
|
if (defaultVariants) {
|
|
44
44
|
Object.assign(defaultProps, defaultVariants)
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
let isReactNativeWeb = parentStaticConfig?.isReactNativeWeb || RNComponents.has(Component)
|
|
47
|
+
// this can happen due to smart-ness in fake-react-native, rough heuristic here to ensure we match (could be better..)
|
|
48
|
+
if (!('staticConfig' in Component) && !isReactNativeWeb) {
|
|
49
|
+
if (RNComponents.has(Component['displayName'])) {
|
|
50
|
+
RNComponents.add(Component)
|
|
51
|
+
isReactNativeWeb = true
|
|
52
|
+
} else {
|
|
53
|
+
if (process.env.NODE_ENV === 'development') {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.warn(
|
|
56
|
+
`Invalid styled() component: Tamagui only accepts react-native Text, View, Image, TextInput, or another styled Tamagui view`
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
47
61
|
const reactNativeWebComponent = isReactNativeWeb
|
|
48
62
|
? parentStaticConfig?.reactNativeWebComponent || Component
|
|
49
63
|
: null
|
package/src/types.tsx
CHANGED
|
@@ -1198,9 +1198,42 @@ type AnimationConfig = {
|
|
|
1198
1198
|
[key: string]: any
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
|
+
// includes a very limited adapter between various impls for number => style
|
|
1202
|
+
// this is useful only in limited scenarios like `Sheet`, but necessary in those cases
|
|
1203
|
+
|
|
1204
|
+
export type AnimatedNumberStrategy =
|
|
1205
|
+
// only values shared between reanimated/react-native for now
|
|
1206
|
+
| {
|
|
1207
|
+
type: 'spring'
|
|
1208
|
+
stiffness?: number
|
|
1209
|
+
damping?: number
|
|
1210
|
+
mass?: number
|
|
1211
|
+
overshootClamping?: boolean
|
|
1212
|
+
restSpeedThreshold?: number
|
|
1213
|
+
restDisplacementThreshold?: number
|
|
1214
|
+
}
|
|
1215
|
+
| { type: 'timing'; duration: number }
|
|
1216
|
+
| { type: 'direct' }
|
|
1217
|
+
|
|
1218
|
+
export type UniversalAnimatedNumber<A> = {
|
|
1219
|
+
getInstance(): A
|
|
1220
|
+
getValue(): number
|
|
1221
|
+
setValue(next: number, config?: AnimatedNumberStrategy): void
|
|
1222
|
+
stop(): void
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1201
1225
|
export type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
1202
1226
|
avoidClasses?: boolean
|
|
1203
1227
|
useAnimations: UseAnimationHook
|
|
1228
|
+
useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>
|
|
1229
|
+
useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(
|
|
1230
|
+
val: V,
|
|
1231
|
+
getStyle: (current: any) => any
|
|
1232
|
+
) => void
|
|
1233
|
+
useAnimatedNumberReaction: (
|
|
1234
|
+
val: UniversalAnimatedNumber<any>,
|
|
1235
|
+
onValue: (current: number) => void
|
|
1236
|
+
) => void
|
|
1204
1237
|
animations: A
|
|
1205
1238
|
View?: any
|
|
1206
1239
|
Text?: any
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { useForceUpdate } from '@tamagui/use-force-update'
|
|
1
2
|
import * as React from 'react'
|
|
2
3
|
|
|
3
|
-
import {
|
|
4
|
-
import { isClient, isSSR } from '../constants/platform'
|
|
4
|
+
import { isClient, isRSC, isSSR } from '../constants/platform'
|
|
5
5
|
import { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'
|
|
6
6
|
import { TextAncestorProvider } from '../contexts/TextAncestorContext'
|
|
7
7
|
import { useMediaQueryListeners } from '../hooks/useMedia'
|
|
8
|
-
import { TamaguiProviderProps } from '../types'
|
|
8
|
+
import type { TamaguiProviderProps } from '../types'
|
|
9
9
|
import { ThemeProvider } from './ThemeProvider'
|
|
10
10
|
|
|
11
11
|
export function TamaguiProvider({
|
|
@@ -14,6 +14,14 @@ export function TamaguiProvider({
|
|
|
14
14
|
config,
|
|
15
15
|
...themePropsProvider
|
|
16
16
|
}: TamaguiProviderProps) {
|
|
17
|
+
if (isRSC) {
|
|
18
|
+
return (
|
|
19
|
+
<span style={{ display: 'contents' }} className={`t_${config.defaultTheme || 'light'}`}>
|
|
20
|
+
{children}
|
|
21
|
+
</span>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
if (!isSSR) {
|
|
18
26
|
useMediaQueryListeners()
|
|
19
27
|
}
|
|
@@ -36,7 +44,6 @@ export function TamaguiProvider({
|
|
|
36
44
|
<ButtonInsideButtonContext.Provider value={false}>
|
|
37
45
|
<TextAncestorProvider>
|
|
38
46
|
<ThemeProvider
|
|
39
|
-
themes={config.themes}
|
|
40
47
|
defaultTheme={config.defaultTheme || 'light'}
|
|
41
48
|
themeClassNameOnRoot={config.themeClassNameOnRoot}
|
|
42
49
|
disableRootThemeClass={config.disableRootThemeClass}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useLayoutEffect, useMemo } from 'react'
|
|
2
2
|
|
|
3
|
-
import { getHasConfigured } from '../
|
|
3
|
+
import { getConfig, getHasConfigured } from '../config'
|
|
4
4
|
import { THEME_CLASSNAME_PREFIX } from '../constants/constants'
|
|
5
5
|
import { ThemeContext } from '../contexts/ThemeContext'
|
|
6
6
|
import { Theme } from './Theme'
|
|
@@ -10,7 +10,6 @@ React['createElement']
|
|
|
10
10
|
|
|
11
11
|
export type ThemeProviderProps = {
|
|
12
12
|
className?: string
|
|
13
|
-
themes: any
|
|
14
13
|
defaultTheme: string
|
|
15
14
|
disableRootThemeClass?: boolean
|
|
16
15
|
themeClassNameOnRoot?: boolean
|
|
@@ -19,8 +18,10 @@ export type ThemeProviderProps = {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export const ThemeProvider = (props: ThemeProviderProps) => {
|
|
22
|
-
if (
|
|
23
|
-
|
|
21
|
+
if (process.env.NODE_ENV === 'development') {
|
|
22
|
+
if (!getHasConfigured()) {
|
|
23
|
+
throw new Error(`Missing configureThemes() call, add to your root file`)
|
|
24
|
+
}
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// ensure theme is attached to root body node as well to work with modals by default
|
|
@@ -40,10 +41,12 @@ export const ThemeProvider = (props: ThemeProviderProps) => {
|
|
|
40
41
|
|
|
41
42
|
const themeContext = useMemo(() => {
|
|
42
43
|
return {
|
|
43
|
-
themes
|
|
44
|
+
get themes() {
|
|
45
|
+
return getConfig().themes
|
|
46
|
+
},
|
|
44
47
|
defaultTheme: props.defaultTheme,
|
|
45
48
|
}
|
|
46
|
-
}, [props.defaultTheme
|
|
49
|
+
}, [props.defaultTheme])
|
|
47
50
|
|
|
48
51
|
return (
|
|
49
52
|
<ThemeContext.Provider value={themeContext}>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ConfigListener, TamaguiInternalConfig } from './types';
|
|
2
|
+
export declare const setConfig: (next: TamaguiInternalConfig) => void;
|
|
3
|
+
export declare const setConfigFont: (name: string, font: any, fontParsed: any) => void;
|
|
4
|
+
export declare const getHasConfigured: () => boolean;
|
|
5
|
+
export declare const getConfig: () => TamaguiInternalConfig<import("./types").CreateTokens<import("./types").VariableVal>, {
|
|
6
|
+
[key: string]: Partial<import("./types").TamaguiBaseTheme> & {
|
|
7
|
+
[key: string]: import("./types").VariableVal;
|
|
8
|
+
};
|
|
9
|
+
}, {}, {
|
|
10
|
+
[key: string]: {
|
|
11
|
+
[key: string]: string | number;
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
[key: string]: string | {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
}, import("./types").GenericFonts>;
|
|
18
|
+
export declare const getTokens: () => import("./types").CreateTokens<import("./createVariable").Variable<import("./createVariable").VariableValue>>;
|
|
19
|
+
export declare const getThemes: () => {
|
|
20
|
+
[key: string]: Partial<import("./types").TamaguiBaseTheme> & {
|
|
21
|
+
[key: string]: import("./types").VariableVal;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const configListeners: Set<ConfigListener>;
|
|
25
|
+
export declare const onConfiguredOnce: (cb: ConfigListener) => void;
|
|
26
|
+
export declare const updateConfig: (key: string, value: any) => void;
|
|
27
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -5,6 +5,7 @@ export declare const isWeb: boolean;
|
|
|
5
5
|
export declare const isWindowDefined: boolean;
|
|
6
6
|
export declare const isSSR: boolean;
|
|
7
7
|
export declare const isClient: boolean;
|
|
8
|
+
export declare const isRSC: any;
|
|
8
9
|
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
9
10
|
export declare const isChrome: boolean;
|
|
10
11
|
export declare const isWebTouchable: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
export declare const isAndroid: boolean;
|
|
3
|
+
export declare const isIOS: boolean;
|
|
4
|
+
export declare const isWeb = false;
|
|
5
|
+
export declare const isWindowDefined = false;
|
|
6
|
+
export declare const isSSR = false;
|
|
7
|
+
export declare const isClient = false;
|
|
8
|
+
export declare const isRSC = false;
|
|
9
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
10
|
+
export declare const isChrome = false;
|
|
11
|
+
export declare const isWebTouchable = false;
|
|
12
|
+
export declare const isTouchable = true;
|
|
13
|
+
//# sourceMappingURL=platform.native.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpaceDirection, SpaceTokens, SpacerProps, StaticConfig, StaticConfigParsed, StylableComponent, TamaguiComponent, TamaguiElement } from './types';
|
|
3
|
+
export declare const mouseUps: Set<Function>;
|
|
4
|
+
export declare function createComponent<ComponentPropTypes extends Object = {}, Ref = TamaguiElement, BaseProps = never>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent): TamaguiComponent<ComponentPropTypes, Ref, BaseProps, {}>;
|
|
5
|
+
export declare const Unspaced: {
|
|
6
|
+
(props: {
|
|
7
|
+
children?: any;
|
|
8
|
+
}): any;
|
|
9
|
+
isUnspaced: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const Spacer: TamaguiComponent<SpacerProps, TamaguiElement, never, {}>;
|
|
12
|
+
export declare type SpacedChildrenProps = {
|
|
13
|
+
isZStack?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
space?: SpaceTokens | number | null;
|
|
16
|
+
spaceFlex?: boolean | number;
|
|
17
|
+
direction?: SpaceDirection;
|
|
18
|
+
separator?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare function spacedChildren({ isZStack, children, space, direction, spaceFlex, separator, }: SpacedChildrenProps): React.ReactNode;
|
|
21
|
+
export declare function processIDRefList(idRefList: string | Array<string>): string;
|
|
22
|
+
export declare const accessibilityRoleToWebRole: {
|
|
23
|
+
adjustable: string;
|
|
24
|
+
button: string;
|
|
25
|
+
header: string;
|
|
26
|
+
image: string;
|
|
27
|
+
imagebutton: null;
|
|
28
|
+
keyboardkey: null;
|
|
29
|
+
label: null;
|
|
30
|
+
link: string;
|
|
31
|
+
none: string;
|
|
32
|
+
search: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
text: null;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=createComponent.server.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { VariableColorVal } from './types';
|
|
2
1
|
declare const IS_VAR = "__isVar__";
|
|
3
2
|
export declare type VariableValue = string | number;
|
|
4
3
|
declare type VariableIn<A extends VariableValue = VariableValue> = {
|
|
@@ -19,7 +18,7 @@ export declare const createVariable: <A extends string | number = any>(props: Va
|
|
|
19
18
|
isFloating?: boolean | undefined;
|
|
20
19
|
__isVar__: boolean;
|
|
21
20
|
};
|
|
22
|
-
export declare function variableToString(vrble?:
|
|
21
|
+
export declare function variableToString(vrble?: any): string;
|
|
23
22
|
export declare function isVariable(v: Variable | any): v is Variable;
|
|
24
23
|
export declare function getVariableValue(v: Variable | any): any;
|
|
25
24
|
export declare function getVariableName(v: Variable | any): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const RNComponents:
|
|
1
|
+
export declare const RNComponents: Set<any>;
|
|
2
2
|
//# sourceMappingURL=RNComponents.d.ts.map
|
|
@@ -30,14 +30,8 @@ export declare class ThemeManager {
|
|
|
30
30
|
update({ name, theme, className }?: SetActiveThemeProps, force?: boolean): boolean;
|
|
31
31
|
getNextTheme(props?: GetNextThemeProps, debug?: any): {
|
|
32
32
|
name: string;
|
|
33
|
-
theme:
|
|
34
|
-
|
|
35
|
-
}) | null;
|
|
36
|
-
className?: undefined;
|
|
37
|
-
} | {
|
|
38
|
-
name: string;
|
|
39
|
-
theme: any;
|
|
40
|
-
className: string;
|
|
33
|
+
theme: ThemeObject | null;
|
|
34
|
+
className: string | undefined;
|
|
41
35
|
};
|
|
42
36
|
getClassName(name: string): string;
|
|
43
37
|
track(uuid: any, keys: Set<string>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=useAnimationDriver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=useAnimationDriver.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeManager } from '../helpers/ThemeManager';
|
|
2
2
|
import { ThemeName, ThemeObject } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export interface ThemeProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
disableThemeClass?: boolean;
|
|
6
6
|
name: Exclude<ThemeName, number> | null;
|
|
@@ -8,7 +8,7 @@ export declare type ThemeProps = {
|
|
|
8
8
|
children?: any;
|
|
9
9
|
reset?: boolean;
|
|
10
10
|
debug?: boolean | 'verbose';
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
export declare const useTheme: (themeName?: string | null, componentName?: string, props?: ThemeProps, forceUpdate?: any) => ThemeObject;
|
|
13
13
|
export declare const getThemeManager: (theme: any) => ThemeManager | undefined;
|
|
14
14
|
export declare const useThemeName: (opts?: {
|
|
@@ -17,26 +17,10 @@ export declare const useThemeName: (opts?: {
|
|
|
17
17
|
export declare const useDefaultThemeName: () => ThemeName | undefined;
|
|
18
18
|
export declare const activeThemeManagers: Set<ThemeManager>;
|
|
19
19
|
export declare const useChangeThemeEffect: (name?: string | null, componentName?: string, props?: ThemeProps, forceUpdateProp?: any) => {
|
|
20
|
-
themes:
|
|
21
|
-
[key: string]: Partial<import("../types").TamaguiBaseTheme> & {
|
|
22
|
-
[key: string]: import("../types").VariableVal;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
themeManager: ThemeManager | null;
|
|
26
|
-
name: string;
|
|
27
|
-
theme: (Partial<import("../types").TamaguiBaseTheme> & {
|
|
28
|
-
[key: string]: import("../types").VariableVal;
|
|
29
|
-
}) | null;
|
|
30
|
-
className?: undefined;
|
|
31
|
-
} | {
|
|
32
|
-
themes: {
|
|
33
|
-
[key: string]: Partial<import("../types").TamaguiBaseTheme> & {
|
|
34
|
-
[key: string]: import("../types").VariableVal;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
20
|
+
themes: Record<string, ThemeObject>;
|
|
37
21
|
themeManager: ThemeManager | null;
|
|
38
22
|
name: string;
|
|
39
|
-
theme:
|
|
40
|
-
className
|
|
23
|
+
theme: ThemeObject | null;
|
|
24
|
+
className?: string | undefined;
|
|
41
25
|
};
|
|
42
26
|
//# sourceMappingURL=useTheme.d.ts.map
|
package/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './updateTheme';
|
|
|
13
13
|
export * from './styled';
|
|
14
14
|
export * from './types';
|
|
15
15
|
export type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
16
|
-
export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './
|
|
16
|
+
export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './config';
|
|
17
17
|
export * from './constants/constants';
|
|
18
18
|
export * from './constants/platform';
|
|
19
19
|
export { createDOMProps } from '@tamagui/rnw';
|
|
@@ -21,6 +21,7 @@ export * from './helpers/calc';
|
|
|
21
21
|
export * from './helpers/createShallowUpdate';
|
|
22
22
|
export * from './helpers/getStackSize';
|
|
23
23
|
export * from './helpers/getVariantExtras';
|
|
24
|
+
export * from './helpers/getAnimationDriver';
|
|
24
25
|
export * from './helpers/getExpandedShorthands';
|
|
25
26
|
export * from './helpers/getSize';
|
|
26
27
|
export * from './helpers/getSplitStyles';
|
package/types/types.d.ts
CHANGED
|
@@ -460,9 +460,32 @@ export declare type SplitStyleState = TamaguiComponentState & {
|
|
|
460
460
|
declare type AnimationConfig = {
|
|
461
461
|
[key: string]: any;
|
|
462
462
|
};
|
|
463
|
+
export declare type AnimatedNumberStrategy = {
|
|
464
|
+
type: 'spring';
|
|
465
|
+
stiffness?: number;
|
|
466
|
+
damping?: number;
|
|
467
|
+
mass?: number;
|
|
468
|
+
overshootClamping?: boolean;
|
|
469
|
+
restSpeedThreshold?: number;
|
|
470
|
+
restDisplacementThreshold?: number;
|
|
471
|
+
} | {
|
|
472
|
+
type: 'timing';
|
|
473
|
+
duration: number;
|
|
474
|
+
} | {
|
|
475
|
+
type: 'direct';
|
|
476
|
+
};
|
|
477
|
+
export declare type UniversalAnimatedNumber<A> = {
|
|
478
|
+
getInstance(): A;
|
|
479
|
+
getValue(): number;
|
|
480
|
+
setValue(next: number, config?: AnimatedNumberStrategy): void;
|
|
481
|
+
stop(): void;
|
|
482
|
+
};
|
|
463
483
|
export declare type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
464
484
|
avoidClasses?: boolean;
|
|
465
485
|
useAnimations: UseAnimationHook;
|
|
486
|
+
useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>;
|
|
487
|
+
useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(val: V, getStyle: (current: any) => any) => void;
|
|
488
|
+
useAnimatedNumberReaction: (val: UniversalAnimatedNumber<any>, onValue: (current: number) => void) => void;
|
|
466
489
|
animations: A;
|
|
467
490
|
View?: any;
|
|
468
491
|
Text?: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TamaguiProviderProps } from '../types';
|
|
2
|
+
import type { TamaguiProviderProps } from '../types';
|
|
3
3
|
export declare function TamaguiProvider({ children, disableInjectCSS, config, ...themePropsProvider }: TamaguiProviderProps): JSX.Element;
|
|
4
4
|
//# sourceMappingURL=TamaguiProvider.d.ts.map
|