@tamagui/core 1.0.1-beta.108 → 1.0.1-beta.111
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/Pressability.js +1 -0
- package/dist/cjs/Pressability.js.map +1 -1
- package/dist/cjs/Pressability.native.js +1 -0
- package/dist/cjs/Pressability.native.js.map +1 -1
- package/dist/cjs/Tamagui.js +1 -0
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/ThemeContext.js +1 -0
- package/dist/cjs/ThemeContext.js.map +1 -1
- package/dist/cjs/ThemeManager.js +1 -0
- package/dist/cjs/ThemeManager.js.map +1 -1
- package/dist/cjs/conf.js +1 -0
- package/dist/cjs/conf.js.map +1 -1
- package/dist/cjs/constants/constants.js +9 -21
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/platform.js +1 -0
- package/dist/cjs/constants/platform.js.map +1 -1
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +1 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/createComponent.js +114 -216
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +1 -0
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createShorthands.js +1 -0
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +7 -23
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/createTheme.js +1 -0
- package/dist/cjs/createTheme.js.map +1 -1
- package/dist/cjs/createTokens.js +1 -0
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createVariable.js +1 -0
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariables.js +1 -0
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/defaultComponentState.js +1 -0
- package/dist/cjs/helpers/RNComponents.js +1 -0
- package/dist/cjs/helpers/RNComponents.js.map +1 -1
- package/dist/cjs/helpers/areEqualSets.js +1 -0
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/calc.js +1 -0
- package/dist/cjs/helpers/calc.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.js +1 -0
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createPropMapper.js +1 -0
- package/dist/cjs/helpers/createPropMapper.js.map +1 -1
- package/dist/cjs/helpers/createShallowUpdate.js +2 -15
- package/dist/cjs/helpers/createShallowUpdate.js.map +1 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +10 -37
- package/dist/cjs/helpers/createTamaguiProvider.js.map +1 -1
- package/dist/cjs/helpers/cssHash.js +1 -0
- package/dist/cjs/helpers/cssHash.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.js +7 -19
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.js +21 -32
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/extendStaticConfig.js +30 -29
- package/dist/cjs/helpers/extendStaticConfig.js.map +1 -1
- package/dist/cjs/helpers/fixNativeShadow.js +1 -0
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +1 -0
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getFont.js +1 -0
- package/dist/cjs/helpers/getFont.js.map +1 -1
- package/dist/cjs/helpers/getSize.js +1 -0
- package/dist/cjs/helpers/getSize.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +21 -30
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getStackSize.js +1 -0
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +2 -15
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +1 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +1 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/isObj.js +1 -0
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +1 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.js +1 -0
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +1 -0
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +1 -0
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeTransform.js +1 -0
- package/dist/cjs/helpers/mergeTransform.js.map +1 -1
- package/dist/cjs/helpers/nativeGestureHandler.native.js +1 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +1 -0
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js +1 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -0
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.js +1 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.js +1 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/startTransition.js +1 -0
- package/dist/cjs/helpers/startTransition.js.map +1 -1
- package/dist/cjs/helpers/themeable.js +3 -31
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/validate.js +6 -28
- package/dist/cjs/helpers/validate.js.map +1 -1
- package/dist/cjs/helpers/withStaticProperties.js +1 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/wrapThemeManagerContext.js +1 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +1 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/cjs/hooks/useConstant.js +1 -0
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +9 -38
- package/dist/cjs/hooks/useFeatures.js.map +1 -1
- package/dist/cjs/hooks/useId.js +1 -0
- package/dist/cjs/hooks/useId.js.map +1 -1
- package/dist/cjs/hooks/useIsMounted.js +1 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +1 -0
- package/dist/cjs/hooks/useIsSSR.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.js +2 -1
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +10 -19
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/usePressable.js +2 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +8 -22
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useUnmountEffect.js +1 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/insertFont.js +1 -0
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/static.js +1 -0
- package/dist/cjs/static.js.map +1 -1
- package/dist/cjs/styled.js +10 -36
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +15 -40
- package/dist/cjs/views/Slot.js.map +1 -1
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/Text.js +13 -22
- package/dist/cjs/views/Text.js.map +1 -1
- package/dist/cjs/views/TextAncestorContext.js +1 -0
- package/dist/cjs/views/TextAncestorContext.js.map +1 -1
- package/dist/cjs/views/Theme.js +1 -0
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/ThemeInverse.js +1 -0
- package/dist/cjs/views/ThemeInverse.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +1 -0
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeReset.js +1 -0
- package/dist/cjs/views/ThemeReset.js.map +1 -1
- package/dist/esm/constants/constants.js +8 -23
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/createComponent.js +113 -218
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +6 -25
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/helpers/createShallowUpdate.js +1 -17
- package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
- package/dist/esm/helpers/createTamaguiProvider.js +9 -39
- package/dist/esm/helpers/createTamaguiProvider.js.map +1 -1
- package/dist/esm/helpers/expandStyle.js +6 -21
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +20 -34
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/extendStaticConfig.js +29 -31
- package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +20 -32
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +1 -16
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/themeable.js +2 -33
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/validate.js +5 -30
- package/dist/esm/helpers/validate.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +8 -40
- package/dist/esm/hooks/useFeatures.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +9 -21
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/usePressable.js +1 -16
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +7 -24
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/styled.js +9 -38
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/views/Slot.js +14 -42
- package/dist/esm/views/Slot.js.map +1 -1
- package/dist/esm/views/Stack.js +3 -21
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Text.js +12 -24
- package/dist/esm/views/Text.js.map +1 -1
- package/package.json +10 -10
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/createTamaguiProvider.d.ts +1 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/dist/cjs/constants/rnw.js +0 -32
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js +0 -28
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js +0 -55
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/hooks/useEvent.js +0 -34
- package/dist/cjs/hooks/useEvent.js.map +0 -7
- package/dist/cjs/hooks/useGet.js +0 -39
- package/dist/cjs/hooks/useGet.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/startTransition.js +0 -32
- package/dist/cjs/startTransition.js.map +0 -7
- package/dist/cjs/views/FontLanguage.js +0 -40
- package/dist/cjs/views/FontLanguage.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -6
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js +0 -32
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/hooks/useEvent.js +0 -11
- package/dist/esm/hooks/useEvent.js.map +0 -7
- package/dist/esm/hooks/useGet.js +0 -16
- package/dist/esm/hooks/useGet.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/startTransition.js +0 -6
- package/dist/esm/startTransition.js.map +0 -7
- package/dist/esm/views/FontLanguage.js +0 -13
- package/dist/esm/views/FontLanguage.js.map +0 -7
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/constants/rnw.native.d.ts +0 -2
- package/types/constants/rnw.native.d.ts.map +0 -1
- package/types/hooks/useEvent.d.ts +0 -4
- package/types/hooks/useEvent.d.ts.map +0 -1
- package/types/hooks/useGet.d.ts +0 -2
- package/types/hooks/useGet.d.ts.map +0 -1
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts.map +0 -1
- package/types/startTransition.d.ts +0 -3
- package/types/startTransition.d.ts.map +0 -1
- package/types/views/FontLanguage.d.ts.map +0 -1
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
1
|
import { composeEventHandlers, stylePropsView, validStyles } from "@tamagui/helpers";
|
|
33
2
|
import {
|
|
34
3
|
useElementLayout,
|
|
@@ -63,7 +32,6 @@ import { mergeProps } from "./helpers/mergeProps";
|
|
|
63
32
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
64
33
|
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
65
34
|
import { useFeatures } from "./hooks/useFeatures";
|
|
66
|
-
import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
67
35
|
import { mediaState } from "./hooks/useMedia";
|
|
68
36
|
import { usePressable } from "./hooks/usePressable";
|
|
69
37
|
import { getThemeManager, useTheme } from "./hooks/useTheme";
|
|
@@ -119,7 +87,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
119
87
|
let tamaguiDefaultProps;
|
|
120
88
|
let initialSplitStyles;
|
|
121
89
|
const component = forwardRef((propsIn, forwardedRef) => {
|
|
122
|
-
var _a,
|
|
90
|
+
var _a, _b, _c, _d;
|
|
123
91
|
let props;
|
|
124
92
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
125
93
|
props = mergeProps(tamaguiDefaultProps, propsIn)[0];
|
|
@@ -152,21 +120,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
152
120
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
153
121
|
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
154
122
|
const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false);
|
|
155
|
-
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ?
|
|
123
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? {
|
|
124
|
+
...state,
|
|
156
125
|
hasTextAncestor,
|
|
157
126
|
dynamicStylesInline: true
|
|
158
|
-
}
|
|
127
|
+
} : {
|
|
128
|
+
...state,
|
|
159
129
|
noClassNames: true,
|
|
160
130
|
dynamicStylesInline: true,
|
|
161
131
|
hasTextAncestor,
|
|
162
132
|
resolveVariablesAs: "value"
|
|
163
|
-
}
|
|
133
|
+
};
|
|
164
134
|
const splitStyles = useSplitStyles(props, staticConfig, theme, splitStyleState, props.asChild ? null : initialSplitStyles.classNames, props["debug"]);
|
|
165
135
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
166
136
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
167
137
|
const isAnimated = !!(useAnimations && props.animation);
|
|
168
138
|
const hasEnterStyle = !!props.enterStyle;
|
|
169
|
-
const animationFeatureStylesIn = props.animation ?
|
|
139
|
+
const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null;
|
|
170
140
|
const features = useFeatures(props, {
|
|
171
141
|
forceUpdate,
|
|
172
142
|
setStateShallow,
|
|
@@ -179,7 +149,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
179
149
|
hostRef,
|
|
180
150
|
onDidAnimate: props.onDidAnimate
|
|
181
151
|
});
|
|
182
|
-
const
|
|
152
|
+
const {
|
|
183
153
|
tag,
|
|
184
154
|
hitSlop,
|
|
185
155
|
asChild,
|
|
@@ -202,32 +172,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
202
172
|
forceStyle: _forceStyle,
|
|
203
173
|
onClick,
|
|
204
174
|
theme: _themeProp,
|
|
205
|
-
defaultVariants
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"hitSlop",
|
|
209
|
-
"asChild",
|
|
210
|
-
"children",
|
|
211
|
-
"onPress",
|
|
212
|
-
"onPressIn",
|
|
213
|
-
"onPressOut",
|
|
214
|
-
"onHoverIn",
|
|
215
|
-
"onHoverOut",
|
|
216
|
-
"themeShallow",
|
|
217
|
-
"space",
|
|
218
|
-
"spaceDirection",
|
|
219
|
-
"disabled",
|
|
220
|
-
"onMouseUp",
|
|
221
|
-
"onMouseDown",
|
|
222
|
-
"onMouseEnter",
|
|
223
|
-
"onMouseLeave",
|
|
224
|
-
"hrefAttrs",
|
|
225
|
-
"separator",
|
|
226
|
-
"forceStyle",
|
|
227
|
-
"onClick",
|
|
228
|
-
"theme",
|
|
229
|
-
"defaultVariants"
|
|
230
|
-
]);
|
|
175
|
+
defaultVariants,
|
|
176
|
+
...nonTamaguiProps
|
|
177
|
+
} = viewPropsIn;
|
|
231
178
|
const isTaggable = !Component || typeof Component === "string";
|
|
232
179
|
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
233
180
|
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
@@ -238,7 +185,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
238
185
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
239
186
|
let viewProps;
|
|
240
187
|
if (process.env.TAMAGUI_TARGET === "web" && !staticConfig.isReactNativeWeb) {
|
|
241
|
-
const
|
|
188
|
+
const {
|
|
242
189
|
onMoveShouldSetResponder,
|
|
243
190
|
onMoveShouldSetResponderCapture,
|
|
244
191
|
onResponderEnd,
|
|
@@ -307,78 +254,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
307
254
|
accessibilityValue,
|
|
308
255
|
collapsable,
|
|
309
256
|
focusable,
|
|
310
|
-
onLayout
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
"onMoveShouldSetResponderCapture",
|
|
314
|
-
"onResponderEnd",
|
|
315
|
-
"onResponderGrant",
|
|
316
|
-
"onResponderMove",
|
|
317
|
-
"onResponderReject",
|
|
318
|
-
"onResponderRelease",
|
|
319
|
-
"onResponderStart",
|
|
320
|
-
"onResponderTerminate",
|
|
321
|
-
"onResponderTerminationRequest",
|
|
322
|
-
"onScrollShouldSetResponder",
|
|
323
|
-
"onScrollShouldSetResponderCapture",
|
|
324
|
-
"onSelectionChangeShouldSetResponder",
|
|
325
|
-
"onSelectionChangeShouldSetResponderCapture",
|
|
326
|
-
"onStartShouldSetResponder",
|
|
327
|
-
"onStartShouldSetResponderCapture",
|
|
328
|
-
"nativeID",
|
|
329
|
-
"accessibilityActiveDescendant",
|
|
330
|
-
"accessibilityAtomic",
|
|
331
|
-
"accessibilityAutoComplete",
|
|
332
|
-
"accessibilityBusy",
|
|
333
|
-
"accessibilityChecked",
|
|
334
|
-
"accessibilityColumnCount",
|
|
335
|
-
"accessibilityColumnIndex",
|
|
336
|
-
"accessibilityColumnSpan",
|
|
337
|
-
"accessibilityControls",
|
|
338
|
-
"accessibilityCurrent",
|
|
339
|
-
"accessibilityDescribedBy",
|
|
340
|
-
"accessibilityDetails",
|
|
341
|
-
"accessibilityDisabled",
|
|
342
|
-
"accessibilityErrorMessage",
|
|
343
|
-
"accessibilityExpanded",
|
|
344
|
-
"accessibilityFlowTo",
|
|
345
|
-
"accessibilityHasPopup",
|
|
346
|
-
"accessibilityHidden",
|
|
347
|
-
"accessibilityInvalid",
|
|
348
|
-
"accessibilityKeyShortcuts",
|
|
349
|
-
"accessibilityLabel",
|
|
350
|
-
"accessibilityLabelledBy",
|
|
351
|
-
"accessibilityLevel",
|
|
352
|
-
"accessibilityLiveRegion",
|
|
353
|
-
"accessibilityModal",
|
|
354
|
-
"accessibilityMultiline",
|
|
355
|
-
"accessibilityMultiSelectable",
|
|
356
|
-
"accessibilityOrientation",
|
|
357
|
-
"accessibilityOwns",
|
|
358
|
-
"accessibilityPlaceholder",
|
|
359
|
-
"accessibilityPosInSet",
|
|
360
|
-
"accessibilityPressed",
|
|
361
|
-
"accessibilityReadOnly",
|
|
362
|
-
"accessibilityRequired",
|
|
363
|
-
"accessibilityRole",
|
|
364
|
-
"accessibilityRoleDescription",
|
|
365
|
-
"accessibilityRowCount",
|
|
366
|
-
"accessibilityRowIndex",
|
|
367
|
-
"accessibilityRowSpan",
|
|
368
|
-
"accessibilitySelected",
|
|
369
|
-
"accessibilitySetSize",
|
|
370
|
-
"accessibilitySort",
|
|
371
|
-
"accessibilityValueMax",
|
|
372
|
-
"accessibilityValueMin",
|
|
373
|
-
"accessibilityValueNow",
|
|
374
|
-
"accessibilityValueText",
|
|
375
|
-
"accessible",
|
|
376
|
-
"accessibilityState",
|
|
377
|
-
"accessibilityValue",
|
|
378
|
-
"collapsable",
|
|
379
|
-
"focusable",
|
|
380
|
-
"onLayout"
|
|
381
|
-
]);
|
|
257
|
+
onLayout,
|
|
258
|
+
...webProps
|
|
259
|
+
} = nonTamaguiProps;
|
|
382
260
|
viewProps = webProps;
|
|
383
261
|
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
384
262
|
useElementLayout(hostRef, onLayout);
|
|
@@ -468,7 +346,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
468
346
|
let styles;
|
|
469
347
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
470
348
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
471
|
-
styles =
|
|
349
|
+
styles = {
|
|
350
|
+
...defaultNativeStyle,
|
|
351
|
+
...animationStyles ?? style,
|
|
352
|
+
...medias
|
|
353
|
+
};
|
|
472
354
|
} else {
|
|
473
355
|
styles = [
|
|
474
356
|
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
@@ -506,10 +388,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
506
388
|
const style2 = animationStyles ?? splitStyles.style;
|
|
507
389
|
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
508
390
|
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
509
|
-
viewProps.dataSet =
|
|
391
|
+
viewProps.dataSet = {
|
|
392
|
+
...viewProps.dataSet,
|
|
510
393
|
className,
|
|
511
394
|
id: props.id
|
|
512
|
-
}
|
|
395
|
+
};
|
|
513
396
|
if (props["data-is"]) {
|
|
514
397
|
viewProps.dataSet.is = props["data-is"];
|
|
515
398
|
}
|
|
@@ -522,8 +405,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
522
405
|
}
|
|
523
406
|
const initialPseudos = initialSplitStyles.pseudos;
|
|
524
407
|
const attachPress = !!((pseudos == null ? void 0 : pseudos.pressStyle) || (initialPseudos == null ? void 0 : initialPseudos.pressStyle) || onPress || onPressOut || onPressIn || onClick);
|
|
525
|
-
const
|
|
526
|
-
const isHoverable = isWeb && !isTouch;
|
|
408
|
+
const isHoverable = isWeb;
|
|
527
409
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
528
410
|
const handlesPressEvents = !isStringElement && !asChild;
|
|
529
411
|
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
@@ -538,44 +420,44 @@ function createComponent(configIn, ParentComponent) {
|
|
|
538
420
|
pressIn: false
|
|
539
421
|
});
|
|
540
422
|
}, []);
|
|
541
|
-
const events = shouldAttach ?
|
|
423
|
+
const events = shouldAttach ? {
|
|
542
424
|
[pressOutKey]: attachPress ? (e) => {
|
|
543
425
|
unPress();
|
|
544
426
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
545
427
|
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
546
|
-
} : void 0
|
|
547
|
-
}, isHoverable && {
|
|
548
|
-
onMouseEnter: attachHover ? (e) => {
|
|
549
|
-
const next = {};
|
|
550
|
-
if (attachHover) {
|
|
551
|
-
next.hover = true;
|
|
552
|
-
}
|
|
553
|
-
if (state.pressIn) {
|
|
554
|
-
next.press = true;
|
|
555
|
-
}
|
|
556
|
-
if (Object.keys(next).length) {
|
|
557
|
-
setStateShallow(next);
|
|
558
|
-
}
|
|
559
|
-
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
560
|
-
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
561
428
|
} : void 0,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
429
|
+
...isHoverable && {
|
|
430
|
+
onMouseEnter: attachHover ? (e) => {
|
|
431
|
+
const next = {};
|
|
432
|
+
if (attachHover) {
|
|
433
|
+
next.hover = true;
|
|
434
|
+
}
|
|
435
|
+
if (state.pressIn) {
|
|
436
|
+
next.press = true;
|
|
437
|
+
}
|
|
438
|
+
if (Object.keys(next).length) {
|
|
439
|
+
setStateShallow(next);
|
|
440
|
+
}
|
|
441
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
442
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
443
|
+
} : void 0,
|
|
444
|
+
onMouseLeave: attachHover ? (e) => {
|
|
445
|
+
const next = {};
|
|
446
|
+
mouseUps.add(unPress);
|
|
447
|
+
if (attachHover) {
|
|
448
|
+
next.hover = false;
|
|
449
|
+
}
|
|
450
|
+
if (state.pressIn) {
|
|
451
|
+
next.press = false;
|
|
452
|
+
next.pressIn = false;
|
|
453
|
+
}
|
|
454
|
+
if (Object.keys(next).length) {
|
|
455
|
+
setStateShallow(next);
|
|
456
|
+
}
|
|
457
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
458
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
459
|
+
} : void 0
|
|
460
|
+
},
|
|
579
461
|
[pressInKey]: attachPress ? (e) => {
|
|
580
462
|
setStateShallow({
|
|
581
463
|
press: true,
|
|
@@ -592,17 +474,18 @@ function createComponent(configIn, ParentComponent) {
|
|
|
592
474
|
unPress();
|
|
593
475
|
onClick == null ? void 0 : onClick(e);
|
|
594
476
|
onPress == null ? void 0 : onPress(e);
|
|
595
|
-
} : null
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
477
|
+
} : null,
|
|
478
|
+
...!isWeb && {
|
|
479
|
+
cancelable: !props.rejectResponderTermination,
|
|
480
|
+
disabled: props.disabled !== null ? props.disabled : (_b = props.accessibilityState) == null ? void 0 : _b.disabled,
|
|
481
|
+
hitSlop: props.hitSlop,
|
|
482
|
+
delayLongPress: props.delayLongPress,
|
|
483
|
+
delayPressIn: props.delayPressIn,
|
|
484
|
+
delayPressOut: props.delayPressOut,
|
|
485
|
+
focusable: viewProps.focusable ?? true,
|
|
486
|
+
minPressDuration: 0
|
|
487
|
+
}
|
|
488
|
+
} : null;
|
|
606
489
|
let space = spaceProp;
|
|
607
490
|
if (features.enabled.mediaQuery) {
|
|
608
491
|
for (const key in mediaState) {
|
|
@@ -626,22 +509,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
626
509
|
let content;
|
|
627
510
|
if (asChild) {
|
|
628
511
|
elementType = Slot;
|
|
629
|
-
viewProps =
|
|
512
|
+
viewProps = {
|
|
513
|
+
...viewProps,
|
|
630
514
|
onPress,
|
|
631
515
|
onPressIn,
|
|
632
516
|
onPressOut
|
|
633
|
-
}
|
|
517
|
+
};
|
|
634
518
|
}
|
|
635
519
|
if (isWeb) {
|
|
636
|
-
const [pressableProps] = usePressable(events ?
|
|
637
|
-
disabled
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
520
|
+
const [pressableProps] = usePressable(events ? {
|
|
521
|
+
disabled,
|
|
522
|
+
...hitSlop && {
|
|
523
|
+
hitSlop
|
|
524
|
+
},
|
|
641
525
|
onPressOut: events[pressOutKey],
|
|
642
526
|
onPressIn: events[pressInKey],
|
|
643
527
|
onPress: events[pressKey]
|
|
644
|
-
}
|
|
528
|
+
} : {
|
|
645
529
|
disabled: true
|
|
646
530
|
});
|
|
647
531
|
if (events) {
|
|
@@ -696,26 +580,27 @@ function createComponent(configIn, ParentComponent) {
|
|
|
696
580
|
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
697
581
|
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
698
582
|
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
699
|
-
content = /* @__PURE__ */ React.createElement("span",
|
|
583
|
+
content = /* @__PURE__ */ React.createElement("span", {
|
|
700
584
|
className: `${hoverClassName} ${themeClassName}`,
|
|
701
585
|
style: {
|
|
702
586
|
display: "contents"
|
|
587
|
+
},
|
|
588
|
+
...shouldWrapWithHover && {
|
|
589
|
+
onMouseEnter: events.onMouseEnter,
|
|
590
|
+
onMouseLeave: events.onMouseLeave
|
|
703
591
|
}
|
|
704
|
-
},
|
|
705
|
-
onMouseEnter: events.onMouseEnter,
|
|
706
|
-
onMouseLeave: events.onMouseLeave
|
|
707
|
-
}), content);
|
|
592
|
+
}, content);
|
|
708
593
|
}
|
|
709
594
|
}
|
|
710
595
|
if (process.env.NODE_ENV === "development") {
|
|
711
596
|
if (props["debug"]) {
|
|
712
|
-
console.groupCollapsed("props out", viewProps);
|
|
597
|
+
console.groupCollapsed("props out", viewProps, typeof elementType === "string" ? elementType : "Component");
|
|
713
598
|
for (const key in viewProps) {
|
|
714
599
|
console.log(key, viewProps[key]);
|
|
715
600
|
}
|
|
716
601
|
console.groupEnd();
|
|
717
602
|
if (typeof window !== "undefined") {
|
|
718
|
-
console.log(
|
|
603
|
+
console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, isStringElement, classNamesIn: (_c = props.className) == null ? void 0 : _c.split(" "), classNamesOut: (_d = viewProps.className) == null ? void 0 : _d.split(" "), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null });
|
|
719
604
|
}
|
|
720
605
|
console.groupEnd();
|
|
721
606
|
}
|
|
@@ -758,7 +643,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
758
643
|
keepVariantsAsProps: true
|
|
759
644
|
}, void 0, debug);
|
|
760
645
|
const [defaults, defaultsClassnames] = mergeProps(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
761
|
-
initialSplitStyles.classNames =
|
|
646
|
+
initialSplitStyles.classNames = {
|
|
647
|
+
...parentClassNames,
|
|
648
|
+
...defaultsClassnames,
|
|
649
|
+
...initialSplitStyles.classNames
|
|
650
|
+
};
|
|
762
651
|
defaultNativeStyle = {};
|
|
763
652
|
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
764
653
|
if (!isWeb) {
|
|
@@ -794,17 +683,21 @@ function createComponent(configIn, ParentComponent) {
|
|
|
794
683
|
if (configIn.memo) {
|
|
795
684
|
res = memo(res);
|
|
796
685
|
}
|
|
797
|
-
res.staticConfig =
|
|
798
|
-
validStyles: staticConfig.validStyles || stylePropsView
|
|
799
|
-
|
|
686
|
+
res.staticConfig = {
|
|
687
|
+
validStyles: staticConfig.validStyles || stylePropsView,
|
|
688
|
+
...staticConfig
|
|
689
|
+
};
|
|
800
690
|
res.extractable = (Component, conf) => {
|
|
801
|
-
Component.staticConfig = extendStaticConfig(
|
|
802
|
-
Component
|
|
803
|
-
|
|
691
|
+
Component.staticConfig = extendStaticConfig({
|
|
692
|
+
Component,
|
|
693
|
+
...conf,
|
|
804
694
|
neverFlatten: true,
|
|
805
695
|
isExtractable: true,
|
|
806
|
-
defaultProps:
|
|
807
|
-
|
|
696
|
+
defaultProps: {
|
|
697
|
+
...Component.defaultProps,
|
|
698
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
699
|
+
}
|
|
700
|
+
}, res);
|
|
808
701
|
return Component;
|
|
809
702
|
};
|
|
810
703
|
return res;
|
|
@@ -817,9 +710,10 @@ const Spacer = createComponent({
|
|
|
817
710
|
memo: true,
|
|
818
711
|
componentName: "Spacer",
|
|
819
712
|
validStyles,
|
|
820
|
-
defaultProps:
|
|
713
|
+
defaultProps: {
|
|
714
|
+
...stackDefaultStyles,
|
|
821
715
|
size: true
|
|
822
|
-
}
|
|
716
|
+
},
|
|
823
717
|
variants: {
|
|
824
718
|
size: {
|
|
825
719
|
"...size": (size, { tokens }) => {
|
|
@@ -920,13 +814,14 @@ function spacedChildren({
|
|
|
920
814
|
return final;
|
|
921
815
|
}
|
|
922
816
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
923
|
-
return /* @__PURE__ */ React.createElement(Spacer,
|
|
817
|
+
return /* @__PURE__ */ React.createElement(Spacer, {
|
|
924
818
|
key,
|
|
925
819
|
size: space,
|
|
926
|
-
direction
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
820
|
+
direction,
|
|
821
|
+
...spaceFlex && {
|
|
822
|
+
flex: spaceFlex
|
|
823
|
+
}
|
|
824
|
+
});
|
|
930
825
|
}
|
|
931
826
|
function isUnspaced(child) {
|
|
932
827
|
var _a, _b;
|
|
@@ -959,7 +854,7 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
959
854
|
const pseudoStyle = pseudos[name];
|
|
960
855
|
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
961
856
|
const defaultPseudoStyle = initialPseudos[name];
|
|
962
|
-
const style = defaultPseudoStyle ?
|
|
857
|
+
const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle;
|
|
963
858
|
if (style) {
|
|
964
859
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
965
860
|
}
|