@tamagui/web 2.1.0 → 2.2.0-1781071309197
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test$colon$web.log +5 -4
- package/dist/cjs/createComponent.cjs +3 -2
- package/dist/cjs/createComponent.native.js +3 -2
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/eventHandling.native.js +15 -0
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/platformResolveValue.cjs +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js +3 -3
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +7 -8
- package/dist/cjs/hooks/useThemeState.native.js +7 -8
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/opacityModifier.test-d.cjs +29 -0
- package/dist/cjs/opacityModifier.test-d.native.js +32 -0
- package/dist/cjs/opacityModifier.test-d.native.js.map +1 -0
- package/dist/esm/createComponent.mjs +13 -9
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +19 -15
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +5 -5
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +5 -5
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/eventHandling.native.js +15 -0
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +1 -2
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +1 -3
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +17 -18
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +18 -22
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +1 -3
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +0 -26
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs.map +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +1 -4
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +1 -2
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +0 -2
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +1 -4
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +4 -4
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +1 -2
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +2 -3
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +0 -1
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/opacityModifier.test-d.mjs +30 -0
- package/dist/esm/opacityModifier.test-d.mjs.map +1 -0
- package/dist/esm/opacityModifier.test-d.native.js +30 -0
- package/dist/esm/opacityModifier.test-d.native.js.map +1 -0
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +6 -6
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +2 -4
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/package.json +13 -13
- package/src/createComponent.tsx +25 -3
- package/src/eventHandling.native.ts +16 -0
- package/src/helpers/getSplitStyles.tsx +2 -2
- package/src/helpers/platformResolveValue.native.ts +4 -1
- package/src/helpers/platformResolveValue.ts +5 -1
- package/src/hooks/getThemeProxied.ts +4 -4
- package/src/hooks/useThemeState.ts +2 -3
- package/src/opacityModifier.test-d.ts +61 -0
- package/src/types.tsx +26 -4
- package/types/createComponent.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.native.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/types.d.ts +10 -4
- package/types/types.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylePropsTextOnly","validStyles","createComponent","ellipsisStyle","maxWidth","overflow","textOverflow","whiteSpace","Text","componentName","acceptsClassName","isText","defaultProps","inlineWhenUnflattened","Set","inlineProps","variants","numberOfLines","WebkitLineClamp","WebkitBoxOrient","display","ellipsis","true"],"sources":["
|
|
1
|
+
{"version":3,"names":["stylePropsTextOnly","validStyles","createComponent","ellipsisStyle","maxWidth","overflow","textOverflow","whiteSpace","Text","componentName","acceptsClassName","isText","defaultProps","inlineWhenUnflattened","Set","inlineProps","variants","numberOfLines","WebkitLineClamp","WebkitBoxOrient","display","ellipsis","true"],"sources":["Text.mjs"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\n\nconst ellipsisStyle = {\n\tmaxWidth: \"100%\",\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\twhiteSpace: \"nowrap\"\n};\nconst Text = createComponent({\n\tcomponentName: \"Text\",\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: void 0,\n\tinlineWhenUnflattened: /* @__PURE__ */ new Set([\"fontFamily\"]),\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: {\n\t\tnumberOfLines: {\n\t\t\t1: ellipsisStyle,\n\t\t\t\":number\": (numberOfLines) => numberOfLines >= 1 ? {\n\t\t\t\tmaxWidth: \"100%\",\n\t\t\t\tWebkitLineClamp: numberOfLines,\n\t\t\t\tWebkitBoxOrient: \"vertical\",\n\t\t\t\tdisplay: \"-webkit-box\",\n\t\t\t\toverflow: \"hidden\"\n\t\t\t} : null\n\t\t},\n\t\tellipsis: { true: ellipsisStyle }\n\t},\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n});\n\nexport { Text };"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,kBAAkB;AAClE,SAASC,eAAe,QAAQ,wBAAoB;AAEpD,MAAMC,aAAa,GAAG;EACrBC,QAAQ,EAAE,MAAM;EAChBC,QAAQ,EAAE,QAAQ;EAClBC,YAAY,EAAE,UAAU;EACxBC,UAAU,EAAE;AACb,CAAC;AACD,MAAMC,IAAI,GAAGN,eAAe,CAAC;EAC5BO,aAAa,EAAE,MAAM;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,MAAM,EAAE,IAAI;EACZC,YAAY,EAAE,KAAK,CAAC;EACpBC,qBAAqB,EAAE,eAAgB,IAAIC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;EAC9DC,WAAW,EAAE,eAAgB,IAAID,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC;EAC/DE,QAAQ,EAAE;IACTC,aAAa,EAAE;MACd,CAAC,EAAEd,aAAa;MAChB,SAAS,EAAGc,aAAa,IAAKA,aAAa,IAAI,CAAC,GAAG;QAClDb,QAAQ,EAAE,MAAM;QAChBc,eAAe,EAAED,aAAa;QAC9BE,eAAe,EAAE,UAAU;QAC3BC,OAAO,EAAE,aAAa;QACtBf,QAAQ,EAAE;MACX,CAAC,GAAG;IACL,CAAC;IACDgB,QAAQ,EAAE;MAAEC,IAAI,EAAEnB;IAAc;EACjC,CAAC;EACDF,WAAW,EAAE;IACZ,GAAGA,WAAW;IACd,GAAGD;EACJ;AACD,CAAC,CAAC;AAEF,SAASQ,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylePropsTextOnly","validStyles","createComponent","Text","componentName","acceptsClassName","isText","defaultProps","suppressHighlighting","inlineWhenUnflattened","Set","inlineProps","variants","ellipsis","true","numberOfLines","lineBreakMode"],"sources":["
|
|
1
|
+
{"version":3,"names":["stylePropsTextOnly","validStyles","createComponent","Text","componentName","acceptsClassName","isText","defaultProps","suppressHighlighting","inlineWhenUnflattened","Set","inlineProps","variants","ellipsis","true","numberOfLines","lineBreakMode"],"sources":["Text.native.js"],"sourcesContent":["import { stylePropsTextOnly, validStyles } from \"@tamagui/helpers\";\nimport { createComponent } from \"../createComponent\";\n\nvar Text = createComponent({\n\tcomponentName: \"Text\",\n\tacceptsClassName: true,\n\tisText: true,\n\tdefaultProps: { suppressHighlighting: true },\n\tinlineWhenUnflattened: /* @__PURE__ */ new Set([\"fontFamily\"]),\n\tinlineProps: /* @__PURE__ */ new Set([\"maxFontSizeMultiplier\"]),\n\tvariants: { ellipsis: { true: {\n\t\tnumberOfLines: 1,\n\t\tlineBreakMode: \"clip\"\n\t} } },\n\tvalidStyles: {\n\t\t...validStyles,\n\t\t...stylePropsTextOnly\n\t}\n});\n\nexport { Text };"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,kBAAkB;AAClE,SAASC,eAAe,QAAQ,8BAAoB;AAEpD,IAAIC,IAAI,GAAGD,eAAe,CAAC;EAC1BE,aAAa,EAAE,MAAM;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,MAAM,EAAE,IAAI;EACZC,YAAY,EAAE;IAAEC,oBAAoB,EAAE;EAAK,CAAC;EAC5CC,qBAAqB,EAAE,eAAgB,IAAIC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;EAC9DC,WAAW,EAAE,eAAgB,IAAID,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC;EAC/DE,QAAQ,EAAE;IAAEC,QAAQ,EAAE;MAAEC,IAAI,EAAE;QAC7BC,aAAa,EAAE,CAAC;QAChBC,aAAa,EAAE;MAChB;IAAE;EAAE,CAAC;EACLf,WAAW,EAAE;IACZ,GAAGA,WAAW;IACd,GAAGD;EACJ;AACD,CAAC,CAAC;AAEF,SAASG,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useIsomorphicLayoutEffect","useId","getSetting","THEME_CLASSNAME_PREFIX","Theme","jsx","ThemeProvider","props","addThemeClassName","cn","defaultTheme","target","document","documentElement","body","classList","add","remove","forceClassName","className","name","_isRoot","children"],"sources":["
|
|
1
|
+
{"version":3,"names":["useIsomorphicLayoutEffect","useId","getSetting","THEME_CLASSNAME_PREFIX","Theme","jsx","ThemeProvider","props","addThemeClassName","cn","defaultTheme","target","document","documentElement","body","classList","add","remove","forceClassName","className","name","_isRoot","children"],"sources":["ThemeProvider.mjs"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { useId } from \"react\";\nimport { getSetting } from \"../config\";\nimport { THEME_CLASSNAME_PREFIX } from \"../constants/constants\";\nimport { Theme } from \"./Theme\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst ThemeProvider = (props) => {\n\t\"use no memo\";\n\tconst addThemeClassName = getSetting(\"addThemeClassName\");\n\tuseIsomorphicLayoutEffect(() => {\n\t\tif (addThemeClassName === false) return;\n\t\tconst cn = `${THEME_CLASSNAME_PREFIX}${props.defaultTheme}`;\n\t\tconst target = getSetting(\"addThemeClassName\") === \"html\" ? document.documentElement : document.body;\n\t\ttarget.classList.add(cn);\n\t\treturn () => {\n\t\t\ttarget.classList.remove(cn);\n\t\t};\n\t}, [props.defaultTheme, addThemeClassName]);\n\tconst forceClassName = addThemeClassName === void 0;\n\treturn /* @__PURE__ */ jsx(Theme, {\n\t\tclassName: props.className,\n\t\tname: props.defaultTheme,\n\t\tforceClassName,\n\t\t_isRoot: useId,\n\t\tchildren: props.children\n\t});\n};\n\nexport { ThemeProvider };"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,UAAU,QAAQ,eAAW;AACtC,SAASC,sBAAsB,QAAQ,4BAAwB;AAC/D,SAASC,KAAK,QAAQ,aAAS;AAC/B,SAASC,GAAG,QAAQ,mBAAmB;AAEvC,MAAMC,aAAa,GAAIC,KAAK,IAAK;EAChC,aAAa;;EACb,MAAMC,iBAAiB,GAAGN,UAAU,CAAC,mBAAmB,CAAC;EACzDF,yBAAyB,CAAC,MAAM;IAC/B,IAAIQ,iBAAiB,KAAK,KAAK,EAAE;IACjC,MAAMC,EAAE,GAAG,GAAGN,sBAAsB,GAAGI,KAAK,CAACG,YAAY,EAAE;IAC3D,MAAMC,MAAM,GAAGT,UAAU,CAAC,mBAAmB,CAAC,KAAK,MAAM,GAAGU,QAAQ,CAACC,eAAe,GAAGD,QAAQ,CAACE,IAAI;IACpGH,MAAM,CAACI,SAAS,CAACC,GAAG,CAACP,EAAE,CAAC;IACxB,OAAO,MAAM;MACZE,MAAM,CAACI,SAAS,CAACE,MAAM,CAACR,EAAE,CAAC;IAC5B,CAAC;EACF,CAAC,EAAE,CAACF,KAAK,CAACG,YAAY,EAAEF,iBAAiB,CAAC,CAAC;EAC3C,MAAMU,cAAc,GAAGV,iBAAiB,KAAK,KAAK,CAAC;EACnD,OAAO,eAAgBH,GAAG,CAACD,KAAK,EAAE;IACjCe,SAAS,EAAEZ,KAAK,CAACY,SAAS;IAC1BC,IAAI,EAAEb,KAAK,CAACG,YAAY;IACxBQ,cAAc;IACdG,OAAO,EAAEpB,KAAK;IACdqB,QAAQ,EAAEf,KAAK,CAACe;EACjB,CAAC,CAAC;AACH,CAAC;AAED,SAAShB,aAAa","ignoreList":[]}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useId } from "react";
|
|
4
3
|
import { getSetting } from "../config.native.js";
|
|
5
|
-
import { THEME_CLASSNAME_PREFIX } from "../constants/constants.native.js";
|
|
6
4
|
import { Theme } from "./Theme.native.js";
|
|
7
5
|
var ThemeProvider = function (props) {
|
|
8
6
|
"use no memo";
|
|
9
7
|
|
|
10
8
|
var forceClassName = getSetting("addThemeClassName") === void 0;
|
|
11
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */jsx(Theme, {
|
|
12
10
|
className: props.className,
|
|
13
11
|
name: props.defaultTheme,
|
|
14
12
|
forceClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","
|
|
1
|
+
{"version":3,"names":["jsx","useId","getSetting","Theme","ThemeProvider","props","forceClassName","className","name","defaultTheme","_isRoot","children"],"sources":["ThemeProvider.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useId } from \"react\";\nimport { getSetting } from \"../config\";\nimport { Theme } from \"./Theme\";\n\nvar ThemeProvider = function(props) {\n\t\"use no memo\";\n\tvar forceClassName = getSetting(\"addThemeClassName\") === void 0;\n\treturn /* @__PURE__ */ jsx(Theme, {\n\t\tclassName: props.className,\n\t\tname: props.defaultTheme,\n\t\tforceClassName,\n\t\t_isRoot: useId,\n\t\tchildren: props.children\n\t});\n};\n\nexport { ThemeProvider };"],"mappings":"AAAA,SAASA,GAAG,QAAQ,mBAAmB;AACvC,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,UAAU,QAAQ,qBAAW;AACtC,SAASC,KAAK,QAAQ,mBAAS;AAE/B,IAAIC,aAAa,GAAG,SAAAA,CAASC,KAAK,EAAE;EACnC,aAAa;;EACb,IAAIC,cAAc,GAAGJ,UAAU,CAAC,mBAAmB,CAAC,KAAK,KAAK,CAAC;EAC/D,OAAO,eAAgBF,GAAG,CAACG,KAAK,EAAE;IACjCI,SAAS,EAAEF,KAAK,CAACE,SAAS;IAC1BC,IAAI,EAAEH,KAAK,CAACI,YAAY;IACxBH,cAAc;IACdI,OAAO,EAAET,KAAK;IACdU,QAAQ,EAAEN,KAAK,CAACM;EACjB,CAAC,CAAC;AACH,CAAC;AAED,SAASP,aAAa","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-1781071309197",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nate Wienert"
|
|
@@ -51,20 +51,20 @@
|
|
|
51
51
|
"test:web": "vitest --typecheck --run"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@tamagui/compose-refs": "2.
|
|
55
|
-
"@tamagui/constants": "2.
|
|
56
|
-
"@tamagui/helpers": "2.
|
|
57
|
-
"@tamagui/is-equal-shallow": "2.
|
|
58
|
-
"@tamagui/native": "2.
|
|
59
|
-
"@tamagui/normalize-css-color": "2.
|
|
60
|
-
"@tamagui/timer": "2.
|
|
61
|
-
"@tamagui/types": "2.
|
|
62
|
-
"@tamagui/use-did-finish-ssr": "2.
|
|
63
|
-
"@tamagui/use-event": "2.
|
|
64
|
-
"@tamagui/use-force-update": "2.
|
|
54
|
+
"@tamagui/compose-refs": "2.2.0-1781071309197",
|
|
55
|
+
"@tamagui/constants": "2.2.0-1781071309197",
|
|
56
|
+
"@tamagui/helpers": "2.2.0-1781071309197",
|
|
57
|
+
"@tamagui/is-equal-shallow": "2.2.0-1781071309197",
|
|
58
|
+
"@tamagui/native": "2.2.0-1781071309197",
|
|
59
|
+
"@tamagui/normalize-css-color": "2.2.0-1781071309197",
|
|
60
|
+
"@tamagui/timer": "2.2.0-1781071309197",
|
|
61
|
+
"@tamagui/types": "2.2.0-1781071309197",
|
|
62
|
+
"@tamagui/use-did-finish-ssr": "2.2.0-1781071309197",
|
|
63
|
+
"@tamagui/use-event": "2.2.0-1781071309197",
|
|
64
|
+
"@tamagui/use-force-update": "2.2.0-1781071309197"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@tamagui/build": "2.
|
|
67
|
+
"@tamagui/build": "2.2.0-1781071309197",
|
|
68
68
|
"@testing-library/react": "^16.1.0",
|
|
69
69
|
"csstype": "^3.0.10",
|
|
70
70
|
"react": ">=19",
|
package/src/createComponent.tsx
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { composeRefs } from '@tamagui/compose-refs'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
isClient,
|
|
4
|
+
isNativeDesktop,
|
|
5
|
+
isServer,
|
|
6
|
+
isWeb,
|
|
7
|
+
useIsomorphicLayoutEffect,
|
|
8
|
+
} from '@tamagui/constants'
|
|
3
9
|
import { NativeMenuContext } from '@tamagui/native'
|
|
4
10
|
import { composeEventHandlers } from '@tamagui/helpers'
|
|
5
11
|
import { isEqualShallow } from '@tamagui/is-equal-shallow'
|
|
@@ -790,7 +796,23 @@ export function createComponent<
|
|
|
790
796
|
// update prev state for next comparison (includes group states)
|
|
791
797
|
stateRef.current.prevPseudoState = extractPseudoState(updatedState)
|
|
792
798
|
|
|
793
|
-
|
|
799
|
+
// a self pseudo being active means the emitted style is a transient hover/press/focus
|
|
800
|
+
// override (it's not in React state under avoidReRenders), so the worklet must keep it
|
|
801
|
+
// latched across incidental re-renders; when none is active this is the base and renders
|
|
802
|
+
// own it again.
|
|
803
|
+
const hasActivePseudo = Boolean(
|
|
804
|
+
updatedState.hover ||
|
|
805
|
+
updatedState.press ||
|
|
806
|
+
updatedState.pressIn ||
|
|
807
|
+
updatedState.focus ||
|
|
808
|
+
updatedState.focusWithin
|
|
809
|
+
)
|
|
810
|
+
|
|
811
|
+
useStyleListener(
|
|
812
|
+
(nextStyles?.style || {}) as any,
|
|
813
|
+
effectiveTransition,
|
|
814
|
+
hasActivePseudo
|
|
815
|
+
)
|
|
794
816
|
}
|
|
795
817
|
|
|
796
818
|
function updateGroupListeners() {
|
|
@@ -1250,7 +1272,7 @@ export function createComponent<
|
|
|
1250
1272
|
const runtimeHoverStyle = !disabled && noClass && pseudos?.hoverStyle
|
|
1251
1273
|
const needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle)
|
|
1252
1274
|
const attachHover =
|
|
1253
|
-
isWeb &&
|
|
1275
|
+
(isWeb || isNativeDesktop) &&
|
|
1254
1276
|
!!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave)
|
|
1255
1277
|
|
|
1256
1278
|
// check presence rather than value to prevent reparenting bugs
|
|
@@ -31,6 +31,14 @@ const getIsAndroid = () => {
|
|
|
31
31
|
return isAndroidCache
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
let isNativeDesktopCache: boolean | undefined
|
|
35
|
+
const getIsNativeDesktop = () => {
|
|
36
|
+
if (isNativeDesktopCache === undefined) {
|
|
37
|
+
isNativeDesktopCache = Platform?.OS === 'macos' || Platform?.OS === 'windows'
|
|
38
|
+
}
|
|
39
|
+
return isNativeDesktopCache
|
|
40
|
+
}
|
|
41
|
+
|
|
34
42
|
const responderClaim = () => true
|
|
35
43
|
const responderWrapperStyle = { display: 'contents' } as const
|
|
36
44
|
|
|
@@ -57,6 +65,14 @@ export function useEvents(
|
|
|
57
65
|
if (events.onBlur) {
|
|
58
66
|
viewProps['onBlur'] = events.onBlur
|
|
59
67
|
}
|
|
68
|
+
if (getIsNativeDesktop()) {
|
|
69
|
+
if (events.onMouseEnter) {
|
|
70
|
+
viewProps['onMouseEnter'] = events.onMouseEnter
|
|
71
|
+
}
|
|
72
|
+
if (events.onMouseLeave) {
|
|
73
|
+
viewProps['onMouseLeave'] = events.onMouseLeave
|
|
74
|
+
}
|
|
75
|
+
}
|
|
60
76
|
}
|
|
61
77
|
|
|
62
78
|
// hasPressEvents includes events.onPress synthesized just for pressStyle
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAndroid,
|
|
3
3
|
isClient,
|
|
4
|
-
isIos,
|
|
5
4
|
isWeb,
|
|
5
|
+
supportsDynamicColorIOS,
|
|
6
6
|
useIsomorphicLayoutEffect,
|
|
7
7
|
} from '@tamagui/constants'
|
|
8
8
|
import {
|
|
@@ -875,7 +875,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
875
875
|
if (isThemeMedia) {
|
|
876
876
|
if (
|
|
877
877
|
process.env.TAMAGUI_TARGET === 'native' &&
|
|
878
|
-
|
|
878
|
+
supportsDynamicColorIOS &&
|
|
879
879
|
getSetting('fastSchemeChange')
|
|
880
880
|
) {
|
|
881
881
|
// iOS will use https://reactnative.dev/docs/dynamiccolorios
|
|
@@ -2,7 +2,10 @@ import type { GetStyleState, SplitStyleProps } from '../types'
|
|
|
2
2
|
import { getTokenForKey } from './getTokenForKey'
|
|
3
3
|
import { parseNativeStyle } from './parseNativeStyle'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// includes the optional `/NN` opacity-modifier suffix ($color9/50) so
|
|
6
|
+
// getTokenForKey receives it and can apply the alpha — without it the token
|
|
7
|
+
// resolves but the bare `/50` is left behind in the parsed gradient string
|
|
8
|
+
const tokenPattern = /(\$[\w.-]+(?:\/[\d.]+)?)/g
|
|
6
9
|
|
|
7
10
|
// keys that need native object parsing (DynamicColorIOS support)
|
|
8
11
|
const nativeParseKeys: Record<string, boolean> = {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { GetStyleState, SplitStyleProps } from '../types'
|
|
2
2
|
import { getTokenForKey } from './getTokenForKey'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// includes the optional `/NN` opacity-modifier suffix ($color9/50) so
|
|
5
|
+
// getTokenForKey receives it and can apply the alpha — without it the token
|
|
6
|
+
// resolves but the bare `/50` is left behind in the CSS string, which makes
|
|
7
|
+
// the whole declaration invalid
|
|
8
|
+
const tokenPattern = /(\$[\w.-]+(?:\/[\d.]+)?)/g
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* web: resolves embedded $tokens in compound CSS strings via simple regex replacement.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { supportsDynamicColorIOS } from '@tamagui/constants'
|
|
2
2
|
import type { MutableRefObject } from 'react'
|
|
3
3
|
import { getConfig, getSetting } from '../config'
|
|
4
4
|
import { getVariable } from '../createVariable'
|
|
@@ -133,7 +133,7 @@ export function getThemeProxied(
|
|
|
133
133
|
const shouldOptimize =
|
|
134
134
|
scheme &&
|
|
135
135
|
platform !== 'web' &&
|
|
136
|
-
|
|
136
|
+
supportsDynamicColorIOS &&
|
|
137
137
|
!curProps.deopt &&
|
|
138
138
|
!curState.isInverse &&
|
|
139
139
|
fastSchemeChange &&
|
|
@@ -142,7 +142,7 @@ export function getThemeProxied(
|
|
|
142
142
|
if (process.env.NODE_ENV === 'development' && curProps.debug === 'verbose') {
|
|
143
143
|
console.info(
|
|
144
144
|
` 🎨 useTheme().get(${key}) theme=${name} scheme=${scheme}`,
|
|
145
|
-
`\n shouldOptimize=${shouldOptimize} (
|
|
145
|
+
`\n shouldOptimize=${shouldOptimize} (dynamicColorIOS=${supportsDynamicColorIOS} deopt=${curProps.deopt} isInverse=${curState.isInverse} fastScheme=${fastSchemeChange} rootMatch=${rootMatchesSystem})`
|
|
146
146
|
)
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -177,7 +177,7 @@ export function getThemeProxied(
|
|
|
177
177
|
if (process.env.NODE_ENV === 'development' && curProps.debug) {
|
|
178
178
|
console.info(
|
|
179
179
|
` 🎨 useTheme().get(${key}) tracking key (not optimizing)`,
|
|
180
|
-
`\n platform=${platform}
|
|
180
|
+
`\n platform=${platform} dynamicColorIOS=${supportsDynamicColorIOS} deopt=${curProps.deopt} fastScheme=${fastSchemeChange}`
|
|
181
181
|
)
|
|
182
182
|
}
|
|
183
183
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
|
+
import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
3
2
|
import {
|
|
4
3
|
createContext,
|
|
5
4
|
useCallback,
|
|
@@ -127,7 +126,7 @@ Looked for theme${props.name ? ` "${props.name}"` : ''}${props.componentName ? `
|
|
|
127
126
|
// check if this is a scheme-only change (light↔dark) where DynamicColorIOS handles it
|
|
128
127
|
const isSchemeOnlyChange =
|
|
129
128
|
process.env.TAMAGUI_TARGET === 'native' &&
|
|
130
|
-
|
|
129
|
+
supportsDynamicColorIOS &&
|
|
131
130
|
getSetting('fastSchemeChange') &&
|
|
132
131
|
local &&
|
|
133
132
|
parentState &&
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type tests for the opacity modifier syntax (e.g., $color/50)
|
|
3
|
+
*
|
|
4
|
+
* The runtime already supports this syntax in getTokenForKey, but the types
|
|
5
|
+
* were not accepting it. These tests verify that color tokens with opacity
|
|
6
|
+
* modifiers are now type-safe.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { expectTypeOf, describe, test } from 'vitest'
|
|
10
|
+
import type { ColorTokens, FontColorTokens } from './types'
|
|
11
|
+
|
|
12
|
+
describe('opacity modifier types', () => {
|
|
13
|
+
test('ColorTokens accepts opacity modifier syntax', () => {
|
|
14
|
+
// Should accept token with opacity modifier
|
|
15
|
+
const colorWithOpacity: ColorTokens = '$color/50'
|
|
16
|
+
const colorWithFullOpacity: ColorTokens = '$color/100'
|
|
17
|
+
const colorWithLowOpacity: ColorTokens = '$color/10'
|
|
18
|
+
|
|
19
|
+
// Should still accept regular tokens
|
|
20
|
+
const regularToken: ColorTokens = '$color'
|
|
21
|
+
const colorName: ColorTokens = 'red'
|
|
22
|
+
|
|
23
|
+
// These should all be valid
|
|
24
|
+
expectTypeOf(colorWithOpacity).toMatchTypeOf<ColorTokens>()
|
|
25
|
+
expectTypeOf(colorWithFullOpacity).toMatchTypeOf<ColorTokens>()
|
|
26
|
+
expectTypeOf(colorWithLowOpacity).toMatchTypeOf<ColorTokens>()
|
|
27
|
+
expectTypeOf(regularToken).toMatchTypeOf<ColorTokens>()
|
|
28
|
+
expectTypeOf(colorName).toMatchTypeOf<ColorTokens>()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
test('FontColorTokens accepts opacity modifier syntax', () => {
|
|
32
|
+
// Should accept font color token with opacity modifier
|
|
33
|
+
const fontColorWithOpacity: FontColorTokens = '$fontColor/50'
|
|
34
|
+
const fontColorWithFullOpacity: FontColorTokens = '$fontColor/100'
|
|
35
|
+
|
|
36
|
+
// Should still accept regular tokens and numbers
|
|
37
|
+
const regularFontToken: FontColorTokens = '$fontColor'
|
|
38
|
+
const fontColorNumber: FontColorTokens = 42
|
|
39
|
+
|
|
40
|
+
// These should all be valid
|
|
41
|
+
expectTypeOf(fontColorWithOpacity).toMatchTypeOf<FontColorTokens>()
|
|
42
|
+
expectTypeOf(fontColorWithFullOpacity).toMatchTypeOf<FontColorTokens>()
|
|
43
|
+
expectTypeOf(regularFontToken).toMatchTypeOf<FontColorTokens>()
|
|
44
|
+
expectTypeOf(fontColorNumber).toMatchTypeOf<FontColorTokens>()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('opacity modifier rejects invalid formats', () => {
|
|
48
|
+
// These should NOT be valid (but TypeScript will still accept them as strings)
|
|
49
|
+
// The runtime parsing handles validation
|
|
50
|
+
|
|
51
|
+
// Valid opacity numbers (0-100)
|
|
52
|
+
const validOpacity: ColorTokens = '$color/75'
|
|
53
|
+
expectTypeOf(validOpacity).toMatchTypeOf<ColorTokens>()
|
|
54
|
+
|
|
55
|
+
// Note: TypeScript template literal types are permissive with numbers
|
|
56
|
+
// The runtime validation in getTokenForKey handles edge cases like:
|
|
57
|
+
// - Negative numbers
|
|
58
|
+
// - Numbers > 100
|
|
59
|
+
// - Non-numeric strings after /
|
|
60
|
+
})
|
|
61
|
+
})
|
package/src/types.tsx
CHANGED
|
@@ -1699,11 +1699,17 @@ export type SpaceTokens =
|
|
|
1699
1699
|
| GetTokenString<keyof Tokens['space']>
|
|
1700
1700
|
| ThemeValueFallbackSpace
|
|
1701
1701
|
|
|
1702
|
-
|
|
1702
|
+
// base color token strings (before opacity modifier)
|
|
1703
|
+
type ColorTokenBase =
|
|
1703
1704
|
| SpecificTokensSpecial
|
|
1704
1705
|
| GetTokenString<keyof Tokens['color']>
|
|
1705
1706
|
| GetTokenString<keyof ThemeParsed>
|
|
1707
|
+
|
|
1708
|
+
export type ColorTokens =
|
|
1709
|
+
| ColorTokenBase
|
|
1706
1710
|
| CSSColorNames
|
|
1711
|
+
// opacity modifier: $token/50 → parsed at runtime in getTokenForKey
|
|
1712
|
+
| `${ColorTokenBase & string}/${number}`
|
|
1707
1713
|
|
|
1708
1714
|
export type ZIndexTokens =
|
|
1709
1715
|
| SpecificTokensSpecial
|
|
@@ -1769,7 +1775,12 @@ export type FontWeightValues =
|
|
|
1769
1775
|
| 'bold'
|
|
1770
1776
|
| 'normal'
|
|
1771
1777
|
export type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightValues
|
|
1772
|
-
|
|
1778
|
+
// font color tokens also support the opacity modifier
|
|
1779
|
+
type FontColorTokenBase = `$${GetTokenFontKeysFor<'color'>}`
|
|
1780
|
+
export type FontColorTokens =
|
|
1781
|
+
| FontColorTokenBase
|
|
1782
|
+
| number
|
|
1783
|
+
| `${FontColorTokenBase}/${number}`
|
|
1773
1784
|
export type FontLetterSpacingTokens =
|
|
1774
1785
|
| `$${GetTokenFontKeysFor<'letterSpacing'>}`
|
|
1775
1786
|
| number
|
|
@@ -2693,7 +2704,14 @@ export type GetNonStyledProps<A extends StylableComponent> = A extends {
|
|
|
2693
2704
|
export type GetBaseStyles<A, B> = A extends {
|
|
2694
2705
|
__tama: [any, any, any, infer C, any, any]
|
|
2695
2706
|
}
|
|
2696
|
-
?
|
|
2707
|
+
? // when extending an existing tamagui component (e.g. styled(View, ...)), it
|
|
2708
|
+
// contributes its base styles. but isText/isInput in the config still means
|
|
2709
|
+
// "this accepts text styles" (it drives runtime validStyles too), so merge
|
|
2710
|
+
// text style props in, otherwise text-only props and their shorthands (e.g.
|
|
2711
|
+
// the `text` shorthand for `textAlign`) get dropped from the type.
|
|
2712
|
+
B extends { isText: true } | { isInput: true }
|
|
2713
|
+
? C & TextStylePropsBase
|
|
2714
|
+
: C
|
|
2697
2715
|
: B extends { isText: true }
|
|
2698
2716
|
? TextStylePropsBase
|
|
2699
2717
|
: B extends { isInput: true }
|
|
@@ -3246,7 +3264,11 @@ export type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>
|
|
|
3246
3264
|
|
|
3247
3265
|
type UseStyleListener = (
|
|
3248
3266
|
nextStyle: Record<string, unknown>,
|
|
3249
|
-
effectiveTransition?: TransitionProp | null
|
|
3267
|
+
effectiveTransition?: TransitionProp | null,
|
|
3268
|
+
// true while a self pseudo (hover/press/focus) is active. lets avoidReRenders drivers know
|
|
3269
|
+
// the emitted style is a transient pseudo override that a real re-render must not be allowed
|
|
3270
|
+
// to reconcile away, vs the no-pseudo base which renders own again.
|
|
3271
|
+
pseudoActive?: boolean
|
|
3250
3272
|
) => void
|
|
3251
3273
|
export type UseStyleEmitter = (cb: UseStyleListener) => void
|
|
3252
3274
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA6B/D,OAAO,KAAK,EAQV,YAAY,EAEZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EAOf,MAAM,SAAS,CAAA;AAahB,KAAK,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA;AAEpF,eAAO,MAAM,kBAAkB,wBAA+B,CAAA;AA8J9D,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACnD,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,SAAS,GAAG,KAAK,EACjB,UAAU,SAAS,MAAM,GAAG,KAAK,EACjC,YAAY,EAAE,YAAY,wEAkjD3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventHandling.native.d.ts","sourceRoot":"","sources":["../src/eventHandling.native.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"eventHandling.native.d.ts","sourceRoot":"","sources":["../src/eventHandling.native.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAoCrE,wBAAgB,YAAY,OAE3B;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,GAAG,EACX,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE;IAAE,OAAO,EAAE,wBAAwB,CAAA;CAAE,EAC/C,YAAY,EAAE,YAAY,EAC1B,KAAK,CAAC,EAAE,OAAO,EACf,kBAAkB,CAAC,EAAE,OAAO,EAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,kBAAkB,CAAC,EAAE,OAAO,OA6L7B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE;IAAE,OAAO,EAAE,wBAAwB,CAAA;CAAE,EAC/C,KAAK,CAAC,EAAE,OAAO,EACf,oBAAoB,CAAC,EAAE,OAAO,OA4E/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformResolveValue.d.ts","sourceRoot":"","sources":["../../src/helpers/platformResolveValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"platformResolveValue.d.ts","sourceRoot":"","sources":["../../src/helpers/platformResolveValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS9D;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,MAAM,CAQR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformResolveValue.native.d.ts","sourceRoot":"","sources":["../../src/helpers/platformResolveValue.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"platformResolveValue.native.d.ts","sourceRoot":"","sources":["../../src/helpers/platformResolveValue.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA8B9D;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,GAAG,CAmCL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useThemeState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useThemeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useThemeState.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAEV,UAAU,EACV,UAAU,EACV,sBAAsB,EACvB,MAAM,UAAU,CAAA;AAEjB,KAAK,EAAE,GAAG,MAAM,CAAA;AAEhB,eAAO,MAAM,iBAAiB,iCAAwB,CAAA;AAatD,eAAO,MAAM,iBAAiB,YAK7B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,IAAI,EAAE,2BAAmB,CAAA;AAWvD,eAAO,MAAM,iBAAiB,yBAAuB,CAAA;AAKrD,eAAO,MAAM,aAAa,GACxB,OAAO,sBAAsB,EAC7B,2BAAc,EACd,MAAM,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAC1C,aAAa,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,KAChD,UAyKF,CAAA;AAsUD,eAAO,MAAM,qBAAqB,GAAI,OAAO,UAAU,YACW,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -983,7 +983,8 @@ export type SpecificTokensSpecial = TamaguiSettings extends {
|
|
|
983
983
|
} ? Val extends 'except-special' | undefined ? never : SpecificTokens : SpecificTokens;
|
|
984
984
|
export type SizeTokens = SpecificTokensSpecial | ThemeValueFallbackSize | GetTokenString<keyof Tokens['size']>;
|
|
985
985
|
export type SpaceTokens = SpecificTokensSpecial | GetTokenString<keyof Tokens['space']> | ThemeValueFallbackSpace;
|
|
986
|
-
|
|
986
|
+
type ColorTokenBase = SpecificTokensSpecial | GetTokenString<keyof Tokens['color']> | GetTokenString<keyof ThemeParsed>;
|
|
987
|
+
export type ColorTokens = ColorTokenBase | CSSColorNames | `${ColorTokenBase & string}/${number}`;
|
|
987
988
|
export type ZIndexTokens = SpecificTokensSpecial | GetTokenString<keyof Tokens['zIndex']> | ThemeValueFallbackZIndex | number;
|
|
988
989
|
export type RadiusTokens = SpecificTokensSpecial | GetTokenString<keyof Tokens['radius']> | ThemeValueFallbackRadius | number | RemString;
|
|
989
990
|
export type NonSpecificTokens = GetTokenString<keyof Tokens['radius']> | GetTokenString<keyof Tokens['zIndex']> | GetTokenString<keyof Tokens['color']> | GetTokenString<keyof Tokens['space']> | GetTokenString<keyof Tokens['size']>;
|
|
@@ -1001,7 +1002,8 @@ export type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | numbe
|
|
|
1001
1002
|
export type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number | RemString;
|
|
1002
1003
|
export type FontWeightValues = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | 'bold' | 'normal';
|
|
1003
1004
|
export type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightValues;
|
|
1004
|
-
|
|
1005
|
+
type FontColorTokenBase = `$${GetTokenFontKeysFor<'color'>}`;
|
|
1006
|
+
export type FontColorTokens = FontColorTokenBase | number | `${FontColorTokenBase}/${number}`;
|
|
1005
1007
|
export type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number | RemString;
|
|
1006
1008
|
export type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | RNTextStyle['fontStyle'];
|
|
1007
1009
|
export type FontTransformTokens = `$${GetTokenFontKeysFor<'transform'>}` | RNTextStyle['textTransform'];
|
|
@@ -1539,7 +1541,11 @@ export type GetNonStyledProps<A extends StylableComponent> = A extends {
|
|
|
1539
1541
|
} ? B : TamaguiComponentPropsBaseBase & GetProps<A>;
|
|
1540
1542
|
export type GetBaseStyles<A, B> = A extends {
|
|
1541
1543
|
__tama: [any, any, any, infer C, any, any];
|
|
1542
|
-
} ?
|
|
1544
|
+
} ? B extends {
|
|
1545
|
+
isText: true;
|
|
1546
|
+
} | {
|
|
1547
|
+
isInput: true;
|
|
1548
|
+
} ? C & TextStylePropsBase : C : B extends {
|
|
1543
1549
|
isText: true;
|
|
1544
1550
|
} ? TextStylePropsBase : B extends {
|
|
1545
1551
|
isInput: true;
|
|
@@ -1846,7 +1852,7 @@ export type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
|
1846
1852
|
Text?: any;
|
|
1847
1853
|
};
|
|
1848
1854
|
export type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
|
|
1849
|
-
type UseStyleListener = (nextStyle: Record<string, unknown>, effectiveTransition?: TransitionProp | null) => void;
|
|
1855
|
+
type UseStyleListener = (nextStyle: Record<string, unknown>, effectiveTransition?: TransitionProp | null, pseudoActive?: boolean) => void;
|
|
1850
1856
|
export type UseStyleEmitter = (cb: UseStyleListener) => void;
|
|
1851
1857
|
export type UseAnimationHook = (props: {
|
|
1852
1858
|
style: Record<string, any>;
|