@tamagui/core 1.0.0-beta.4 → 1.0.0-beta.7
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/README.md +1 -0
- package/dist/cjs/createComponent.js +13 -5
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/addStylesUsingClassname.js +17 -12
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +33 -3
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.native.js +16 -12
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/cjs/helpers/getButtonSize.js +48 -0
- package/dist/cjs/helpers/getButtonSize.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +0 -40
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getTextSize.js +56 -0
- package/dist/cjs/helpers/getTextSize.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +1 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/hooks/useId.js +59 -0
- package/dist/cjs/hooks/useId.js.map +7 -0
- package/dist/cjs/index.js +9 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +115 -0
- package/dist/cjs/views/Slot.js.map +7 -0
- package/dist/esm/createComponent.js +12 -5
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/addStylesUsingClassname.js +18 -13
- package/dist/esm/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +34 -3
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.native.js +16 -12
- package/dist/esm/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/esm/helpers/getButtonSize.js +27 -0
- package/dist/esm/helpers/getButtonSize.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +0 -41
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getTextSize.js +34 -0
- package/dist/esm/helpers/getTextSize.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +1 -0
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/hooks/useId.js +35 -0
- package/dist/esm/hooks/useId.js.map +7 -0
- package/dist/esm/index.js +9 -6
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/views/Slot.js +63 -0
- package/dist/esm/views/Slot.js.map +7 -0
- package/dist/jsx/createComponent.js +12 -5
- package/dist/jsx/helpers/addStylesUsingClassname.js +18 -13
- package/dist/jsx/helpers/createPropMapper.js +34 -3
- package/dist/jsx/helpers/fixNativeShadow.native.js +16 -12
- package/dist/jsx/helpers/getButtonSize.js +26 -0
- package/dist/jsx/helpers/getSplitStyles.js +0 -41
- package/dist/jsx/helpers/getTextSize.js +33 -0
- package/dist/jsx/helpers/insertStyleRule.js +1 -0
- package/dist/jsx/hooks/useId.js +34 -0
- package/dist/jsx/index.js +9 -6
- package/dist/jsx/views/Slot.js +56 -0
- package/package.json +5 -5
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/addStylesUsingClassname.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/fixNativeShadow.native.d.ts +1 -1
- package/types/helpers/fixNativeShadow.native.d.ts.map +1 -1
- package/types/helpers/getButtonSize.d.ts +8 -0
- package/types/helpers/getButtonSize.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getTextSize.d.ts +3 -0
- package/types/helpers/getTextSize.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/hooks/useId.d.ts +9 -0
- package/types/hooks/useId.d.ts.map +1 -0
- package/types/index.d.ts +9 -6
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +19 -5
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +9 -0
- package/types/views/Slot.d.ts.map +1 -0
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { useInsertionEffect
|
|
3
|
+
import { useInsertionEffect } from "react";
|
|
4
4
|
import { getStylesAtomic } from "./getStylesAtomic";
|
|
5
5
|
import { insertStyleRule, updateInsertedCache } from "./insertStyleRule";
|
|
6
6
|
let added = /* @__PURE__ */ new Set();
|
|
7
|
-
const effect = useInsertionEffect || useLayoutEffect;
|
|
8
7
|
function useStylesAsClassname(styles, disable = false, debug = false) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
if (!useInsertionEffect) {
|
|
9
|
+
return addStylesUsingClassname(disable ? styles : [], debug);
|
|
10
|
+
} else {
|
|
11
|
+
const insertions = [];
|
|
12
|
+
const className = addStylesUsingClassname(disable ? [] : styles, debug, (identifier, rules) => {
|
|
13
|
+
for (const rule of rules) {
|
|
14
|
+
insertions.push({ identifier, rule });
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
17
|
for (const { identifier, rule } of insertions) {
|
|
18
|
-
|
|
18
|
+
updateInsertedCache(identifier, rule);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
useInsertionEffect(() => {
|
|
21
|
+
for (const { identifier, rule } of insertions) {
|
|
22
|
+
insertStyleRule(identifier, rule);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return className;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
__name(useStylesAsClassname, "useStylesAsClassname");
|
|
24
29
|
function addStylesUsingClassname(styles, debug = false, onAdd) {
|
|
@@ -63,7 +63,7 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
63
63
|
if (isObj(variantValue)) {
|
|
64
64
|
variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
|
|
65
65
|
}
|
|
66
|
-
return variantValue;
|
|
66
|
+
return expansions(variantValue);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
let shouldReturn = false;
|
|
@@ -80,9 +80,9 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
if (shouldReturn) {
|
|
83
|
-
return {
|
|
83
|
+
return expansions({
|
|
84
84
|
[key]: value
|
|
85
|
-
};
|
|
85
|
+
});
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}, "createPropMapper");
|
|
@@ -200,6 +200,37 @@ const tokenCategories = {
|
|
|
200
200
|
borderRightColor: true
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
+
const sidesX = ["Left", "Right"];
|
|
204
|
+
const sidesY = ["Top", "Bottom"];
|
|
205
|
+
const sidesXY = [...sidesX, ...sidesY];
|
|
206
|
+
const expand = {
|
|
207
|
+
padding: sidesXY.map((x) => `padding${x}`),
|
|
208
|
+
paddingHorizontal: sidesX.map((x) => `padding${x}`),
|
|
209
|
+
paddingVertical: sidesY.map((x) => `padding${x}`),
|
|
210
|
+
margin: sidesXY.map((x) => `margin${x}`),
|
|
211
|
+
marginHorizontal: sidesX.map((x) => `margin${x}`),
|
|
212
|
+
marginVertical: sidesY.map((x) => `margin${x}`)
|
|
213
|
+
};
|
|
214
|
+
function expansions(styleObj) {
|
|
215
|
+
var _a, _b;
|
|
216
|
+
for (const key in expand) {
|
|
217
|
+
if (key in styleObj) {
|
|
218
|
+
for (const expandKey of expand[key]) {
|
|
219
|
+
styleObj[expandKey] = styleObj[key];
|
|
220
|
+
}
|
|
221
|
+
delete styleObj[key];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if ("flex" in styleObj) {
|
|
225
|
+
if (typeof styleObj.flex === "number") {
|
|
226
|
+
styleObj.flexGrow = (_a = styleObj.flexGrow) != null ? _a : styleObj.flex;
|
|
227
|
+
styleObj.flexShrink = (_b = styleObj.flexShrink) != null ? _b : 1;
|
|
228
|
+
delete styleObj.flex;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return styleObj;
|
|
232
|
+
}
|
|
233
|
+
__name(expansions, "expansions");
|
|
203
234
|
export {
|
|
204
235
|
createPropMapper
|
|
205
236
|
};
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
const matchRgbaHsla = /(rgba|hsla)\(\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,})\s*\)$/;
|
|
4
|
-
function fixNativeShadow(
|
|
5
|
-
|
|
4
|
+
function fixNativeShadow(styles) {
|
|
5
|
+
const color = styles.find((x) => x[0] === "shadowColor");
|
|
6
|
+
if (!color) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
|
-
if (!
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if (!styles.find((x) => x[0] === "shadowOffset")) {
|
|
10
|
+
styles.push([
|
|
11
|
+
"shadowOffset",
|
|
12
|
+
{
|
|
13
|
+
width: 0,
|
|
14
|
+
height: 0
|
|
15
|
+
}
|
|
16
|
+
]);
|
|
13
17
|
}
|
|
14
|
-
if ("shadowOpacity"
|
|
18
|
+
if (styles.find((x) => x[0] === "shadowOpacity")) {
|
|
15
19
|
return;
|
|
16
20
|
}
|
|
17
|
-
const c = `${
|
|
21
|
+
const c = `${color[1]}`;
|
|
18
22
|
if ((c[0] === "r" || c[0] === "h") && c[3] === "a") {
|
|
19
23
|
const [_, type, _1, _2, _3, a] = c.match(matchRgbaHsla) || [];
|
|
20
24
|
if (typeof a !== "string") {
|
|
21
25
|
console.trace("invalid", c, type);
|
|
22
26
|
throw new Error(`invalid style`);
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
styles.push(["shadowColor", `${type.replace("a", "")}(${_1},${_2},${_3})`]);
|
|
29
|
+
styles.push(["shadowOpacity", +a]);
|
|
26
30
|
} else {
|
|
27
|
-
|
|
31
|
+
styles.push(["shadowOpacity", 1]);
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
__name(fixNativeShadow, "fixNativeShadow");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { getVariableValue, isVariable } from "@tamagui/core";
|
|
4
|
+
const getButtonSize = /* @__PURE__ */ __name((sizeX = 0.9, sizeY = 0.333) => (val, { tokens, props, fonts }) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6
|
+
const size = (_c = (_b = (_a = tokens.size[val]) != null ? _a : tokens.size["$4"]) != null ? _b : val) != null ? _c : 14;
|
|
7
|
+
const radius = (_e = (_d = tokens.radius[val]) != null ? _d : tokens.radius["$4"]) != null ? _e : size;
|
|
8
|
+
const px = Math.round(+(isVariable(size) ? size.val : size) * sizeX);
|
|
9
|
+
const py = Math.round(+(isVariable(size) ? size.val : size) * sizeY);
|
|
10
|
+
const font = fonts[props.fontFamily] || fonts["$body"];
|
|
11
|
+
const lineHeights = font.lineHeight;
|
|
12
|
+
const lineHeight = (_f = lineHeights[val]) != null ? _f : lineHeights["$4"];
|
|
13
|
+
const minHeight = Math.round(getVariableValue(lineHeight) + py * 2);
|
|
14
|
+
if (process.env.NODE_ENV === "development" && props["debug"]) {
|
|
15
|
+
console.log("getButtonSize", props.fontFamily, { size, py, val, lineHeight, minHeight });
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
minHeight,
|
|
19
|
+
paddingHorizontal: props.circular ? 0 : px,
|
|
20
|
+
paddingVertical: props.circular ? 0 : py,
|
|
21
|
+
borderRadius: props.circular ? 1e5 : (_g = props.borderRadius) != null ? _g : radius
|
|
22
|
+
};
|
|
23
|
+
}, "getButtonSize");
|
|
24
|
+
export {
|
|
25
|
+
getButtonSize
|
|
26
|
+
};
|
|
@@ -288,47 +288,6 @@ const getSubStyle = /* @__PURE__ */ __name((styleIn, staticConfig, theme, props,
|
|
|
288
288
|
return styleOut;
|
|
289
289
|
}, "getSubStyle");
|
|
290
290
|
function normalizeStyleObject(style) {
|
|
291
|
-
var _a, _b;
|
|
292
|
-
if (style.padding) {
|
|
293
|
-
style.paddingLeft = style.padding;
|
|
294
|
-
style.paddingTop = style.padding;
|
|
295
|
-
style.paddingRight = style.padding;
|
|
296
|
-
style.paddingBottom = style.padding;
|
|
297
|
-
delete style.padding;
|
|
298
|
-
}
|
|
299
|
-
if (style.paddingHorizontal) {
|
|
300
|
-
style.paddingLeft = style.paddingHorizontal;
|
|
301
|
-
style.paddingRight = style.paddingHorizontal;
|
|
302
|
-
delete style.paddingHorizontal;
|
|
303
|
-
}
|
|
304
|
-
if (style.paddingVertical) {
|
|
305
|
-
style.paddingLeft = style.paddingVertical;
|
|
306
|
-
style.paddingRight = style.paddingVertical;
|
|
307
|
-
delete style.paddingVertical;
|
|
308
|
-
}
|
|
309
|
-
if (style.margin) {
|
|
310
|
-
style.marginLeft = style.margin;
|
|
311
|
-
style.marginTop = style.margin;
|
|
312
|
-
style.marginRight = style.margin;
|
|
313
|
-
style.marginBottom = style.margin;
|
|
314
|
-
delete style.margin;
|
|
315
|
-
}
|
|
316
|
-
if (style.marginHorizontal) {
|
|
317
|
-
style.marginLeft = style.marginHorizontal;
|
|
318
|
-
style.marginRight = style.marginHorizontal;
|
|
319
|
-
delete style.marginHorizontal;
|
|
320
|
-
}
|
|
321
|
-
if (style.marginVertical) {
|
|
322
|
-
style.marginLeft = style.marginVertical;
|
|
323
|
-
style.marginRight = style.marginVertical;
|
|
324
|
-
delete style.marginVertical;
|
|
325
|
-
}
|
|
326
|
-
if (typeof style.flex === "number") {
|
|
327
|
-
const val = style.flex;
|
|
328
|
-
delete style.flex;
|
|
329
|
-
style.flexGrow = (_a = style.flexGrow) != null ? _a : val;
|
|
330
|
-
style.flexShrink = (_b = style.flexShrink) != null ? _b : 1;
|
|
331
|
-
}
|
|
332
291
|
if (!isWeb) {
|
|
333
292
|
fixNativeShadow(style);
|
|
334
293
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { getVariableValue } from "../createVariable";
|
|
4
|
+
const getTextSize = /* @__PURE__ */ __name((val = "$4", { fonts, theme, props }) => {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
const family = getVariableValue(props.fontFamily) || "$body";
|
|
7
|
+
const font = fonts[family] || fonts["$body"];
|
|
8
|
+
if (!font) {
|
|
9
|
+
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const fontFamily = font.family;
|
|
13
|
+
const fontSize = props.fontSize || font.size[val];
|
|
14
|
+
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
15
|
+
const fontWeight = props.fontWeight || font.weight[val];
|
|
16
|
+
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
17
|
+
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
18
|
+
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
19
|
+
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
20
|
+
return {
|
|
21
|
+
color,
|
|
22
|
+
fontStyle,
|
|
23
|
+
textTransform,
|
|
24
|
+
fontFamily,
|
|
25
|
+
fontWeight,
|
|
26
|
+
letterSpacing,
|
|
27
|
+
fontSize,
|
|
28
|
+
lineHeight
|
|
29
|
+
};
|
|
30
|
+
}, "getTextSize");
|
|
31
|
+
export {
|
|
32
|
+
getTextSize
|
|
33
|
+
};
|
|
@@ -79,6 +79,7 @@ function insertStyleRule(identifier, rule) {
|
|
|
79
79
|
return;
|
|
80
80
|
hasInsertedSinceUpdate = true;
|
|
81
81
|
updateInsertedCache(identifier, rule);
|
|
82
|
+
allSelectors[identifier] = process.env.NODE_ENV === "development" ? rule : true;
|
|
82
83
|
sheet == null ? void 0 : sheet.insertRule(rule, sheet.cssRules.length);
|
|
83
84
|
}
|
|
84
85
|
__name(insertStyleRule, "insertStyleRule");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
5
|
+
let serverHandoffComplete = false;
|
|
6
|
+
let id = 0;
|
|
7
|
+
function genId() {
|
|
8
|
+
return ++id;
|
|
9
|
+
}
|
|
10
|
+
__name(genId, "genId");
|
|
11
|
+
function useId(providedId) {
|
|
12
|
+
var _a;
|
|
13
|
+
if (typeof React.useId === "function") {
|
|
14
|
+
let id3 = React.useId(providedId);
|
|
15
|
+
return providedId != null ? providedId : id3;
|
|
16
|
+
}
|
|
17
|
+
let initialId = providedId != null ? providedId : serverHandoffComplete ? genId() : null;
|
|
18
|
+
let [id2, setId] = React.useState(initialId);
|
|
19
|
+
useIsomorphicLayoutEffect(() => {
|
|
20
|
+
if (id2 === null) {
|
|
21
|
+
setId(genId());
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (serverHandoffComplete === false) {
|
|
26
|
+
serverHandoffComplete = true;
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
return (_a = providedId != null ? providedId : id2) != null ? _a : void 0;
|
|
30
|
+
}
|
|
31
|
+
__name(useId, "useId");
|
|
32
|
+
export {
|
|
33
|
+
useId
|
|
34
|
+
};
|
package/dist/jsx/index.js
CHANGED
|
@@ -13,31 +13,34 @@ import { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } f
|
|
|
13
13
|
export * from "./constants/constants";
|
|
14
14
|
export * from "./constants/platform";
|
|
15
15
|
export * from "./constants/rnw";
|
|
16
|
+
export * from "./helpers/getButtonSize";
|
|
16
17
|
export * from "./helpers/getExpandedShorthands";
|
|
17
18
|
export * from "./helpers/getSize";
|
|
18
19
|
export * from "./helpers/getSplitStyles";
|
|
19
20
|
export * from "./helpers/getStylesAtomic";
|
|
21
|
+
export * from "./helpers/getTextSize";
|
|
20
22
|
export * from "./helpers/isObj";
|
|
21
23
|
export * from "./helpers/isTamaguiElement";
|
|
22
24
|
export * from "./helpers/matchMedia";
|
|
23
25
|
export * from "./helpers/themeable";
|
|
24
26
|
export * from "./helpers/withStaticProperties";
|
|
25
27
|
export * from "./contexts/ButtonInsideButtonContext";
|
|
26
|
-
export * from "./hooks/useIsTouchDevice";
|
|
27
28
|
export * from "./hooks/useConstant";
|
|
28
|
-
export * from "./hooks/
|
|
29
|
+
export * from "./hooks/useId";
|
|
30
|
+
export * from "./hooks/useIsMounted";
|
|
31
|
+
export * from "./hooks/useIsTouchDevice";
|
|
29
32
|
export * from "./hooks/useMedia";
|
|
33
|
+
export * from "./hooks/usePressable";
|
|
30
34
|
export * from "./hooks/useTheme";
|
|
31
|
-
export * from "./hooks/useIsMounted";
|
|
32
35
|
export * from "./hooks/useUnmountEffect";
|
|
33
|
-
export * from "@tamagui/use-force-update";
|
|
34
36
|
export * from "./views/Stack";
|
|
35
37
|
export * from "./views/Text";
|
|
38
|
+
export * from "./views/TextAncestorContext";
|
|
36
39
|
export * from "./views/Theme";
|
|
37
|
-
export * from "./views/ThemeReset";
|
|
38
40
|
export * from "./views/ThemeInverse";
|
|
39
41
|
export * from "./views/ThemeProvider";
|
|
40
|
-
export * from "./views/
|
|
42
|
+
export * from "./views/ThemeReset";
|
|
43
|
+
export * from "@tamagui/use-force-update";
|
|
41
44
|
export * from "@tamagui/helpers";
|
|
42
45
|
export {
|
|
43
46
|
RNWTextProps,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { composeRefs } from "@tamagui/compose-refs";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
const Slot = React.forwardRef((props, forwardedRef) => {
|
|
6
|
+
const { children, ...slotProps } = props;
|
|
7
|
+
if (React.Children.toArray(children).some(isSlottable)) {
|
|
8
|
+
return <>{React.Children.map(children, (child) => {
|
|
9
|
+
return isSlottable(child) ? <SlotClone {...slotProps} ref={forwardedRef}>{child.props.children}</SlotClone> : child;
|
|
10
|
+
})}</>;
|
|
11
|
+
}
|
|
12
|
+
return <SlotClone {...slotProps} ref={forwardedRef}>{children}</SlotClone>;
|
|
13
|
+
});
|
|
14
|
+
Slot.displayName = "Slot";
|
|
15
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
16
|
+
const { children, ...slotProps } = props;
|
|
17
|
+
if (React.isValidElement(children)) {
|
|
18
|
+
return React.cloneElement(children, {
|
|
19
|
+
...mergeProps(slotProps, children.props),
|
|
20
|
+
ref: composeRefs(forwardedRef, children.ref)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
24
|
+
});
|
|
25
|
+
SlotClone.displayName = "SlotClone";
|
|
26
|
+
const Slottable = /* @__PURE__ */ __name(({ children }) => {
|
|
27
|
+
return <>{children}</>;
|
|
28
|
+
}, "Slottable");
|
|
29
|
+
function isSlottable(child) {
|
|
30
|
+
return React.isValidElement(child);
|
|
31
|
+
}
|
|
32
|
+
__name(isSlottable, "isSlottable");
|
|
33
|
+
function mergeProps(slotProps, childProps) {
|
|
34
|
+
const overrideProps = { ...childProps };
|
|
35
|
+
for (const propName in childProps) {
|
|
36
|
+
const slotPropValue = slotProps[propName];
|
|
37
|
+
const childPropValue = childProps[propName];
|
|
38
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
39
|
+
if (isHandler) {
|
|
40
|
+
overrideProps[propName] = (...args) => {
|
|
41
|
+
childPropValue == null ? void 0 : childPropValue(...args);
|
|
42
|
+
slotPropValue == null ? void 0 : slotPropValue(...args);
|
|
43
|
+
};
|
|
44
|
+
} else if (propName === "style") {
|
|
45
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
46
|
+
} else if (propName === "className") {
|
|
47
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { ...slotProps, ...overrideProps };
|
|
51
|
+
}
|
|
52
|
+
__name(mergeProps, "mergeProps");
|
|
53
|
+
export {
|
|
54
|
+
Slot,
|
|
55
|
+
Slottable
|
|
56
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/helpers": "^1.0.0-beta.
|
|
22
|
+
"@tamagui/helpers": "^1.0.0-beta.7",
|
|
23
23
|
"@tamagui/ow": "^0.28.1",
|
|
24
|
-
"@tamagui/use-debounce": "^1.0.0-beta.
|
|
25
|
-
"@tamagui/use-force-update": "^1.0.0-beta.
|
|
24
|
+
"@tamagui/use-debounce": "^1.0.0-beta.7",
|
|
25
|
+
"@tamagui/use-force-update": "^1.0.0-beta.7",
|
|
26
26
|
"react": "*",
|
|
27
27
|
"react-dom": "*"
|
|
28
28
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"react-native-web": "*"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "^1.0.0-beta.
|
|
33
|
+
"@tamagui/build": "^1.0.0-beta.7",
|
|
34
34
|
"@types/react": "^17.0.35",
|
|
35
35
|
"csstype": "^3.0.10",
|
|
36
36
|
"esbuild": "^0.14.36",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAoB,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAiBhE,OAAO,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAKjB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAoB,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAiBhE,OAAO,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAKjB,MAAM,SAAS,CAAA;AAgBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA0B3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,IAAI,EACV,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,EAAE,eAAe,CAAC,EAAE,iBAAiB,4DAsoB1F;AAKD,eAAO,MAAM,MAAM;;;;mBA4CjB,CAAA;AAEF,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,aAAa,EACb,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,GAAG,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;CAC3C,SA2CA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,eAkBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addStylesUsingClassname.d.ts","sourceRoot":"","sources":["../../src/helpers/addStylesUsingClassname.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addStylesUsingClassname.d.ts","sourceRoot":"","sources":["../../src/helpers/addStylesUsingClassname.tsx"],"names":[],"mappings":"AAYA,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,OAAO,UAAQ,EAAE,KAAK,UAAQ,UAqBjF;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,GAAG,EAAE,EACb,KAAK,GAAE,OAAO,GAAG,SAAiB,EAClC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,UA6BrD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StaticConfig } from '../types';
|
|
2
2
|
export declare type ResolveVariableTypes = 'auto' | 'value' | 'variable' | 'both';
|
|
3
|
-
export declare const createPropMapper: (staticConfig: Partial<StaticConfig>) => (key: string, value: any, theme: any, props: any, returnVariablesAs?: ResolveVariableTypes, avoidDefaultProps?: boolean) => any;
|
|
3
|
+
export declare const createPropMapper: (staticConfig: Partial<StaticConfig>) => (key: string, value: any, theme: any, props: any, returnVariablesAs?: ResolveVariableTypes, avoidDefaultProps?: boolean) => Record<string, any> | undefined;
|
|
4
4
|
//# sourceMappingURL=createPropMapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAgD,MAAM,UAAU,CAAA;AAGrF,oBAAY,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAA;AA4BzE,eAAO,MAAM,gBAAgB,iBAAkB,QAAQ,YAAY,CAAC,WAK3D,MAAM,SACJ,GAAG,SACH,GAAG,SACH,GAAG,sBACS,oBAAoB,
|
|
1
|
+
{"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAgD,MAAM,UAAU,CAAA;AAGrF,oBAAY,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAA;AA4BzE,eAAO,MAAM,gBAAgB,iBAAkB,QAAQ,YAAY,CAAC,WAK3D,MAAM,SACJ,GAAG,SACH,GAAG,SACH,GAAG,sBACS,oBAAoB,iEAyE1C,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function fixNativeShadow(
|
|
1
|
+
export declare function fixNativeShadow(styles: [string, any][]): void;
|
|
2
2
|
//# sourceMappingURL=fixNativeShadow.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixNativeShadow.native.d.ts","sourceRoot":"","sources":["../../src/helpers/fixNativeShadow.native.tsx"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"fixNativeShadow.native.d.ts","sourceRoot":"","sources":["../../src/helpers/fixNativeShadow.native.tsx"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAgCtD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantSpreadExtras } from '@tamagui/core';
|
|
2
|
+
export declare const getButtonSize: (sizeX?: number, sizeY?: number) => (val: any, { tokens, props, fonts }: VariantSpreadExtras<any>) => {
|
|
3
|
+
minHeight: number;
|
|
4
|
+
paddingHorizontal: number;
|
|
5
|
+
paddingVertical: number;
|
|
6
|
+
borderRadius: any;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=getButtonSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getButtonSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getButtonSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,eAAe,CAAA;AAIjF,eAAO,MAAM,aAAa,4CAElB,GAAG,4BAA4B,oBAAoB,GAAG,CAAC;;;;;CAmB5D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC,OAAO,EACL,SAAS,EAET,YAAY,EAEZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAElB,WAAW,EACZ,MAAM,UAAU,CAAA;AAWjB,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACrD,oBAAY,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAchE,aAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,eAAe,GAAG;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,EACD,iBAAiB,CAAC,EAAE,GAAG,KACpB;IACH,OAAO,EAAE,YAAY,CAAA;IACrB,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACpC,KAAK,EAAE,SAAS,CAAA;IAChB,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IACjC,SAAS,EAAE,UAAU,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,aA2T5B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,aAM/B,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA;AAED,eAAO,MAAM,WAAW,YACb,MAAM,gBACD,kBAAkB,SACzB,WAAW,SACX,GAAG,SACH,eAAe,8CAErB,SAuBF,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC,OAAO,EACL,SAAS,EAET,YAAY,EAEZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAElB,WAAW,EACZ,MAAM,UAAU,CAAA;AAWjB,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACrD,oBAAY,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAchE,aAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,eAAe,GAAG;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,EACD,iBAAiB,CAAC,EAAE,GAAG,KACpB;IACH,OAAO,EAAE,YAAY,CAAA;IACrB,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACpC,KAAK,EAAE,SAAS,CAAA;IAChB,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IACjC,SAAS,EAAE,UAAU,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,aA2T5B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,aAM/B,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA;AAED,eAAO,MAAM,WAAW,YACb,MAAM,gBACD,kBAAkB,SACzB,WAAW,SACX,GAAG,SACH,eAAe,8CAErB,SAuBF,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,QAI9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTextSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getTextSize.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE3E,eAAO,MAAM,WAAW,EAAE,qBAAqB,CAAC,SAAS,EAAE,cAAc,CA4BxE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,IAAK,CAAA;AAEpC,eAAO,MAAM,eAAe,UAAqB,CAAA;AACjD,eAAO,MAAM,gBAAgB,iBAAyC,CAAA;AACtE,eAAO,MAAM,gBAAgB,UAA2B,CAAA;AAgCxD,wBAAgB,cAAc,SA6B7B;AAMD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAMnE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,IAAK,CAAA;AAEpC,eAAO,MAAM,eAAe,UAAqB,CAAA;AACjD,eAAO,MAAM,gBAAgB,iBAAyC,CAAA;AACtE,eAAO,MAAM,gBAAgB,UAA2B,CAAA;AAgCxD,wBAAgB,cAAc,SA6B7B;AAMD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAMnE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAM/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function useId(idFromProps: string): string;
|
|
2
|
+
declare function useId(idFromProps: number): number;
|
|
3
|
+
declare function useId(idFromProps: string | number): string | number;
|
|
4
|
+
declare function useId(idFromProps: string | undefined | null): string | undefined;
|
|
5
|
+
declare function useId(idFromProps: number | undefined | null): number | undefined;
|
|
6
|
+
declare function useId(idFromProps: string | number | undefined | null): string | number | undefined;
|
|
7
|
+
declare function useId(): string | undefined;
|
|
8
|
+
export { useId };
|
|
9
|
+
//# sourceMappingURL=useId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../src/hooks/useId.tsx"],"names":[],"mappings":"AA+EA,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAC7D,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAC5F,iBAAS,KAAK,IAAI,MAAM,GAAG,SAAS,CAAA;AAwCpC,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -13,30 +13,33 @@ export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } f
|
|
|
13
13
|
export * from './constants/constants';
|
|
14
14
|
export * from './constants/platform';
|
|
15
15
|
export * from './constants/rnw';
|
|
16
|
+
export * from './helpers/getButtonSize';
|
|
16
17
|
export * from './helpers/getExpandedShorthands';
|
|
17
18
|
export * from './helpers/getSize';
|
|
18
19
|
export * from './helpers/getSplitStyles';
|
|
19
20
|
export * from './helpers/getStylesAtomic';
|
|
21
|
+
export * from './helpers/getTextSize';
|
|
20
22
|
export * from './helpers/isObj';
|
|
21
23
|
export * from './helpers/isTamaguiElement';
|
|
22
24
|
export * from './helpers/matchMedia';
|
|
23
25
|
export * from './helpers/themeable';
|
|
24
26
|
export * from './helpers/withStaticProperties';
|
|
25
27
|
export * from './contexts/ButtonInsideButtonContext';
|
|
26
|
-
export * from './hooks/useIsTouchDevice';
|
|
27
28
|
export * from './hooks/useConstant';
|
|
28
|
-
export * from './hooks/
|
|
29
|
+
export * from './hooks/useId';
|
|
30
|
+
export * from './hooks/useIsMounted';
|
|
31
|
+
export * from './hooks/useIsTouchDevice';
|
|
29
32
|
export * from './hooks/useMedia';
|
|
33
|
+
export * from './hooks/usePressable';
|
|
30
34
|
export * from './hooks/useTheme';
|
|
31
|
-
export * from './hooks/useIsMounted';
|
|
32
35
|
export * from './hooks/useUnmountEffect';
|
|
33
|
-
export * from '@tamagui/use-force-update';
|
|
34
36
|
export * from './views/Stack';
|
|
35
37
|
export * from './views/Text';
|
|
38
|
+
export * from './views/TextAncestorContext';
|
|
36
39
|
export * from './views/Theme';
|
|
37
|
-
export * from './views/ThemeReset';
|
|
38
40
|
export * from './views/ThemeInverse';
|
|
39
41
|
export * from './views/ThemeProvider';
|
|
40
|
-
export * from './views/
|
|
42
|
+
export * from './views/ThemeReset';
|
|
43
|
+
export * from '@tamagui/use-force-update';
|
|
41
44
|
export * from '@tamagui/helpers';
|
|
42
45
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE5F,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAE9C,cAAc,sCAAsC,CAAA;AAEpD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE5F,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAE9C,cAAc,sCAAsC,CAAA;AAEpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AAExC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export declare type Themes = TamaguiConfig['themes'];
|
|
|
86
86
|
export declare type ThemeName = GetAltThemeNames<keyof Themes>;
|
|
87
87
|
export declare type ThemeKeys = keyof ThemeObject;
|
|
88
88
|
export declare type ThemeTokens = `$${ThemeKeys}`;
|
|
89
|
-
export declare type AnimationKeys = GetAnimationKeys<TamaguiConfig>;
|
|
89
|
+
export declare type AnimationKeys = Omit<GetAnimationKeys<TamaguiConfig>, number>;
|
|
90
90
|
declare type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
|
|
91
91
|
export declare type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B extends GenericThemes = GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia, E extends GenericAnimations = GenericAnimations, F extends GenericFonts = GenericFonts> = CreateTamaguiConfig<A, B, C, D, E, F> & {
|
|
92
92
|
Provider: (props: TamaguiProviderProps) => any;
|
|
@@ -158,12 +158,28 @@ export declare type TransformStyleProps = {
|
|
|
158
158
|
rotateX?: string;
|
|
159
159
|
rotateZ?: string;
|
|
160
160
|
};
|
|
161
|
+
export declare type AnimationConfigType = any;
|
|
162
|
+
export declare type AnimationProp = AnimationKeys | {
|
|
163
|
+
[key: string]: AnimationKeys | {
|
|
164
|
+
type: AnimationKeys;
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
};
|
|
167
|
+
} | [
|
|
168
|
+
AnimationKeys,
|
|
169
|
+
{
|
|
170
|
+
[key: string]: AnimationKeys | {
|
|
171
|
+
type?: AnimationKeys;
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
];
|
|
161
176
|
export declare type TamaguiComponentPropsBase = {
|
|
177
|
+
asChild?: boolean;
|
|
162
178
|
space?: SpaceTokens;
|
|
163
179
|
dangerouslySetInnerHTML?: {
|
|
164
180
|
__html: string;
|
|
165
181
|
};
|
|
166
|
-
animation?:
|
|
182
|
+
animation?: AnimationProp;
|
|
167
183
|
animateOnly?: string[];
|
|
168
184
|
children?: any | any[];
|
|
169
185
|
debug?: boolean | 'break' | 'verbose';
|
|
@@ -383,9 +399,7 @@ export declare type AnimationDriver<A extends AnimationConfig = AnimationConfig>
|
|
|
383
399
|
View?: any;
|
|
384
400
|
Text?: any;
|
|
385
401
|
};
|
|
386
|
-
export declare type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any
|
|
387
|
-
animation: string;
|
|
388
|
-
};
|
|
402
|
+
export declare type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
|
|
389
403
|
export declare type UseAnimationHelpers = {
|
|
390
404
|
staticConfig: StaticConfigParsed;
|
|
391
405
|
getStyle: (props?: {
|