@tamagui/web 1.88.3 → 1.88.5
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/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +22 -3
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/interfaces/KeyTypes.js +14 -0
- package/dist/cjs/interfaces/KeyTypes.js.map +6 -0
- package/dist/cjs/interfaces/KeyTypes.native.js +15 -0
- package/dist/cjs/interfaces/KeyTypes.native.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.js +14 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js +15 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.js +14 -0
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js +15 -0
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentState.js +14 -0
- package/dist/cjs/interfaces/TamaguiComponentState.js.map +6 -0
- package/dist/cjs/interfaces/TamaguiComponentState.native.js +15 -0
- package/dist/cjs/interfaces/TamaguiComponentState.native.js.map +6 -0
- package/dist/cjs/interfaces/WebOnlyPressEvents.js +14 -0
- package/dist/cjs/interfaces/WebOnlyPressEvents.js.map +6 -0
- package/dist/cjs/interfaces/WebOnlyPressEvents.native.js +15 -0
- package/dist/cjs/interfaces/WebOnlyPressEvents.native.js.map +6 -0
- package/dist/cjs/internalWithTheme.js +1 -1
- package/dist/cjs/internalWithTheme.js.map +1 -1
- package/dist/cjs/internalWithTheme.native.js +1 -1
- package/dist/cjs/internalWithTheme.native.js.map +1 -1
- package/dist/cjs/types.js +3 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +8 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/View.js.map +1 -1
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +22 -3
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/interfaces/KeyTypes.js +1 -0
- package/dist/esm/interfaces/KeyTypes.js.map +6 -0
- package/dist/esm/interfaces/KeyTypes.native.js +15 -0
- package/dist/esm/interfaces/KeyTypes.native.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentEvents.js +1 -0
- package/dist/esm/interfaces/TamaguiComponentEvents.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js +15 -0
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.js +1 -0
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +15 -0
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentState.js +1 -0
- package/dist/esm/interfaces/TamaguiComponentState.js.map +6 -0
- package/dist/esm/interfaces/TamaguiComponentState.native.js +15 -0
- package/dist/esm/interfaces/TamaguiComponentState.native.js.map +6 -0
- package/dist/esm/interfaces/WebOnlyPressEvents.js +1 -0
- package/dist/esm/interfaces/WebOnlyPressEvents.js.map +6 -0
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js +15 -0
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js.map +6 -0
- package/dist/esm/internalWithTheme.js +1 -1
- package/dist/esm/internalWithTheme.js.map +1 -1
- package/dist/esm/internalWithTheme.native.js +1 -1
- package/dist/esm/internalWithTheme.native.js.map +1 -1
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +2 -2
- package/dist/esm/types.native.js +8 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/View.js.map +1 -1
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +10 -10
- package/src/createComponent.tsx +6 -11
- package/src/defaultComponentState.tsx +1 -1
- package/src/helpers/getSplitStyles.tsx +29 -6
- package/src/hooks/useProps.tsx +2 -2
- package/src/interfaces/KeyTypes.tsx +79 -0
- package/src/interfaces/TamaguiComponentEvents.tsx +18 -0
- package/src/interfaces/TamaguiComponentPropsBaseBase.tsx +202 -0
- package/src/interfaces/TamaguiComponentState.tsx +15 -0
- package/src/interfaces/WebOnlyPressEvents.tsx +17 -0
- package/src/internalWithTheme.tsx +4 -8
- package/src/setupHooks.ts +2 -2
- package/src/types.tsx +23 -354
- package/src/views/Stack.tsx +2 -2
- package/src/views/View.tsx +4 -2
- package/types/createComponent.d.ts +3 -3
- package/types/createComponent.d.ts.map +1 -1
- package/types/defaultComponentState.d.ts +1 -1
- package/types/defaultComponentState.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts +2 -2
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/interfaces/KeyTypes.d.ts +4 -0
- package/types/interfaces/KeyTypes.d.ts.map +1 -0
- package/types/interfaces/TamaguiComponentEvents.d.ts +19 -0
- package/types/interfaces/TamaguiComponentEvents.d.ts.map +1 -0
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts +81 -0
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts.map +1 -0
- package/types/interfaces/TamaguiComponentState.d.ts +14 -0
- package/types/interfaces/TamaguiComponentState.d.ts.map +1 -0
- package/types/interfaces/WebOnlyPressEvents.d.ts +17 -0
- package/types/interfaces/WebOnlyPressEvents.d.ts.map +1 -0
- package/types/internalWithTheme.d.ts.map +1 -1
- package/types/setupHooks.d.ts +3 -1
- package/types/setupHooks.d.ts.map +1 -1
- package/types/types.d.ts +22 -144
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.d.ts +2 -2
- package/types/views/Stack.d.ts.map +1 -1
- package/types/views/View.d.ts +4 -3
- package/types/views/View.d.ts.map +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
return to;
|
|
11
|
+
};
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
+
var TamaguiComponentPropsBaseBase_exports = {};
|
|
14
|
+
module.exports = __toCommonJS(TamaguiComponentPropsBaseBase_exports);
|
|
15
|
+
//# sourceMappingURL=TamaguiComponentPropsBaseBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=TamaguiComponentState.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
return to;
|
|
11
|
+
};
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
+
var TamaguiComponentState_exports = {};
|
|
14
|
+
module.exports = __toCommonJS(TamaguiComponentState_exports);
|
|
15
|
+
//# sourceMappingURL=TamaguiComponentState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=WebOnlyPressEvents.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
return to;
|
|
11
|
+
};
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
+
var WebOnlyPressEvents_exports = {};
|
|
14
|
+
module.exports = __toCommonJS(WebOnlyPressEvents_exports);
|
|
15
|
+
//# sourceMappingURL=WebOnlyPressEvents.js.map
|
|
@@ -2,7 +2,7 @@ import { useTheme } from "./hooks/useTheme";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
const internalWithTheme = (Component, styleProvider) => (props) => {
|
|
4
4
|
const { expressions, ...rest } = props, theme = useTheme();
|
|
5
|
-
return /* @__PURE__ */ jsx(Component, { style: styleProvider(theme,
|
|
5
|
+
return /* @__PURE__ */ jsx(Component, { style: styleProvider(theme, expressions), ...rest });
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
internalWithTheme
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/internalWithTheme.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAOhB;AAHF,MAAM,oBAAoB,CAAC,WAAgB,kBAAuB,CAAC,UAAU;AAClF,QAAM,EAAE,aAAa,GAAG,KAAK,IAAI,OAC3B,QAAQ,SAAS;AACvB,SAAO,oBAAC,aAAU,OAAO,cAAc,OAAO,WAAW,GAAI,GAAG,MAAM;AACxE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -21,7 +21,7 @@ module.exports = __toCommonJS(internalWithTheme_exports);
|
|
|
21
21
|
var import_useTheme = require("./hooks/useTheme"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
22
|
const internalWithTheme = (Component, styleProvider) => (props) => {
|
|
23
23
|
const { expressions, ...rest } = props, theme = (0, import_useTheme.useTheme)();
|
|
24
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { style: styleProvider(theme,
|
|
24
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { style: styleProvider(theme, expressions), ...rest });
|
|
25
25
|
};
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/internalWithTheme.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB,6BAOhB;AAHF,MAAM,oBAAoB,CAAC,WAAgB,kBAAuB,CAAC,UAAU;AAClF,QAAM,EAAE,aAAa,GAAG,KAAK,IAAI,OAC3B,YAAQ,0BAAS;AACvB,SAAO,4CAAC,aAAU,OAAO,cAAc,OAAO,WAAW,GAAI,GAAG,MAAM;AACxE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/types.js
CHANGED
package/dist/esm/types.js.map
CHANGED
package/dist/esm/types.native.js
CHANGED
|
@@ -8,8 +8,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
8
8
|
for (let key of __getOwnPropNames(from))
|
|
9
9
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
10
|
return to;
|
|
11
|
-
};
|
|
11
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
12
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
13
|
var types_exports = {};
|
|
14
14
|
module.exports = __toCommonJS(types_exports);
|
|
15
|
+
__reExport(types_exports, require("./interfaces/KeyTypes"), module.exports);
|
|
16
|
+
__reExport(types_exports, require("./interfaces/TamaguiComponentState"), module.exports);
|
|
17
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
18
|
+
0 && (module.exports = {
|
|
19
|
+
...require("./interfaces/KeyTypes"),
|
|
20
|
+
...require("./interfaces/TamaguiComponentState")
|
|
21
|
+
});
|
|
15
22
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/View.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;
|
|
4
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAezB,MAAM,OAAO,gBAKlB;AAAA,EACA,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd;AACF,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/View.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA4B,6BAE5B,mBAAmC,mCACnC,yBAAgC;
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA4B,6BAE5B,mBAAmC,mCACnC,yBAAgC;AAezB,MAAM,WAAO,wCAKlB;AAAA,EACA,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd;AACF,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.5",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.88.
|
|
31
|
-
"@tamagui/constants": "1.88.
|
|
32
|
-
"@tamagui/helpers": "1.88.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.88.
|
|
34
|
-
"@tamagui/timer": "1.88.
|
|
35
|
-
"@tamagui/use-did-finish-ssr": "1.88.
|
|
36
|
-
"@tamagui/use-event": "1.88.
|
|
37
|
-
"@tamagui/use-force-update": "1.88.
|
|
30
|
+
"@tamagui/compose-refs": "1.88.5",
|
|
31
|
+
"@tamagui/constants": "1.88.5",
|
|
32
|
+
"@tamagui/helpers": "1.88.5",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.88.5",
|
|
34
|
+
"@tamagui/timer": "1.88.5",
|
|
35
|
+
"@tamagui/use-did-finish-ssr": "1.88.5",
|
|
36
|
+
"@tamagui/use-event": "1.88.5",
|
|
37
|
+
"@tamagui/use-force-update": "1.88.5",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-dom": "^18.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.88.
|
|
42
|
+
"@tamagui/build": "1.88.5",
|
|
43
43
|
"@testing-library/react": "^14.0.0",
|
|
44
44
|
"csstype": "^3.0.10",
|
|
45
45
|
"typescript": "^5.3.3",
|
package/src/createComponent.tsx
CHANGED
|
@@ -48,15 +48,12 @@ import {
|
|
|
48
48
|
SpaceDirection,
|
|
49
49
|
SpaceValue,
|
|
50
50
|
SpacerProps,
|
|
51
|
-
|
|
51
|
+
SpacerStyleProps,
|
|
52
52
|
StackNonStyleProps,
|
|
53
53
|
StackProps,
|
|
54
|
-
StackStylePropsBase,
|
|
55
54
|
StaticConfig,
|
|
56
55
|
StyleableOptions,
|
|
57
56
|
TamaguiComponent,
|
|
58
|
-
TamaguiComponentEvents,
|
|
59
|
-
TamaguiComponentState,
|
|
60
57
|
TamaguiComponentStateRef,
|
|
61
58
|
TamaguiElement,
|
|
62
59
|
TamaguiInternalConfig,
|
|
@@ -64,15 +61,14 @@ import {
|
|
|
64
61
|
UseAnimationHook,
|
|
65
62
|
UseAnimationProps,
|
|
66
63
|
UseThemeWithStateProps,
|
|
67
|
-
WebOnlyPressEvents,
|
|
68
64
|
} from './types'
|
|
65
|
+
import { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
66
|
+
import { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
67
|
+
import { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
69
68
|
import { Slot } from './views/Slot'
|
|
70
69
|
import { getThemedChildren } from './views/Theme'
|
|
71
70
|
import { ThemeDebug } from './views/ThemeDebug'
|
|
72
71
|
|
|
73
|
-
// this appears to fix expo / babel not picking this up sometimes? really odd
|
|
74
|
-
process.env.TAMAGUI_TARGET
|
|
75
|
-
|
|
76
72
|
/**
|
|
77
73
|
* All things that need one-time setup after createTamagui is called
|
|
78
74
|
*/
|
|
@@ -144,7 +140,7 @@ let BaseView: any
|
|
|
144
140
|
let hasSetupBaseViews = false
|
|
145
141
|
|
|
146
142
|
export function createComponent<
|
|
147
|
-
ComponentPropTypes extends
|
|
143
|
+
ComponentPropTypes extends Record<string, any> = {},
|
|
148
144
|
Ref extends TamaguiElement = TamaguiElement,
|
|
149
145
|
BaseProps = never,
|
|
150
146
|
BaseStyles extends Object = never,
|
|
@@ -1390,11 +1386,10 @@ const getSpacerSize = (size: SizeTokens | number | boolean, { tokens }) => {
|
|
|
1390
1386
|
// dont used styled() here to avoid circular deps
|
|
1391
1387
|
// keep inline to avoid circular deps
|
|
1392
1388
|
export const Spacer = createComponent<
|
|
1393
|
-
// @ts-expect-error its fine
|
|
1394
1389
|
SpacerProps,
|
|
1395
1390
|
TamaguiElement,
|
|
1396
1391
|
StackNonStyleProps,
|
|
1397
|
-
|
|
1392
|
+
SpacerStyleProps
|
|
1398
1393
|
>({
|
|
1399
1394
|
acceptsClassName: true,
|
|
1400
1395
|
memo: true,
|
|
@@ -48,12 +48,12 @@ import type {
|
|
|
48
48
|
SplitStyleProps,
|
|
49
49
|
StaticConfig,
|
|
50
50
|
StyleObject,
|
|
51
|
-
TamaguiComponentState,
|
|
52
51
|
TamaguiInternalConfig,
|
|
53
52
|
TextStyleProps,
|
|
54
53
|
ThemeParsed,
|
|
55
54
|
ViewStyleWithPseudos,
|
|
56
55
|
} from '../types'
|
|
56
|
+
import type { TamaguiComponentState } from '../interfaces/TamaguiComponentState'
|
|
57
57
|
import { createMediaStyle } from './createMediaStyle'
|
|
58
58
|
import { fixStyles } from './expandStyles'
|
|
59
59
|
import { getGroupPropParts } from './getGroupPropParts'
|
|
@@ -1494,11 +1494,34 @@ if (process.env.TAMAGUI_TARGET === 'native') {
|
|
|
1494
1494
|
outlineColor: 1,
|
|
1495
1495
|
})
|
|
1496
1496
|
} else {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1497
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1498
|
+
// native only, not web props
|
|
1499
|
+
// we only skip them in dev to avoid warnings, in prod they silently drop
|
|
1500
|
+
Object.assign(skipProps, {
|
|
1501
|
+
accessibilityElementsHidden: 1,
|
|
1502
|
+
accessibilityIgnoresInvertColors: 1,
|
|
1503
|
+
accessibilityLanguage: 1,
|
|
1504
|
+
adjustsFontSizeToFit: 1,
|
|
1505
|
+
allowFontScaling: 1,
|
|
1506
|
+
dataDetectorType: 1,
|
|
1507
|
+
dynamicTypeRamp: 1,
|
|
1508
|
+
elevationAndroid: 1,
|
|
1509
|
+
importantForAccessibility: 1,
|
|
1510
|
+
lineBreakStrategyIOS: 1,
|
|
1511
|
+
minimumFontScale: 1,
|
|
1512
|
+
needsOffscreenAlphaCompositing: 1,
|
|
1513
|
+
nextFocusDown: 1,
|
|
1514
|
+
nextFocusForward: 1,
|
|
1515
|
+
nextFocusLeft: 1,
|
|
1516
|
+
nextFocusRight: 1,
|
|
1517
|
+
nextFocusUp: 1,
|
|
1518
|
+
onMagicTap: 1,
|
|
1519
|
+
selectionColor: 1,
|
|
1520
|
+
shouldRasterizeIOS: 1,
|
|
1521
|
+
suppressHighlighting: 1,
|
|
1522
|
+
textBreakStrategy: 1,
|
|
1523
|
+
})
|
|
1524
|
+
}
|
|
1502
1525
|
}
|
|
1503
1526
|
|
|
1504
1527
|
const accessibilityRoleToWebRole = {
|
package/src/hooks/useProps.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { defaultComponentStateMounted } from '../defaultComponentState'
|
|
|
5
5
|
import { useSplitStyles } from '../helpers/getSplitStyles'
|
|
6
6
|
import {
|
|
7
7
|
SplitStyleProps,
|
|
8
|
-
|
|
8
|
+
StackStyle,
|
|
9
9
|
StaticConfig,
|
|
10
10
|
ThemeParsed,
|
|
11
11
|
UseMediaState,
|
|
@@ -27,7 +27,7 @@ export type PropsWithoutMediaStyles<A> = {
|
|
|
27
27
|
[Key in keyof A extends `$${string}` ? never : keyof A]?: A[Key]
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
type StyleLikeObject = (
|
|
30
|
+
type StyleLikeObject = (StackStyle & Record<string, any>) | Object
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Returns props and style as a single object, expanding and merging shorthands and media queries.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type SizeKeys =
|
|
2
|
+
| 'width'
|
|
3
|
+
| 'height'
|
|
4
|
+
| 'minWidth'
|
|
5
|
+
| 'minHeight'
|
|
6
|
+
| 'maxWidth'
|
|
7
|
+
| 'maxHeight'
|
|
8
|
+
| 'shadowRadius'
|
|
9
|
+
|
|
10
|
+
export type ColorKeys =
|
|
11
|
+
| 'color'
|
|
12
|
+
| 'backgroundColor'
|
|
13
|
+
| 'borderColor'
|
|
14
|
+
| 'borderBottomColor'
|
|
15
|
+
| 'borderTopColor'
|
|
16
|
+
| 'borderLeftColor'
|
|
17
|
+
| 'borderRightColor'
|
|
18
|
+
| 'shadowColor'
|
|
19
|
+
| 'outlineColor'
|
|
20
|
+
| 'textShadowColor'
|
|
21
|
+
| 'borderBlockColor'
|
|
22
|
+
| 'borderBlockEndColor'
|
|
23
|
+
| 'borderBlockStartColor'
|
|
24
|
+
|
|
25
|
+
export type SpaceKeys =
|
|
26
|
+
| 'space'
|
|
27
|
+
| 'padding'
|
|
28
|
+
| 'paddingHorizontal'
|
|
29
|
+
| 'paddingVertical'
|
|
30
|
+
| 'paddingLeft'
|
|
31
|
+
| 'paddingTop'
|
|
32
|
+
| 'paddingBottom'
|
|
33
|
+
| 'paddingLeft'
|
|
34
|
+
| 'paddingRight'
|
|
35
|
+
| 'paddingEnd'
|
|
36
|
+
| 'paddingStart'
|
|
37
|
+
| 'margin'
|
|
38
|
+
| 'marginHorizontal'
|
|
39
|
+
| 'marginVertical'
|
|
40
|
+
| 'marginLeft'
|
|
41
|
+
| 'marginTop'
|
|
42
|
+
| 'marginBottom'
|
|
43
|
+
| 'marginLeft'
|
|
44
|
+
| 'marginRight'
|
|
45
|
+
| 'marginEnd'
|
|
46
|
+
| 'marginStart'
|
|
47
|
+
| 'x'
|
|
48
|
+
| 'y'
|
|
49
|
+
| 'gap'
|
|
50
|
+
| 'rowGap'
|
|
51
|
+
| 'columnGap'
|
|
52
|
+
| 'scale'
|
|
53
|
+
| 'scaleX'
|
|
54
|
+
| 'scaleY'
|
|
55
|
+
| 'borderTopEndRadius'
|
|
56
|
+
| 'borderTopLeftRadius'
|
|
57
|
+
| 'borderTopRightRadius'
|
|
58
|
+
| 'borderTopStartRadius'
|
|
59
|
+
| 'borderBottomEndRadius'
|
|
60
|
+
| 'borderBottomLeftRadius'
|
|
61
|
+
| 'borderBottomRightRadius'
|
|
62
|
+
| 'borderBottomStartRadius'
|
|
63
|
+
| 'borderBottomWidth'
|
|
64
|
+
| 'borderLeftWidth'
|
|
65
|
+
| 'borderRadius'
|
|
66
|
+
| 'borderRightWidth'
|
|
67
|
+
| 'borderTopEndRadius'
|
|
68
|
+
| 'borderTopLeftRadius'
|
|
69
|
+
| 'borderTopRightRadius'
|
|
70
|
+
| 'borderEndWidth'
|
|
71
|
+
| 'borderStartWidth'
|
|
72
|
+
| 'borderTopStartRadius'
|
|
73
|
+
| 'borderTopWidth'
|
|
74
|
+
| 'borderWidth'
|
|
75
|
+
| 'left'
|
|
76
|
+
| 'top'
|
|
77
|
+
| 'right'
|
|
78
|
+
| 'bottom'
|
|
79
|
+
| 'shadowOffset'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type TamaguiComponentEvents = {
|
|
2
|
+
cancelable?: boolean | undefined
|
|
3
|
+
disabled?: any
|
|
4
|
+
hitSlop?: any
|
|
5
|
+
delayLongPress?: any
|
|
6
|
+
delayPressIn?: any
|
|
7
|
+
delayPressOut?: any
|
|
8
|
+
focusable?: any
|
|
9
|
+
minPressDuration?: number | undefined
|
|
10
|
+
onPressIn: ((e: any) => void) | undefined
|
|
11
|
+
onPress: ((e: any) => void) | undefined
|
|
12
|
+
onLongPress?: ((e: any) => void) | undefined
|
|
13
|
+
onMouseEnter?: ((e: any) => void) | undefined
|
|
14
|
+
onMouseLeave?: ((e: any) => void) | undefined
|
|
15
|
+
onPressOut: ((e: any) => void) | undefined
|
|
16
|
+
onFocus?: ((e: any) => void) | undefined
|
|
17
|
+
onBlur?: ((e: any) => void) | undefined
|
|
18
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Role } from './Role'
|
|
2
|
+
import { DebugProp, ThemeName, GroupNames } from '../types'
|
|
3
|
+
|
|
4
|
+
export type TamaguiComponentPropsBaseBase = {
|
|
5
|
+
target?: string
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* When truthy passes through all props to a single child element, and avoids rendering its own element.
|
|
9
|
+
* Must pass just one child React element that will receive all the props.
|
|
10
|
+
*
|
|
11
|
+
* The option "except-style" will avoid passing any style related props.
|
|
12
|
+
*
|
|
13
|
+
* The option "web" will map all React Native style props to web props (onPress becomes onClick).
|
|
14
|
+
*
|
|
15
|
+
* The option "except-style-web" combines the except-style and web options.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
asChild?: boolean | 'except-style' | 'except-style-web' | 'web'
|
|
19
|
+
|
|
20
|
+
dangerouslySetInnerHTML?: { __html: string }
|
|
21
|
+
children?: any | any[]
|
|
22
|
+
|
|
23
|
+
debug?: DebugProp
|
|
24
|
+
|
|
25
|
+
disabled?: boolean
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Same as the web className property, useful for applying styles from CSS on web only
|
|
29
|
+
*/
|
|
30
|
+
className?: string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* If given a theme it will only apply to this element, instead of passing down to children
|
|
34
|
+
*/
|
|
35
|
+
themeShallow?: boolean
|
|
36
|
+
|
|
37
|
+
themeInverse?: boolean
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Same as the web id property for setting a uid on an element
|
|
41
|
+
*/
|
|
42
|
+
id?: string
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Controls the output tag on web
|
|
46
|
+
* {@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element}
|
|
47
|
+
*/
|
|
48
|
+
tag?:
|
|
49
|
+
| (string & {})
|
|
50
|
+
| 'address'
|
|
51
|
+
| 'article'
|
|
52
|
+
| 'aside'
|
|
53
|
+
| 'footer'
|
|
54
|
+
| 'header'
|
|
55
|
+
| 'h1'
|
|
56
|
+
| 'h2'
|
|
57
|
+
| 'h3'
|
|
58
|
+
| 'h4'
|
|
59
|
+
| 'h5'
|
|
60
|
+
| 'h6'
|
|
61
|
+
| 'main'
|
|
62
|
+
| 'nav'
|
|
63
|
+
| 'section'
|
|
64
|
+
| 'search'
|
|
65
|
+
| 'blockquote'
|
|
66
|
+
| 'dd'
|
|
67
|
+
| 'div'
|
|
68
|
+
| 'dl'
|
|
69
|
+
| 'dt'
|
|
70
|
+
| 'figcaption'
|
|
71
|
+
| 'figure'
|
|
72
|
+
| 'hr'
|
|
73
|
+
| 'li'
|
|
74
|
+
| 'ol'
|
|
75
|
+
| 'ul'
|
|
76
|
+
| 'p'
|
|
77
|
+
| 'pre'
|
|
78
|
+
| 'a'
|
|
79
|
+
| 'abbr'
|
|
80
|
+
| 'p'
|
|
81
|
+
| 'b'
|
|
82
|
+
| 'abbr'
|
|
83
|
+
| 'bdi'
|
|
84
|
+
| 'bdo'
|
|
85
|
+
| 'br'
|
|
86
|
+
| 'cite'
|
|
87
|
+
| 'code'
|
|
88
|
+
| 'data'
|
|
89
|
+
| 'dfn'
|
|
90
|
+
| 'em'
|
|
91
|
+
| 'i'
|
|
92
|
+
| 'kbd'
|
|
93
|
+
| 'mark'
|
|
94
|
+
| 'q'
|
|
95
|
+
| 'rp'
|
|
96
|
+
| 'rt'
|
|
97
|
+
| 'rtc'
|
|
98
|
+
| 'ruby'
|
|
99
|
+
| 's'
|
|
100
|
+
| 'samp'
|
|
101
|
+
| 'small'
|
|
102
|
+
| 'span'
|
|
103
|
+
| 'strong'
|
|
104
|
+
| 'sub'
|
|
105
|
+
| 'sup'
|
|
106
|
+
| 'time'
|
|
107
|
+
| 'u'
|
|
108
|
+
| 'var'
|
|
109
|
+
| 'wbr'
|
|
110
|
+
| 'area'
|
|
111
|
+
| 'audio'
|
|
112
|
+
| 'img'
|
|
113
|
+
| 'map'
|
|
114
|
+
| 'track'
|
|
115
|
+
| 'video'
|
|
116
|
+
| 'embed'
|
|
117
|
+
| 'object'
|
|
118
|
+
| 'param'
|
|
119
|
+
| 'picture'
|
|
120
|
+
| 'source'
|
|
121
|
+
| 'canvas'
|
|
122
|
+
| 'noscript'
|
|
123
|
+
| 'script'
|
|
124
|
+
| 'del'
|
|
125
|
+
| 'ins'
|
|
126
|
+
| 'caption'
|
|
127
|
+
| 'col'
|
|
128
|
+
| 'colgroup'
|
|
129
|
+
| 'table'
|
|
130
|
+
| 'thead'
|
|
131
|
+
| 'tbody'
|
|
132
|
+
| 'td'
|
|
133
|
+
| 'th'
|
|
134
|
+
| 'tr'
|
|
135
|
+
| 'button'
|
|
136
|
+
| 'datalist'
|
|
137
|
+
| 'fieldset'
|
|
138
|
+
| 'form'
|
|
139
|
+
| 'input'
|
|
140
|
+
| 'label'
|
|
141
|
+
| 'legend'
|
|
142
|
+
| 'meter'
|
|
143
|
+
| 'optgroup'
|
|
144
|
+
| 'option'
|
|
145
|
+
| 'output'
|
|
146
|
+
| 'progress'
|
|
147
|
+
| 'select'
|
|
148
|
+
| 'textarea'
|
|
149
|
+
| 'details'
|
|
150
|
+
| 'dialog'
|
|
151
|
+
| 'menu'
|
|
152
|
+
| 'summary'
|
|
153
|
+
| 'template'
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Applies a theme to this element
|
|
157
|
+
*/
|
|
158
|
+
theme?: ThemeName | null
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Marks this component as a group for use in styling children based on parents named group
|
|
162
|
+
* See: https://tamagui.dev/docs/intro/props
|
|
163
|
+
*/
|
|
164
|
+
group?: GroupNames
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Works only alongside group, when children of the group are using container based sizing on native you can hide them until parent is measured.
|
|
168
|
+
* See: https://tamagui.dev/docs/intro/props
|
|
169
|
+
*/
|
|
170
|
+
untilMeasured?: 'hide' | 'show'
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Equivalent to "name" property on styled() for automatically applying a theme
|
|
174
|
+
*/
|
|
175
|
+
componentName?: string
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Used for controlling the order of focus with keyboard or assistive device enavigation
|
|
179
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
180
|
+
*/
|
|
181
|
+
tabIndex?: string | number
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Equivalent to role="" attribute on web for accessibility
|
|
185
|
+
*/
|
|
186
|
+
role?: Role
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Disable all compiler optimization
|
|
190
|
+
*/
|
|
191
|
+
disableOptimization?: boolean
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Forces the pseudo style state to be on
|
|
195
|
+
*/
|
|
196
|
+
forceStyle?: 'hover' | 'press' | 'focus'
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Disables className output of styles, instead using only inline styles
|
|
200
|
+
*/
|
|
201
|
+
disableClassName?: boolean
|
|
202
|
+
}
|