@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,38 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
8
|
var __export = (target, all) => {
|
|
37
9
|
for (var name in all)
|
|
38
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -77,7 +49,6 @@ var import_mergeProps = require("./helpers/mergeProps");
|
|
|
77
49
|
var import_proxyThemeVariables = require("./helpers/proxyThemeVariables");
|
|
78
50
|
var import_wrapThemeManagerContext = require("./helpers/wrapThemeManagerContext");
|
|
79
51
|
var import_useFeatures = require("./hooks/useFeatures");
|
|
80
|
-
var import_useIsTouchDevice = require("./hooks/useIsTouchDevice");
|
|
81
52
|
var import_useMedia = require("./hooks/useMedia");
|
|
82
53
|
var import_usePressable = require("./hooks/usePressable");
|
|
83
54
|
var import_useTheme = require("./hooks/useTheme");
|
|
@@ -133,7 +104,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
133
104
|
let tamaguiDefaultProps;
|
|
134
105
|
let initialSplitStyles;
|
|
135
106
|
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
136
|
-
var _a,
|
|
107
|
+
var _a, _b, _c, _d;
|
|
137
108
|
let props;
|
|
138
109
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
139
110
|
props = (0, import_mergeProps.mergeProps)(tamaguiDefaultProps, propsIn)[0];
|
|
@@ -166,21 +137,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
166
137
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
167
138
|
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
168
139
|
const hasTextAncestor = !!(import_platform.isWeb && isText ? (0, import_react.useContext)(import_TextAncestorContext.TextAncestorContext) : false);
|
|
169
|
-
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ?
|
|
140
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? {
|
|
141
|
+
...state,
|
|
170
142
|
hasTextAncestor,
|
|
171
143
|
dynamicStylesInline: true
|
|
172
|
-
}
|
|
144
|
+
} : {
|
|
145
|
+
...state,
|
|
173
146
|
noClassNames: true,
|
|
174
147
|
dynamicStylesInline: true,
|
|
175
148
|
hasTextAncestor,
|
|
176
149
|
resolveVariablesAs: "value"
|
|
177
|
-
}
|
|
150
|
+
};
|
|
178
151
|
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, splitStyleState, props.asChild ? null : initialSplitStyles.classNames, props["debug"]);
|
|
179
152
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
180
153
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
181
154
|
const isAnimated = !!(useAnimations && props.animation);
|
|
182
155
|
const hasEnterStyle = !!props.enterStyle;
|
|
183
|
-
const animationFeatureStylesIn = props.animation ?
|
|
156
|
+
const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null;
|
|
184
157
|
const features = (0, import_useFeatures.useFeatures)(props, {
|
|
185
158
|
forceUpdate,
|
|
186
159
|
setStateShallow,
|
|
@@ -193,7 +166,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
193
166
|
hostRef,
|
|
194
167
|
onDidAnimate: props.onDidAnimate
|
|
195
168
|
});
|
|
196
|
-
const
|
|
169
|
+
const {
|
|
197
170
|
tag,
|
|
198
171
|
hitSlop,
|
|
199
172
|
asChild,
|
|
@@ -216,32 +189,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
216
189
|
forceStyle: _forceStyle,
|
|
217
190
|
onClick,
|
|
218
191
|
theme: _themeProp,
|
|
219
|
-
defaultVariants
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
"hitSlop",
|
|
223
|
-
"asChild",
|
|
224
|
-
"children",
|
|
225
|
-
"onPress",
|
|
226
|
-
"onPressIn",
|
|
227
|
-
"onPressOut",
|
|
228
|
-
"onHoverIn",
|
|
229
|
-
"onHoverOut",
|
|
230
|
-
"themeShallow",
|
|
231
|
-
"space",
|
|
232
|
-
"spaceDirection",
|
|
233
|
-
"disabled",
|
|
234
|
-
"onMouseUp",
|
|
235
|
-
"onMouseDown",
|
|
236
|
-
"onMouseEnter",
|
|
237
|
-
"onMouseLeave",
|
|
238
|
-
"hrefAttrs",
|
|
239
|
-
"separator",
|
|
240
|
-
"forceStyle",
|
|
241
|
-
"onClick",
|
|
242
|
-
"theme",
|
|
243
|
-
"defaultVariants"
|
|
244
|
-
]);
|
|
192
|
+
defaultVariants,
|
|
193
|
+
...nonTamaguiProps
|
|
194
|
+
} = viewPropsIn;
|
|
245
195
|
const isTaggable = !Component || typeof Component === "string";
|
|
246
196
|
const element = import_platform.isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
247
197
|
const BaseTextComponent = !import_platform.isWeb ? import_react_native.Text : element || "span";
|
|
@@ -252,7 +202,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
252
202
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
253
203
|
let viewProps;
|
|
254
204
|
if (process.env.TAMAGUI_TARGET === "web" && !staticConfig.isReactNativeWeb) {
|
|
255
|
-
const
|
|
205
|
+
const {
|
|
256
206
|
onMoveShouldSetResponder,
|
|
257
207
|
onMoveShouldSetResponderCapture,
|
|
258
208
|
onResponderEnd,
|
|
@@ -321,78 +271,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
321
271
|
accessibilityValue,
|
|
322
272
|
collapsable,
|
|
323
273
|
focusable,
|
|
324
|
-
onLayout
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
"onMoveShouldSetResponderCapture",
|
|
328
|
-
"onResponderEnd",
|
|
329
|
-
"onResponderGrant",
|
|
330
|
-
"onResponderMove",
|
|
331
|
-
"onResponderReject",
|
|
332
|
-
"onResponderRelease",
|
|
333
|
-
"onResponderStart",
|
|
334
|
-
"onResponderTerminate",
|
|
335
|
-
"onResponderTerminationRequest",
|
|
336
|
-
"onScrollShouldSetResponder",
|
|
337
|
-
"onScrollShouldSetResponderCapture",
|
|
338
|
-
"onSelectionChangeShouldSetResponder",
|
|
339
|
-
"onSelectionChangeShouldSetResponderCapture",
|
|
340
|
-
"onStartShouldSetResponder",
|
|
341
|
-
"onStartShouldSetResponderCapture",
|
|
342
|
-
"nativeID",
|
|
343
|
-
"accessibilityActiveDescendant",
|
|
344
|
-
"accessibilityAtomic",
|
|
345
|
-
"accessibilityAutoComplete",
|
|
346
|
-
"accessibilityBusy",
|
|
347
|
-
"accessibilityChecked",
|
|
348
|
-
"accessibilityColumnCount",
|
|
349
|
-
"accessibilityColumnIndex",
|
|
350
|
-
"accessibilityColumnSpan",
|
|
351
|
-
"accessibilityControls",
|
|
352
|
-
"accessibilityCurrent",
|
|
353
|
-
"accessibilityDescribedBy",
|
|
354
|
-
"accessibilityDetails",
|
|
355
|
-
"accessibilityDisabled",
|
|
356
|
-
"accessibilityErrorMessage",
|
|
357
|
-
"accessibilityExpanded",
|
|
358
|
-
"accessibilityFlowTo",
|
|
359
|
-
"accessibilityHasPopup",
|
|
360
|
-
"accessibilityHidden",
|
|
361
|
-
"accessibilityInvalid",
|
|
362
|
-
"accessibilityKeyShortcuts",
|
|
363
|
-
"accessibilityLabel",
|
|
364
|
-
"accessibilityLabelledBy",
|
|
365
|
-
"accessibilityLevel",
|
|
366
|
-
"accessibilityLiveRegion",
|
|
367
|
-
"accessibilityModal",
|
|
368
|
-
"accessibilityMultiline",
|
|
369
|
-
"accessibilityMultiSelectable",
|
|
370
|
-
"accessibilityOrientation",
|
|
371
|
-
"accessibilityOwns",
|
|
372
|
-
"accessibilityPlaceholder",
|
|
373
|
-
"accessibilityPosInSet",
|
|
374
|
-
"accessibilityPressed",
|
|
375
|
-
"accessibilityReadOnly",
|
|
376
|
-
"accessibilityRequired",
|
|
377
|
-
"accessibilityRole",
|
|
378
|
-
"accessibilityRoleDescription",
|
|
379
|
-
"accessibilityRowCount",
|
|
380
|
-
"accessibilityRowIndex",
|
|
381
|
-
"accessibilityRowSpan",
|
|
382
|
-
"accessibilitySelected",
|
|
383
|
-
"accessibilitySetSize",
|
|
384
|
-
"accessibilitySort",
|
|
385
|
-
"accessibilityValueMax",
|
|
386
|
-
"accessibilityValueMin",
|
|
387
|
-
"accessibilityValueNow",
|
|
388
|
-
"accessibilityValueText",
|
|
389
|
-
"accessible",
|
|
390
|
-
"accessibilityState",
|
|
391
|
-
"accessibilityValue",
|
|
392
|
-
"collapsable",
|
|
393
|
-
"focusable",
|
|
394
|
-
"onLayout"
|
|
395
|
-
]);
|
|
274
|
+
onLayout,
|
|
275
|
+
...webProps
|
|
276
|
+
} = nonTamaguiProps;
|
|
396
277
|
viewProps = webProps;
|
|
397
278
|
(0, import_assignNativePropsToWeb.assignNativePropsToWeb)(elementType, viewProps, nonTamaguiProps);
|
|
398
279
|
(0, import_rnw.useElementLayout)(hostRef, onLayout);
|
|
@@ -482,7 +363,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
482
363
|
let styles;
|
|
483
364
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
484
365
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
485
|
-
styles =
|
|
366
|
+
styles = {
|
|
367
|
+
...defaultNativeStyle,
|
|
368
|
+
...animationStyles ?? style,
|
|
369
|
+
...medias
|
|
370
|
+
};
|
|
486
371
|
} else {
|
|
487
372
|
styles = [
|
|
488
373
|
import_platform.isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
@@ -520,10 +405,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
520
405
|
const style2 = animationStyles ?? splitStyles.style;
|
|
521
406
|
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
522
407
|
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
523
|
-
viewProps.dataSet =
|
|
408
|
+
viewProps.dataSet = {
|
|
409
|
+
...viewProps.dataSet,
|
|
524
410
|
className,
|
|
525
411
|
id: props.id
|
|
526
|
-
}
|
|
412
|
+
};
|
|
527
413
|
if (props["data-is"]) {
|
|
528
414
|
viewProps.dataSet.is = props["data-is"];
|
|
529
415
|
}
|
|
@@ -536,8 +422,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
536
422
|
}
|
|
537
423
|
const initialPseudos = initialSplitStyles.pseudos;
|
|
538
424
|
const attachPress = !!((pseudos == null ? void 0 : pseudos.pressStyle) || (initialPseudos == null ? void 0 : initialPseudos.pressStyle) || onPress || onPressOut || onPressIn || onClick);
|
|
539
|
-
const
|
|
540
|
-
const isHoverable = import_platform.isWeb && !isTouch;
|
|
425
|
+
const isHoverable = import_platform.isWeb;
|
|
541
426
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
542
427
|
const handlesPressEvents = !isStringElement && !asChild;
|
|
543
428
|
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
@@ -552,44 +437,44 @@ function createComponent(configIn, ParentComponent) {
|
|
|
552
437
|
pressIn: false
|
|
553
438
|
});
|
|
554
439
|
}, []);
|
|
555
|
-
const events = shouldAttach ?
|
|
440
|
+
const events = shouldAttach ? {
|
|
556
441
|
[pressOutKey]: attachPress ? (e) => {
|
|
557
442
|
unPress();
|
|
558
443
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
559
444
|
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
560
|
-
} : void 0
|
|
561
|
-
}, isHoverable && {
|
|
562
|
-
onMouseEnter: attachHover ? (e) => {
|
|
563
|
-
const next = {};
|
|
564
|
-
if (attachHover) {
|
|
565
|
-
next.hover = true;
|
|
566
|
-
}
|
|
567
|
-
if (state.pressIn) {
|
|
568
|
-
next.press = true;
|
|
569
|
-
}
|
|
570
|
-
if (Object.keys(next).length) {
|
|
571
|
-
setStateShallow(next);
|
|
572
|
-
}
|
|
573
|
-
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
574
|
-
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
575
445
|
} : void 0,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
446
|
+
...isHoverable && {
|
|
447
|
+
onMouseEnter: attachHover ? (e) => {
|
|
448
|
+
const next = {};
|
|
449
|
+
if (attachHover) {
|
|
450
|
+
next.hover = true;
|
|
451
|
+
}
|
|
452
|
+
if (state.pressIn) {
|
|
453
|
+
next.press = true;
|
|
454
|
+
}
|
|
455
|
+
if (Object.keys(next).length) {
|
|
456
|
+
setStateShallow(next);
|
|
457
|
+
}
|
|
458
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
459
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
460
|
+
} : void 0,
|
|
461
|
+
onMouseLeave: attachHover ? (e) => {
|
|
462
|
+
const next = {};
|
|
463
|
+
mouseUps.add(unPress);
|
|
464
|
+
if (attachHover) {
|
|
465
|
+
next.hover = false;
|
|
466
|
+
}
|
|
467
|
+
if (state.pressIn) {
|
|
468
|
+
next.press = false;
|
|
469
|
+
next.pressIn = false;
|
|
470
|
+
}
|
|
471
|
+
if (Object.keys(next).length) {
|
|
472
|
+
setStateShallow(next);
|
|
473
|
+
}
|
|
474
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
475
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
476
|
+
} : void 0
|
|
477
|
+
},
|
|
593
478
|
[pressInKey]: attachPress ? (e) => {
|
|
594
479
|
setStateShallow({
|
|
595
480
|
press: true,
|
|
@@ -606,17 +491,18 @@ function createComponent(configIn, ParentComponent) {
|
|
|
606
491
|
unPress();
|
|
607
492
|
onClick == null ? void 0 : onClick(e);
|
|
608
493
|
onPress == null ? void 0 : onPress(e);
|
|
609
|
-
} : null
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
494
|
+
} : null,
|
|
495
|
+
...!import_platform.isWeb && {
|
|
496
|
+
cancelable: !props.rejectResponderTermination,
|
|
497
|
+
disabled: props.disabled !== null ? props.disabled : (_b = props.accessibilityState) == null ? void 0 : _b.disabled,
|
|
498
|
+
hitSlop: props.hitSlop,
|
|
499
|
+
delayLongPress: props.delayLongPress,
|
|
500
|
+
delayPressIn: props.delayPressIn,
|
|
501
|
+
delayPressOut: props.delayPressOut,
|
|
502
|
+
focusable: viewProps.focusable ?? true,
|
|
503
|
+
minPressDuration: 0
|
|
504
|
+
}
|
|
505
|
+
} : null;
|
|
620
506
|
let space = spaceProp;
|
|
621
507
|
if (features.enabled.mediaQuery) {
|
|
622
508
|
for (const key in import_useMedia.mediaState) {
|
|
@@ -640,22 +526,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
640
526
|
let content;
|
|
641
527
|
if (asChild) {
|
|
642
528
|
elementType = import_Slot.Slot;
|
|
643
|
-
viewProps =
|
|
529
|
+
viewProps = {
|
|
530
|
+
...viewProps,
|
|
644
531
|
onPress,
|
|
645
532
|
onPressIn,
|
|
646
533
|
onPressOut
|
|
647
|
-
}
|
|
534
|
+
};
|
|
648
535
|
}
|
|
649
536
|
if (import_platform.isWeb) {
|
|
650
|
-
const [pressableProps] = (0, import_usePressable.usePressable)(events ?
|
|
651
|
-
disabled
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
537
|
+
const [pressableProps] = (0, import_usePressable.usePressable)(events ? {
|
|
538
|
+
disabled,
|
|
539
|
+
...hitSlop && {
|
|
540
|
+
hitSlop
|
|
541
|
+
},
|
|
655
542
|
onPressOut: events[pressOutKey],
|
|
656
543
|
onPressIn: events[pressInKey],
|
|
657
544
|
onPress: events[pressKey]
|
|
658
|
-
}
|
|
545
|
+
} : {
|
|
659
546
|
disabled: true
|
|
660
547
|
});
|
|
661
548
|
if (events) {
|
|
@@ -710,26 +597,27 @@ function createComponent(configIn, ParentComponent) {
|
|
|
710
597
|
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
711
598
|
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
712
599
|
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
713
|
-
content = /* @__PURE__ */ import_react.default.createElement("span",
|
|
600
|
+
content = /* @__PURE__ */ import_react.default.createElement("span", {
|
|
714
601
|
className: `${hoverClassName} ${themeClassName}`,
|
|
715
602
|
style: {
|
|
716
603
|
display: "contents"
|
|
604
|
+
},
|
|
605
|
+
...shouldWrapWithHover && {
|
|
606
|
+
onMouseEnter: events.onMouseEnter,
|
|
607
|
+
onMouseLeave: events.onMouseLeave
|
|
717
608
|
}
|
|
718
|
-
},
|
|
719
|
-
onMouseEnter: events.onMouseEnter,
|
|
720
|
-
onMouseLeave: events.onMouseLeave
|
|
721
|
-
}), content);
|
|
609
|
+
}, content);
|
|
722
610
|
}
|
|
723
611
|
}
|
|
724
612
|
if (process.env.NODE_ENV === "development") {
|
|
725
613
|
if (props["debug"]) {
|
|
726
|
-
console.groupCollapsed("props out", viewProps);
|
|
614
|
+
console.groupCollapsed("props out", viewProps, typeof elementType === "string" ? elementType : "Component");
|
|
727
615
|
for (const key in viewProps) {
|
|
728
616
|
console.log(key, viewProps[key]);
|
|
729
617
|
}
|
|
730
618
|
console.groupEnd();
|
|
731
619
|
if (typeof window !== "undefined") {
|
|
732
|
-
console.log(
|
|
620
|
+
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, (0, import_insertStyleRule.getAllSelectors)()[v]])) } : null });
|
|
733
621
|
}
|
|
734
622
|
console.groupEnd();
|
|
735
623
|
}
|
|
@@ -772,7 +660,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
772
660
|
keepVariantsAsProps: true
|
|
773
661
|
}, void 0, debug);
|
|
774
662
|
const [defaults, defaultsClassnames] = (0, import_mergeProps.mergeProps)(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
775
|
-
initialSplitStyles.classNames =
|
|
663
|
+
initialSplitStyles.classNames = {
|
|
664
|
+
...parentClassNames,
|
|
665
|
+
...defaultsClassnames,
|
|
666
|
+
...initialSplitStyles.classNames
|
|
667
|
+
};
|
|
776
668
|
defaultNativeStyle = {};
|
|
777
669
|
const validStyles2 = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
778
670
|
if (!import_platform.isWeb) {
|
|
@@ -808,17 +700,21 @@ function createComponent(configIn, ParentComponent) {
|
|
|
808
700
|
if (configIn.memo) {
|
|
809
701
|
res = (0, import_react.memo)(res);
|
|
810
702
|
}
|
|
811
|
-
res.staticConfig =
|
|
812
|
-
validStyles: staticConfig.validStyles || import_helpers.stylePropsView
|
|
813
|
-
|
|
703
|
+
res.staticConfig = {
|
|
704
|
+
validStyles: staticConfig.validStyles || import_helpers.stylePropsView,
|
|
705
|
+
...staticConfig
|
|
706
|
+
};
|
|
814
707
|
res.extractable = (Component, conf) => {
|
|
815
|
-
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
816
|
-
Component
|
|
817
|
-
|
|
708
|
+
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)({
|
|
709
|
+
Component,
|
|
710
|
+
...conf,
|
|
818
711
|
neverFlatten: true,
|
|
819
712
|
isExtractable: true,
|
|
820
|
-
defaultProps:
|
|
821
|
-
|
|
713
|
+
defaultProps: {
|
|
714
|
+
...Component.defaultProps,
|
|
715
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
716
|
+
}
|
|
717
|
+
}, res);
|
|
822
718
|
return Component;
|
|
823
719
|
};
|
|
824
720
|
return res;
|
|
@@ -831,9 +727,10 @@ const Spacer = createComponent({
|
|
|
831
727
|
memo: true,
|
|
832
728
|
componentName: "Spacer",
|
|
833
729
|
validStyles: import_helpers.validStyles,
|
|
834
|
-
defaultProps:
|
|
730
|
+
defaultProps: {
|
|
731
|
+
...import_constants.stackDefaultStyles,
|
|
835
732
|
size: true
|
|
836
|
-
}
|
|
733
|
+
},
|
|
837
734
|
variants: {
|
|
838
735
|
size: {
|
|
839
736
|
"...size": (size, { tokens }) => {
|
|
@@ -934,13 +831,14 @@ function spacedChildren({
|
|
|
934
831
|
return final;
|
|
935
832
|
}
|
|
936
833
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
937
|
-
return /* @__PURE__ */ import_react.default.createElement(Spacer,
|
|
834
|
+
return /* @__PURE__ */ import_react.default.createElement(Spacer, {
|
|
938
835
|
key,
|
|
939
836
|
size: space,
|
|
940
|
-
direction
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
837
|
+
direction,
|
|
838
|
+
...spaceFlex && {
|
|
839
|
+
flex: spaceFlex
|
|
840
|
+
}
|
|
841
|
+
});
|
|
944
842
|
}
|
|
945
843
|
function isUnspaced(child) {
|
|
946
844
|
var _a, _b;
|
|
@@ -973,7 +871,7 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
973
871
|
const pseudoStyle = pseudos[name];
|
|
974
872
|
const shouldNestObject = import_platform.isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
975
873
|
const defaultPseudoStyle = initialPseudos[name];
|
|
976
|
-
const style = defaultPseudoStyle ?
|
|
874
|
+
const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle;
|
|
977
875
|
if (style) {
|
|
978
876
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
979
877
|
}
|