@tamagui/core 1.0.1-beta.75 → 1.0.1-beta.78
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/ThemeManager.js +6 -22
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/createComponent.js +13 -10
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createTamagui.js +2 -2
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createVariable.js +9 -1
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +4 -16
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/generateAtomicStyles.js +55 -70
- package/dist/cjs/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +18 -10
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +4 -2
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +12 -10
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/{pseudos.js → pseudoDescriptors.js} +7 -7
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/insertFont.js +16 -4
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/static.js +1 -1
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/ThemeManager.js +6 -22
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/constants/constants.js +23 -8
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/createComponent.js +228 -121
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js.map +1 -1
- package/dist/esm/createTamagui.js +28 -10
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createVariable.js +9 -1
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +4 -5
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +17 -1
- package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
- package/dist/esm/helpers/createTamaguiProvider.js +39 -9
- package/dist/esm/helpers/createTamaguiProvider.js.map +1 -1
- package/dist/esm/helpers/extendStaticConfig.js +28 -27
- package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
- package/dist/esm/helpers/fixNativeShadow.native.js +2 -3
- package/dist/esm/helpers/fixNativeShadow.native.js.map +1 -1
- package/dist/esm/helpers/generateAtomicStyles.js +75 -76
- package/dist/esm/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/esm/helpers/getSize.js +2 -3
- package/dist/esm/helpers/getSize.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +50 -30
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStackSize.js +1 -2
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +38 -7
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +12 -10
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +1 -1
- package/dist/esm/helpers/mergeTransform.js.map +1 -1
- package/dist/{jsx/helpers/pseudos.js → esm/helpers/pseudoDescriptors.js} +3 -2
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/themeable.js +33 -2
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/validate.js +30 -5
- package/dist/esm/helpers/validate.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +40 -8
- package/dist/esm/hooks/useFeatures.js.map +1 -1
- package/dist/esm/hooks/useId.js +2 -3
- package/dist/esm/hooks/useId.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +18 -6
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/usePressable.js +16 -1
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +24 -7
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/insertFont.js +16 -4
- package/dist/esm/insertFont.js.map +2 -2
- package/dist/esm/static.js +1 -1
- package/dist/esm/static.js.map +1 -1
- package/dist/esm/styled.js +38 -9
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/views/Slot.js +40 -11
- package/dist/esm/views/Slot.js.map +1 -1
- package/dist/esm/views/Stack.js +21 -3
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Text.js +24 -12
- package/dist/esm/views/Text.js.map +1 -1
- package/dist/esm/views/TextAncestorContext.js +2 -2
- package/dist/esm/views/TextAncestorContext.js.map +1 -1
- package/package.json +7 -7
- package/reset.css +4 -0
- package/types/ThemeManager.d.ts +1 -1
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/createComponent.d.ts +2 -4
- package/types/createComponent.d.ts.map +1 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/generateAtomicStyles.d.ts +2 -2
- package/types/helpers/generateAtomicStyles.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +2 -0
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/{pseudos.d.ts → pseudoDescriptors.d.ts} +3 -3
- package/types/helpers/pseudoDescriptors.d.ts.map +1 -0
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts +1 -1
- package/types/insertFont.d.ts.map +1 -1
- package/types/static.d.ts +1 -1
- package/types/static.d.ts.map +1 -1
- package/types/types.d.ts +2 -2
- package/types/types.d.ts.map +1 -1
- package/dist/cjs/helpers/pseudos.js.map +0 -7
- package/dist/esm/helpers/pseudos.js +0 -18
- package/dist/esm/helpers/pseudos.js.map +0 -7
- package/dist/jsx/Pressability.js +0 -4
- package/dist/jsx/Pressability.native.js +0 -4
- package/dist/jsx/Tamagui.js +0 -38
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -194
- package/dist/jsx/conf.js +0 -38
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -10
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -1036
- package/dist/jsx/createFont.js +0 -25
- package/dist/jsx/createShorthands.js +0 -6
- package/dist/jsx/createTamagui.js +0 -245
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -11
- package/dist/jsx/createVariable.js +0 -64
- package/dist/jsx/createVariables.js +0 -31
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/areEqualSets.js +0 -13
- package/dist/jsx/helpers/calc.js +0 -46
- package/dist/jsx/helpers/createMediaStyle.js +0 -29
- package/dist/jsx/helpers/createPropMapper.js +0 -243
- package/dist/jsx/helpers/createShallowUpdate.js +0 -16
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -28
- package/dist/jsx/helpers/extendStaticConfig.js +0 -62
- package/dist/jsx/helpers/fixNativeShadow.js +0 -5
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -28
- package/dist/jsx/helpers/generateAtomicStyles.js +0 -410
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -15
- package/dist/jsx/helpers/getSize.js +0 -19
- package/dist/jsx/helpers/getSplitStyles.js +0 -380
- package/dist/jsx/helpers/getStackSize.js +0 -15
- package/dist/jsx/helpers/getStylesAtomic.js +0 -61
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -6
- package/dist/jsx/helpers/getTextSize.js +0 -31
- package/dist/jsx/helpers/getVariantExtras.js +0 -22
- package/dist/jsx/helpers/insertStyleRule.js +0 -91
- package/dist/jsx/helpers/isObj.js +0 -4
- package/dist/jsx/helpers/isTamaguiComponent.js +0 -12
- package/dist/jsx/helpers/isTamaguiElement.js +0 -8
- package/dist/jsx/helpers/matchMedia.js +0 -15
- package/dist/jsx/helpers/matchMedia.native.js +0 -6
- package/dist/jsx/helpers/mergeProps.js +0 -15
- package/dist/jsx/helpers/mergeTransform.js +0 -16
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -14
- package/dist/jsx/helpers/registerCSSVariable.js +0 -14
- package/dist/jsx/helpers/themeable.js +0 -22
- package/dist/jsx/helpers/validate.js +0 -73
- package/dist/jsx/helpers/withStaticProperties.js +0 -7
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -7
- package/dist/jsx/hooks/useConstant.js +0 -11
- package/dist/jsx/hooks/useFeatures.js +0 -165
- package/dist/jsx/hooks/useId.js +0 -32
- package/dist/jsx/hooks/useIsMounted.js +0 -15
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -14
- package/dist/jsx/hooks/useMedia.js +0 -153
- package/dist/jsx/hooks/usePressable.js +0 -11
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -164
- package/dist/jsx/hooks/useUnmountEffect.js +0 -7
- package/dist/jsx/index.js +0 -64
- package/dist/jsx/insertFont.js +0 -51
- package/dist/jsx/static.js +0 -18
- package/dist/jsx/styled.js +0 -49
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -70
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -57
- package/dist/jsx/views/TextAncestorContext.js +0 -13
- package/dist/jsx/views/Theme.js +0 -27
- package/dist/jsx/views/ThemeInverse.js +0 -24
- package/dist/jsx/views/ThemeProvider.js +0 -34
- package/dist/jsx/views/ThemeReset.js +0 -32
- package/types/helpers/pseudos.d.ts.map +0 -1
|
@@ -1,3 +1,34 @@
|
|
|
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
|
+
};
|
|
1
32
|
import { composeEventHandlers, stylePropsView, validStyles } from "@tamagui/helpers";
|
|
2
33
|
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
3
34
|
import React, {
|
|
@@ -82,7 +113,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
82
113
|
let tamaguiDefaultProps;
|
|
83
114
|
let initialSplitStyles;
|
|
84
115
|
const component = forwardRef((propsIn, forwardedRef) => {
|
|
85
|
-
var _a,
|
|
116
|
+
var _a, _d, _e, _f;
|
|
86
117
|
let props;
|
|
87
118
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
88
119
|
props = mergeProps(tamaguiDefaultProps, propsIn);
|
|
@@ -110,32 +141,29 @@ function createComponent(configIn, ParentComponent) {
|
|
|
110
141
|
const setStateShallow = createShallowUpdate(statesUsed[1]);
|
|
111
142
|
let state = statesUsed[0];
|
|
112
143
|
if (propsIn.forceStyle) {
|
|
113
|
-
state = {
|
|
114
|
-
...state,
|
|
144
|
+
state = __spreadProps(__spreadValues({}, state), {
|
|
115
145
|
[propsIn.forceStyle]: true
|
|
116
|
-
};
|
|
146
|
+
});
|
|
117
147
|
}
|
|
118
148
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
119
149
|
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
120
150
|
const hasTextAncestor = !!(isWeb ? useContext(TextAncestorContext) : false);
|
|
121
|
-
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? {
|
|
122
|
-
...state,
|
|
151
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? __spreadProps(__spreadValues({}, state), {
|
|
123
152
|
hasTextAncestor,
|
|
124
153
|
dynamicStylesInline: true
|
|
125
|
-
} : {
|
|
126
|
-
...state,
|
|
154
|
+
}) : __spreadProps(__spreadValues({}, state), {
|
|
127
155
|
noClassNames: true,
|
|
128
156
|
dynamicStylesInline: true,
|
|
129
157
|
hasTextAncestor,
|
|
130
158
|
resolveVariablesAs: "value"
|
|
131
|
-
};
|
|
159
|
+
});
|
|
132
160
|
const splitStyles = useSplitStyles(props, staticConfig, theme, splitStyleState, props.asChild ? null : initialSplitStyles.classNames, props["debug"]);
|
|
133
161
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
134
162
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
135
163
|
const isAnimated = !!(useAnimations && props.animation);
|
|
136
164
|
const hasEnterStyle = !!props.enterStyle;
|
|
137
165
|
const hostRef = useRef(null);
|
|
138
|
-
const animationFeatureStylesIn = props.animation ? {
|
|
166
|
+
const animationFeatureStylesIn = props.animation ? __spreadValues(__spreadValues({}, defaultNativeStyle), style) : null;
|
|
139
167
|
const features = useFeatures(props, {
|
|
140
168
|
forceUpdate,
|
|
141
169
|
setStateShallow,
|
|
@@ -148,7 +176,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
148
176
|
hostRef,
|
|
149
177
|
onDidAnimate: props.onDidAnimate
|
|
150
178
|
});
|
|
151
|
-
const {
|
|
179
|
+
const _b = viewPropsIn, {
|
|
152
180
|
tag,
|
|
153
181
|
hitSlop,
|
|
154
182
|
asChild,
|
|
@@ -170,9 +198,31 @@ function createComponent(configIn, ParentComponent) {
|
|
|
170
198
|
forceStyle: _forceStyle,
|
|
171
199
|
onClick,
|
|
172
200
|
theme: _themeProp,
|
|
173
|
-
defaultVariants
|
|
174
|
-
|
|
175
|
-
|
|
201
|
+
defaultVariants
|
|
202
|
+
} = _b, nonTamaguiProps = __objRest(_b, [
|
|
203
|
+
"tag",
|
|
204
|
+
"hitSlop",
|
|
205
|
+
"asChild",
|
|
206
|
+
"children",
|
|
207
|
+
"onPress",
|
|
208
|
+
"onPressIn",
|
|
209
|
+
"onPressOut",
|
|
210
|
+
"onHoverIn",
|
|
211
|
+
"onHoverOut",
|
|
212
|
+
"space",
|
|
213
|
+
"spaceDirection",
|
|
214
|
+
"disabled",
|
|
215
|
+
"onMouseUp",
|
|
216
|
+
"onMouseDown",
|
|
217
|
+
"onMouseEnter",
|
|
218
|
+
"onMouseLeave",
|
|
219
|
+
"hrefAttrs",
|
|
220
|
+
"separator",
|
|
221
|
+
"forceStyle",
|
|
222
|
+
"onClick",
|
|
223
|
+
"theme",
|
|
224
|
+
"defaultVariants"
|
|
225
|
+
]);
|
|
176
226
|
const isTaggable = !Component || typeof Component === "string";
|
|
177
227
|
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
178
228
|
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
@@ -183,7 +233,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
183
233
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
184
234
|
let viewProps;
|
|
185
235
|
if (isWeb && !staticConfig.isReactNativeWeb) {
|
|
186
|
-
const {
|
|
236
|
+
const _c = nonTamaguiProps, {
|
|
187
237
|
onMoveShouldSetResponder,
|
|
188
238
|
onMoveShouldSetResponderCapture,
|
|
189
239
|
onResponderEnd,
|
|
@@ -252,9 +302,78 @@ function createComponent(configIn, ParentComponent) {
|
|
|
252
302
|
accessibilityValue,
|
|
253
303
|
collapsable,
|
|
254
304
|
focusable,
|
|
255
|
-
onLayout
|
|
256
|
-
|
|
257
|
-
|
|
305
|
+
onLayout
|
|
306
|
+
} = _c, webProps = __objRest(_c, [
|
|
307
|
+
"onMoveShouldSetResponder",
|
|
308
|
+
"onMoveShouldSetResponderCapture",
|
|
309
|
+
"onResponderEnd",
|
|
310
|
+
"onResponderGrant",
|
|
311
|
+
"onResponderMove",
|
|
312
|
+
"onResponderReject",
|
|
313
|
+
"onResponderRelease",
|
|
314
|
+
"onResponderStart",
|
|
315
|
+
"onResponderTerminate",
|
|
316
|
+
"onResponderTerminationRequest",
|
|
317
|
+
"onScrollShouldSetResponder",
|
|
318
|
+
"onScrollShouldSetResponderCapture",
|
|
319
|
+
"onSelectionChangeShouldSetResponder",
|
|
320
|
+
"onSelectionChangeShouldSetResponderCapture",
|
|
321
|
+
"onStartShouldSetResponder",
|
|
322
|
+
"onStartShouldSetResponderCapture",
|
|
323
|
+
"nativeID",
|
|
324
|
+
"accessibilityActiveDescendant",
|
|
325
|
+
"accessibilityAtomic",
|
|
326
|
+
"accessibilityAutoComplete",
|
|
327
|
+
"accessibilityBusy",
|
|
328
|
+
"accessibilityChecked",
|
|
329
|
+
"accessibilityColumnCount",
|
|
330
|
+
"accessibilityColumnIndex",
|
|
331
|
+
"accessibilityColumnSpan",
|
|
332
|
+
"accessibilityControls",
|
|
333
|
+
"accessibilityCurrent",
|
|
334
|
+
"accessibilityDescribedBy",
|
|
335
|
+
"accessibilityDetails",
|
|
336
|
+
"accessibilityDisabled",
|
|
337
|
+
"accessibilityErrorMessage",
|
|
338
|
+
"accessibilityExpanded",
|
|
339
|
+
"accessibilityFlowTo",
|
|
340
|
+
"accessibilityHasPopup",
|
|
341
|
+
"accessibilityHidden",
|
|
342
|
+
"accessibilityInvalid",
|
|
343
|
+
"accessibilityKeyShortcuts",
|
|
344
|
+
"accessibilityLabel",
|
|
345
|
+
"accessibilityLabelledBy",
|
|
346
|
+
"accessibilityLevel",
|
|
347
|
+
"accessibilityLiveRegion",
|
|
348
|
+
"accessibilityModal",
|
|
349
|
+
"accessibilityMultiline",
|
|
350
|
+
"accessibilityMultiSelectable",
|
|
351
|
+
"accessibilityOrientation",
|
|
352
|
+
"accessibilityOwns",
|
|
353
|
+
"accessibilityPlaceholder",
|
|
354
|
+
"accessibilityPosInSet",
|
|
355
|
+
"accessibilityPressed",
|
|
356
|
+
"accessibilityReadOnly",
|
|
357
|
+
"accessibilityRequired",
|
|
358
|
+
"accessibilityRole",
|
|
359
|
+
"accessibilityRoleDescription",
|
|
360
|
+
"accessibilityRowCount",
|
|
361
|
+
"accessibilityRowIndex",
|
|
362
|
+
"accessibilityRowSpan",
|
|
363
|
+
"accessibilitySelected",
|
|
364
|
+
"accessibilitySetSize",
|
|
365
|
+
"accessibilitySort",
|
|
366
|
+
"accessibilityValueMax",
|
|
367
|
+
"accessibilityValueMin",
|
|
368
|
+
"accessibilityValueNow",
|
|
369
|
+
"accessibilityValueText",
|
|
370
|
+
"accessible",
|
|
371
|
+
"accessibilityState",
|
|
372
|
+
"accessibilityValue",
|
|
373
|
+
"collapsable",
|
|
374
|
+
"focusable",
|
|
375
|
+
"onLayout"
|
|
376
|
+
]);
|
|
258
377
|
viewProps = webProps;
|
|
259
378
|
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
260
379
|
if (!asChild) {
|
|
@@ -358,15 +477,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
358
477
|
let styles;
|
|
359
478
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
360
479
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
361
|
-
styles = {
|
|
362
|
-
...defaultNativeStyle,
|
|
363
|
-
...animationStyles != null ? animationStyles : style,
|
|
364
|
-
...medias
|
|
365
|
-
};
|
|
480
|
+
styles = __spreadValues(__spreadValues(__spreadValues({}, defaultNativeStyle), animationStyles ?? style), medias);
|
|
366
481
|
} else {
|
|
367
482
|
styles = [
|
|
368
483
|
isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
369
|
-
animationStyles
|
|
484
|
+
animationStyles ?? style,
|
|
370
485
|
medias
|
|
371
486
|
];
|
|
372
487
|
if (!animationStyles) {
|
|
@@ -397,17 +512,16 @@ function createComponent(configIn, ParentComponent) {
|
|
|
397
512
|
classNames ? Object.values(classNames).join(" ") : ""
|
|
398
513
|
];
|
|
399
514
|
const className = classList.join(" ");
|
|
400
|
-
const style2 = animationStyles
|
|
515
|
+
const style2 = animationStyles ?? splitStyles.style;
|
|
401
516
|
if (process.env.NODE_ENV === "development" && props["debug"]) {
|
|
402
517
|
console.log(" \xBB className", { splitStyles, style: style2, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
|
|
403
518
|
}
|
|
404
519
|
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
405
520
|
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
406
|
-
viewProps.dataSet = {
|
|
407
|
-
...viewProps.dataSet,
|
|
521
|
+
viewProps.dataSet = __spreadProps(__spreadValues({}, viewProps.dataSet), {
|
|
408
522
|
className,
|
|
409
523
|
id: props.id
|
|
410
|
-
};
|
|
524
|
+
});
|
|
411
525
|
if (props["data-is"]) {
|
|
412
526
|
viewProps.dataSet.is = props["data-is"];
|
|
413
527
|
}
|
|
@@ -436,44 +550,44 @@ function createComponent(configIn, ParentComponent) {
|
|
|
436
550
|
pressIn: false
|
|
437
551
|
});
|
|
438
552
|
}, []);
|
|
439
|
-
const events = shouldAttach ? {
|
|
553
|
+
const events = shouldAttach ? __spreadValues(__spreadProps(__spreadValues({
|
|
440
554
|
[pressOutKey]: attachPress ? (e) => {
|
|
441
555
|
unPress();
|
|
442
556
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
443
557
|
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
558
|
+
} : void 0
|
|
559
|
+
}, isHoverable && {
|
|
560
|
+
onMouseEnter: attachHover ? (e) => {
|
|
561
|
+
let next = {};
|
|
562
|
+
if (attachHover) {
|
|
563
|
+
next.hover = true;
|
|
564
|
+
}
|
|
565
|
+
if (state.pressIn) {
|
|
566
|
+
next.press = true;
|
|
567
|
+
}
|
|
568
|
+
if (Object.keys(next).length) {
|
|
569
|
+
setStateShallow(next);
|
|
570
|
+
}
|
|
571
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
572
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
444
573
|
} : void 0,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
mouseUps.add(unPress);
|
|
463
|
-
if (attachHover) {
|
|
464
|
-
next.hover = false;
|
|
465
|
-
}
|
|
466
|
-
if (state.pressIn) {
|
|
467
|
-
next.press = false;
|
|
468
|
-
next.pressIn = false;
|
|
469
|
-
}
|
|
470
|
-
if (Object.keys(next).length) {
|
|
471
|
-
setStateShallow(next);
|
|
472
|
-
}
|
|
473
|
-
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
474
|
-
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
475
|
-
} : void 0
|
|
476
|
-
},
|
|
574
|
+
onMouseLeave: attachHover ? (e) => {
|
|
575
|
+
let next = {};
|
|
576
|
+
mouseUps.add(unPress);
|
|
577
|
+
if (attachHover) {
|
|
578
|
+
next.hover = false;
|
|
579
|
+
}
|
|
580
|
+
if (state.pressIn) {
|
|
581
|
+
next.press = false;
|
|
582
|
+
next.pressIn = false;
|
|
583
|
+
}
|
|
584
|
+
if (Object.keys(next).length) {
|
|
585
|
+
setStateShallow(next);
|
|
586
|
+
}
|
|
587
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
588
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
589
|
+
} : void 0
|
|
590
|
+
}), {
|
|
477
591
|
[pressInKey]: attachPress ? (e) => {
|
|
478
592
|
setStateShallow({
|
|
479
593
|
press: true,
|
|
@@ -489,18 +603,17 @@ function createComponent(configIn, ParentComponent) {
|
|
|
489
603
|
unPress();
|
|
490
604
|
onClick == null ? void 0 : onClick(e);
|
|
491
605
|
onPress == null ? void 0 : onPress(e);
|
|
492
|
-
} : null
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
} : null;
|
|
606
|
+
} : null
|
|
607
|
+
}), !isWeb && {
|
|
608
|
+
cancelable: !props.rejectResponderTermination,
|
|
609
|
+
disabled: props.disabled !== null ? props.disabled : (_d = props.accessibilityState) == null ? void 0 : _d.disabled,
|
|
610
|
+
hitSlop: props.hitSlop,
|
|
611
|
+
delayLongPress: props.delayLongPress,
|
|
612
|
+
delayPressIn: props.delayPressIn,
|
|
613
|
+
delayPressOut: props.delayPressOut,
|
|
614
|
+
focusable: viewProps.focusable ?? true,
|
|
615
|
+
minPressDuration: 0
|
|
616
|
+
}) : null;
|
|
504
617
|
let space = spaceProp;
|
|
505
618
|
if (features.enabled.mediaQuery) {
|
|
506
619
|
for (const key in mediaState) {
|
|
@@ -521,23 +634,22 @@ function createComponent(configIn, ParentComponent) {
|
|
|
521
634
|
let content;
|
|
522
635
|
if (asChild) {
|
|
523
636
|
elementType = Slot;
|
|
524
|
-
viewProps = {
|
|
525
|
-
...viewProps,
|
|
637
|
+
viewProps = __spreadProps(__spreadValues({}, viewProps), {
|
|
526
638
|
onPress,
|
|
527
639
|
onPressIn,
|
|
528
640
|
onPressOut
|
|
529
|
-
};
|
|
641
|
+
});
|
|
530
642
|
}
|
|
531
643
|
if (isWeb) {
|
|
532
|
-
const [pressableProps] = usePressable(events ? {
|
|
533
|
-
disabled
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
644
|
+
const [pressableProps] = usePressable(events ? __spreadProps(__spreadValues({
|
|
645
|
+
disabled
|
|
646
|
+
}, hitSlop && {
|
|
647
|
+
hitSlop
|
|
648
|
+
}), {
|
|
537
649
|
onPressOut: events[pressOutKey],
|
|
538
650
|
onPressIn: events[pressInKey],
|
|
539
651
|
onPress: events[pressKey]
|
|
540
|
-
} : {
|
|
652
|
+
}) : {
|
|
541
653
|
disabled: true
|
|
542
654
|
});
|
|
543
655
|
if (events) {
|
|
@@ -592,21 +704,20 @@ function createComponent(configIn, ParentComponent) {
|
|
|
592
704
|
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
593
705
|
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
594
706
|
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
595
|
-
content = /* @__PURE__ */ React.createElement("span", {
|
|
707
|
+
content = /* @__PURE__ */ React.createElement("span", __spreadValues({
|
|
596
708
|
className: `${hoverClassName} ${themeClassName}`,
|
|
597
709
|
style: {
|
|
598
710
|
display: "contents"
|
|
599
|
-
},
|
|
600
|
-
...shouldWrapWithHover && {
|
|
601
|
-
onMouseEnter: events.onMouseEnter,
|
|
602
|
-
onMouseLeave: events.onMouseLeave
|
|
603
711
|
}
|
|
604
|
-
},
|
|
712
|
+
}, shouldWrapWithHover && {
|
|
713
|
+
onMouseEnter: events.onMouseEnter,
|
|
714
|
+
onMouseLeave: events.onMouseLeave
|
|
715
|
+
}), content);
|
|
605
716
|
}
|
|
606
717
|
}
|
|
607
718
|
if (process.env.NODE_ENV === "development") {
|
|
608
719
|
if (props["debug"]) {
|
|
609
|
-
console.log("\u2B50\uFE0F", { propsIn: {
|
|
720
|
+
console.log("\u2B50\uFE0F", __spreadValues({ propsIn: __spreadValues({}, props), propsOut: __spreadValues({}, viewProps), elementType, state, splitStyles, animationStyles, isStringElement, classNamesIn: (_e = props.className) == null ? void 0 : _e.split(" "), classNamesOut: (_f = viewProps.className) == null ? void 0 : _f.split(" "), events, shouldAttach, ViewComponent: elementType, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles }, typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo } : null));
|
|
610
721
|
}
|
|
611
722
|
}
|
|
612
723
|
if (features.elements.length) {
|
|
@@ -670,12 +781,14 @@ function createComponent(configIn, ParentComponent) {
|
|
|
670
781
|
const defaults = mergeProps(component.defaultProps, initialSplitStyles.viewProps);
|
|
671
782
|
defaultNativeStyle = {};
|
|
672
783
|
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
784
|
+
if (!isWeb) {
|
|
785
|
+
for (const key in staticConfig.defaultProps) {
|
|
786
|
+
const val = staticConfig.defaultProps[key];
|
|
787
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles2[key] || val[0] === "_") {
|
|
788
|
+
defaults[key] = val;
|
|
789
|
+
} else {
|
|
790
|
+
defaultNativeStyle[key] = val;
|
|
791
|
+
}
|
|
679
792
|
}
|
|
680
793
|
}
|
|
681
794
|
defaultNativeStyleSheet = StyleSheet.create({
|
|
@@ -700,21 +813,17 @@ function createComponent(configIn, ParentComponent) {
|
|
|
700
813
|
if (configIn.memo) {
|
|
701
814
|
res = memo(res);
|
|
702
815
|
}
|
|
703
|
-
res.staticConfig = {
|
|
704
|
-
validStyles: staticConfig.validStyles || stylePropsView
|
|
705
|
-
|
|
706
|
-
};
|
|
816
|
+
res.staticConfig = __spreadValues({
|
|
817
|
+
validStyles: staticConfig.validStyles || stylePropsView
|
|
818
|
+
}, staticConfig);
|
|
707
819
|
res.extractable = (Component, conf) => {
|
|
708
|
-
Component.staticConfig = extendStaticConfig({
|
|
709
|
-
Component
|
|
710
|
-
|
|
820
|
+
Component.staticConfig = extendStaticConfig(__spreadProps(__spreadValues({
|
|
821
|
+
Component
|
|
822
|
+
}, conf), {
|
|
711
823
|
neverFlatten: true,
|
|
712
824
|
isExtractable: true,
|
|
713
|
-
defaultProps: {
|
|
714
|
-
|
|
715
|
-
...conf == null ? void 0 : conf.defaultProps
|
|
716
|
-
}
|
|
717
|
-
}, res);
|
|
825
|
+
defaultProps: __spreadValues(__spreadValues({}, Component.defaultProps), conf == null ? void 0 : conf.defaultProps)
|
|
826
|
+
}), res);
|
|
718
827
|
return Component;
|
|
719
828
|
};
|
|
720
829
|
return res;
|
|
@@ -728,16 +837,14 @@ const Spacer = createComponent({
|
|
|
728
837
|
memo: true,
|
|
729
838
|
componentName: "Spacer",
|
|
730
839
|
validStyles,
|
|
731
|
-
defaultProps: {
|
|
732
|
-
...stackDefaultStyles,
|
|
840
|
+
defaultProps: __spreadProps(__spreadValues({}, stackDefaultStyles), {
|
|
733
841
|
size: true
|
|
734
|
-
},
|
|
842
|
+
}),
|
|
735
843
|
variants: {
|
|
736
844
|
size: {
|
|
737
845
|
"...size": (size, { tokens }) => {
|
|
738
|
-
var _a;
|
|
739
846
|
size = size == true ? "$true" : size;
|
|
740
|
-
const sizePx =
|
|
847
|
+
const sizePx = tokens.space[size] ?? size;
|
|
741
848
|
return {
|
|
742
849
|
width: sizePx,
|
|
743
850
|
height: sizePx,
|
|
@@ -759,11 +866,12 @@ const Spacer = createComponent({
|
|
|
759
866
|
vertical: {
|
|
760
867
|
width: 0,
|
|
761
868
|
minWidth: 0
|
|
762
|
-
}
|
|
869
|
+
},
|
|
870
|
+
both: {}
|
|
763
871
|
}
|
|
764
872
|
},
|
|
765
873
|
defaultVariants: {
|
|
766
|
-
direction: "
|
|
874
|
+
direction: "both"
|
|
767
875
|
}
|
|
768
876
|
});
|
|
769
877
|
function spacedChildren({
|
|
@@ -832,14 +940,13 @@ function spacedChildren({
|
|
|
832
940
|
return final;
|
|
833
941
|
}
|
|
834
942
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
835
|
-
return /* @__PURE__ */ React.createElement(Spacer, {
|
|
943
|
+
return /* @__PURE__ */ React.createElement(Spacer, __spreadValues({
|
|
836
944
|
key,
|
|
837
|
-
direction: direction === "both" ? void 0 : direction === "row" || direction === "row-reverse" ? "horizontal" : "vertical",
|
|
838
945
|
size: space,
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
});
|
|
946
|
+
direction
|
|
947
|
+
}, spaceFlex && {
|
|
948
|
+
flex: spaceFlex
|
|
949
|
+
}));
|
|
843
950
|
}
|
|
844
951
|
function isUnspaced(child) {
|
|
845
952
|
var _a, _b;
|
|
@@ -1031,7 +1138,7 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
1031
1138
|
const pseudoStyle = pseudos[name];
|
|
1032
1139
|
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
1033
1140
|
const defaultPseudoStyle = initialPseudos[name];
|
|
1034
|
-
const style = defaultPseudoStyle ? {
|
|
1141
|
+
const style = defaultPseudoStyle ? __spreadValues(__spreadValues({}, defaultPseudoStyle), pseudoStyle) : pseudoStyle;
|
|
1035
1142
|
if (style) {
|
|
1036
1143
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1037
1144
|
}
|