@tamagui/core 1.0.1-beta.190 → 1.0.1-beta.191
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/addTheme.js.map +2 -2
- package/dist/cjs/createComponent.js +2 -2
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createShorthands.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +4 -2
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +5 -9
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +12 -18
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/esm/addTheme.js.map +2 -2
- package/dist/esm/createComponent.js +2 -2
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createShorthands.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +4 -2
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +5 -9
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/views/Slot.js +12 -12
- package/dist/esm/views/Slot.js.map +2 -2
- package/package.json +13 -12
- package/src/addTheme.ts +1 -0
- package/src/createComponent.tsx +4 -2
- package/src/createShorthands.ts +4 -2
- package/src/helpers/createPropMapper.ts +5 -2
- package/src/helpers/expandStyles.ts +1 -0
- package/src/helpers/insertStyleRule.tsx +11 -11
- package/src/types.tsx +58 -39
- package/src/views/Slot.tsx +16 -20
- package/types/Tamagui.d.ts +1 -1
- package/types/config.d.ts +1 -1
- package/types/createShorthands.d.ts +2 -1
- package/types/helpers/expandStyles.d.ts +5 -5
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/types.d.ts +30 -19
- package/types/views/Slot.d.ts +4 -4
- package/src/constants/platform.native.ts +0 -14
- package/src/constants/platform.ts +0 -41
- package/types/conf.d.ts +0 -26
- package/types/createComponent.server.d.ts +0 -36
- package/types/helpers/createShallowUpdate.d.ts +0 -3
- package/types/helpers/cssHash.d.ts +0 -2
- package/types/helpers/useAnimationDriver.d.ts +0 -1
- package/types/hooks/useAnimationDriver.d.ts +0 -1
- package/types/hooks/useDidFinishSSR.d.ts +0 -3
- package/types/hooks/useFeatures.d.ts +0 -23
- package/types/hooks/useIsSSR.d.ts +0 -4
- package/types/hooks/useServerContext.d.ts +0 -2
package/types/types.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ export declare type TamaguiComponentPropsBase = {
|
|
|
30
30
|
tag?: string;
|
|
31
31
|
theme?: ThemeName | null;
|
|
32
32
|
componentName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Forces the pseudo style state to be on
|
|
35
|
+
*/
|
|
33
36
|
forceStyle?: 'hover' | 'press' | 'focus';
|
|
34
37
|
onHoverIn?: (e: MouseEvent) => any;
|
|
35
38
|
onHoverOut?: (e: MouseEvent) => any;
|
|
@@ -39,8 +42,6 @@ export declare type TamaguiComponentPropsBase = {
|
|
|
39
42
|
onMouseEnter?: (e: MouseEvent) => any;
|
|
40
43
|
onMouseLeave?: (e: MouseEvent) => any;
|
|
41
44
|
onMouseDown?: (e: MouseEvent) => any;
|
|
42
|
-
userSelect?: Properties['userSelect'];
|
|
43
|
-
cursor?: Properties['cursor'];
|
|
44
45
|
};
|
|
45
46
|
export declare type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<Props & React.RefAttributes<Ref>>;
|
|
46
47
|
export declare type ConfigListener = (conf: TamaguiInternalConfig) => void;
|
|
@@ -88,7 +89,11 @@ declare type GenericThemes = {
|
|
|
88
89
|
[key: string]: VariableVal;
|
|
89
90
|
});
|
|
90
91
|
};
|
|
91
|
-
declare type
|
|
92
|
+
declare type AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase;
|
|
93
|
+
export declare type CreateShorthands = {
|
|
94
|
+
[key: string]: AllStyleKeys;
|
|
95
|
+
};
|
|
96
|
+
export declare type GenericShorthands = {};
|
|
92
97
|
declare type GenericMedia = {
|
|
93
98
|
[key: string]: {
|
|
94
99
|
[key: string]: number | string;
|
|
@@ -148,13 +153,15 @@ export declare type AnimationKeys = TamaguiConfig['animations'] extends Animatio
|
|
|
148
153
|
export declare type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>;
|
|
149
154
|
declare type ArrayIntersection<A extends any[]> = A[keyof A];
|
|
150
155
|
declare type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
|
|
151
|
-
|
|
156
|
+
declare type SpacerPropsBase = {
|
|
152
157
|
size?: number | SpaceTokens | null;
|
|
153
158
|
flex?: boolean | number;
|
|
154
159
|
direction?: SpaceDirection;
|
|
155
160
|
};
|
|
161
|
+
declare type SpacerOwnProps = SpacerPropsBase & WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>;
|
|
162
|
+
export declare type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> & SpacerOwnProps;
|
|
156
163
|
export declare type CreateTamaguiProps = {
|
|
157
|
-
shorthands?:
|
|
164
|
+
shorthands?: CreateShorthands;
|
|
158
165
|
media?: GenericTamaguiConfig['media'];
|
|
159
166
|
animations?: AnimationDriver<any>;
|
|
160
167
|
fonts: GenericTamaguiConfig['fonts'];
|
|
@@ -333,19 +340,18 @@ export declare type PseudoStyles = {
|
|
|
333
340
|
declare type WithThemeAndShorthands<A extends object> = WithThemeValues<A> & WithShorthands<WithThemeValues<A>>;
|
|
334
341
|
declare type WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>;
|
|
335
342
|
declare type WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
343
|
+
/**
|
|
344
|
+
* Base style-only props (no media, pseudo):
|
|
345
|
+
*/
|
|
346
|
+
declare type StylePropsWebOnly = {
|
|
340
347
|
pointerEvents?: ViewProps['pointerEvents'];
|
|
348
|
+
cursor?: Properties['cursor'];
|
|
349
|
+
contain?: Properties['contain'];
|
|
350
|
+
display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex';
|
|
351
|
+
userSelect?: Properties['userSelect'];
|
|
341
352
|
};
|
|
342
|
-
export declare type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> & TransformStyleProps &
|
|
343
|
-
export declare type
|
|
344
|
-
export declare type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
|
|
345
|
-
export declare type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>;
|
|
346
|
-
export declare type StackProps = StackPropsBaseShared & StackStyleProps;
|
|
347
|
-
export declare type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
|
|
348
|
-
export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps & {
|
|
353
|
+
export declare type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> & TransformStyleProps & StylePropsWebOnly;
|
|
354
|
+
export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & StylePropsWebOnly & {
|
|
349
355
|
ellipse?: boolean;
|
|
350
356
|
selectable?: boolean;
|
|
351
357
|
textDecorationDistance?: number;
|
|
@@ -353,10 +359,14 @@ export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVi
|
|
|
353
359
|
whiteSpace?: Properties['whiteSpace'];
|
|
354
360
|
wordWrap?: Properties['wordWrap'];
|
|
355
361
|
};
|
|
356
|
-
export declare type
|
|
357
|
-
export declare type
|
|
362
|
+
export declare type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> & RNWViewProps & TamaguiComponentPropsBase;
|
|
363
|
+
export declare type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
|
|
364
|
+
export declare type StackPropsBase = StackNonStyleProps & WithThemeAndShorthands<StackStylePropsBase>;
|
|
365
|
+
export declare type StackProps = StackNonStyleProps & StackStyleProps;
|
|
366
|
+
export declare type TextNonStyleProps = Omit<ReactTextProps, 'children'> & RNWTextProps & TamaguiComponentPropsBase;
|
|
367
|
+
export declare type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>;
|
|
358
368
|
export declare type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>;
|
|
359
|
-
export declare type TextProps =
|
|
369
|
+
export declare type TextProps = TextNonStyleProps & TextStyleProps;
|
|
360
370
|
export declare type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase>;
|
|
361
371
|
export declare type TamaguiComponent<Props = any, Ref = any, BaseProps = {}, VariantProps = {}> = ReactComponentWithRef<Props, Ref> & StaticComponentObject;
|
|
362
372
|
declare type StaticComponentObject = {
|
|
@@ -617,5 +627,6 @@ export declare type UseAnimationHelpers = {
|
|
|
617
627
|
export declare type UseAnimationHook = (props: UseAnimationProps, helpers: UseAnimationHelpers) => null | {
|
|
618
628
|
style?: StackStylePropsBase | StackStylePropsBase[];
|
|
619
629
|
};
|
|
630
|
+
export declare type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
|
|
620
631
|
export {};
|
|
621
632
|
//# sourceMappingURL=types.d.ts.map
|
package/types/views/Slot.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare type SlotProps = {
|
|
3
|
-
children?:
|
|
3
|
+
children?: ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const Slot:
|
|
5
|
+
export declare const Slot: import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<HTMLElement>>;
|
|
6
6
|
export declare const Slottable: ({ children }: {
|
|
7
|
-
children:
|
|
7
|
+
children: ReactNode;
|
|
8
8
|
}) => JSX.Element;
|
|
9
9
|
export declare function mergeEvent(a?: Function, b?: Function): (...args: unknown[]) => void;
|
|
10
10
|
//# sourceMappingURL=Slot.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react'
|
|
2
|
-
import { Platform } from 'react-native'
|
|
3
|
-
|
|
4
|
-
export const isAndroid = Platform?.OS === 'android'
|
|
5
|
-
export const isIOS = Platform?.OS === 'ios'
|
|
6
|
-
export const isWeb = false
|
|
7
|
-
export const isWindowDefined = false
|
|
8
|
-
export const isServer = false
|
|
9
|
-
export const isClient = false
|
|
10
|
-
export const isRSC = false
|
|
11
|
-
export const useIsomorphicLayoutEffect = useLayoutEffect
|
|
12
|
-
export const isChrome = false
|
|
13
|
-
export const isWebTouchable = false
|
|
14
|
-
export const isTouchable = true
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect } from 'react'
|
|
2
|
-
import { Platform } from 'react-native'
|
|
3
|
-
|
|
4
|
-
export const isAndroid = Platform?.OS === 'android'
|
|
5
|
-
export const isIOS = Platform?.OS === 'ios'
|
|
6
|
-
export const isWeb = process.env.TAMAGUI_TARGET === 'web'
|
|
7
|
-
export const isWindowDefined = typeof window !== 'undefined'
|
|
8
|
-
export const isServer = isWeb && !isWindowDefined
|
|
9
|
-
export const isClient = isWeb && isWindowDefined
|
|
10
|
-
|
|
11
|
-
// may want to move to VITE_RSC_BUILD
|
|
12
|
-
export const isRSC = process.env.ENABLE_RSC
|
|
13
|
-
? // note this is statically analyzed so no funny business, just access it without optional chaining
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
import.meta.env
|
|
16
|
-
? // @ts-ignore
|
|
17
|
-
import.meta.env.SSR
|
|
18
|
-
: false
|
|
19
|
-
: false
|
|
20
|
-
|
|
21
|
-
const idFn = () => {}
|
|
22
|
-
export const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? useEffect : useLayoutEffect
|
|
23
|
-
export const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')
|
|
24
|
-
export const isWebTouchable = isClient && 'ontouchstart' in window
|
|
25
|
-
export const isTouchable = !isWeb || isWebTouchable
|
|
26
|
-
|
|
27
|
-
if (process.env.NODE_ENV === 'development') {
|
|
28
|
-
if (!process.env.TAMAGUI_TARGET) {
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.warn(`Must set TAMAGUI_TARGET to "web" or "native"`)
|
|
31
|
-
} else if (
|
|
32
|
-
isClient &&
|
|
33
|
-
process.env.TAMAGUI_TARGET !== 'web' &&
|
|
34
|
-
process.env.TAMAGUI_IGNORE_TARGET !== '1'
|
|
35
|
-
) {
|
|
36
|
-
// eslint-disable-next-line no-console
|
|
37
|
-
console.warn(
|
|
38
|
-
`Must set TAMAGUI_TARGET to "web" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
}
|
package/types/conf.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=conf.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=useAnimationDriver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=useAnimationDriver.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { View, ViewStyle } from 'react-native';
|
|
3
|
-
import { PseudoStyles, SplitStyleState, StaticConfigParsed, TamaguiComponentState, UseAnimationHook } from '../types';
|
|
4
|
-
declare type FeatureUtils = {
|
|
5
|
-
forceUpdate: Function;
|
|
6
|
-
state: SplitStyleState;
|
|
7
|
-
setStateShallow: (next: Partial<TamaguiComponentState>) => void;
|
|
8
|
-
useAnimations?: UseAnimationHook;
|
|
9
|
-
pseudos: PseudoStyles;
|
|
10
|
-
style: ViewStyle | null | undefined;
|
|
11
|
-
staticConfig: StaticConfigParsed;
|
|
12
|
-
theme: any;
|
|
13
|
-
onDidAnimate?: () => void;
|
|
14
|
-
hostRef: RefObject<HTMLElement | View>;
|
|
15
|
-
};
|
|
16
|
-
export declare const useFeatures: (props: any, utils?: FeatureUtils) => {
|
|
17
|
-
elements: JSX.Element[];
|
|
18
|
-
enabled: {
|
|
19
|
-
mediaQuery?: boolean | undefined;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=useFeatures.d.ts.map
|